com.dtolabs.rundeck.core.cli
Class NodeFilterOptions

java.lang.Object
  extended by com.dtolabs.rundeck.core.cli.NodeFilterOptions
All Implemented Interfaces:
CLIToolOptions

public class NodeFilterOptions
extends java.lang.Object
implements CLIToolOptions

NodeFilterOptions presents common Nodeset filter options for a CLI Tool.


Field Summary
static java.lang.String DONTKEEPGOING
           
static java.lang.String DONTKEEPGOING_LONG
           
static java.lang.String FAILEDNODES
           
static java.lang.String FAILEDNODES_LONG
           
static java.lang.String FILTER_EXCLUDE
           
static java.lang.String FILTER_EXCLUDE_LONG
           
static java.lang.String FILTER_INCLUDE
           
static java.lang.String FILTER_INCLUDE_LONG
           
static java.lang.String KEEPGOING
           
static java.lang.String KEEPGOING_LONG
           
static java.lang.String THREADCOUNT
           
static java.lang.String THREADCOUNT_LONG
           
 
Constructor Summary
NodeFilterOptions()
          Default constructor, does not configure failednodes file option
NodeFilterOptions(boolean includeFailednodes)
          Create options, specify whether failednodes file option is included
 
Method Summary
 void addOptions(org.apache.commons.cli.Options options)
           
 java.lang.String getArgExcludeNodes()
           
 java.lang.String getArgIncludeNodes()
           
 NodeSet getNodeSet()
          Create and return a NodeSet representing the input arguments, may be empty.
 boolean isKeepgoingSet()
          Return true if a keepgoing option (K or N) has been specified, false otherwise
 void parseArgs(org.apache.commons.cli.CommandLine cli, java.lang.String[] original)
           
protected  java.util.Map<java.lang.String,java.lang.String> parseExcludeArgs(java.lang.String[] keys, org.apache.commons.cli.CommandLine cli)
          Parse the value of the -X option
protected static java.util.Map<java.lang.String,java.lang.String> parseFilterArgs(java.lang.String[] keys, org.apache.commons.cli.CommandLine cli, java.lang.String opt)
           
protected  java.util.Map<java.lang.String,java.lang.String> parseIncludeArgs(java.lang.String[] keys, org.apache.commons.cli.CommandLine cli)
          Parse the value of the -X option.
protected static java.util.Map<java.lang.String,java.lang.String> parseMultiNodeArgs(java.lang.String[] keys, java.lang.String[] values)
          Parse the values as key=value pairs, using the set of allowed keys.
 void validate(org.apache.commons.cli.CommandLine cli, java.lang.String[] original)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILTER_INCLUDE

public static final java.lang.String FILTER_INCLUDE
See Also:
Constant Field Values

FILTER_EXCLUDE

public static final java.lang.String FILTER_EXCLUDE
See Also:
Constant Field Values

FILTER_INCLUDE_LONG

public static final java.lang.String FILTER_INCLUDE_LONG
See Also:
Constant Field Values

FILTER_EXCLUDE_LONG

public static final java.lang.String FILTER_EXCLUDE_LONG
See Also:
Constant Field Values

THREADCOUNT

public static final java.lang.String THREADCOUNT
See Also:
Constant Field Values

THREADCOUNT_LONG

public static final java.lang.String THREADCOUNT_LONG
See Also:
Constant Field Values

KEEPGOING

public static final java.lang.String KEEPGOING
See Also:
Constant Field Values

KEEPGOING_LONG

public static final java.lang.String KEEPGOING_LONG
See Also:
Constant Field Values

DONTKEEPGOING

public static final java.lang.String DONTKEEPGOING
See Also:
Constant Field Values

DONTKEEPGOING_LONG

public static final java.lang.String DONTKEEPGOING_LONG
See Also:
Constant Field Values

FAILEDNODES

public static final java.lang.String FAILEDNODES
See Also:
Constant Field Values

FAILEDNODES_LONG

public static final java.lang.String FAILEDNODES_LONG
See Also:
Constant Field Values
Constructor Detail

NodeFilterOptions

public NodeFilterOptions(boolean includeFailednodes)
Create options, specify whether failednodes file option is included

Parameters:
includeFailednodes - if true, include failednodes file option

NodeFilterOptions

public NodeFilterOptions()
Default constructor, does not configure failednodes file option

Method Detail

addOptions

public void addOptions(org.apache.commons.cli.Options options)
Specified by:
addOptions in interface CLIToolOptions

parseArgs

public void parseArgs(org.apache.commons.cli.CommandLine cli,
                      java.lang.String[] original)
Specified by:
parseArgs in interface CLIToolOptions

validate

public void validate(org.apache.commons.cli.CommandLine cli,
                     java.lang.String[] original)
              throws CLIToolOptionsException
Specified by:
validate in interface CLIToolOptions
Throws:
CLIToolOptionsException

parseExcludeArgs

protected java.util.Map<java.lang.String,java.lang.String> parseExcludeArgs(java.lang.String[] keys,
                                                                            org.apache.commons.cli.CommandLine cli)
Parse the value of the -X option

Parameters:
keys -
cli -
Returns:

parseIncludeArgs

protected java.util.Map<java.lang.String,java.lang.String> parseIncludeArgs(java.lang.String[] keys,
                                                                            org.apache.commons.cli.CommandLine cli)
Parse the value of the -X option.

Parameters:
keys -
cli -
Returns:

parseFilterArgs

protected static java.util.Map<java.lang.String,java.lang.String> parseFilterArgs(java.lang.String[] keys,
                                                                                  org.apache.commons.cli.CommandLine cli,
                                                                                  java.lang.String opt)

parseMultiNodeArgs

protected static java.util.Map<java.lang.String,java.lang.String> parseMultiNodeArgs(java.lang.String[] keys,
                                                                                     java.lang.String[] values)
Parse the values as key=value pairs, using the set of allowed keys. If there is only one entry in the values array without a key, then the first key of the allowed keys is used as the default

Parameters:
keys - allowed keys for the key=value strings, the first key is used as the default key
values - array of key=value strings, or merely 1 value string if the array is size 1
Returns:
map of the key to values

getNodeSet

public NodeSet getNodeSet()
Create and return a NodeSet representing the input arguments, may be empty.

Returns:
nodeset

isKeepgoingSet

public boolean isKeepgoingSet()
Return true if a keepgoing option (K or N) has been specified, false otherwise

Returns:
true if -K or -N option specified

getArgIncludeNodes

public java.lang.String getArgIncludeNodes()

getArgExcludeNodes

public java.lang.String getArgExcludeNodes()