## org.hornetq.api.core.management
Class ManagementHelper

    java.lang.Object
      org.hornetq.api.core.management.ManagementHelper

    public class ManagementHelper

extends Object

Helper class to use HornetQ Core messages to manage server resources.

Version:
  `$Revision$`
Author:
  Jeff Mesnil, Tim Fox

Field Summary
`static SimpleString` `HDR_ADDRESS`
`static SimpleString` `HDR_ATTRIBUTE`
`static SimpleString` `HDR_BINDING_ID`
`static SimpleString` `HDR_BINDING_TYPE`
`static SimpleString` `HDR_CHECK_TYPE`
`static SimpleString` `HDR_CLUSTER_NAME`
`static SimpleString` `HDR_CONSUMER_COUNT`
`static SimpleString` `HDR_DISTANCE`
`static SimpleString` `HDR_FILTERSTRING`
`static SimpleString` `HDR_NOTIFICATION_TIMESTAMP`
`static SimpleString` `HDR_NOTIFICATION_TYPE`
`static SimpleString` `HDR_OPERATION_NAME`
`static SimpleString` `HDR_OPERATION_SUCCEEDED`
`static SimpleString` `HDR_PROPOSAL_ALT_VALUE`
`static SimpleString` `HDR_PROPOSAL_GROUP_ID`
`static SimpleString` `HDR_PROPOSAL_VALUE`
`static SimpleString` `HDR_RESOURCE_NAME`
`static SimpleString` `HDR_ROUTING_NAME`
`static SimpleString` `HDR_USER`

Method Summary
`static Object[]` `fromCommaSeparatedArrayOfCommaSeparatedKeyValues(String str)` Used by HornetQ management service.
`static Map<String,Object>` `fromCommaSeparatedKeyValues(String str)` Used by HornetQ management service.
`static Object` `getResult(Message message)` Returns the result of an operation invocation or an attribute value.
`static Object[]` `getResults(Message 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(Message message, String resourceName, String attribute)` Stores a resource attribute in a message to retrieve the value from the server resource.
`static void` `putOperationInvocation(Message message, String resourceName, String operationName)` Stores a operation invocation in a message to invoke the corresponding operation the value from the server resource.
`static void` `putOperationInvocation(Message message, String resourceName, String operationName, Object... parameters)` Stores a operation invocation in a message to invoke the corresponding operation the value from the server resource.
`static Object[]` `retrieveOperationParameters(Message message)` Used by HornetQ management service.
`static void` `storeResult(Message message, Object result)` Used by HornetQ management service.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### HDR_RESOURCE_NAME

    public static final SimpleString HDR_RESOURCE_NAME

### HDR_ATTRIBUTE

    public static final SimpleString HDR_ATTRIBUTE

### HDR_OPERATION_NAME

    public static final SimpleString HDR_OPERATION_NAME

### HDR_OPERATION_SUCCEEDED

    public static final SimpleString HDR_OPERATION_SUCCEEDED

### HDR_NOTIFICATION_TYPE

    public static final SimpleString HDR_NOTIFICATION_TYPE

### HDR_NOTIFICATION_TIMESTAMP

    public static final SimpleString HDR_NOTIFICATION_TIMESTAMP

### HDR_ROUTING_NAME

    public static final SimpleString HDR_ROUTING_NAME

### HDR_CLUSTER_NAME

    public static final SimpleString HDR_CLUSTER_NAME

### HDR_ADDRESS

    public static final SimpleString HDR_ADDRESS

### HDR_BINDING_ID

    public static final SimpleString HDR_BINDING_ID

### HDR_BINDING_TYPE

    public static final SimpleString HDR_BINDING_TYPE

### HDR_FILTERSTRING

    public static final SimpleString HDR_FILTERSTRING

### HDR_DISTANCE

    public static final SimpleString HDR_DISTANCE

### HDR_CONSUMER_COUNT

    public static final SimpleString HDR_CONSUMER_COUNT

### HDR_USER

    public static final SimpleString HDR_USER

### HDR_CHECK_TYPE

    public static final SimpleString HDR_CHECK_TYPE

### HDR_PROPOSAL_GROUP_ID

    public static final SimpleString HDR_PROPOSAL_GROUP_ID

### HDR_PROPOSAL_VALUE

    public static final SimpleString HDR_PROPOSAL_VALUE

### HDR_PROPOSAL_ALT_VALUE

    public static final SimpleString HDR_PROPOSAL_ALT_VALUE

Method Detail

### putAttribute

    public static void putAttribute(Message message,
                                    String resourceName,
                                    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(Message message,
                                              String resourceName,
                                              String operationName)
                                       throws Exception

  Stores a 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:
    `Exception`
  See Also:
    `ResourceNames`

### putOperationInvocation

    public static void putOperationInvocation(Message message,
                                              String resourceName,
                                              String operationName,
                                              Object... parameters)
                                       throws Exception

  Stores a 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:
    `Exception`
  See Also:
    `ResourceNames`

### retrieveOperationParameters

    public static Object[] retrieveOperationParameters(Message message)
                                                throws Exception

  Used by HornetQ management service.

  Throws:
    `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(Message message,
                                   Object result)
                            throws Exception

  Used by HornetQ management service.

  Throws:
    `Exception`

### getResults

    public static Object[] getResults(Message message)
                               throws 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:
    `Exception`

### getResult

    public static Object getResult(Message message)
                            throws 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:
    `Exception`

### hasOperationSucceeded

    public static boolean hasOperationSucceeded(Message message)

  Returns whether the invocation of the management operation on the server resource succeeded.

### fromCommaSeparatedKeyValues

    public static Map<String,Object> fromCommaSeparatedKeyValues(String str)
                                                          throws Exception

  Used by HornetQ management service.

  Throws:
    `Exception`

### fromCommaSeparatedArrayOfCommaSeparatedKeyValues

    public static Object[] fromCommaSeparatedArrayOfCommaSeparatedKeyValues(String str)
                                                                     throws Exception

  Used by HornetQ management service.

  Throws:
    `Exception`

Copyright © 2009 Red Hat Inc. All Rights Reserved.