Class MessageProcessorAdminService


  • public class MessageProcessorAdminService
    extends org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
    • Field Detail

      • DEFAULT_AXIS2_XML

        public static final String DEFAULT_AXIS2_XML
    • Constructor Detail

      • MessageProcessorAdminService

        public MessageProcessorAdminService()
    • Method Detail

      • addMessageProcessor

        public void addMessageProcessor​(String xml)
                                 throws org.apache.axis2.AxisFault
        Get an XML configuration element for a message processor from the FE and creates and add the MessageStore to the synapse configuration.
        Parameters:
        xml - string that contain the message processor configuration.
        Throws:
        org.apache.axis2.AxisFault - if some thing goes wrong when creating a MessageProcessor with the given xml.
      • modifyMessageProcessor

        public void modifyMessageProcessor​(String xml)
                                    throws org.apache.axis2.AxisFault
        Modify and Existing Message processor based on the given XML that is passed from the FE
        Parameters:
        xml - XML configuration for the changed Message processor
        Throws:
        org.apache.axis2.AxisFault - if Some thing goes wrong when modifying the Message processor
      • getMessageProcessor

        public String getMessageProcessor​(String name)
                                   throws org.apache.axis2.AxisFault
        Get the Synapse configuration for a Message processor
        Parameters:
        name - name of the message processor
        Returns:
        XML String that contain the configuration
        Throws:
        org.apache.axis2.AxisFault
      • deleteMessageProcessor

        public void deleteMessageProcessor​(String name)
                                    throws org.apache.axis2.AxisFault
        Delete the MessageProcessor instance with given name in the synapse configuration
        Parameters:
        name - of the MessageProcessor to be deleted
        Throws:
        org.apache.axis2.AxisFault - if Message processor does not exist
      • getMessageProcessorNames

        public String[] getMessageProcessorNames()
                                          throws org.apache.axis2.AxisFault
        Get all the Current Message processor names defined in the configuration
        Returns:
        array of Strings that contains MessageStore names
        Throws:
        org.apache.axis2.AxisFault
      • getMessageIds

        public String[] getMessageIds​(String processorName)
                               throws org.apache.axis2.AxisFault
        Get All the Messages Stored in the Message Store associated with the Processor
        Parameters:
        processorName - ScheduledMessageForwarding Processor Name
        Returns:
        Array of Message ids.
        Throws:
        org.apache.axis2.AxisFault
      • getMessageProcessorDataList

        public MessageProcessorMetaData[] getMessageProcessorDataList()
                                                               throws org.apache.axis2.AxisFault
        Get all the Current Message processor data defined in the configuration
        Returns:
        Array of MessageProcessorMetaDatas.
        Throws:
        org.apache.axis2.AxisFault
      • getEnvelope

        public String getEnvelope​(String processorName,
                                  String messageId)
                           throws org.apache.axis2.AxisFault
        Get the SOAP Envelope of the Requested message from the associated Store
        Parameters:
        processorName - Message Processor Name
        messageId - Message id of the Message
        Returns:
        Throws:
        org.apache.axis2.AxisFault
      • deleteMessage

        public void deleteMessage​(String processorName,
                                  String messageId)
                           throws org.apache.axis2.AxisFault
        Delete a Message with given Message id for the associated store
        Parameters:
        processorName - message processor name
        messageId - message id of the message to be deleted
        Throws:
        org.apache.axis2.AxisFault
      • deleteFirstMessages

        public void deleteFirstMessages​(String processorName)
                                 throws org.apache.axis2.AxisFault
        Delete first messages from the Message Store associated with the Processor
        Parameters:
        processorName - Message Processor Name
        Throws:
        org.apache.axis2.AxisFault
      • deleteAllMessages

        public void deleteAllMessages​(String processorName)
                               throws org.apache.axis2.AxisFault
        Delete all messages from the Message Store associated with the Processor
        Parameters:
        processorName - Message Processor Name
        Throws:
        org.apache.axis2.AxisFault
      • resend

        public void resend​(String processorName,
                           String messageId)
                    throws org.apache.axis2.AxisFault
        Resend a Give Message
        Parameters:
        processorName -
        messageId -
        Throws:
        org.apache.axis2.AxisFault
      • resendFirstMessage

        public void resendFirstMessage​(String processorName,
                                       String messageId)
                                throws org.apache.axis2.AxisFault
        Resend first Message
        Parameters:
        processorName -
        messageId -
        Throws:
        org.apache.axis2.AxisFault
      • resendAll

        public void resendAll​(String processorName)
                       throws org.apache.axis2.AxisFault
        messageID Resend All messages
        Parameters:
        processorName -
        Throws:
        org.apache.axis2.AxisFault
      • getSize

        public int getSize​(String processorName)
                    throws org.apache.axis2.AxisFault
        Get the Number of Messages in the message store associated with the processor
        Parameters:
        processorName -
        Returns:
        Throws:
        org.apache.axis2.AxisFault
      • isActive

        public boolean isActive​(String processorName)
                         throws org.apache.axis2.AxisFault
        Get the Active Status of the message processor
        Parameters:
        processorName -
        Returns:
        Throws:
        org.apache.axis2.AxisFault
      • isTaskLocationKnown

        public boolean isTaskLocationKnown​(String processorName)
                                    throws org.apache.axis2.AxisFault
        Throws:
        org.apache.axis2.AxisFault
      • activate

        public void activate​(String processorName)
                      throws org.apache.axis2.AxisFault
        Throws:
        org.apache.axis2.AxisFault
      • deactivate

        public void deactivate​(String processorName)
                        throws org.apache.axis2.AxisFault
        Throws:
        org.apache.axis2.AxisFault
      • getClassName

        public String getClassName​(String name)
                            throws org.apache.axis2.AxisFault
        Get the implementation class name of the MessageProcessor
        Parameters:
        name - of the MessageProcessor
        Returns:
        implementation class name of the Message Processor
        Throws:
        org.apache.axis2.AxisFault
      • getDefinedEndpoints

        public String[] getDefinedEndpoints()
                                     throws org.apache.axis2.AxisFault
        Throws:
        org.apache.axis2.AxisFault
      • validateAxis2ClientRepo

        public boolean validateAxis2ClientRepo​(String input)
                                        throws org.apache.axis2.AxisFault
        Checks whether given Axis2ClientRepo is valid one or not
        Parameters:
        input - location of the Axis2 Client Repository
        Returns:
        true if the given axis client repository valid, false otherwise.
        Throws:
        org.apache.axis2.AxisFault - If an ERROR is encountered or given repository location is invalid.
      • browseMessage

        public String browseMessage​(String processorName)
                             throws org.apache.axis2.AxisFault
        Gets the message from the associated queue.
        Parameters:
        processorName - message processor name.
        Returns:
        message returns message received from the queue as a string.
        Throws:
        org.apache.axis2.AxisFault
      • popMessage

        public boolean popMessage​(String processorName)
                           throws org.apache.axis2.AxisFault
        Pops the message from the associated queue.
        Parameters:
        processorName - message processor name.
        Returns:
        true if ++ is successful, else false
        Throws:
        org.apache.axis2.AxisFault
      • popAndRedirectMessage

        public boolean popAndRedirectMessage​(String processorName,
                                             String storeName)
                                      throws org.apache.axis2.AxisFault
        Pops the message and redirects it to a specified queue.
        Parameters:
        processorName - message processor name.
        storeName - name of the store to redirect the message.
        Returns:
        true if ++ is successful, else false
        Throws:
        org.apache.axis2.AxisFault