Class ManagementHelper
java.lang.Object
org.apache.activemq.artemis.api.core.management.ManagementHelper
Helper class to use ActiveMQ Artemis Core messages to manage server resources.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleStringstatic final SimpleString -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddoManagement(String uri, String user, String password, ManagementHelper.MessageAcceptor setup, ManagementHelper.MessageAcceptor ok, ManagementHelper.MessageAcceptor failed) static voiddoManagement(ClientSession session, ManagementHelper.MessageAcceptor setup, ManagementHelper.MessageAcceptor ok, ManagementHelper.MessageAcceptor failed) Utility function to reuse a ClientSessionConnection and perform a single management operation via core.static voiddoManagement(ServerLocator locator, String user, String password, ManagementHelper.MessageAcceptor setup, ManagementHelper.MessageAcceptor ok, ManagementHelper.MessageAcceptor failed) static ObjectgetResult(ICoreMessage message) Returns the result of an operation invocation or an attribute value; if an error occurred on the serverhasOperationSucceeded(Message)will returnfalseand the result will be aStringcorresponding to the server exception.static ObjectgetResult(ICoreMessage message, Class desiredType) Returns the result of an operation invocation or an attribute value; if an error occurred on the serverhasOperationSucceeded(Message)will returnfalseand the result will be aStringcorresponding to the server exception.static Object[]getResults(ICoreMessage message) Returns the result of an operation invocation or an attribute value; if an error occurred on the serverhasOperationSucceeded(Message)will returnfalseand the result will be aStringcorresponding to the server exception.static booleanhasOperationSucceeded(Message message) Returns whether the invocation of the management operation on the server resource succeeded.static booleanisAttributesResult(Message message) Returns whether the JMS message corresponds to the result of a management attribute value.static booleanisOperationResult(Message message) Returns whether the JMS message corresponds to the result of a management operation invocation.static voidputAttribute(ICoreMessage message, String resourceName, String attribute) Stores a resource attribute in a message to retrieve the value from the server resource.static voidputOperationInvocation(ICoreMessage message, String resourceName, String operationName) Stores an operation invocation in a message to invoke the corresponding operation the value from the server resource.static voidputOperationInvocation(ICoreMessage message, String resourceName, String operationName, Object... parameters) Stores an operation invocation in a message to invoke the corresponding operation the value from the server resource.static Object[]retrieveOperationParameters(Message message) Used by ActiveMQ Artemis management service.static voidstoreResult(org.apache.activemq.artemis.core.message.impl.CoreMessage message, Object result) Used by ActiveMQ Artemis management service.
-
Field Details
-
HDR_RESOURCE_NAME
-
HDR_ATTRIBUTE
-
HDR_OPERATION_NAME
-
HDR_OPERATION_SUCCEEDED
-
HDR_NOTIFICATION_TYPE
-
HDR_NOTIFICATION_TIMESTAMP
-
HDR_ROUTING_NAME
-
HDR_CLUSTER_NAME
-
HDR_ADDRESS
-
HDR_ROUTING_TYPE
-
HDR_BINDING_ID
-
HDR_BINDING_TYPE
-
HDR_FILTERSTRING
-
HDR_DISTANCE
-
HDR_CONSUMER_COUNT
-
HDR_USER
-
HDR_VALIDATED_USER
-
HDR_CERT_SUBJECT_DN
-
HDR_CHECK_TYPE
-
HDR_SESSION_NAME
-
HDR_REMOTE_ADDRESS
-
HDR_PROPOSAL_GROUP_ID
-
HDR_PROPOSAL_VALUE
-
HDR_PROPOSAL_ALT_VALUE
-
HDR_CONSUMER_NAME
-
HDR_CONNECTION_NAME
-
HDR_MESSAGE_ID
-
HDR_PROTOCOL_NAME
-
HDR_CLIENT_ID
-
-
Method Details
-
doManagement
public static void doManagement(String uri, String user, String password, ManagementHelper.MessageAcceptor setup, ManagementHelper.MessageAcceptor ok, ManagementHelper.MessageAcceptor failed) throws Exception - Throws:
Exception
-
doManagement
public static void doManagement(ServerLocator locator, String user, String password, ManagementHelper.MessageAcceptor setup, ManagementHelper.MessageAcceptor ok, ManagementHelper.MessageAcceptor failed) throws Exception - Throws:
Exception
-
doManagement
public static void doManagement(ClientSession session, ManagementHelper.MessageAcceptor setup, ManagementHelper.MessageAcceptor ok, ManagementHelper.MessageAcceptor failed) throws Exception Utility function to reuse a ClientSessionConnection and perform a single management operation via core.- Throws:
Exception
-
putAttribute
Stores a resource attribute in a message to retrieve the value from the server resource.- Parameters:
message- messageresourceName- the name of the resourceattribute- the name of the attribute- See Also:
-
putOperationInvocation
public static void putOperationInvocation(ICoreMessage message, String resourceName, String operationName) throws Exception Stores an operation invocation in a message to invoke the corresponding operation the value from the server resource.- Parameters:
message- messageresourceName- the name of the resourceoperationName- the name of the operation to invoke on the resource- Throws:
Exception- See Also:
-
putOperationInvocation
public static void putOperationInvocation(ICoreMessage message, String resourceName, String operationName, Object... parameters) throws Exception Stores an operation invocation in a message to invoke the corresponding operation the value from the server resource.- Parameters:
message- messageresourceName- the name of the server resourceoperationName- the name of the operation to invoke on the server resourceparameters- the parameters to use to invoke the server resource- Throws:
Exception- See Also:
-
retrieveOperationParameters
-
isOperationResult
Returns whether the JMS message corresponds to the result of a management operation invocation.- Returns:
- whether the JMS message corresponds to the result of a management operation invocation
-
isAttributesResult
Returns whether the JMS message corresponds to the result of a management attribute value.- Returns:
- whether the JMS message corresponds to the result of a management attribute value
-
storeResult
-
getResults
Returns the result of an operation invocation or an attribute value; if an error occurred on the serverhasOperationSucceeded(Message)will returnfalseand the result will be aStringcorresponding to the server exception.- Returns:
- the result of an operation invocation or an attribute value; if an error occurred on the server
hasOperationSucceeded(Message)will returnfalseand the result will be aStringcorresponding to the server exception - Throws:
Exception
-
getResult
Returns the result of an operation invocation or an attribute value; if an error occurred on the serverhasOperationSucceeded(Message)will returnfalseand the result will be aStringcorresponding to the server exception.- Returns:
- the result of an operation invocation or an attribute value; if an error occurred on the server
hasOperationSucceeded(Message)will returnfalseand the result will be aStringcorresponding to the server exception - Throws:
Exception
-
getResult
Returns the result of an operation invocation or an attribute value; if an error occurred on the serverhasOperationSucceeded(Message)will returnfalseand the result will be aStringcorresponding to the server exception.- Returns:
- the result of an operation invocation or an attribute value; if an error occurred on the server
hasOperationSucceeded(Message)will returnfalseand the result will be aStringcorresponding to the server exception - Throws:
Exception
-
hasOperationSucceeded
Returns whether the invocation of the management operation on the server resource succeeded.- Returns:
- whether the invocation of the management operation on the server resource succeeded
-