org.jlab.coda.afecs.platform
Class AControlDesigner

java.lang.Object
  extended by org.jlab.coda.afecs.system.ABase
      extended by org.jlab.coda.afecs.platform.AControlDesigner

public class AControlDesigner
extends ABase

JSA: Thomas Jefferson National Accelerator Facility
This software was developed under a United States Government license,
described in the NOTICE file included as part of this distribution.
Copyright (c), Aug 18, 2009

Starts CParser object. Accepts messages to configure particular control system, described in the form of control oriented ontology langauge files. Sends message to the AContainer agents to start described agents. Agents will then register with the platform registrary system. Class that parsses COOL configuration files and designs control system or systems (system). This is a class that responds gui requests to send the list of configuration file names ($COOL_HOME/config/Control dir).


Field Summary
 
Fields inherited from class org.jlab.coda.afecs.system.ABase
myConfig, myCRCClientConnection, myName, myPlatformConnection, myRcDomainConnection
 
Constructor Summary
AControlDesigner()
          Constructor does cMsg connect
 
Method Summary
 void definePriority(AComponent c)
          Sets default priority for a component in case the deffinition in the cool is missing
 java.lang.String getAvailableContainerHostName()
          For all registered containers on the platform randomly selects one and returns the host name of that container.
 boolean parseControl(java.lang.String session, java.lang.String runtype)
          Parses COOL control description file
 boolean parseControl(java.lang.String session, java.lang.String runtype, java.lang.String agentName, java.lang.String containerHost)
          This method is called by the request of the supervisor that needed to restart an agent on some other container.
 
Methods inherited from class org.jlab.coda.afecs.system.ABase
B2O, codaInfoGetCodaClass, codaInfoGetObjectType, codaInfoGetState, codaInfoGetStatus, codaInfoSyncGetCodaClass, codaInfoSyncGetObjectType, codaInfoSyncGetStatus, connect, connect, connect, dalogMsg, dalogMsg, disconnect, getCurrentTime, getCurrentTime, getCurrentTimeInMs, getPlDescription, getPlEXPID, getPlMulticastUDL, getPlUDL, isConnected, isNumber, isRcClientConnected, msg2xml, msgForward, multicastConnect, multicastConnect, O2B, p2pSend, p2pSend, p2pSend, p2pSend, rcClientConnect, rcClientDisconnect, rcClientInfoSyncGetState, rcConnect, rcMonitor, rcp2pSend, rcp2pSend, rcSend, rcSend, rcSend, rcSend, rcSend, rcSend, rcSend, rcSend, readFileAsString, removeUnixShellProcess, reporAlarmMsg, reportAlarmMsg, reportAlarmMsg, runControlGetConfigId, runControlGetRunNumber, runControlGetRunType, runControlSetRunNumber, runControlSetRunType, runControlSyncGetRunNumber, runControlSyncGetRunType, runShellCommand, send, send, send, send, send, send, send, sessionControlConfigure, sessionControlExit, sessionControlGetSession, sessionControlSetInterval, sessionControlSetSession, sessionControlSetState, sessionControlStartReporting, sessionControlStopReporting, sessionControlSyncGetSession, sleep, updateHostUdl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AControlDesigner

public AControlDesigner()
Constructor does cMsg connect

Method Detail

parseControl

public boolean parseControl(java.lang.String session,
                            java.lang.String runtype)
Parses COOL control description file

Parameters:
session - in wich control runs
runtype - the name of the configuraion file
Returns:
parsing status

parseControl

public boolean parseControl(java.lang.String session,
                            java.lang.String runtype,
                            java.lang.String agentName,
                            java.lang.String containerHost)
This method is called by the request of the supervisor that needed to restart an agent on some other container. Parses COOL control description file, if control contains requested agent start that agent on the specified container.

Parameters:
session - in wich control runs
runtype - the name of the configuraion file
agentName - the name of the agent
containerHost - the name of the container
Returns:
parsing status

definePriority

public void definePriority(AComponent c)
Sets default priority for a component in case the deffinition in the cool is missing

Parameters:
c - AComponent object

getAvailableContainerHostName

public java.lang.String getAvailableContainerHostName()
For all registered containers on the platform randomly selects one and returns the host name of that container.

Returns:
cname container host name