Class ManagementHelper


  • public final class ManagementHelper
    extends java.lang.Object
    Helper class to use ActiveMQ Artemis Core messages to manage server resources.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object getResult​(ICoreMessage message)
      Returns the result of an operation invocation or an attribute value.
      static java.lang.Object getResult​(ICoreMessage message, java.lang.Class desiredType)
      Returns the result of an operation invocation or an attribute value.
      static java.lang.Object[] getResults​(ICoreMessage message)
      Returns the result of an operation invocation or an attribute value.
      static boolean hasOperationSucceeded​(Message message)
      Returns whether the invocation of the management operation on the server resource succeeded.
      static boolean isAttributesResult​(Message message)
      Returns whether the JMS message corresponds to the result of a management attribute value.
      static boolean isOperationResult​(Message message)
      Returns whether the JMS message corresponds to the result of a management operation invocation.
      static void putAttribute​(ICoreMessage message, java.lang.String resourceName, java.lang.String attribute)
      Stores a resource attribute in a message to retrieve the value from the server resource.
      static void putOperationInvocation​(ICoreMessage message, java.lang.String resourceName, java.lang.String operationName)
      Stores an operation invocation in a message to invoke the corresponding operation the value from the server resource.
      static void putOperationInvocation​(ICoreMessage message, java.lang.String resourceName, java.lang.String operationName, java.lang.Object... parameters)
      Stores an operation invocation in a message to invoke the corresponding operation the value from the server resource.
      static java.lang.Object[] retrieveOperationParameters​(Message message)
      Used by ActiveMQ Artemis management service.
      static void storeResult​(org.apache.activemq.artemis.core.message.impl.CoreMessage message, java.lang.Object result)
      Used by ActiveMQ Artemis management service.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • HDR_RESOURCE_NAME

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_RESOURCE_NAME
      • HDR_ATTRIBUTE

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_ATTRIBUTE
      • HDR_OPERATION_NAME

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_OPERATION_NAME
      • HDR_OPERATION_SUCCEEDED

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_OPERATION_SUCCEEDED
      • HDR_NOTIFICATION_TYPE

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_NOTIFICATION_TYPE
      • HDR_NOTIFICATION_TIMESTAMP

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_NOTIFICATION_TIMESTAMP
      • HDR_ROUTING_NAME

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_ROUTING_NAME
      • HDR_CLUSTER_NAME

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_CLUSTER_NAME
      • HDR_ADDRESS

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_ADDRESS
      • HDR_ROUTING_TYPE

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_ROUTING_TYPE
      • HDR_BINDING_ID

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_BINDING_ID
      • HDR_BINDING_TYPE

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_BINDING_TYPE
      • HDR_FILTERSTRING

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_FILTERSTRING
      • HDR_DISTANCE

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_DISTANCE
      • HDR_CONSUMER_COUNT

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_CONSUMER_COUNT
      • HDR_USER

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_USER
      • HDR_VALIDATED_USER

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_VALIDATED_USER
      • HDR_CERT_SUBJECT_DN

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_CERT_SUBJECT_DN
      • HDR_CHECK_TYPE

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_CHECK_TYPE
      • HDR_SESSION_NAME

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_SESSION_NAME
      • HDR_REMOTE_ADDRESS

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_REMOTE_ADDRESS
      • HDR_PROPOSAL_GROUP_ID

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_PROPOSAL_GROUP_ID
      • HDR_PROPOSAL_VALUE

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_PROPOSAL_VALUE
      • HDR_PROPOSAL_ALT_VALUE

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_PROPOSAL_ALT_VALUE
      • HDR_CONSUMER_NAME

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_CONSUMER_NAME
      • HDR_CONNECTION_NAME

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_CONNECTION_NAME
      • HDR_MESSAGE_ID

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_MESSAGE_ID
      • HDR_PROTOCOL_NAME

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_PROTOCOL_NAME
      • HDR_CLIENT_ID

        public static final org.apache.activemq.artemis.api.core.SimpleString HDR_CLIENT_ID
    • Method Detail

      • putAttribute

        public static void putAttribute​(ICoreMessage message,
                                        java.lang.String resourceName,
                                        java.lang.String attribute)
        Stores a resource attribute in a message to retrieve the value from the server resource.
        Parameters:
        message - message
        resourceName - the name of the resource
        attribute - the name of the attribute
        See Also:
        ResourceNames
      • putOperationInvocation

        public static void putOperationInvocation​(ICoreMessage message,
                                                  java.lang.String resourceName,
                                                  java.lang.String operationName)
                                           throws java.lang.Exception
        Stores an operation invocation in a message to invoke the corresponding operation the value from the server resource.
        Parameters:
        message - message
        resourceName - the name of the resource
        operationName - the name of the operation to invoke on the resource
        Throws:
        java.lang.Exception
        See Also:
        ResourceNames
      • putOperationInvocation

        public static void putOperationInvocation​(ICoreMessage message,
                                                  java.lang.String resourceName,
                                                  java.lang.String operationName,
                                                  java.lang.Object... parameters)
                                           throws java.lang.Exception
        Stores an operation invocation in a message to invoke the corresponding operation the value from the server resource.
        Parameters:
        message - message
        resourceName - the name of the server resource
        operationName - the name of the operation to invoke on the server resource
        parameters - the parameters to use to invoke the server resource
        Throws:
        java.lang.Exception
        See Also:
        ResourceNames
      • retrieveOperationParameters

        public static java.lang.Object[] retrieveOperationParameters​(Message message)
                                                              throws java.lang.Exception
        Used by ActiveMQ Artemis management service.
        Throws:
        java.lang.Exception
      • isOperationResult

        public static boolean isOperationResult​(Message message)
        Returns whether the JMS message corresponds to the result of a management operation invocation.
      • isAttributesResult

        public static boolean isAttributesResult​(Message message)
        Returns whether the JMS message corresponds to the result of a management attribute value.
      • storeResult

        public static void storeResult​(org.apache.activemq.artemis.core.message.impl.CoreMessage message,
                                       java.lang.Object result)
                                throws java.lang.Exception
        Used by ActiveMQ Artemis management service.
        Throws:
        java.lang.Exception
      • getResults

        public static java.lang.Object[] getResults​(ICoreMessage message)
                                             throws java.lang.Exception
        Returns the result of an operation invocation or an attribute value.
        If an error occurred on the server, hasOperationSucceeded(Message) will return false. and the result will be a String corresponding to the server exception.
        Throws:
        java.lang.Exception
      • getResult

        public static java.lang.Object getResult​(ICoreMessage message)
                                          throws java.lang.Exception
        Returns the result of an operation invocation or an attribute value.
        If an error occurred on the server, hasOperationSucceeded(Message) will return false. and the result will be a String corresponding to the server exception.
        Throws:
        java.lang.Exception
      • getResult

        public static java.lang.Object getResult​(ICoreMessage message,
                                                 java.lang.Class desiredType)
                                          throws java.lang.Exception
        Returns the result of an operation invocation or an attribute value.
        If an error occurred on the server, hasOperationSucceeded(Message) will return false. and the result will be a String corresponding to the server exception.
        Throws:
        java.lang.Exception
      • hasOperationSucceeded

        public static boolean hasOperationSucceeded​(Message message)
        Returns whether the invocation of the management operation on the server resource succeeded.