Package com.dtolabs.rundeck.core.common
Class NodeSupport
- java.lang.Object
-
- com.dtolabs.rundeck.core.common.NodeSupport
-
- All Implemented Interfaces:
IFrameworkNodes
public class NodeSupport extends java.lang.Object implements IFrameworkNodes
Created by greg on 2/20/15.
-
-
Constructor Summary
Constructors Constructor Description NodeSupport()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeEntryImpl
createFrameworkNode()
INodeSet
filterAuthorizedNodes(java.lang.String project, java.util.Set<java.lang.String> actions, INodeSet unfiltered, com.dtolabs.rundeck.core.authorization.AuthContext authContext)
java.lang.String
getFrameworkNodeHostname()
Gets the value of "framework.server.hostname" propertyjava.lang.String
getFrameworkNodeName()
Gets the value of "framework.server.name" propertyIPropertyLookup
getLookup()
java.util.HashMap<java.lang.String,java.lang.String>
getNodeAuthResource(INodeEntry iNodeEntry)
INodeDesc
getNodeDesc()
Gets theINodeDesc
value describing the framework nodestatic java.lang.String
getOsFamily()
boolean
isLocalNode(INodeDesc node)
Return true if the node is the local framework node.void
setLookup(IPropertyLookup lookup)
-
-
-
Method Detail
-
getFrameworkNodeHostname
public java.lang.String getFrameworkNodeHostname()
Gets the value of "framework.server.hostname" property- Specified by:
getFrameworkNodeHostname
in interfaceIFrameworkNodes
- Returns:
- Returns value of framework.server.hostname property
-
getFrameworkNodeName
public java.lang.String getFrameworkNodeName()
Gets the value of "framework.server.name" property- Specified by:
getFrameworkNodeName
in interfaceIFrameworkNodes
- Returns:
- Returns value of framework.server.name property
-
createFrameworkNode
public NodeEntryImpl createFrameworkNode()
- Specified by:
createFrameworkNode
in interfaceIFrameworkNodes
- Returns:
- Generate a node entry for the framework with default values
-
getOsFamily
public static java.lang.String getOsFamily()
-
filterAuthorizedNodes
public INodeSet filterAuthorizedNodes(java.lang.String project, java.util.Set<java.lang.String> actions, INodeSet unfiltered, com.dtolabs.rundeck.core.authorization.AuthContext authContext)
- Specified by:
filterAuthorizedNodes
in interfaceIFrameworkNodes
- Parameters:
project
- project nameactions
- action setunfiltered
- nodesauthContext
- authoriziation- Returns:
- the nodeset consisting only of the input nodes where the specified actions are all authorized
-
getNodeAuthResource
public java.util.HashMap<java.lang.String,java.lang.String> getNodeAuthResource(INodeEntry iNodeEntry)
-
getNodeDesc
public INodeDesc getNodeDesc()
Gets theINodeDesc
value describing the framework node- Specified by:
getNodeDesc
in interfaceIFrameworkNodes
- Returns:
- the singleton
INodeDesc
object for this framework instance
-
isLocalNode
public boolean isLocalNode(INodeDesc node)
Return true if the node is the local framework node. Compares the (logical) node names of the nodes after eliding any embedded 'user@' parts.- Specified by:
isLocalNode
in interfaceIFrameworkNodes
- Parameters:
node
- the node- Returns:
- true if the node's name is the same as the framework's node name
-
getLookup
public IPropertyLookup getLookup()
-
setLookup
public void setLookup(IPropertyLookup lookup)
-
-