public class ClusterConfig extends AbstractLockable<ClusterConfig>
OpenGridCluster
instance has been created.Modifier and Type | Field and Description |
---|---|
static DateFormatter |
DATE_CMD
Convert date string from the date command into Date objects.
|
private java.lang.String |
dateCommand |
private java.lang.String |
hostInfoCommand |
private java.lang.String |
jobAgentExternalId |
private java.lang.String |
jobFolder |
private java.util.List<NodeConfig> |
nodes |
private java.lang.String |
ogsInfoCommand |
private java.lang.String |
tmpFolder |
private java.lang.String |
tmpFolderDebug |
Constructor and Description |
---|
ClusterConfig() |
Modifier and Type | Method and Description |
---|---|
void |
addNode(NodeConfig node)
Add the name of a node in the cluster.
|
org.json.simple.JSONObject |
asJSONObject(JSONOptions options)
Get the configuration information as a JSON object.
|
protected void |
checkValid(boolean forLock)
Job folder and date command are required.
|
java.lang.String |
getDateCommand()
Get the command to execute for getting the current
date and time from the cluster.
|
java.lang.String |
getHostInfoCommand()
Get the command to execute for getting some information
about the hardware and operating system of the host.
|
java.lang.String |
getJobAgentExternalId()
Get the External ID of the job agent this cluster
should be linked to.
|
java.lang.String |
getJobFolder()
Get the path to the primary job folder on the
Open Grid cluster.
|
java.util.List<NodeConfig> |
getNodes()
Get all configured nodes.
|
java.lang.String |
getOpenGridInfoCommand()
Get the command to execute for getting some information
about the Open Grid Scheduler software version.
|
java.lang.String |
getTmpFolder(boolean debug)
Get the path to a temporary folder that a job can use
for storing temporary data.
|
void |
setDateCommand(java.lang.String dateCommand)
Set the command that should be executed to get the current
date and time from the cluster.
|
void |
setHostInfoCommand(java.lang.String hostInfoCommand)
Set the command that should be executed to get some information
about the hardware and operating system of the host.
|
void |
setJobAgentExternalId(java.lang.String jobAgentExternalId)
Set the External ID of the job agent this cluster
should be linked to.
|
void |
setJobFolder(java.lang.String jobFolder)
Set the path to the primary job folder on the
Open Grid cluster.
|
void |
setOpenGridInfoCommand(java.lang.String ogsInfoCommand)
Set the command that should be executed to get some information
about the Open Grid Scheduler software version.
|
void |
setTmpFolder(java.lang.String tmpFolder,
boolean debug)
Set the path to the temporary job folder on the
Open Grid cluster.
|
checkLocked, isLocked, isValid, lock
public static final DateFormatter DATE_CMD
private java.lang.String jobFolder
private java.lang.String tmpFolder
private java.lang.String tmpFolderDebug
private java.lang.String dateCommand
private java.lang.String hostInfoCommand
private java.lang.String ogsInfoCommand
private java.lang.String jobAgentExternalId
private java.util.List<NodeConfig> nodes
public java.lang.String getJobFolder()
public void setJobFolder(java.lang.String jobFolder)
java.lang.IllegalStateException
- If this instance has been lockedpublic java.lang.String getTmpFolder(boolean debug)
public void setTmpFolder(java.lang.String tmpFolder, boolean debug)
java.lang.IllegalStateException
- If this instance has been lockedpublic java.lang.String getDateCommand()
public void setDateCommand(java.lang.String dateCommand)
java.lang.IllegalStateException
- If this instance has been lockedpublic java.lang.String getHostInfoCommand()
public void setHostInfoCommand(java.lang.String hostInfoCommand)
java.lang.IllegalStateException
- If this instance has been lockedpublic java.lang.String getOpenGridInfoCommand()
public void setOpenGridInfoCommand(java.lang.String ogsInfoCommand)
java.lang.IllegalStateException
- If this instance has been lockedpublic java.lang.String getJobAgentExternalId()
public void setJobAgentExternalId(java.lang.String jobAgentExternalId)
java.lang.IllegalStateException
- If this instance has been lockedpublic void addNode(NodeConfig node)
public java.util.List<NodeConfig> getNodes()
protected void checkValid(boolean forLock)
checkValid
in class AbstractLockable<ClusterConfig>
forLock
- If TRUE, the instance will be locked after validationpublic org.json.simple.JSONObject asJSONObject(JSONOptions options)
JSONOption.NODE_INFO
is enabled:
- nodes: array with node names
(*) The 'jobAgent' is a sub-object that is only included
if the job agent external id has been set. If
JSONOption.JOBAGENT_INFO
is enabled additional
information is loaded from the database:
- jobAgent.id
- jobAgent.name
- jobAgent.isShared
- jobAgent.exception (only if there is some problem loading the information)