Class MQDestination
- java.lang.Object
-
- com.ibm.msg.client.jms.internal.JmsReadablePropertyContextImpl
-
- com.ibm.msg.client.jms.internal.JmsPropertyContextImpl
-
- com.ibm.msg.client.jms.admin.JmsDestinationImpl
-
- com.ibm.msg.client.jms.admin.JmsJndiDestinationImpl
-
- com.ibm.mq.jms.MQDestination
-
- All Implemented Interfaces:
- com.ibm.jms.JMSDestination, JmsDestination, JmsPropertyContext, JmsReadablePropertyContext, com.ibm.msg.client.provider.ProviderPropertyContextCallback, java.io.Serializable, java.util.Map<java.lang.String,java.lang.Object>, javax.jms.Destination, javax.naming.Referenceable
public class MQDestination extends com.ibm.msg.client.jms.admin.JmsJndiDestinationImpl implements javax.jms.Destination, com.ibm.jms.JMSDestination, java.io.SerializableAn MQDestination object encapsulates a provider-specific address.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.ibm.msg.client.jms.JmsDestination
DESTINATION_TYPE_QUEUE, DESTINATION_TYPE_TOPIC
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetCCSID()Gets the number of the character set that is used by this destination for sending messages.java.lang.StringgetDescription()Gets the description of the destination.intgetEncoding()Gets the encoding that is used for this destination.longgetExpiry()Gets the value of the expiry for this destination.intgetFailIfQuiesce()Gets the status of the failIfQuiesce property of this destination.intgetMessageBodyStyle()Gets the value of the message body style for messages sent to or received from this destination.intgetMQMDMessageContext()Gets the value of the message context options for messages sent to this destination.booleangetMQMDReadEnabled()Whether JMS_IBM_MQMD* properties are set on messages sent to or received messages from this destination based on the MQMD fields, after the send operation or during the receive operation.booleangetMQMDWriteEnabled()Whether JMS_IBM_MQMD* properties on messages sent to this destination modify the MQMD fields prior to the send operation.intgetPersistence()Gets the value of the persistence of all messages sent to this destination.intgetPriority()Gets the override priority value.java.lang.StringgetProperty(java.lang.String name)Gets the named, user-defined property from the MQDestination URI.intgetPutAsyncAllowed()Indicates whether asynchronous puts are allowed on this destinationintgetReadAheadAllowed()Indicates whether read ahead is allowed on this destinationintgetReadAheadClosePolicy()Indicates whether a read ahead buffer should be drained by asynchronous consumers on close, when reading from this destination, or whether the current running callback should complete and allow other messages to stay on the buffer (to be discarded)intgetReceiveCCSID()Gets the number of the character set that is used when receiving messages from this destination.intgetReceiveConversion()Determines if the QueueManager is asked to convert messages before retrieval.javax.naming.ReferencegetReference()Returns a reference object to enable this object to be stored in JNDI.intgetReplyToStyle()Get the ReplyToStyle.java.lang.StringgetStringFromDestination()Produces a transport-dependent string that encapsulates the properties of the destination.intgetTargetClient()Gets the JMS compliance indicator flag.java.lang.StringgetUnmappableAction()Gets the action to be taken for unmappable characters when sending messages to this destinationbytegetUnmappableReplacement()Gets the byte to be used for unmappable characters when sending messages to this destinationintgetWildcardFormat()Gets the formatting accepted when using wildcards.voidsetCCSID(int ccsid)Sets the number of the character set that is used by this destination for sending messages.voidsetDescription(java.lang.String description)Sets a description of the destination.voidsetEncoding(int encoding)Sets the encoding to be used for numeric fields in messages sent to this destination.voidsetExpiry(long expiry)Sets the expiry of all messages sent to this destination.voidsetFailIfQuiesce(int fiq)Sets the behavior of applications accessing a quiescing queue manager with this destination.voidsetMessageBodyStyle(int bodyStyle)Sets the value for the message body style for messages sent to or received from this destination.voidsetMQMDMessageContext(int messageContext)Sets the value of the message context options for messages sent to this destination.voidsetMQMDReadEnabled(boolean readEnabled)Whether JMS_IBM_MQMD* properties are set on messages sent to or received messages from this destination based on the MQMD fields, after the send operation or during the receive operation.voidsetMQMDWriteEnabled(boolean writeEnabled)Whether JMS_IBM_MQMD* properties on messages sent to this destination modify the MQMD fields prior to the send operation.voidsetPersistence(int persistence)Overrides the persistence of all messages sent to this destination.voidsetPriority(int priority)Overrides the priority of all messages sent to this destination.voidsetProperty(java.lang.String name, java.lang.String value)Sets an arbitrary, user-defined property.voidsetPutAsyncAllowed(int paa)Sets whether asynchronous puts are allowed on this destinationvoidsetReadAheadAllowed(int raa)Sets whether read ahead is allowed on this destinationvoidsetReadAheadClosePolicy(int racp)Sets whether a read ahead buffer should be drained by asynchronous consumers on close, when reading from this destination, or whether the current running callback should complete and allow other messages to stay on the buffer (to be discarded)voidsetReceiveCCSID(int ccsid)Sets the number of the character set that is used when receiving messages from this destination.voidsetReceiveConversion(int rcnvc)Controls if the queuemanager is asked to convert messages before retrieval.voidsetReplyToStyle(int style)Set the ReplyToStyle.voidsetTargetClient(int targetClient)Sets a flag indicating whether the remote application supports JMS.voidsetUnmappableAction(java.lang.String unmappableAction)Sets the action to be taken for unmappable characters when sending messages to this destinationvoidsetUnmappableReplacement(java.lang.Byte unmappableReplacement)Sets the byte to be used for unmappable characters when sending messages to this destinationvoidsetWildcardFormat(int format)Sets the formatting to accept when using wildcards.-
Methods inherited from class com.ibm.msg.client.jms.admin.JmsDestinationImpl
equals, getQueueName, getTopicName, hashCode, setStringProperty, toString
-
Methods inherited from class com.ibm.msg.client.jms.internal.JmsPropertyContextImpl
clear, containsKey, containsValue, entrySet, get, getObjectProperty, isEmpty, keySet, propertyExists, put, putAll, remove, setBatchProperties, setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty, setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty, setObjectProperty, setProviderPropertyContext, setShortProperty, size, values
-
Methods inherited from class com.ibm.msg.client.jms.internal.JmsReadablePropertyContextImpl
dump, getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getPropertyNames, getShortProperty, getStringProperty
-
Methods inherited from interface com.ibm.msg.client.jms.JmsPropertyContext
setBatchProperties, setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty, setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty, setObjectProperty, setShortProperty, setStringProperty
-
Methods inherited from interface com.ibm.msg.client.jms.JmsReadablePropertyContext
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty, getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty, getObjectProperty, getPropertyNames, getShortProperty, getStringProperty, propertyExists
-
-
-
-
Method Detail
-
getCCSID
public int getCCSID()
Gets the number of the character set that is used by this destination for sending messages.- Returns:
- the CCSID.
-
getUnmappableAction
public java.lang.String getUnmappableAction() throws javax.jms.JMSExceptionGets the action to be taken for unmappable characters when sending messages to this destination- Returns:
- the name of the action to be used
- Throws:
javax.jms.JMSException
-
getUnmappableReplacement
public byte getUnmappableReplacement() throws javax.jms.JMSExceptionGets the byte to be used for unmappable characters when sending messages to this destination- Returns:
- unmappableReplacement the byte to be used
- Throws:
javax.jms.JMSException
-
getReceiveCCSID
public int getReceiveCCSID() throws javax.jms.JMSExceptionGets the number of the character set that is used when receiving messages from this destination. This is the CCSID that the QueueManager is requested to convert to if and only ifCommonConstants.WMQ_RECEIVE_CONVERSION_QMGRis specified on thesetReceiveConversion(int)method.A value of
CommonConstants.WMQ_RECEIVE_CCSID_JVM_DEFAULTimplies the codepage of the running JVM.- Returns:
- The CCSID.
- Throws:
javax.jms.JMSException- if any exception occurs retrieving the value
-
getReceiveConversion
public int getReceiveConversion() throws javax.jms.JMSExceptionDetermines if the QueueManager is asked to convert messages before retrieval. Setting this toCommonConstants.WMQ_RECEIVE_CONVERSION_QMGRwill add GMO_CONVERT to all get calls.The default value is
CommonConstants.WMQ_RECEIVE_CONVERSION_CLIENT_MSG. This will set the client to convert only the payload of the JMS Messages.To control the CCSID to which the QueueManager will convert set it via
setReceiveCCSID(int)- Returns:
CommonConstants.WMQ_RECEIVE_CONVERSION_QMGRorCommonConstants.WMQ_RECEIVE_CONVERSION_CLIENT_MSG- Throws:
javax.jms.JMSException- if an exception retrieving the value occurs
-
getDescription
public java.lang.String getDescription()
Gets the description of the destination.- Returns:
- the description.
-
getEncoding
public int getEncoding()
Gets the encoding that is used for this destination.- Returns:
- the encoding.
-
getExpiry
public long getExpiry()
Gets the value of the expiry for this destination.- Returns:
- the expiry time (milliseconds).
-
getFailIfQuiesce
public int getFailIfQuiesce()
Gets the status of the failIfQuiesce property of this destination.- Returns:
- possible values are:
-
getMQMDMessageContext
public int getMQMDMessageContext() throws javax.jms.JMSExceptionGets the value of the message context options for messages sent to this destination.- Returns:
- possible values are:
- Throws:
javax.jms.JMSException
-
getMQMDWriteEnabled
public boolean getMQMDWriteEnabled() throws javax.jms.JMSExceptionWhether JMS_IBM_MQMD* properties on messages sent to this destination modify the MQMD fields prior to the send operation.- Returns:
- true or false
- Throws:
javax.jms.JMSException
-
getMQMDReadEnabled
public boolean getMQMDReadEnabled() throws javax.jms.JMSExceptionWhether JMS_IBM_MQMD* properties are set on messages sent to or received messages from this destination based on the MQMD fields, after the send operation or during the receive operation.- Returns:
- true or false
- Throws:
javax.jms.JMSException
-
getMessageBodyStyle
public int getMessageBodyStyle() throws javax.jms.JMSExceptionGets the value of the message body style for messages sent to or received from this destination.- Returns:
- possible values are:
- Throws:
javax.jms.JMSException
-
getPersistence
public int getPersistence()
Gets the value of the persistence of all messages sent to this destination.- Returns:
- the value of persistence.
-
getPriority
public int getPriority()
Gets the override priority value.- Returns:
- the new priority. Possible values are:
WMQConstants.WMQ_PRI_APPWMQConstants.WMQ_PRI_QDEF- An integer between 0 and 9, inclusive.
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Gets the named, user-defined property from the MQDestination URI.- Parameters:
name- The name of the property.- Returns:
- the value of the named property or null if this property has not been defined.
- See Also:
setProperty(java.lang.String, java.lang.String)
-
getPutAsyncAllowed
public int getPutAsyncAllowed() throws javax.jms.JMSExceptionIndicates whether asynchronous puts are allowed on this destination- Returns:
- possible values are:
- Throws:
javax.jms.JMSException
-
getReadAheadAllowed
public int getReadAheadAllowed() throws javax.jms.JMSExceptionIndicates whether read ahead is allowed on this destination- Returns:
- possible values are:
- Throws:
javax.jms.JMSException
-
getReadAheadClosePolicy
public int getReadAheadClosePolicy() throws javax.jms.JMSExceptionIndicates whether a read ahead buffer should be drained by asynchronous consumers on close, when reading from this destination, or whether the current running callback should complete and allow other messages to stay on the buffer (to be discarded)- Returns:
- possible values are:
- Throws:
javax.jms.JMSException
-
getReference
public javax.naming.Reference getReference() throws javax.naming.NamingExceptionReturns a reference object to enable this object to be stored in JNDI.- Specified by:
getReferencein interfacejavax.naming.Referenceable- Overrides:
getReferencein classcom.ibm.msg.client.jms.admin.JmsJndiDestinationImpl- Returns:
- the reference object
- Throws:
javax.naming.NamingException
-
getStringFromDestination
public java.lang.String getStringFromDestination()
Produces a transport-dependent string that encapsulates the properties of the destination. This returns the full URI of the destination.- Specified by:
getStringFromDestinationin interfacecom.ibm.jms.JMSDestination- Returns:
- String URI of the destination.
-
getTargetClient
public int getTargetClient()
Gets the JMS compliance indicator flag.- Returns:
- possible values are:
-
getWildcardFormat
public int getWildcardFormat() throws javax.jms.JMSExceptionGets the formatting accepted when using wildcards.- Returns:
- property applicable to all instances of Destination and Topic. In the v6 implementation, where publish/subscribe messaging is performed via a broker, different topic wildcard syntax is used depending on which broker is used. In v7, using native publish/subscribe within the queue manager, the wildcard syntax can be chosen via this property.
- Throws:
javax.jms.JMSException- if an internal error occurs.
-
setCCSID
public void setCCSID(int ccsid) throws javax.jms.JMSExceptionSets the number of the character set that is used by this destination for sending messages.- Parameters:
ccsid- the CCSID.- Throws:
javax.jms.JMSException- if ccsid is invalid.
-
setUnmappableAction
public void setUnmappableAction(java.lang.String unmappableAction) throws javax.jms.JMSExceptionSets the action to be taken for unmappable characters when sending messages to this destination- Parameters:
unmappableAction- the name of the action to be used- Throws:
javax.jms.JMSException
-
setUnmappableReplacement
public void setUnmappableReplacement(java.lang.Byte unmappableReplacement) throws javax.jms.JMSExceptionSets the byte to be used for unmappable characters when sending messages to this destination- Parameters:
unmappableReplacement- the byte to be used- Throws:
javax.jms.JMSException
-
setReceiveCCSID
public void setReceiveCCSID(int ccsid) throws javax.jms.JMSExceptionSets the number of the character set that is used when receiving messages from this destination. This is the CCSID that the QueueManager is requested to convert to if and only ifCommonConstants.WMQ_RECEIVE_CONVERSION_QMGRis specified on thesetReceiveConversion(int)method.To specify codepage that the JVM is running in use
CommonConstants.WMQ_RECEIVE_CCSID_JVM_DEFAULT- Parameters:
ccsid- the CCSID.- Throws:
javax.jms.JMSException- if ccsid is invalid.
-
setReceiveConversion
public void setReceiveConversion(int rcnvc) throws javax.jms.JMSExceptionControls if the queuemanager is asked to convert messages before retrieval. Setting this toCommonConstants.WMQ_RECEIVE_CONVERSION_QMGRwill add GMO_CONVERT to all get calls. The default value isCommonConstants.WMQ_RECEIVE_CONVERSION_CLIENT_MSG. This will set the client to convert only the payload of the JMS Messages.To control the CCSID to which the QueueManager will convert set it via
setReceiveCCSID(int)- Parameters:
rcnvc-CommonConstants.WMQ_RECEIVE_CONVERSION_QMGRCommonConstants.WMQ_RECEIVE_CONVERSION_CLIENT_MSG- Throws:
javax.jms.JMSException- if a value supplied is invalid.
-
setDescription
public void setDescription(java.lang.String description)
Sets a description of the destination.- Parameters:
description- the description for the destination.
-
setEncoding
public void setEncoding(int encoding) throws javax.jms.JMSExceptionSets the encoding to be used for numeric fields in messages sent to this destination.- Parameters:
encoding- the encoding.- Throws:
javax.jms.JMSException- if encoding is not valid.
-
setExpiry
public void setExpiry(long expiry) throws javax.jms.JMSExceptionSets the expiry of all messages sent to this destination.- Parameters:
expiry- the expiry time (milliseconds).- Throws:
javax.jms.JMSException- if expiry is not valid.
-
setFailIfQuiesce
public void setFailIfQuiesce(int fiq) throws javax.jms.JMSExceptionSets the behavior of applications accessing a quiescing queue manager with this destination.- Parameters:
fiq- possible values are:- Throws:
javax.jms.JMSException- if fiq is not one of the above.
-
setMQMDMessageContext
public void setMQMDMessageContext(int messageContext) throws javax.jms.JMSExceptionSets the value of the message context options for messages sent to this destination.- Parameters:
messageContext- the value of message context options. Possible values are:- Throws:
javax.jms.JMSException- if messageContext is invalid
-
setMQMDWriteEnabled
public void setMQMDWriteEnabled(boolean writeEnabled) throws javax.jms.JMSExceptionWhether JMS_IBM_MQMD* properties on messages sent to this destination modify the MQMD fields prior to the send operation.- Parameters:
writeEnabled- true or false- Throws:
javax.jms.JMSException- if the value cannot be set
-
setMQMDReadEnabled
public void setMQMDReadEnabled(boolean readEnabled) throws javax.jms.JMSExceptionWhether JMS_IBM_MQMD* properties are set on messages sent to or received messages from this destination based on the MQMD fields, after the send operation or during the receive operation.- Parameters:
readEnabled- true or false- Throws:
javax.jms.JMSException- if the value cannot be set
-
setMessageBodyStyle
public void setMessageBodyStyle(int bodyStyle) throws javax.jms.JMSExceptionSets the value for the message body style for messages sent to or received from this destination.- Parameters:
bodyStyle- the value for the message body style. Possible values are:- Throws:
javax.jms.JMSException- if bodyStyle is invalid
-
setPersistence
public void setPersistence(int persistence) throws javax.jms.JMSExceptionOverrides the persistence of all messages sent to this destination.- Parameters:
persistence- the value of persistence.- Throws:
javax.jms.JMSException- if persistence is invalid.
-
setPriority
public void setPriority(int priority) throws javax.jms.JMSExceptionOverrides the priority of all messages sent to this destination.- Parameters:
priority- the new priority. Possible values are:WMQConstants.WMQ_PRI_APPWMQConstants.WMQ_PRI_QDEF- An integer between 0 and 9, inclusive.
- Throws:
javax.jms.JMSException- if the value is invalid
-
setProperty
public void setProperty(java.lang.String name, java.lang.String value)Sets an arbitrary, user-defined property. This property is added to the URI string that is returned by callinggetStringFromDestination(). Names and values for such properties must conform to the following rules:Names can contain any character, but
=
,%
and&
characters will be escaped using standard URI syntax (that is, %3d, %25 and %26 respectively) when they are added to the destination URI string.
Names beginning with the charactersibm
are reserved for IBM internal use only.
The names of existing MQDestination properties (for example, priority, CCSID or brokerVersion) are also reserved.
Values can contain any character but%
and&
characters will be escaped using standard URI syntax when they are added to the ProviderDestination URI string.Destination URI strings that cannot be decoded due to syntax errors will result in a JMSException with reason MQJMS_EXCEPTION_INVALID_DESTINATION being thrown.
Names and Values added using the setProperty() method must not have any
=
,%
and&
characters replaced by escape sequences as this will be done when they are added to the destination URI string.
If this method is used on a 1.3.1 JDK or lower, the Names and Values added will not be escaped and will be added to the destination URI as they are. This can cause unpredictable results if the Names or Values contain unescaped=
,%
or&
characters. For example, they might result in a JMSException being thrown or they might cause additional erroneous properties to be defined in the MQDestination object.- Parameters:
name- The name of the property.value- The value of the property.
-
setPutAsyncAllowed
public void setPutAsyncAllowed(int paa) throws javax.jms.JMSExceptionSets whether asynchronous puts are allowed on this destination- Parameters:
paa- possible values are:- Throws:
javax.jms.JMSException- if paa is not one of the above.
-
setReadAheadAllowed
public void setReadAheadAllowed(int raa) throws javax.jms.JMSExceptionSets whether read ahead is allowed on this destination- Parameters:
raa- possible values are:- Throws:
javax.jms.JMSException- if raa is not one of the above.
-
setReadAheadClosePolicy
public void setReadAheadClosePolicy(int racp) throws javax.jms.JMSExceptionSets whether a read ahead buffer should be drained by asynchronous consumers on close, when reading from this destination, or whether the current running callback should complete and allow other messages to stay on the buffer (to be discarded)- Parameters:
racp- possible values are:- Throws:
javax.jms.JMSException- if racp is not one of the above.
-
setTargetClient
public void setTargetClient(int targetClient) throws javax.jms.JMSExceptionSets a flag indicating whether the remote application supports JMS.- Parameters:
targetClient- the value of the flag. Possible values are:- Throws:
javax.jms.JMSException- if the value is invalid
-
setWildcardFormat
public void setWildcardFormat(int format) throws javax.jms.JMSExceptionSets the formatting to accept when using wildcards.- Parameters:
format- property applicable to all instances of ConnectionFactory TopicConnectionFactory and their XA equivalents. In the v6 implementation, where publish/subscribe messaging is performed via a broker, different topic wildcard syntax is used depending on which broker is used. In v7, using native publish/subscribe within the queue manager, the wildcard syntax can be chosen via this property.- Throws:
javax.jms.JMSException- if an internal error occurs.
-
setReplyToStyle
public void setReplyToStyle(int style) throws javax.jms.JMSExceptionSet the ReplyToStyle. This determines if style of the JMSReplyTo. It can either be taken direct from the RFH2 or the Destination Name can be determined from the MQMD. If it comes from the RFH2 it will match exactly the value that was set on send. If it comes from the MQMD, any processing that has been applied to the MQMD reply to fields will be reflected. This property is handled when messages are received.- Parameters:
style- Permitted values are- Throws:
javax.jms.JMSException
-
getReplyToStyle
public int getReplyToStyle() throws javax.jms.JMSExceptionGet the ReplyToStyle. This determines if style of the JMSReplyTo. It can either be taken direct from the RFH2 or the Destination Name can be determined from the MQMD. If it comes from the RFH2 it will match exactly the value that was set on send. This property is handled when messages are received. If it comes from the MQMD, any processing that has been applied to the MQMD reply to fields will be reflected.- Returns:
- style Permitted values are
- Throws:
javax.jms.JMSException
-
-