com.candle.roma.kxc
Class RomaBeResponse

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

public class RomaBeResponse
extends java.lang.Object

This class encapsulates responses made by a Roma Business Element following a Roma Client request. It enables the application to set the options required when responding to a Roma Client request.

This class provides a framework for associating application specific data with a BusinessElement response.

It is intended that RomaBeResponse subclasses provide an implementation for the marshalling of application-specific data. The marshalResponse() method may be overridden to stream application data into a message buffer.

See Also:
RomaBusinessElement

Constructor Summary
RomaBeResponse()
          Constructs an empty RomaBeResponse object.
RomaBeResponse(RomaBeRequest br)
          Constructs a new RomaBeResponse object and initialises it with message id, correlation id and theme from supplied RomaBeRequest.
RomaBeResponse(RomaTheme theme)
          Constructs a new RomaBeResponse object and associates it with the specified theme
RomaBeResponse(RomaTheme theme, byte[] msgBuf, int msgLen)
          Constructs a new RomaBeResponse object, associates it with the specified theme and sets user message buffer.
RomaBeResponse(RomaTheme theme, byte[] msgBuf, int msgLen, byte[] tagBuf, int tagLen)
          Constructs a new RomaBeResponse object, associates it with the specified theme and sets user message buffer.
 
Method Summary
 byte[] correlId()
          Return the message correlation identifier.
 RomaILSData getILSData()
          Get incoming ILS data
 void marshalResponse()
          Marshalls response data immediately prior the reponse being sent.
 byte[] msgId()
          Return the message identifier in a byte array.
 void setApiProfileName(java.lang.String profile)
          Associates an API profile with the put operation.
 void setCloseTheme(boolean flag)
          Specify whether the theme should be closed automatically when the operation completes.
 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 setErrorProfileName(java.lang.String profile)
          Associates an error profile with the put operation.
 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.
 void setILSData(RomaILSData ilsData)
          Set outgoing ILS data
 void setIncrementRetryCount(boolean select)
          Enables or disables the option to reset the retry count when sending the message.
 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 setNoEms(boolean select)
          Enables or disables the option to send the message to an exception message service if the put operation fails.
 void setNoNotification(boolean select)
          Enables or disables the option to send a notification message back to the sender if the message get operation fails.
 void setNoSyncAllowed(boolean flag)
          Controls whether an MSMQ message can be placed outside syncpoint control.
 void setNotification(boolean flag)
          Set or clear notification flag
 void setNoTransformation(boolean select)
          Enables or disables the option to send the message to a message transformation service if the next component in the workflow cannot accept the message format.
 void setPersistence(int persistence)
          Set a new value for the message perisitence.
 void setPriority(int priority)
          Set the message priority.
 void setRetainTheme(boolean flag)
          Specify whether the theme should be retained for future operations.
 void setSecurityDef(RomaSecurityDef secDef)
          Set security definition
 void setSelector(int sel)
          Sets the put selector.
 void setSuppressErrorProfile(boolean flag)
          Specify if error profiling is to be suppressed
 void setSyncpointDef(RomaSyncpointDef sync)
          Specify sync point definitiion
 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.
 void setTermSupported(boolean flag)
          Specify if termination is supported
 void setTheme(RomaTheme theme)
          Update the message theme.
 void setUseApiProfile(boolean flag)
          Indicates that flags and options specified in the API profile should be used for the Roma put operation.
 void setUseTheme(boolean flag)
          Specify whether an existing theme should be used.
 int status()
          Return message status
 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

RomaBeResponse

public RomaBeResponse()
Constructs an empty RomaBeResponse object.

RomaBeResponse

public RomaBeResponse(RomaTheme theme)
Constructs a new RomaBeResponse object and associates it with the specified theme
Parameters:
theme - the theme of the request that this response is intended for.
See Also:
setTheme(com.candle.roma.kxc.RomaTheme)

RomaBeResponse

public RomaBeResponse(RomaTheme theme,
                      byte[] msgBuf,
                      int msgLen)
Constructs a new RomaBeResponse object, associates it with the specified theme and sets user message buffer.
Parameters:
theme - the theme of the request that this response is intended for.
msgBuf - byte array containing the message.
msgLen - length of the message.

RomaBeResponse

public RomaBeResponse(RomaTheme theme,
                      byte[] msgBuf,
                      int msgLen,
                      byte[] tagBuf,
                      int tagLen)
Constructs a new RomaBeResponse object, associates it with the specified theme and sets user message buffer.
Parameters:
theme - the theme of the request that this response is intended for.
msgBuf - byte array containing the message.
msgLen - length of the message.
tagBuf - byte array containing the tag data.
tagLen - length of the tag data.

RomaBeResponse

public RomaBeResponse(RomaBeRequest br)
Constructs a new RomaBeResponse object and initialises it with message id, correlation id and theme from supplied RomaBeRequest.
Parameters:
br - a RomaBeRequest
Method Detail

marshalResponse

public void marshalResponse()
                     throws java.io.IOException
Marshalls response data immediately prior the reponse being sent. Invoked by the RomaBusinessElement.put() method.
Throws:
java.io.IOException - if the marshalling operation fails for some reason.
See Also:
RomaBusinessElement.put( RomaBeResponse )

setSelector

public void setSelector(int sel)
Sets the put selector. This specifies which identifiers contained in the RomaMessage should be used when the message is put.
Parameters:
sel - the new value of the put selector.

The expected return value will be one of the following fields :-

  • USE_NONE
  • USE_MSGID
  • USE_CORRELID
  • USE_MSGID_AND_CORRELID

setNoSyncAllowed

public void setNoSyncAllowed(boolean flag)
Controls whether an MSMQ message can be placed outside syncpoint control. If the application attempts to put a message to MSMQ inside syncpoint control but the target queue does not support transactions, the call is normally rejected with error code RC_NONXACTIONAL. The application can call this method with true flag to force an MSMQ message to be placed outside syncpoint control.
Parameters:
flag - one of :-
  • true - allow MSMQ messages to be placed outside syncpoint control
  • false - don't allow MSMQ messages to be placed outside syncpoint control

setApiProfileName

public void setApiProfileName(java.lang.String profile)
Associates an API profile with the put operation.
Parameters:
profile - the name of the API profile.

setErrorProfileName

public void setErrorProfileName(java.lang.String profile)
Associates an error profile with the put operation.
Parameters:
profile - the name of the error profile.

setSuppressErrorProfile

public void setSuppressErrorProfile(boolean flag)
Specify if error profiling is to be suppressed
Parameters:
flag - true to suppress error profiling

setUseApiProfile

public void setUseApiProfile(boolean flag)
Indicates that flags and options specified in the API profile should be used for the Roma put operation.

If this option is chosen but the specified profile is not available then default values are used for the put options.

Parameters:
flag - true to suppress error profiling

setIncrementRetryCount

public void setIncrementRetryCount(boolean select)
Enables or disables the option to reset the retry count when sending the message.
Parameters:
select - one of :-
  • true - do not increment the retry count when sending the message.
  • false - reset the retry count when sending the message.

setNoEms

public void setNoEms(boolean select)
Enables or disables the option to send the message to an exception message service if the put operation fails.
Parameters:
select - one of :-
  • true - do not perform a send to an exception message service if put fails.
  • false - allow a message to be sent to an exception message service if the put fails.

setNoNotification

public void setNoNotification(boolean select)
Enables or disables the option to send a notification message back to the sender if the message get operation fails.
Parameters:
select - one of :-
  • true - do not allow a notification message to be sent on a get failure.
  • false - do allow a notification message to be sent.

setNoTransformation

public void setNoTransformation(boolean select)
Enables or disables the option to send the message to a message transformation service if the next component in the workflow cannot accept the message format.
Parameters:
select - one of :-
  • true - do not allow the message to sent to the transformation service.
  • false - allow the message to be routed via a transformation service if necessary.

setUseTheme

public void setUseTheme(boolean flag)
Specify whether an existing theme should be used.

Parameters:
flag - if true then the existing theme is used.

setRetainTheme

public void setRetainTheme(boolean flag)
Specify whether the theme should be retained for future operations.

Parameters:
flag - if true then the theme is retained.

setCloseTheme

public void setCloseTheme(boolean flag)
Specify whether the theme should be closed automatically when the operation completes.

Parameters:
flag - if true then the theme will be closed.

setNotification

public void setNotification(boolean flag)
Set or clear notification flag
Parameters:
flag - if true then Roma sends response immediately back to client, ignoring any further business components

setTermSupported

public void setTermSupported(boolean flag)
Specify if termination is supported
Parameters:
flag - true to indicate termination is supported.

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.

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.

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.

setMsgName

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

status

public int status()
Return message status

setSecurityDef

public void setSecurityDef(RomaSecurityDef secDef)
Set security definition
Parameters:
secDef - security definition to be sent with message

setSyncpointDef

public void setSyncpointDef(RomaSyncpointDef sync)
Specify sync point definitiion

Parameters:
sync - definition 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 message data.
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 tag data.
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

setILSData

public void setILSData(RomaILSData ilsData)
Set outgoing ILS data
Parameters:
ilsData - The ILS data to be sent with message

getILSData

public RomaILSData getILSData()
Get incoming ILS data