public abstract class AbstractJMS20Client extends AbstractJMSClient implements JMSClient
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,javax.jms.JMSConsumer> |
temporaryConsumers |
CONNECTION_FACTORY_NAME, factory, INVALID_MESSAGE_EXCEPTION, temporaryDestinations| Constructor and Description |
|---|
AbstractJMS20Client(String clientID)
Create new JMS client version 2.0 instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnection()
Permanently closes JMS client connection.
|
String |
createTemporaryQueue()
Create new temporary queue.
|
String |
createTemporaryTopic()
Create new temporary topic.
|
void |
deleteTemporaryQueue(String queueName)
Deletes temporary queue.
|
void |
deleteTemporaryTopic(String queueName)
Deletes temporary topic.
|
byte[] |
getMessageByteContent(String messageID)
Return byte message's byte content.
|
String |
getMessageCorrelationID(String messageID)
Return message's correlation ID
|
String |
getMessageDestinationName(String messageID)
Return message's target destination (Queue or Topic) name.
|
long |
getMessageExpirationTime(String messageID)
Return message's expiration time in milliseconds.
|
String |
getMessageID(String messageID)
Return message's unique ID.
|
Map<String,Object> |
getMessageMapContent(String messageID)
Return map message's map content.
|
int |
getMessagePriority(String messageID)
Return message's priority value from 1-9.
|
Object |
getMessageProperty(String propertyName,
String messageID)
Return message property value
|
String |
getMessageReplyToQueue(String messageID)
Return message's reply to queue (or topic) target destination.
|
String |
getMessageTextContent(String messageID)
Return text message's string content.
|
long |
getMessageTimestamp(String messageID)
Return message's latest timestamp.
|
String |
getMessageType(String messageID)
Return message's JMS type.
|
int |
getQueueDepth(String queueName)
Return specified queue current depth (Amount of unread messages in queue).
|
void |
initializeClient(Map<String,Object> parameters)
Initializes current JMS client wrapper.
|
void |
openConnection()
Open new connection into MQ provider/broker.
|
void |
openConnection(String userName,
String password)
Open new connection into MQ provider/broker.
|
String |
peekFromQueue(String queueName,
String messageSelector)
Peek first message from the queue.
|
void |
publishIntoTopic(String topicName,
byte[] content,
Map<String,Object> parameters,
Map<String,Object> properties)
Publish new message into topic.
|
void |
publishIntoTopic(String topicName,
Map<String,Object> content,
Map<String,Object> parameters,
Map<String,Object> properties)
Publish new message into topic.
|
void |
publishIntoTopic(String topicName,
String content,
Map<String,Object> parameters,
Map<String,Object> properties)
Publish new message into topic.
|
void |
purgeQueue(String queueName)
Remove all messages from specified queue.
|
String |
readFromQueue(String queueName,
long timeout,
String messageSelector)
Read single message from the queue.
|
String |
readFromTopic(String name,
long timeout)
Read single message from the topic.
|
void |
subscribeTopic(String topicName,
String name,
String messageSelector)
Make new durable subscription into topic.
|
void |
unsubscribeTopic(String name)
Cancel made durable subscription for the topic.
|
void |
writeIntoQueue(String queueName,
byte[] content,
Map<String,Object> parameters,
Map<String,Object> properties)
Write new message into queue
|
void |
writeIntoQueue(String queueName,
Map<String,Object> content,
Map<String,Object> parameters,
Map<String,Object> properties)
Write new message into queue
|
void |
writeIntoQueue(String queueName,
String content,
Map<String,Object> parameters,
Map<String,Object> properties)
Write new message into queue
|
addMessage, clearMessages, createConnectionFactory, getClientID, getMessage, isConnected, resolveMessageType, resolveMessageTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearMessages, getClientID, resolveMessageTypepublic AbstractJMS20Client(String clientID)
clientID - - Unique client IDpublic void closeConnection()
throws javax.jms.JMSException
JMSClientcloseConnection in interface JMSClientcloseConnection in class AbstractJMSClientjavax.jms.JMSException - If closing of connection failspublic String createTemporaryQueue() throws javax.jms.JMSException
JMSClientcreateTemporaryQueue in interface JMSClientjavax.jms.JMSException - If temporary queue creation fails.public String createTemporaryTopic() throws javax.jms.JMSException
JMSClientcreateTemporaryTopic in interface JMSClientjavax.jms.JMSException - If temporary topic creation fails.public void deleteTemporaryQueue(String queueName) throws javax.jms.JMSException
JMSClientdeleteTemporaryQueue in interface JMSClientqueueName - - Temporary queue namejavax.jms.JMSException - If deletion fails.public void deleteTemporaryTopic(String queueName) throws javax.jms.JMSException
JMSClientdeleteTemporaryTopic in interface JMSClientqueueName - - Temporary topic namejavax.jms.JMSException - If deletion fails.public byte[] getMessageByteContent(String messageID) throws javax.jms.JMSException
JMSClientgetMessageByteContent in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If reading bytes from message fails.public Map<String,Object> getMessageMapContent(String messageID) throws javax.jms.JMSException
JMSClientgetMessageMapContent in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If reading map from message fails.public String getMessageCorrelationID(String messageID) throws javax.jms.JMSException
JMSClientgetMessageCorrelationID in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If getting message's meta data fails.public String getMessageDestinationName(String messageID) throws javax.jms.JMSException
JMSClientgetMessageDestinationName in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If getting message's meta data fails.public long getMessageExpirationTime(String messageID) throws javax.jms.JMSException
JMSClientgetMessageExpirationTime in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If getting message's meta data fails.public String getMessageID(String messageID) throws javax.jms.JMSException
JMSClientgetMessageID in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If getting message's meta data fails.public int getMessagePriority(String messageID) throws javax.jms.JMSException
JMSClientgetMessagePriority in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If getting message's meta data fails.public Object getMessageProperty(String propertyName, String messageID) throws javax.jms.JMSException
JMSClientgetMessageProperty in interface JMSClientpropertyName - - Name of the propertymessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If getting message's meta data fails.public String getMessageReplyToQueue(String messageID) throws javax.jms.JMSException
JMSClientgetMessageReplyToQueue in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If getting message's meta data fails.public String getMessageTextContent(String messageID) throws javax.jms.JMSException
JMSClientgetMessageTextContent in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - - If getting message content fails for any reason.public long getMessageTimestamp(String messageID) throws javax.jms.JMSException
JMSClientgetMessageTimestamp in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If getting message's meta data fails.public String getMessageType(String messageID) throws javax.jms.JMSException
JMSClientgetMessageType in interface JMSClientmessageID - - Optional message ID. If not given then method attempt to read content from latest read messagejavax.jms.JMSException - If getting message's meta data fails.public int getQueueDepth(String queueName) throws javax.jms.JMSException
JMSClientgetQueueDepth in interface JMSClientqueueName - - Name of the queue to checkjavax.jms.JMSException - If getting queue depth fails for any reason.public void initializeClient(Map<String,Object> parameters) throws Exception
JMSClientinitializeClient in interface JMSClientparameters - - Parameters for client initialization.Exception - If initializing the client fails for any reason.public void openConnection()
throws javax.jms.JMSException
JMSClientopenConnection in interface JMSClientopenConnection in class AbstractJMSClientjavax.jms.JMSException - If opening the connection fails.public void openConnection(String userName, String password) throws javax.jms.JMSException
JMSClientopenConnection in interface JMSClientuserName - - User name used for connection authenticationpassword - - Password used for connection authenticationjavax.jms.JMSException - If opening the connection fails.public String peekFromQueue(String queueName, String messageSelector) throws javax.jms.JMSException
JMSClientpeekFromQueue in interface JMSClientqueueName - - Queue to peek frommessageSelector - - Optional message selector to filter queue contentnull if no message was peeked from the queue.javax.jms.JMSException - If reading the message fails.public void publishIntoTopic(String topicName, String content, Map<String,Object> parameters, Map<String,Object> properties)
JMSClientpublishIntoTopic in interface JMSClienttopicName - - Topic name into which message is publishedcontent - - Message's contentparameters - - Optional message's JMS parameters.
Key values are defined in MessageParameterNamesproperties - - Optional JMS message propertiesMessageParameterNamespublic void publishIntoTopic(String topicName, byte[] content, Map<String,Object> parameters, Map<String,Object> properties)
JMSClientpublishIntoTopic in interface JMSClienttopicName - - Topic name into which message is publishedcontent - - Message's contentparameters - - Optional message's JMS parameters.
Key values are defined in MessageParameterNamesproperties - - Optional JMS message propertiesMessageParameterNamespublic void publishIntoTopic(String topicName, Map<String,Object> content, Map<String,Object> parameters, Map<String,Object> properties)
JMSClientpublishIntoTopic in interface JMSClienttopicName - - Topic name into which message is publishedcontent - - Message's contentparameters - - Optional message's JMS parameters.
Key values are defined in MessageParameterNamesproperties - - Optional JMS message propertiesMessageParameterNamespublic void purgeQueue(String queueName) throws javax.jms.JMSException
JMSClientpurgeQueue in interface JMSClientqueueName - - Name of the queue to purge from messagesjavax.jms.JMSException - If purging the queue fails for any reason.public String readFromQueue(String queueName, long timeout, String messageSelector) throws javax.jms.JMSException
JMSClientreadFromQueue in interface JMSClientqueueName - - Name of the queue to read fromtimeout - - Timeout in milliseconds to wait for message to appear into queuemessageSelector - - Optional message selector string for filtering messagesnull if no message was read from the queue.javax.jms.JMSException - If reading the message fails.public String readFromTopic(String name, long timeout) throws javax.jms.JMSException
JMSClientreadFromTopic in interface JMSClientname - - Name of the durable subscription made for the topic or name of the temporary topictimeout - - Timeout in milliseconds to wait for message to appear into topicnull if no message was read from the topic.javax.jms.JMSException - If reading the message fails.public void subscribeTopic(String topicName, String name, String messageSelector) throws javax.jms.JMSException
JMSClientsubscribeTopic in interface JMSClienttopicName - - Name of the topicname - - Unique name for the durable subscriptionmessageSelector - - Optional message selector string for filtering messagesjavax.jms.JMSException - If subscribing the topic fails.public void unsubscribeTopic(String name)
JMSClientunsubscribeTopic in interface JMSClientname - - Unique subscription name to cancelpublic void writeIntoQueue(String queueName, String content, Map<String,Object> parameters, Map<String,Object> properties)
JMSClientwriteIntoQueue in interface JMSClientqueueName - - Name of the queue to writecontent - - Message's contentparameters - - Optional message's JMS parameters.
Key values are defined in MessageParameterNamesproperties - - Optional JMS message propertiesMessageParameterNamespublic void writeIntoQueue(String queueName, byte[] content, Map<String,Object> parameters, Map<String,Object> properties)
JMSClientwriteIntoQueue in interface JMSClientqueueName - - Name of the queue to writecontent - - Message's contentparameters - - Optional message's JMS parameters.
Key values are defined in MessageParameterNamesproperties - - Optional JMS message propertiesMessageParameterNamespublic void writeIntoQueue(String queueName, Map<String,Object> content, Map<String,Object> parameters, Map<String,Object> properties)
JMSClientwriteIntoQueue in interface JMSClientqueueName - - Name of the queue to writecontent - - Message's contentparameters - - Optional message's JMS parameters.
Key values are defined in MessageParameterNamesproperties - - Optional JMS message propertiesMessageParameterNamesCopyright © 2018. All rights reserved.