Java CAPS JMS Reference

JMS Message Methods

This topic describes Java methods that are available for messages of the type com.stc.connectors.jms.Message, and can be accessed from:

countMapMessage()

retrieveBytesFromMessage()

countStreamMessage()

retrieveBytesFromMessage(arg0)

countUserProperty()

retrieveMapMessage(arg0)

getBytesMessage()

retrieveMapMessageList()

getDestination()

retrieveStringFromMessage(arg0)

getJMSMessageType()

retrieveStringFromMessage()

getMapMessage()

retrieveUserProperty(arg0)

getMapMessage(arg0)

retrieveUserPropertyList()

getMessageProperties()

setBytesMessage(arg0)

getStreamMessage()

setDestination(arg0)

getStreamMessage(arg0)

setJMSMessageType(arg0)

getTextMessage()

setStreamMessage(arg0, arg1)

getUserProperty()

setTextMessage(arg0)

getUserProperty(arg0)

storeMapMessage(arg0, arg1)

 

storeUserProperty(arg0, arg1)

The following Java methods are available for messages of the type com.stc.connectors.jms.receiveWaitMessage, and can be accessed from the receiveWait web service operation.

getTimeToWait()

setTimeToWait(arg0)

countMapMessage()

Description

Counts the number of keys in the map message.

Parameters

None.

Return Value

Returns 

Type 

The number of keys in the map message. 

int

Exceptions

None.

countStreamMessage()

Description

Counts the number of items in the map message.

Parameters

None.

Return Value

Returns 

Type 

The number of items in the stream message. 

int

Exceptions

None.

countUserProperty()

Description

Counts the number of user properties.

Parameters

None.

Return Value

Returns 

Type 

The number of user properties. 

int

Exceptions

None.

getBytesMessage()

Description

Gets the data bytes in the message.

Parameters

None.

Return Value

Returns 

Type 

A byte array representing the data in the message. 

byte []

Exceptions

None.

getJMSMessageType()

Description

Gets the JMS message type.

Parameters

None.

Return Value

Returns 

Type 

The JMS message type, for example, Bytes, Text, Stream, Map.

java.lang.String

Exceptions

None.

getMapMessage()

Description

Gets the name-value pair array containing the map message.

Parameters

None.

Return Value

Returns 

Type 

The NameValuePair array containing the map message.

com.stc.connectors.jms.NameValuePair

Exceptions

None.

getMapMessage(arg0)

Description

Gets the name-value pair containing the map message from the location in the map list specified by arg0.

Parameters

Name 

Type 

Description 

arg0

int

The location of the name-value pair in the map message list. 

Return Value

Returns 

Type 

The NameValuePair object at the specified location.

com.stc.connectors.jms.NameValuePair

Exceptions

None.

getMessageProperties()

Description

Gets the message property object to query for the various JMS message properties.

Parameters

None.

Return Value

Returns 

Type 

The MessageProperty object to query for the various JMS message properties.

com.stc.connectors.jms.MessageProperty

Exceptions

None.

getStreamMessage()

Description

Gets the array of stream message objects.

Parameters

None.

Return Value

Returns 

Type 

An array of stream message objects. 

java.lang.Object

Exceptions

None.

getStreamMessage(arg0)

Description

Gets the stream message object from the location specified by arg0.

Parameters

Name 

Type 

Description 

arg0

int

The location of the stream message in the list. 

Return Value

Returns 

Type 

The StreamMessage object at the specified location.

java.lang.Object

Exceptions

None.

getTextMessage()

Description

Gets the data string in the message.

Parameters

None.

Return Value

Returns 

Type 

The data string in the message. 

java.lang.String

Exceptions

None.

getUserProperty()

Description

Gets the name-value pair array of the user properties in the message.

Parameters

None.

Return Value

Returns 

Type 

The NameValuePair array of the user properties in the message.

com.stc.connectors.jms.NameValuePair

Exceptions

None.

getUserProperty(arg0)

Description

Gets the name-value pair representing user properties from the location specified by arg0.

Parameters

Name 

Type 

Description 

arg0

int

Location of the user property in the list. 

Return Value

Returns 

Type 

The NameValuePair object from the specified location.

com.stc.connectors.jms.NameValuePair

Exceptions

None.

retrieveBytesFromMessage()

Description

Returns the byte array corresponding to the payload of the message object.

Parameters

None.

Return Value

Returns 

Type 

The byte array corresponding to the payload of the message object. 

byte[]

Exceptions

Throws JMSException if conversion is not possible, for example, if the method cannot convert from a map message to a byte array.

retrieveBytesFromMessage(arg0)

Description

Returns the byte array corresponding to the message payload, with the encoding as specified by arg0.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The encoding to use when converting to a byte array. 

Return Value

Returns 

Type 

The byte array corresponding to the message payload, with the specified encoding. 

byte[]

Exceptions

retrieveMapMessage(arg0)

Description

Returns the value of the message specified by arg0, or null if the message does not exist.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The name of the map message. 

Return Value

Returns 

Type 

The value of the specified message, or null if the message does not exist. 

java.lang.Object

Exceptions

None.

retrieveMapMessageList()

Description

Returns a map message list object, which contains map message objects as an array of name-value pairs.

Parameters

None.

Return Value

Returns 

Type 

A MapMessageList object, which contains map message objects as name-value pairs.

com.stc.connectors.jms.MapMessageList

Exceptions

None.

retrieveStringFromMessage()

Description

Returns a string representation of the message payload.

Parameters

None.

Return Value

Returns 

Type 

A string corresponding to the message payload. 

java.lang.String

Exceptions

Throws JMSException if conversion is not possible, for example, if the method cannot convert from a map message to a String.

retrieveStringFromMessage(arg0)

Description

Returns a string representation of the message payload, with the encoding as specified by arg0.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The encoding to use when converting to a string object. 

Return Value

Returns 

Type 

The string corresponding to the message payload, with the specified encoding. 

java.lang.String

Exceptions

Throws JMSException if conversion is not possible.

retrieveUserProperty(arg0)

Description

Returns the value of the user-defined string property specified by arg0, or null if the property does not exist.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The name of the user property. 

Return Value

Returns 

Type 

The value of the specified user property, or null if the property does not exist. 

java.lang.String

Exceptions

None.

retrieveUserPropertyList()

Description

Returns the user property list.

Parameters

None.

Return Value

Returns 

Type 

A UserPropertyList object, which contains user properties as name-value pairs.

com.stc.connectors.jms.UserPropertyList

Exceptions

None.

setBytesMessage(arg0)

Description

Sets the bytes message to the value specified by arg0.

Parameters

Name 

Type 

Description 

arg0

byte[]

The byte array containing the message. 

Return Value

None.

Exceptions

None.

setJMSMessageType(arg0)

Description

Sets the text message type to the value specified by arg0.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The value to which to set the JMS message type, for example, Bytes, Text, Stream, Map.

Return Value

None.

Exceptions

None.

setStreamMessage(arg0, arg1)

Description

Sets the stream message specified by arg0 to the value specified by arg1.

Parameters

Name 

Type 

Description 

arg0

int

The index of the stream message to be set. 

arg1

java.lang.Object

The value to which to set the stream message. 

Return Value

None.

Exceptions

None.

setTextMessage(arg0)

Description

Sets the text message to the value specified by arg0.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The value to which to set the text message. 

Return Value

None.

Exceptions

None.

storeMapMessage(arg0, arg1)

Description

Writes the name and value of a map message to the map message object, where arg0 specifies the name and arg1 specifies the value of the map message.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The name of the map message. 

arg1

java.lang.Object

The value of the map message. 

Return Value

None.

Exceptions

None.

storeUserProperty(arg0, arg1)

Description

Writes the name and value of a user property to the user property object, where arg0 specifies the name and arg1 specifies the value of the user property.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The name of the user property. 

arg1

java.lang.String

The value of the user property. 

Return Value

None.

Exceptions

None.

getTimeToWait()

Description

Gets and returns the timeout period during which the operation blocks program execution, while waiting for a message to arrive.

Parameters

None.

Return Value

Returns 

Type 

The time to wait for a message, in milliseconds. 

long

Exceptions

None.

setTimeToWait(arg0)

Description

Sets the timeout period during which the operation blocks program execution, while waiting for a message to arrive.

Parameters

Name 

Type 

Description 

arg0

long

The time, in milliseconds, for the operation to block program execution. 

Return Value

None.

Exceptions

None.