Package org.jboss.as.jdr.commands
Class CallAS7
- java.lang.Object
-
- org.jboss.as.jdr.commands.JdrCommand
-
- org.jboss.as.jdr.commands.CallAS7
-
public class CallAS7 extends JdrCommand
Command to call the AS 7 management system and store the output in a file.
This class' methods are meant to be chained together to describe a management call. For example:
new CallAS7("my_file").resource("foo", "bar").operation("read-resource")will return a configured CallAS7 instance that will, when executed call
read-resourceon the/foo=bar/resource, and store the output in a file calledmy_file.json.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()executes the commandJdrPluginimplementations do not need to call this method.CallAS7operation(String operation)sets the operation to callCallAS7param(String key, String val)adds a key/value parameter pair to the callCallAS7resource(String... parts)appends resource parts to the resource to call-
Methods inherited from class org.jboss.as.jdr.commands.JdrCommand
setEnvironment
-
-
-
-
Constructor Detail
-
CallAS7
public CallAS7(String name)
constructs an instance and sets the resulting file name- Parameters:
name- of the file to write results to
-
-
Method Detail
-
operation
public CallAS7 operation(String operation)
sets the operation to call- Parameters:
operation- to call, defaults toread-resource- Returns:
- this
-
param
public CallAS7 param(String key, String val)
adds a key/value parameter pair to the call- Parameters:
key-val-- Returns:
- this
-
resource
public CallAS7 resource(String... parts)
appends resource parts to the resource to call If you want to call /foo=bar/baz=boo/, do this:.resource("foo", "bar", "baz", "boo")- Parameters:
parts- to call- Returns:
- this
-
execute
public void execute() throws ExceptionDescription copied from class:JdrCommandexecutes the commandJdrPluginimplementations do not need to call this method.- Specified by:
executein classJdrCommand- Throws:
Exception
-
-