public class JBossASClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ADD |
static String |
ADDRESS |
static String |
BATCH |
static String |
BATCH_STEPS |
static String |
FAILURE_DESCRIPTION |
protected org.apache.commons.logging.Log |
log |
static String |
NAME |
static String |
OPERATION |
static String |
OUTCOME |
static String |
OUTCOME_SUCCESS |
static String |
PERSISTENT |
static String |
READ_ATTRIBUTE |
static String |
READ_RESOURCE |
static String |
REMOVE |
static String |
RESULT |
static String |
SUBSYSTEM |
static String |
SYSTEM_PROPERTY |
static String |
VALUE |
static String |
WRITE_ATTRIBUTE |
| Constructor and Description |
|---|
JBossASClient(org.jboss.as.controller.client.ModelControllerClient client)
Constructs a new JBoss AS Client that talks to the model through the provided client.
|
| Modifier and Type | Method and Description |
|---|---|
static org.jboss.dmr.ModelNode |
createBatchRequest(org.jboss.dmr.ModelNode... steps)
Creates a batch of operations that can be atomically invoked.
|
static org.jboss.dmr.ModelNode |
createReadAttributeRequest(boolean runtime,
String attributeName,
Address address)
Convienence method that allows you to create request that reads a single attribute
value to a resource.
|
static org.jboss.dmr.ModelNode |
createReadAttributeRequest(String attributeName,
Address address)
Convienence method that allows you to create request that reads a single attribute
value to a resource.
|
static org.jboss.dmr.ModelNode |
createRequest(String operation,
Address address)
Convienence method that builds a partial operation request node.
|
static org.jboss.dmr.ModelNode |
createRequest(String operation,
Address address,
org.jboss.dmr.ModelNode extra)
Convienence method that builds a partial operation request node, with additional
node properties supplied by the given node.
|
static org.jboss.dmr.ModelNode |
createWriteAttributeRequest(String attributeName,
String attributeValue,
Address address)
Convienence method that allows you to create request that writes a single attribute's
string value to a resource.
|
org.jboss.dmr.ModelNode |
execute(org.jboss.dmr.ModelNode request)
Convienence method that executes the request.
|
org.jboss.dmr.ModelNode |
findNodeInList(Address addr,
String haystack,
String needle)
This tries to find specific node within a list of nodes.
|
static String |
getFailureDescription(org.jboss.dmr.ModelNode operationResult)
If the operation result was a failure, this returns the failure description if there is one.
|
org.jboss.as.controller.client.ModelControllerClient |
getModelControllerClient() |
static List<String> |
getResultListAsStrings(org.jboss.dmr.ModelNode operationResult)
If the given node has a result list, that list will be returned
with the values as Strings.
|
static org.jboss.dmr.ModelNode |
getResults(org.jboss.dmr.ModelNode operationResult)
If the given node has results, those results are returned in a ModelNode.
|
String |
getStringAttribute(boolean runtime,
String attributeName,
Address address)
Convienence method that allows you to obtain a single attribute's string value from
a resource.
|
String |
getStringAttribute(String attributeName,
Address address)
Convienence method that allows you to obtain a single attribute's string value from
a resource.
|
static boolean |
isSuccess(org.jboss.dmr.ModelNode operationResult)
Returns
true if the operation was a success; false otherwise. |
org.jboss.dmr.ModelNode |
readResource(Address addr)
This returns information on the resource at the given address.
|
org.jboss.dmr.ModelNode |
readResource(Address addr,
boolean recursive)
This returns information on the resource at the given address, recursively
returning child nodes with the result if recursive argument is set to
true. |
void |
remove(Address doomedAddr)
Removes the resource at the given address.
|
static org.jboss.dmr.ModelNode |
setPossibleExpression(org.jboss.dmr.ModelNode node,
String name,
String value)
This sets the given node's named attribute to the given value.
|
protected final org.apache.commons.logging.Log log
public static final String BATCH
public static final String BATCH_STEPS
public static final String OPERATION
public static final String ADDRESS
public static final String RESULT
public static final String OUTCOME
public static final String OUTCOME_SUCCESS
public static final String SUBSYSTEM
public static final String FAILURE_DESCRIPTION
public static final String NAME
public static final String VALUE
public static final String READ_ATTRIBUTE
public static final String READ_RESOURCE
public static final String WRITE_ATTRIBUTE
public static final String ADD
public static final String REMOVE
public static final String SYSTEM_PROPERTY
public static final String PERSISTENT
public JBossASClient(org.jboss.as.controller.client.ModelControllerClient client)
client - the client to usepublic static org.jboss.dmr.ModelNode createReadAttributeRequest(String attributeName, Address address)
attributeName - the name of the attribute whose value is to be readaddress - identifies the resourcepublic static org.jboss.dmr.ModelNode createReadAttributeRequest(boolean runtime,
String attributeName,
Address address)
runtime - if true, the attribute is a runtime attributeattributeName - the name of the attribute whose value is to be readaddress - identifies the resourcepublic static org.jboss.dmr.ModelNode createWriteAttributeRequest(String attributeName, String attributeValue, Address address)
attributeName - the name of the attribute whose value is to be writtenattributeValue - the attribute value that is to be writtenaddress - identifies the resourcepublic static org.jboss.dmr.ModelNode createRequest(String operation, Address address)
operation - the operation to be requestedaddress - identifies the target resourcepublic static org.jboss.dmr.ModelNode createRequest(String operation, Address address, org.jboss.dmr.ModelNode extra)
operation - the operation to be requestedaddress - identifies the target resourceextra - provides additional properties to add to the returned request node.public static org.jboss.dmr.ModelNode createBatchRequest(org.jboss.dmr.ModelNode... steps)
steps - the different operation steps of the batchpublic static List<String> getResultListAsStrings(org.jboss.dmr.ModelNode operationResult)
operationResult - the node to examinepublic static org.jboss.dmr.ModelNode getResults(org.jboss.dmr.ModelNode operationResult)
operationResult - the node to examinepublic static boolean isSuccess(org.jboss.dmr.ModelNode operationResult)
true if the operation was a success; false otherwise.operationResult - the operation result to testpublic static String getFailureDescription(org.jboss.dmr.ModelNode operationResult)
null is returned if the operation was a success.operationResult - the operation whose failure description is to be returnednull if the operation was a successpublic static org.jboss.dmr.ModelNode setPossibleExpression(org.jboss.dmr.ModelNode node,
String name,
String value)
node - the node whose attribute is to be setname - the name of the attribute whose value is to be setvalue - the value, possibly an expressionpublic org.jboss.as.controller.client.ModelControllerClient getModelControllerClient()
public org.jboss.dmr.ModelNode execute(org.jboss.dmr.ModelNode request)
throws Exception
request - Exceptionpublic org.jboss.dmr.ModelNode readResource(Address addr) throws Exception
addr - Exception - if some error prevented the lookup from even happeningpublic org.jboss.dmr.ModelNode readResource(Address addr, boolean recursive) throws Exception
true.
This will not return an exception if the address points to a non-existent resource, rather,
it will just return null. You can use this as a test for resource existence.addr - recursive - if true, return all child data within the resource nodeException - if some error prevented the lookup from even happeningpublic void remove(Address doomedAddr) throws Exception
doomedAddr - the address of the resource to removeExceptionpublic String getStringAttribute(String attributeName, Address address) throws Exception
attributeName - the attribute whose value is to be returnedaddress - identifies the resourceException - if failed to obtain the attribute valuepublic String getStringAttribute(boolean runtime, String attributeName, Address address) throws Exception
runtime - if true, the attribute to be retrieved is a runtime attributeattributeName - the attribute whose value is to be returnedaddress - identifies the resourceException - if failed to obtain the attribute valuepublic org.jboss.dmr.ModelNode findNodeInList(Address addr, String haystack, String needle) throws Exception
addr - haystack - needle - Exception - if the lookup fails for some reasonCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.