Package com.axemble.vdoc.sdk.impl
Class JMSController
java.lang.Object
com.axemble.vdoc.sdk.impl.JMSController
- All Implemented Interfaces:
IController
,IJMSController
,Serializable
SDK access to works with JMS needs
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
checkConsumers
(String contextPrefix, String queueName) Return how many batch consumers are running on this queueint
checkConsumers
(String contextPrefix, String queueName, IJMSMessageProcessor<? extends IJMSMessage> messageProcessor) Return how many batch consumers are running for this message processorlong
countMessage
(String contextPrefix, String queueName) Get number of messages in queuelong
countMessage
(String contextPrefix, String queueName, String messageFilter) Get number of messages in queue with message filtervoid
createQueue
(String contextPrefix, String queueName) Create a queuecreateQueueController
(String contextPrefix, String queueName) Create and retrieve a IJMSQueueController for a queueboolean
deleteMessage
(String contextPrefix, String queueName, long messageId) Delete a message in a queueint
deleteMessages
(String contextPrefix, String queueName, String messageFilter) Delete messages in a queue with filtervoid
deleteQueue
(String contextPrefix, String queueName) Delete a queueint
emptyQueue
(String contextPrefix, String queueName) Empty a queuegetMessages
(String contextPrefix, String queueName, int maxMessages) Get messages in queuegetMessages
(String contextPrefix, String queueName, String messageFilter, int maxMessages) Get messages in queueGet all queuesboolean
queueExist
(String contextPrefix, String queueName) Test if a queue existvoid
runConsumers
(String contextPrefix, String queueName, IJMSMessageProcessor<? extends IJMSMessage> messageProcessor) Run batch consumers for this message processorvoid
stopConsumers
(String contextPrefix, String queueName) Stop all batch consumers for this queuevoid
stopConsumers
(String contextPrefix, String queueName, IJMSMessageProcessor<? extends IJMSMessage> messageProcessor) Stop all batch consumers for this message processor
-
Constructor Details
-
JMSController
public JMSController()
-
-
Method Details
-
createQueueController
Description copied from interface:IJMSController
Create and retrieve a IJMSQueueController for a queue- Specified by:
createQueueController
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue name- Returns:
- the IJMSQueueController instance
-
createQueue
Description copied from interface:IJMSController
Create a queue- Specified by:
createQueue
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue name- Throws:
JMSQueueExistsException
- the exception
-
queueExist
Description copied from interface:IJMSController
Test if a queue exist- Specified by:
queueExist
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue name- Returns:
- true if the queue exist otherwise false
-
deleteQueue
Description copied from interface:IJMSController
Delete a queue- Specified by:
deleteQueue
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue name- Throws:
JMSQueueMissingException
- the exception
-
getQueues
Description copied from interface:IJMSController
Get all queues- Specified by:
getQueues
in interfaceIJMSController
- Returns:
- a list of IJMSQueueBean
-
checkConsumers
public int checkConsumers(String contextPrefix, String queueName, IJMSMessageProcessor<? extends IJMSMessage> messageProcessor) Description copied from interface:IJMSController
Return how many batch consumers are running for this message processor- Specified by:
checkConsumers
in interfaceIJMSController
- Parameters:
contextPrefix
- the queue prefixqueueName
- the queue namemessageProcessor
- the message processor- Returns:
- the number of parallel batch consumer running
-
checkConsumers
Description copied from interface:IJMSController
Return how many batch consumers are running on this queue- Specified by:
checkConsumers
in interfaceIJMSController
- Parameters:
contextPrefix
- the queue prefixqueueName
- the queue name- Returns:
- the number of parallel batch consumer running
-
runConsumers
public void runConsumers(String contextPrefix, String queueName, IJMSMessageProcessor<? extends IJMSMessage> messageProcessor) Description copied from interface:IJMSController
Run batch consumers for this message processor- Specified by:
runConsumers
in interfaceIJMSController
- Parameters:
contextPrefix
- the queue prefixqueueName
- the queue namemessageProcessor
- the message processor
-
stopConsumers
public void stopConsumers(String contextPrefix, String queueName, IJMSMessageProcessor<? extends IJMSMessage> messageProcessor) Description copied from interface:IJMSController
Stop all batch consumers for this message processor- Specified by:
stopConsumers
in interfaceIJMSController
- Parameters:
contextPrefix
- the queue prefixqueueName
- the queue namemessageProcessor
- the message processor
-
stopConsumers
Description copied from interface:IJMSController
Stop all batch consumers for this queue- Specified by:
stopConsumers
in interfaceIJMSController
- Parameters:
contextPrefix
- the queue prefixqueueName
- the queue name
-
countMessage
Description copied from interface:IJMSController
Get number of messages in queue- Specified by:
countMessage
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue name- Returns:
- the number of messages
-
countMessage
Description copied from interface:IJMSController
Get number of messages in queue with message filter- Specified by:
countMessage
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue namemessageFilter
- The filter to apply on message properties - example : "JMSType = 'car' AND color = 'blue' AND weight > 2500"- Returns:
- the number of messages
-
emptyQueue
Description copied from interface:IJMSController
Empty a queue- Specified by:
emptyQueue
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue name- Returns:
- the number of messages deleted
-
deleteMessage
Description copied from interface:IJMSController
Delete a message in a queue- Specified by:
deleteMessage
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue namemessageId
- the message id- Returns:
- true if message has been deleted otherwise false
-
deleteMessages
Description copied from interface:IJMSController
Delete messages in a queue with filter- Specified by:
deleteMessages
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue namemessageFilter
- The filter to apply on message properties - example : "JMSType = 'car' AND color = 'blue' AND weight > 2500"- Returns:
- the number of messages deleted
-
getMessages
public List<IJMSMessageBean> getMessages(String contextPrefix, String queueName, int maxMessages) throws JMSQueueMissingException Description copied from interface:IJMSController
Get messages in queue- Specified by:
getMessages
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue namemaxMessages
- number of messages to get- Returns:
- a list of IJMSMessageBean
- Throws:
JMSQueueMissingException
-
getMessages
public List<IJMSMessageBean> getMessages(String contextPrefix, String queueName, String messageFilter, int maxMessages) throws JMSQueueMissingException Description copied from interface:IJMSController
Get messages in queue- Specified by:
getMessages
in interfaceIJMSController
- Parameters:
contextPrefix
- The queue prefixqueueName
- the queue namemessageFilter
- The filter to apply on message properties - example : "JMSType = 'car' AND color = 'blue' AND weight > 2500"maxMessages
- number of messages to get- Returns:
- a list of IJMSMessageBean
- Throws:
JMSQueueMissingException
-