|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dtolabs.rundeck.core.utils.NodeSet
public class NodeSet
NodeSet provides filtering logic for Node criteria
Nested Class Summary | |
---|---|
class |
NodeSet.Exclude
|
static class |
NodeSet.FILTER_ENUM
Enum of filters. |
class |
NodeSet.Include
|
class |
NodeSet.SetSelector
SetSelector is a filter |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_FILTER_KEY
|
static java.util.List<java.lang.String> |
FILTER_KEYS_LIST
names of the filter attributes used by exclude/include that are exposed to the CLI interface |
static java.util.Collection<java.lang.String> |
FILTER_KEYSET
Collection of names of attributes used by exclude/include that are exposed to the CLI interface |
static java.lang.String |
HOSTNAME
|
static java.lang.String |
NAME
|
static java.lang.String |
OS_ARCH
|
static java.lang.String |
OS_FAMILY
|
static java.lang.String |
OS_NAME
|
static java.lang.String |
OS_VERSION
|
static java.lang.String |
TAGS
|
static java.lang.String |
TYPE
|
Constructor Summary | |
---|---|
NodeSet()
default constructor |
|
NodeSet(INodeEntry singleNode)
Create a nodeset for a single node |
|
NodeSet(java.lang.String singleNodeName)
Create a nodeset with a single node name |
Method Summary | |
---|---|
boolean |
acceptNode(INodeEntry entry)
|
NodeSet.Exclude |
createExclude()
|
NodeSet.Exclude |
createExclude(java.util.Map excludeMap)
Creates an NodeSet.Exclude object populating its
properties from the keys of the map |
NodeSet.Include |
createInclude()
|
NodeSet.Include |
createInclude(java.util.Map includeMap)
Creates an NodeSet.Include object populating its
properties from the keys of the map |
boolean |
equals(java.lang.Object o)
|
static NodeSet |
fromFilter(java.lang.String filter)
Create a NodeSet from a filter |
static java.lang.String |
generateFilter(NodeSet set)
|
NodeSet.Exclude |
getExclude()
|
java.io.File |
getFailedNodesfile()
|
NodeSet.Include |
getInclude()
|
java.lang.String |
getSingleNodeName()
|
int |
getThreadCount()
|
int |
hashCode()
|
boolean |
isBlank()
Return true if the include/exclude filters are blank or non-existent |
boolean |
isKeepgoing()
|
protected static boolean |
matchesInput(java.util.Map<java.lang.String,java.lang.String> attrSelectors,
java.util.Map<java.lang.String,java.lang.String> values,
boolean matchAll)
Return true if any attribute selector matches the corresponding attribute value |
protected static boolean |
matchesInput(java.lang.String inputSelector,
java.lang.String propValue)
Return true if the input selector matches the specified property value |
static boolean |
matchRegexOrEquals(java.lang.String inputSelector,
java.lang.String item)
Tests whether the selector string matches the item, in three possible ways: first, if the selector looks like: "/.../" then it the outer '/' chars are removed and it is treated as a regular expression *only* and PatternSyntaxExceptions are not caught. |
NodesSelector |
nodeSelectorWithDefault(java.lang.String nodename)
Return a new Node Selector that will apply the include/exclude filters if they are set, otherwise it only includes the node with the given nodename |
NodesSelector |
nodeSelectorWithDefaultAll()
Return a new Node Selector that will apply the include/exclude filters if they are set, otherwise it will accept all nodes |
static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
parseFilter(java.lang.String filter)
Parse textual filter and return a map of maps: [include: [key:value,...], exclude: [key:value,...]] |
static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
parseFilter(java.lang.String filter,
boolean joinMulti,
java.lang.String defaultKey)
|
NodeSet.SetSelector |
populateSetSelector(java.util.Map map,
NodeSet.SetSelector setselector)
Creates an NodeSet.SetSelector object populating its
properties from the keys of the map |
void |
setFailedNodesfile(java.io.File failedNodesfile)
|
void |
setKeepgoing(boolean keepgoing)
|
void |
setSingleNodeName(java.lang.String singleNodeName)
|
void |
setThreadCount(int threadCount)
|
boolean |
shouldExclude(INodeEntry entry)
Return true if the node entry should be excluded based on the includes and excludes parameters. |
java.lang.String |
toString()
|
void |
validate()
Validate input. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HOSTNAME
public static final java.lang.String NAME
public static final java.lang.String TYPE
public static final java.lang.String TAGS
public static final java.lang.String OS_NAME
public static final java.lang.String OS_FAMILY
public static final java.lang.String OS_ARCH
public static final java.lang.String OS_VERSION
public static final java.lang.String DEFAULT_FILTER_KEY
public static final java.util.List<java.lang.String> FILTER_KEYS_LIST
public static final java.util.Collection<java.lang.String> FILTER_KEYSET
Constructor Detail |
---|
public NodeSet()
public NodeSet(java.lang.String singleNodeName)
public NodeSet(INodeEntry singleNode)
Method Detail |
---|
public java.lang.String getSingleNodeName()
public void setSingleNodeName(java.lang.String singleNodeName)
public boolean acceptNode(INodeEntry entry)
acceptNode
in interface NodesSelector
public NodesSelector nodeSelectorWithDefault(java.lang.String nodename)
public NodesSelector nodeSelectorWithDefaultAll()
public boolean isBlank()
public NodeSet.Include createInclude()
public NodeSet.Exclude createExclude()
public NodeSet.Include getInclude()
public NodeSet.Exclude getExclude()
public boolean shouldExclude(INodeEntry entry)
entry
- node descriptor entry
public int getThreadCount()
public void setThreadCount(int threadCount)
public boolean isKeepgoing()
public void setKeepgoing(boolean keepgoing)
public void validate()
protected static boolean matchesInput(java.lang.String inputSelector, java.lang.String propValue)
inputSelector
- propValue
-
protected static boolean matchesInput(java.util.Map<java.lang.String,java.lang.String> attrSelectors, java.util.Map<java.lang.String,java.lang.String> values, boolean matchAll)
matchAll
- if true, require all selectors match a value, otherwise return true if any selector matches
public static boolean matchRegexOrEquals(java.lang.String inputSelector, java.lang.String item)
inputSelector
- test string which may be a regular expression, or explicit regular expression string wrapped
in '/' charactersitem
- item to test
public static NodeSet fromFilter(java.lang.String filter)
filter
-
public static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> parseFilter(java.lang.String filter)
filter
-
public static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> parseFilter(java.lang.String filter, boolean joinMulti, java.lang.String defaultKey)
public static java.lang.String generateFilter(NodeSet set)
public NodeSet.Exclude createExclude(java.util.Map excludeMap)
NodeSet.Exclude
object populating its
properties from the keys of the map
excludeMap
- Map containing nodes.properties data
public NodeSet.Include createInclude(java.util.Map includeMap)
NodeSet.Include
object populating its
properties from the keys of the map
includeMap
- Map containing nodes.properties data
public NodeSet.SetSelector populateSetSelector(java.util.Map map, NodeSet.SetSelector setselector)
NodeSet.SetSelector
object populating its
properties from the keys of the map
map
- Map containing nodes.properties datasetselector
- include or exclude object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.io.File getFailedNodesfile()
public void setFailedNodesfile(java.io.File failedNodesfile)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |