com.candle.roma.kxc
Class RomaStorable

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

public class RomaStorable
extends java.lang.Object

This class extends the RomaMessage class to provide the ability to be used on storage queues.


Constructor Summary
RomaStorable()
          Default constructor.
RomaStorable(byte[] msgBuffer, int msgLength)
          Constructor which takes a data buffer.
RomaStorable(RomaStorable storable)
          Constructor which takes a RomaStorable object.
 
Method Summary
 int backoutCount()
          Return the backout count.
 int codepage()
          Return the message codepage.
 byte[] correlId()
          Return the message correlation identifier.
 int encoding()
          Get the message encoding.
 int expiry()
          Return the message expiry time in seconds.
 int feedback()
          Get the message feedback code.
 int format()
          Return the message format.
 java.lang.String formatName()
          Return the message format name.
 void marshalForStorage()
          Called before the PUT operation this method may be overriden in a derived class for data marshalling.
 byte[] msgBuffer()
          Return reference to the message data buffer.
 int msgDataLength()
          Return length of data in the message buffer.
 byte[] msgId()
          Return the message identifier in a byte array.
 int persistence()
          return the message perisitence value.
 int priority()
          Returns the priority assigned to the message.
 void setCodepage(int codepage)
          Set a new message codepage value.
 void setCorrelId(byte[] correlId)
          Set the message correlation identifier.
 void setEncoding(int encoding)
          Set the message encoding.
 void setExpiry(int expiry)
          Set a new message expiry time in seconds.
 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, int dataLength)
          Set buffer containing the message data and the length of the message 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 setPersistence(int persistence)
          Set a new value for the message perisitence.
 void setPriority(int priority)
          Set the message priority.
 void setTheme(RomaTheme theme)
          Update the message theme.
 RomaTheme theme()
          Return the message theme.
 java.util.Date timeStamp()
          Returns the time stamp which, for get operations, is the time at which the put operation occurred.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RomaStorable

public RomaStorable()
Default constructor. New object has default attributes.

RomaStorable

public RomaStorable(RomaStorable storable)
Constructor which takes a RomaStorable object. Package visibility

RomaStorable

public RomaStorable(byte[] msgBuffer,
                    int msgLength)
Constructor which takes a data buffer.
Parameters:
msgBuffer - - data buffer
msgLength - - length of data in buffer
Method Detail

marshalForStorage

public void marshalForStorage()
                       throws RomaError
Called before the PUT operation this method may be overriden in a derived class for data marshalling.
Throws:
RomaError - thrown if marshalling fails.

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

priority

public int priority()
Returns the priority assigned to the message.

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.

persistence

public int persistence()
return the message perisitence value.

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.

format

public int format()
Return the message format.

setFeedback

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

feedback

public int feedback()
Get the message feedback code.

setExpiry

public void setExpiry(int expiry)
Set a new message expiry time in seconds.
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.

expiry

public int expiry()
Return the message expiry time in seconds.

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.

codepage

public int codepage()
Return the message codepage.

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.

encoding

public int encoding()
Get the message encoding.

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.

formatName

public java.lang.String formatName()
Return the message format name.

setTheme

public void setTheme(RomaTheme theme)
Update the message theme.
Parameters:
theme - RomaTheme object.

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.

backoutCount

public int backoutCount()
Return the backout count. This is the number of times that the message has been rolled back.

timeStamp

public java.util.Date timeStamp()
Returns the time stamp which, for get operations, is the time at which the put operation occurred.

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

msgBuffer

public byte[] msgBuffer()
Return reference to the message data buffer.

msgDataLength

public int msgDataLength()
Return length of data in the message buffer.