Class Asadmin
java.lang.Object
org.glassfish.main.itest.tools.asadmin.Asadmin
Tool for executing asadmin/asadmin.bat commands. The tool is stateless.
- Author:
- David Matejcek
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecutes the command with arguments synchronously with given timeout in millis.Executes the command with arguments synchronously with 30000 ms timeout.execDetached(String... args) Executes the command with arguments asynchronously with 30000 ms timeout.<T> List<KeyAndValue<T>> <T> KeyAndValue<T> Removes all custom passwords.Adds environment property set for the asadmin execution.withPassword(String name, String secretValue) Adds a password to the password file.
-
Constructor Details
-
Asadmin
Creates a stateless instance of the tool.- Parameters:
asadmin- - executable fileadminUser- - username authorized to use the domainadminPasswordFile- - a file containing admin's password set asAS_ADMIN_PASSWORD=...
-
Asadmin
Creates a stateless instance of the tool.- Parameters:
asadmin- - executable fileadminUser- - username authorized to use the domainadminPasswordFile- - a file containing admin's password set asAS_ADMIN_PASSWORD=...terse- - to produce output, minimized and suitable for parsing.
-
-
Method Details
-
withEnv
Adds environment property set for the asadmin execution.- Parameters:
name-value-- Returns:
- this
-
withPassword
Adds a password to the password file.- Parameters:
name- Name in the password filesecretValue- Value in the password file- Returns:
- this
-
resetPasswords
Removes all custom passwords.- Returns:
- this
-
getCommandName
- Returns:
- asadmin command file name
-
getValue
-
get
-
execDetached
Executes the command with arguments asynchronously with 30000 ms timeout. The command can be attached by the attach command. You should find the job id in theAsadminResult.getStdOut()asJob ID: [0-9]+- Parameters:
args-- Returns:
AsadminResultnever null.
-
exec
Executes the command with arguments synchronously with 30000 ms timeout.- Parameters:
args-- Returns:
AsadminResultnever null.
-
exec
Executes the command with arguments synchronously with given timeout in millis.- Parameters:
timeout- timeout in millisargs- command and arguments.- Returns:
AsadminResultnever null.
-