Class JMSController

java.lang.Object
com.axemble.vdoc.sdk.impl.JMSController
All Implemented Interfaces:
IController, IJMSController, Serializable

public class JMSController extends Object implements IJMSController
SDK access to works with JMS needs
See Also:
  • Constructor Details

    • JMSController

      public JMSController()
  • Method Details

    • createQueueController

      public IJMSQueueController createQueueController(String contextPrefix, String queueName)
      Description copied from interface: IJMSController
      Create and retrieve a IJMSQueueController for a queue
      Specified by:
      createQueueController in interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      Returns:
      the IJMSQueueController instance
    • createQueue

      public void createQueue(String contextPrefix, String queueName) throws JMSQueueExistsException
      Description copied from interface: IJMSController
      Create a queue
      Specified by:
      createQueue in interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      Throws:
      JMSQueueExistsException - the exception
    • queueExist

      public boolean queueExist(String contextPrefix, String queueName)
      Description copied from interface: IJMSController
      Test if a queue exist
      Specified by:
      queueExist in interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      Returns:
      true if the queue exist otherwise false
    • deleteQueue

      public void deleteQueue(String contextPrefix, String queueName) throws JMSQueueMissingException
      Description copied from interface: IJMSController
      Delete a queue
      Specified by:
      deleteQueue in interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      Throws:
      JMSQueueMissingException - the exception
    • getQueues

      public List<IJMSQueueBean> getQueues()
      Description copied from interface: IJMSController
      Get all queues
      Specified by:
      getQueues in interface IJMSController
      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 interface IJMSController
      Parameters:
      contextPrefix - the queue prefix
      queueName - the queue name
      messageProcessor - the message processor
      Returns:
      the number of parallel batch consumer running
    • checkConsumers

      public int checkConsumers(String contextPrefix, String queueName)
      Description copied from interface: IJMSController
      Return how many batch consumers are running on this queue
      Specified by:
      checkConsumers in interface IJMSController
      Parameters:
      contextPrefix - the queue prefix
      queueName - 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 interface IJMSController
      Parameters:
      contextPrefix - the queue prefix
      queueName - the queue name
      messageProcessor - 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 interface IJMSController
      Parameters:
      contextPrefix - the queue prefix
      queueName - the queue name
      messageProcessor - the message processor
    • stopConsumers

      public void stopConsumers(String contextPrefix, String queueName)
      Description copied from interface: IJMSController
      Stop all batch consumers for this queue
      Specified by:
      stopConsumers in interface IJMSController
      Parameters:
      contextPrefix - the queue prefix
      queueName - the queue name
    • countMessage

      public long countMessage(String contextPrefix, String queueName)
      Description copied from interface: IJMSController
      Get number of messages in queue
      Specified by:
      countMessage in interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      Returns:
      the number of messages
    • countMessage

      public long countMessage(String contextPrefix, String queueName, String messageFilter)
      Description copied from interface: IJMSController
      Get number of messages in queue with message filter
      Specified by:
      countMessage in interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      messageFilter - The filter to apply on message properties - example : "JMSType = 'car' AND color = 'blue' AND weight > 2500"
      Returns:
      the number of messages
    • emptyQueue

      public int emptyQueue(String contextPrefix, String queueName)
      Description copied from interface: IJMSController
      Empty a queue
      Specified by:
      emptyQueue in interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      Returns:
      the number of messages deleted
    • deleteMessage

      public boolean deleteMessage(String contextPrefix, String queueName, long messageId)
      Description copied from interface: IJMSController
      Delete a message in a queue
      Specified by:
      deleteMessage in interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      messageId - the message id
      Returns:
      true if message has been deleted otherwise false
    • deleteMessages

      public int deleteMessages(String contextPrefix, String queueName, String messageFilter)
      Description copied from interface: IJMSController
      Delete messages in a queue with filter
      Specified by:
      deleteMessages in interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      messageFilter - 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 interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      maxMessages - 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 interface IJMSController
      Parameters:
      contextPrefix - The queue prefix
      queueName - the queue name
      messageFilter - 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