com.candle.roma.kxc
Class RomaExceptionMessage

java.lang.Object
  |
  +--com.candle.roma.kxc.RomaExceptionMessage

public class RomaExceptionMessage
extends java.lang.Object

This class is used to report erroneous messages to an Exception Messgage Queue by encapsulating the message that resulted in the error plus information about the error.


Constructor Summary
RomaExceptionMessage()
          Constructs a new exception message with no information.
RomaExceptionMessage(byte[] buffer)
          Constructs a new message exception object with supplied user data.
RomaExceptionMessage(byte[] buffer, int bufLen)
          Constructs a new message exception object with supplied user data.
RomaExceptionMessage(RomaBeRequest message)
          Constructs a new message exception object using an existing RomaBeRequest.
RomaExceptionMessage(RomaBeResponse message)
          Constructs a new message exception object using an existing RomaBeResponse.
RomaExceptionMessage(RomaClientRequest message)
          Constructs a new message exception object using an existing RomaClientRequest.
RomaExceptionMessage(RomaClientResponse message)
          Constructs a new message exception object using an existing RomaClientResponse.
RomaExceptionMessage(RomaPublication message)
          Constructs a new message exception object using an existing RomaPublication.
RomaExceptionMessage(RomaStorable message)
          Constructs a new message exception object using an existing RomaStorable.
 
Method Summary
 byte[] correlId()
          Return the message correlation identifier.
 byte[] msgId()
          Return the message identifier in a byte array.
 void setAdditionalInfo(int errorSubclass, java.lang.String location)
          Sets additional information.
 void setCallType(int type)
          set call type
 void setCodepage(int codepage)
          Set a new message codepage value.
 void setCompCode(int errorSubclass, int code)
          set completion code
 void setCorrelId(byte[] correlId)
          Set the message correlation identifier.
 void setElements(int elements)
          Sets which element should be present in the exception message.
 void setEncoding(int encoding)
          Set the message encoding.
 void setErrorType(int errorSubclass, int type)
          Sets error type.
 void setExpiry(int expiry)
          Set a new message expiry time.
 void setFeedback(int feedback)
          Sets a new message feedback code.
 void setFormat(int format)
          Set a new message format value.
 void setFormatName(java.lang.String formatName)
          Sets the format name.
 boolean setMsgBuffer(byte[] buffer)
          Set buffer containing the message data for a PUT request.
 boolean setMsgBuffer(byte[] buffer, int dataLength)
          Set buffer containing the message data and the length of the message for a PUT request.
 boolean setMsgBuffer(java.lang.String buffer)
          Set buffer containing the message data for a PUT request.
 void setMsgId(byte[] msgId)
          Set the message identifier.
 void setMsgName(java.lang.String messageName)
          Set the name of this message
 void setOperationType(int errorSubclass, int opType)
          Sets the operation type value.
 void setPersistence(int persistence)
          Set a new value for the message perisitence.
 void setPosition(int errorSubclass, int position)
          Sets error position.
 void setPriority(int priority)
          Set the message priority.
 void setReason(int errorSubclass, int reason)
          Sets the reason code.
 void setReturnCode(int errorSubclass, int code)
          set return code
 void setStatus(int status)
          Sets the error status.
 boolean setTagBuffer(byte[] buffer)
          Set buffer containing the tag data for a PUT request.
 boolean setTagBuffer(byte[] buffer, int dataLength)
          Set buffer containing the tag data and the length of the tag for a PUT request.
 boolean setTagBuffer(java.lang.String buffer)
          Set buffer containing the tag data for a PUT request.
 boolean setUserBuffer(byte[] buffer)
          Sets user data buffer.
 boolean setUserBuffer(byte[] buffer, int length)
          Sets user data buffer.
 boolean setUserBuffer(java.lang.String data)
          Sets user data.
 RomaTheme theme()
          Return the message theme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RomaExceptionMessage

public RomaExceptionMessage()
Constructs a new exception message with no information.

RomaExceptionMessage

public RomaExceptionMessage(RomaClientRequest message)
Constructs a new message exception object using an existing RomaClientRequest.
Parameters:
message - a RomaClientRequest object.

RomaExceptionMessage

public RomaExceptionMessage(RomaClientResponse message)
Constructs a new message exception object using an existing RomaClientResponse.
Parameters:
message - a RomaClientResponse object.

RomaExceptionMessage

public RomaExceptionMessage(RomaBeRequest message)
Constructs a new message exception object using an existing RomaBeRequest.
Parameters:
message - a RomaBeRequest object.

RomaExceptionMessage

public RomaExceptionMessage(RomaBeResponse message)
Constructs a new message exception object using an existing RomaBeResponse.
Parameters:
message - a RomaBeResponse object.

RomaExceptionMessage

public RomaExceptionMessage(RomaStorable message)
Constructs a new message exception object using an existing RomaStorable.
Parameters:
message - a RomaStorable object.

RomaExceptionMessage

public RomaExceptionMessage(RomaPublication message)
Constructs a new message exception object using an existing RomaPublication.
Parameters:
message - a RomaPublication object.

RomaExceptionMessage

public RomaExceptionMessage(byte[] buffer,
                            int bufLen)
Constructs a new message exception object with supplied user data.
Parameters:
buffer - contains message data
bufLen - length of message data

RomaExceptionMessage

public RomaExceptionMessage(byte[] buffer)
Constructs a new message exception object with supplied user data.
Parameters:
buffer - contains message data
Method Detail

setPriority

public void setPriority(int priority)
Set the message priority.
Parameters:
priority - this can be one of the following :-
  • PRIORITY_DEFAULT - use the default priority from the transport.
  • PRIORITY_PROFILE - use the priority as specified in the associated Put API profile. If no such profile or attribute, use PRIORITY_DEFAULT.
  • a specific integer meaningful to the underlying transport e.g. 0..9 for MQSeries and BEAMQ, 0..7 for MSMQ

setPersistence

public void setPersistence(int persistence)
Set a new value for the message perisitence.
Parameters:
persistence - this can be one of the following :-
  • PERSISTENCE_YES
  • PERSISTENCE_NO
  • PERSISTENCE_PROFILE - use the persistence value as specified in the associated Put API profile. If no such profile or attribute, use PERSISTENCE_NO.

setFormat

public void setFormat(int format)
Set a new message format value.
Parameters:
format - identifies the format of message. If the value FORMAT_PROFILE is used then the message format value is retrieved from the associated Put API profile. If the profile is not available or else has no format attribute value then the message format value FORMAT_BINARY is used.

setFeedback

public void setFeedback(int feedback)
Sets a new message feedback code.
Parameters:
feedback - new message feedback value.

setExpiry

public void setExpiry(int expiry)
Set a new message expiry time.
Parameters:
expiry - the new expiry time value in seconds or EXPIRY_NEVER or EXPIRY_PROFILE. If EXPIRY_PROFILE is specified then the expiry value is retrieved from the associated Put API profile. If the profile is not available or else has no expiry attribute set, the EXPIRY_NEVER constant is used.

setCodepage

public void setCodepage(int codepage)
Set a new message codepage value.
Parameters:
codepage - the new codepage value. If CODEPAGE_PROFILE is specified then the codepage will be retrieved from the associated Put API profile. If the profile is not available or else has no codepage attribute set, the default value of CODEPAGE_USER will be used.

setEncoding

public void setEncoding(int encoding)
Set the message encoding.
Parameters:
encoding - the new encoding indicator. If this is ENCODING_PROFILE then the value is retrieved from the associated Put API profile. If the profile is not available or else has no encoding attribute set, the default value ENCODING_DEFAULT is used.

setMsgId

public void setMsgId(byte[] msgId)
Set the message identifier.
Parameters:
msgId - a byte array containing the new message id value. The msg id must not exceed kxc.MSG_ID_LENGTH.

msgId

public byte[] msgId()
Return the message identifier in a byte array.

setCorrelId

public void setCorrelId(byte[] correlId)
Set the message correlation identifier.
Parameters:
correlId - the new correlation id.

correlId

public byte[] correlId()
Return the message correlation identifier.

setFormatName

public void setFormatName(java.lang.String formatName)
Sets the format name.
Parameters:
formatName - the new format name.

setMsgName

public void setMsgName(java.lang.String messageName)
Set the name of this message
Parameters:
messageName - name to be used

setMsgBuffer

public boolean setMsgBuffer(byte[] buffer,
                            int dataLength)
Set buffer containing the message data and the length of the message for a PUT request. To send an empty message set length to 0 and buffer to null
Parameters:
buffer - byte array containing the message.
dataLength - length of the message.
Returns:
true if successfull, false if datalength < 0 or datalength = 0 and buffer != null

setMsgBuffer

public boolean setMsgBuffer(byte[] buffer)
Set buffer containing the message data for a PUT request. To send an empty message set buffer to null.
Parameters:
buffer - byte array containing message data.
Returns:
true if successfull.

setMsgBuffer

public boolean setMsgBuffer(java.lang.String buffer)
Set buffer containing the message data for a PUT request.
Parameters:
buffer - String containing message data.
Returns:
true if successfull.

setTagBuffer

public boolean setTagBuffer(byte[] buffer,
                            int dataLength)
Set buffer containing the tag data and the length of the tag for a PUT request.
Parameters:
buffer - byte array containing the message.
dataLength - length of the message.
Returns:
true if successfull, false if datalength < 0 or datalength = 0 and buffer != null

setTagBuffer

public boolean setTagBuffer(byte[] buffer)
Set buffer containing the tag data for a PUT request.
Parameters:
buffer - byte array containing tag data.
Returns:
true if successfull.

setTagBuffer

public boolean setTagBuffer(java.lang.String buffer)
Set buffer containing the tag data for a PUT request.
Parameters:
buffer - String containing tag data.
Returns:
true if successfull.

setElements

public void setElements(int elements)
Sets which element should be present in the exception message. A combination of the following flags can be used :-

Or else one of the following constant values :-


setCallType

public void setCallType(int type)
set call type
Parameters:
type - integer value representing the type of API call being made when the error occurred.

setStatus

public void setStatus(int status)
Sets the error status.
Parameters:
status - new error status.

setCompCode

public void setCompCode(int errorSubclass,
                        int code)
set completion code
Parameters:
errorSubclass - SUBCLASS_PRIMARY - set primary info. SUBCLASS_SECONDARY - set secondary info.
code - completion code

setReturnCode

public void setReturnCode(int errorSubclass,
                          int code)
set return code
Parameters:
errorSubclass - SUBCLASS_PRIMARY - set primary info. SUBCLASS_SECONDARY - set secondary info.
code - return code

setReason

public void setReason(int errorSubclass,
                      int reason)
Sets the reason code.
Parameters:
errorSubclass - SUBCLASS_PRIMARY - set primary info. SUBCLASS_SECONDARY - set secondary info.
reason - the new reason code value.

setOperationType

public void setOperationType(int errorSubclass,
                             int opType)
Sets the operation type value.
Parameters:
errorSubclass - SUBCLASS_PRIMARY - set primary info. SUBCLASS_SECONDARY - set secondary info.
opType - the new operation type identifier.

setPosition

public void setPosition(int errorSubclass,
                        int position)
Sets error position.
Parameters:
errorSubclass - SUBCLASS_PRIMARY - set primary info. SUBCLASS_SECONDARY - set secondary info.
position - the error position

setErrorType

public void setErrorType(int errorSubclass,
                         int type)
Sets error type.
Parameters:
errorSubclass - SUBCLASS_PRIMARY - set primary info. SUBCLASS_SECONDARY - set secondary info.
type - the error type

setAdditionalInfo

public void setAdditionalInfo(int errorSubclass,
                              java.lang.String location)
Sets additional information.
Parameters:
errorSubclass - SUBCLASS_PRIMARY - set primary info. SUBCLASS_SECONDARY - set secondary info.
location - additional error location information.

setUserBuffer

public boolean setUserBuffer(byte[] buffer,
                             int length)
Sets user data buffer.
Parameters:
buffer - user data buffer.
length - user data buffer length
Returns:
true if parameters are correct

setUserBuffer

public boolean setUserBuffer(byte[] buffer)
Sets user data buffer.
Parameters:
buffer - user data buffer.
Returns:
true if parameter is correct.

setUserBuffer

public boolean setUserBuffer(java.lang.String data)
Sets user data.
Parameters:
data - user data.
Returns:
true if parameter is correct.

theme

public RomaTheme theme()
Return the message theme. Theme can be set internally when the message is being sent or received or else explicitly by the user.