public class NodePoolNode extends Object
Constructor and Description |
---|
NodePoolNode(NodePool nodePool,
String id,
NodePoolJob npj)
Creates a new Zookeeper node for the node pool.
|
Modifier and Type | Method and Description |
---|---|
String |
getConnectionString()
Returns the connection string for the underlying NodePool object.
|
Long |
getHoldUntil()
Returns the hold until time (in milliseconds since epoch) for this Node.
|
String |
getHost()
Returns the host or interface IP for the node.
|
String |
getHostKey()
Returns the first host key.
|
List<String> |
getHostKeys()
Returns the host keys.
|
String |
getJenkinsLabel()
Get Jenkins's version of the node label
|
NodePoolJob |
getJob()
Get the NodePoolJob associated with this node
|
String |
getName()
Returns the name for this node.
|
List<String> |
getNPTypes()
Returns a list of NodePool type labels.
|
String |
getPath()
Returns the path for the underlying NodePool object.
|
Integer |
getPort()
Returns the connection port.
|
String |
getProvider()
Get the name of the provider that provisioned this node
|
String |
getZKID()
Returns the id for the underlying NodePool object.
|
void |
hold(String jobIdentifier)
Mark the node as being held.
|
void |
release()
Mark the node as being used and release it.
|
void |
removeHoldUntil()
Removes the node hold until time.
|
void |
setHoldUntil(Long holdUntilTimeEpochMillis)
Sets the node hold until time (ms since epoch).
|
void |
setInUse()
Sets the NodePool state to IN USE.
|
String |
toString()
Returns the string representation for this object.
|
public NodePoolNode(NodePool nodePool, String id, NodePoolJob npj) throws ZookeeperException
nodePool
- NodePoolid
- id of node as represented in ZooKeepernpj
- NodePoolJob object representing the build that this node was requested for.ZookeeperException
- on ZooKeeper errorpublic NodePoolJob getJob()
public List<String> getNPTypes()
public String getProvider()
public String getPath()
public String getZKID()
public String getConnectionString()
public String getJenkinsLabel()
public String getName()
public String getHost()
public Integer getPort()
public String getHostKey()
public String toString()
public void hold(String jobIdentifier) throws Exception
jobIdentifier
- identifier of build/job that this node was running.Exception
- on ZK errorpublic Long getHoldUntil()
public void setHoldUntil(Long holdUntilTimeEpochMillis)
holdUntilTimeEpochMillis
- the hold until time in milliseconds since epochpublic void removeHoldUntil()
public void setInUse() throws Exception
Exception
- if an error occurs while setting the stateCopyright © 2016–2018. All rights reserved.