com.trendmicro.grid.acl.client.util
Class CommandlineClientFactory

java.lang.Object
  extended by com.trendmicro.grid.acl.client.util.CommandlineClientFactory

public class CommandlineClientFactory
extends Object

Implements a factory that creates ServiceClient instances out of provided commandline parameters.

Version:
1.0
Author:
juergen_kellerer, 2011-01-24

Field Summary
static String CLI_KEY_ADDRESS
          Specifies the CLI parameter for the hostname and port of the ACL node.
static String CLI_KEY_PASSWORD
          Specifies the CLI parameter that allows to set the password.
static String CLI_KEY_SSL
          Specifies the CLI parameter that enables HTTPS.
static String CLI_KEY_USERNAME
          Specifies the CLI parameter that allows to set the username.
 
Constructor Summary
CommandlineClientFactory()
          Constructs a new instance.
CommandlineClientFactory(CommandlineParser parser)
          Constructs a new instance and configures the given default parser.
 
Method Summary
 ServiceClient newServiceClient()
          Creates a new connected instance of service client using the parameters of the default cli parser.
 ServiceClient newServiceClient(CommandlineParser cli)
          Creates a new connected instance of service client using the parameters of the given cli parser.
static CommandlineParser setUp(CommandlineParser parser)
          Configures the given commandline parser with the interface options supported by the newServiceClient method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLI_KEY_ADDRESS

public static final String CLI_KEY_ADDRESS
Specifies the CLI parameter for the hostname and port of the ACL node.

See Also:
Constant Field Values

CLI_KEY_SSL

public static final String CLI_KEY_SSL
Specifies the CLI parameter that enables HTTPS.

See Also:
Constant Field Values

CLI_KEY_USERNAME

public static final String CLI_KEY_USERNAME
Specifies the CLI parameter that allows to set the username.

See Also:
Constant Field Values

CLI_KEY_PASSWORD

public static final String CLI_KEY_PASSWORD
Specifies the CLI parameter that allows to set the password.

See Also:
Constant Field Values
Constructor Detail

CommandlineClientFactory

public CommandlineClientFactory()
Constructs a new instance.


CommandlineClientFactory

public CommandlineClientFactory(CommandlineParser parser)
Constructs a new instance and configures the given default parser.

Parameters:
parser - the parser to configure and set as default.
Method Detail

setUp

public static CommandlineParser setUp(CommandlineParser parser)
Configures the given commandline parser with the interface options supported by the newServiceClient method.

Parameters:
parser - the parser to configure.
Returns:
a configured parser.

newServiceClient

public ServiceClient newServiceClient(CommandlineParser cli)
Creates a new connected instance of service client using the parameters of the given cli parser.

Parameters:
cli - an instance of CommandlineParser whose parse method was previously called.
Returns:
a new connected instance of service client using the parameters of the given cli parser.

newServiceClient

public ServiceClient newServiceClient()
Creates a new connected instance of service client using the parameters of the default cli parser.

Returns:
a new connected instance of service client using the parameters of the default cli parser.