|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlab.coda.afecs.platform.APlatformRegistrar
public class APlatformRegistrar
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 13, 2009
AClientInfo
database, as well as maintaining
sessions ASessionInfo
database including runnumbers for each session.
Information will be stored and retrieved
from the xml files.
(database option is not supported for this version).
Constructor Summary | |
---|---|
APlatformRegistrar()
Constructor |
Method Summary | |
---|---|
void |
addAgent(AComponent a)
Adds an agent to the agents hashmap |
void |
addClient(AClientInfo a)
Adds new agent to the hashmap |
int |
addConfigId(java.lang.String confName)
|
void |
addSession(ASessionInfo a)
Adds the new session to the sessions registration hashmap |
boolean |
dumpAgentsDatabase()
Dumps the content of the agents hash map to the disk in the form of xml file. |
boolean |
dumpClientDatabase()
Dumps the content of the hashmap of the registered agents to the disk as an xml file. |
boolean |
dumpRunTypeDatabase()
|
boolean |
dumpSessionsDatabase()
Dumps the content of the sessions hash map to the disk in the form of xml file. |
AComponent |
getAgent(java.lang.String n)
gets the specific agent information form the hashmap |
java.util.concurrent.ConcurrentHashMap<java.lang.String,AComponent> |
getAgentDir()
gets the hshmap of registered agents |
AClientInfo |
getClient(java.lang.String n)
Gets the specified client from the clients hashmap |
java.util.concurrent.ConcurrentHashMap<java.lang.String,AClientInfo> |
getClientDir()
Gets the hashmap of all regiostered physical clients |
int |
getConfigId(java.lang.String confName)
|
java.util.SortedSet<java.lang.String> |
getContainerAdmins()
Goes over the agents database and extracts the agent host names (where agents are physically running). |
int[] |
getRunNumbers(java.lang.String session)
|
ASessionInfo |
getSession(java.lang.String n)
Gets the specified session from the sessions hashmap |
java.util.concurrent.ConcurrentHashMap<java.lang.String,ASessionInfo> |
getSessionDir()
gets the stored hashmap of all registered sessions of the control |
java.util.ArrayList<java.lang.String> |
getSessionNames()
|
int |
getSessionRunNumber(java.lang.String s)
Returns the run number of the specified session |
int |
incrementDbRunnumber(java.lang.String session)
|
int |
incrementSessionRunNumber(java.lang.String s)
Retrives the run number for the specified session from the registered sessions hashmap, increments it and puts it back. |
boolean |
readClientDatabase()
Reads the AFECS_HOME/db/clientRegistration.xml file and fills the internal hashmap of the registered physical clients. |
boolean |
readRunTypeDatabase()
|
boolean |
readSessionDatabase()
Parses AFECS_HOME/db/conmtrolSessions.xml file and creats sessions registrastion internal hashmap. |
void |
removeAgent(java.lang.String n)
Removes agent from the agents hashmap |
void |
removeClient(java.lang.String a)
Removes agent from the hashmap |
void |
removeSession(java.lang.String a)
Removes the session from the registered sessions hashmap |
void |
setAgentDir(java.util.concurrent.ConcurrentHashMap<java.lang.String,AComponent> agentDir)
Sets entire agent registration map |
int |
setDBRunNumber(int rn,
java.lang.String session)
|
int |
setSessionRunNumber(java.lang.String s,
int r)
Set the run number for the specified session |
void |
updateSessionRunType(java.lang.String session,
java.lang.String runtype)
Update the config name for the session |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public APlatformRegistrar()
Method Detail |
---|
public java.util.concurrent.ConcurrentHashMap<java.lang.String,AClientInfo> getClientDir()
AClientInfo
object)public AClientInfo getClient(java.lang.String n)
n
- the name of the client
public void addClient(AClientInfo a)
a
- AClientInfo
objectpublic void removeClient(java.lang.String a)
a
- the name of the agentpublic boolean dumpClientDatabase()
public boolean readClientDatabase()
public java.util.concurrent.ConcurrentHashMap<java.lang.String,ASessionInfo> getSessionDir()
ASessionInfo
object)public ASessionInfo getSession(java.lang.String n)
n
- the name of the session
public void addSession(ASessionInfo a)
a
- ASessionInfo
objectpublic void removeSession(java.lang.String a)
a
- the name of the sessionpublic int setSessionRunNumber(java.lang.String s, int r)
s
- the name of the sessionr
- run number
public int incrementSessionRunNumber(java.lang.String s)
s
- the name of the session
public void updateSessionRunType(java.lang.String session, java.lang.String runtype)
session
- the name of the sessionruntype
- the name of the new configpublic int getSessionRunNumber(java.lang.String s)
s
- the name of the session
public boolean dumpSessionsDatabase()
public boolean readSessionDatabase()
public boolean dumpRunTypeDatabase()
public boolean readRunTypeDatabase()
public int getConfigId(java.lang.String confName)
public int addConfigId(java.lang.String confName)
public java.util.ArrayList<java.lang.String> getSessionNames()
public java.util.concurrent.ConcurrentHashMap<java.lang.String,AComponent> getAgentDir()
AComponent
objectspublic void setAgentDir(java.util.concurrent.ConcurrentHashMap<java.lang.String,AComponent> agentDir)
agentDir
- hashmap (key = name of the agent, value = AComponent
objects)public AComponent getAgent(java.lang.String n)
n
- the name of the agent
public void addAgent(AComponent a)
a
- AComponent
objectpublic void removeAgent(java.lang.String n)
n
- the name of the agentpublic boolean dumpAgentsDatabase()
public java.util.SortedSet<java.lang.String> getContainerAdmins()
public int setDBRunNumber(int rn, java.lang.String session)
public int incrementDbRunnumber(java.lang.String session)
public int[] getRunNumbers(java.lang.String session)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |