|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlab.coda.afecs.system.ABase
public class 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 13, 2009
Field Summary | |
---|---|
AConfig |
myConfig
|
org.jlab.coda.cMsg.cMsg |
myCRCClientConnection
|
java.lang.String |
myName
|
org.jlab.coda.cMsg.cMsg |
myPlatformConnection
|
org.jlab.coda.cMsg.cMsg |
myRcDomainConnection
|
Constructor Summary | |
---|---|
ABase()
Constructor gets the sigleton object of constants |
|
ABase(java.lang.String plUDL,
java.lang.String plMulticastUDL,
java.lang.String plDescription,
java.lang.String plEXPID)
Used by GUI's only |
Method Summary | |
---|---|
java.lang.Object |
B2O(byte[] bytes)
Converts byte array into an Object, that can be cast into preknown class object. |
void |
codaInfoGetCodaClass()
|
void |
codaInfoGetObjectType()
|
void |
codaInfoGetState()
|
void |
codaInfoGetStatus()
|
java.lang.String |
codaInfoSyncGetCodaClass(int to)
|
java.lang.String |
codaInfoSyncGetObjectType(int to)
|
java.lang.String |
codaInfoSyncGetStatus(int to)
|
org.jlab.coda.cMsg.cMsg |
connect()
Connects to the platform cMsg domain server |
org.jlab.coda.cMsg.cMsg |
connect(java.lang.String udl)
Connects to the platform cMsg domain server |
org.jlab.coda.cMsg.cMsg |
connect(java.lang.String udl,
java.lang.String name,
java.lang.String description)
Connects to the platform cMsg domain server |
boolean |
dalogMsg(AComponent c,
int severityId,
java.lang.String severity,
java.lang.String text)
Sends daLogMsg subject = component name and type = rc/report/dalog |
boolean |
dalogMsg(java.lang.String name,
int severityId,
java.lang.String severity,
java.lang.String text)
Sends daLogMsg subject = component name and type = rc/report/dalog |
boolean |
disconnect()
Disconnects from the platform |
java.lang.String |
getCurrentTime()
Gets the current time and returns string representation of it. |
java.lang.String |
getCurrentTime(java.lang.String format)
Gets the current time and returns string representation of it. |
long |
getCurrentTimeInMs()
Current time in milisecods. |
java.lang.String |
getPlDescription()
|
java.lang.String |
getPlEXPID()
|
java.lang.String |
getPlMulticastUDL()
|
java.lang.String |
getPlUDL()
|
boolean |
isConnected()
See if the agent is connected to the platform through cMsg native connection |
int |
isNumber(java.lang.String s)
|
boolean |
isRcClientConnected()
See if component is connected to the client through rcDomain connection |
java.lang.String |
msg2xml(org.jlab.coda.cMsg.cMsgMessage m)
converts cMSgMessage into a xml string |
boolean |
msgForward(org.jlab.coda.cMsg.cMsgMessage msg)
|
org.jlab.coda.cMsg.cMsg |
multicastConnect()
Connects to the platform cMsg domain server through multicast |
org.jlab.coda.cMsg.cMsg |
multicastConnect(java.lang.String udl)
Connects to the platform cMsg domain server through multicast |
byte[] |
O2B(java.lang.Object object)
Converts object into a byte array |
org.jlab.coda.cMsg.cMsgMessage |
p2pSend(java.lang.String subjectS,
java.lang.String typeS,
java.lang.Object obj,
int timeout)
cMsg sendAndGet with an object |
org.jlab.coda.cMsg.cMsgMessage |
p2pSend(java.lang.String subjectS,
java.lang.String typeS,
java.lang.String textS,
java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis,
int timeout)
cMsg sendAndGet with a text and payload |
org.jlab.coda.cMsg.cMsgMessage |
p2pSend(java.lang.String subjectS,
java.lang.String typeS,
java.lang.String textS,
int timeout)
cMsg sendAndGet sends a simple sumbeject with a text |
org.jlab.coda.cMsg.cMsgMessage |
p2pSend(java.lang.String subjectS,
java.lang.String typeS,
java.lang.String textS,
java.lang.Object obj,
int timeout)
cMsg sendAndGet with a text and an object |
boolean |
rcClientConnect(java.lang.String udl)
|
boolean |
rcClientDisconnect()
Disconnects from the rcDomain |
java.lang.String |
rcClientInfoSyncGetState(int to)
|
org.jlab.coda.cMsg.cMsg |
rcConnect()
Connects to the platform rc domain multicast server. |
org.jlab.coda.cMsg.cMsgMessage |
rcMonitor()
Monitors platform rc domain multicast server. |
org.jlab.coda.cMsg.cMsgMessage |
rcp2pSend(java.lang.String subjectS,
java.lang.String typeS,
java.lang.String textS,
java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis,
int timeout)
Implementation of cMsg sendAndGet for RC domain connections. |
org.jlab.coda.cMsg.cMsgMessage |
rcp2pSend(java.lang.String subjectS,
java.lang.String typeS,
java.lang.String textS,
int timeout)
Implementation of cMsg sendAndGet for RC domain connections. |
boolean |
rcSend(java.lang.String subject,
java.lang.String type,
java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
Sends rcDomain cMsg Message including payload items, described |
boolean |
rcSend(java.lang.String subject,
java.lang.String type,
java.lang.Object obj)
Sends rcDomain cMsg Message |
boolean |
rcSend(java.lang.String subject,
java.lang.String type,
java.lang.Object obj,
java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
Sends rcDomain cMsg Message |
boolean |
rcSend(java.lang.String subject,
java.lang.String type,
java.lang.String text)
Sends rcDomain cMsg Message (usually to the physical client) |
boolean |
rcSend(java.lang.String subject,
java.lang.String type,
java.lang.String text,
java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
Sends rcDomain cMsg Message |
boolean |
rcSend(java.lang.String subject,
java.lang.String type,
java.lang.String text,
int usrint)
Sends rcDomain cMsg Message (usually to the physical client) |
boolean |
rcSend(java.lang.String subject,
java.lang.String type,
java.lang.String text,
java.lang.Object obj)
Sends rcDomain cMsg Message |
boolean |
rcSend(java.lang.String subject,
java.lang.String type,
java.lang.String text,
java.lang.Object obj,
java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
Sends rcDomain cMsg Message |
java.lang.String |
readFileAsString(java.lang.String filePath)
|
void |
removeUnixShellProcess(java.lang.String name)
This method is for unix os only. |
boolean |
reporAlarmMsg(java.lang.String s,
AComponent c,
int severityId,
java.lang.String severity,
java.lang.String text)
Sends alarm message to a perdefined type AConstants.AgentReportAlarm |
boolean |
reportAlarmMsg(java.lang.String s,
AComponent c)
Sends alarm message to a predefined type AConstants.AgentReportAlarm |
boolean |
reportAlarmMsg(java.lang.String s,
java.lang.String name,
int severityId,
java.lang.String severity,
java.lang.String text)
Sends alarm message to a perdefined type AConstants.AgentReportAlarm |
void |
runControlGetConfigId()
|
void |
runControlGetRunNumber()
|
void |
runControlGetRunType()
|
void |
runControlSetRunNumber(int i)
|
void |
runControlSetRunType(java.lang.String s)
|
int |
runControlSyncGetRunNumber(int to)
|
java.lang.String |
runControlSyncGetRunType(int to)
|
ShellProcess |
runShellCommand(java.lang.String command)
Runs a shell command |
boolean |
send(java.lang.String subject,
java.lang.String type,
java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
Sends cMsg Message |
boolean |
send(java.lang.String subject,
java.lang.String type,
java.lang.Object obj)
Sends cMsg Message |
boolean |
send(java.lang.String subject,
java.lang.String type,
java.lang.Object obj,
java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
Sends cMsg Message |
boolean |
send(java.lang.String subject,
java.lang.String type,
java.lang.String text)
Sends cMsg Message |
boolean |
send(java.lang.String subject,
java.lang.String type,
java.lang.String text,
java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
Sends cMsg Message |
boolean |
send(java.lang.String subject,
java.lang.String type,
java.lang.String text,
java.lang.Object obj)
Sends cMsg Message |
boolean |
send(java.lang.String subject,
java.lang.String type,
java.lang.String text,
java.lang.Object obj,
java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
Sends cMsg Message |
void |
sessionControlConfigure(java.lang.String s)
|
void |
sessionControlExit()
|
void |
sessionControlGetSession()
|
void |
sessionControlSetInterval(java.lang.String s)
|
void |
sessionControlSetSession(java.lang.String s)
|
void |
sessionControlSetState(java.lang.String s)
|
void |
sessionControlStartReporting()
|
void |
sessionControlStopReporting()
|
java.lang.String |
sessionControlSyncGetSession(int to)
|
void |
sleep(int msec)
Convenient method to force main thread to sleep. |
java.lang.String |
updateHostUdl(java.lang.String host,
int port)
used by GUIs, after finding the platform host, to connect to the platform cMsg server |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public org.jlab.coda.cMsg.cMsg myPlatformConnection
public org.jlab.coda.cMsg.cMsg myRcDomainConnection
public org.jlab.coda.cMsg.cMsg myCRCClientConnection
public java.lang.String myName
public AConfig myConfig
Constructor Detail |
---|
public ABase()
public ABase(java.lang.String plUDL, java.lang.String plMulticastUDL, java.lang.String plDescription, java.lang.String plEXPID)
plUDL
- plMulticastUDL
- plDescription
- plEXPID
- Method Detail |
---|
public java.lang.String updateHostUdl(java.lang.String host, int port)
host
- platform host
public java.lang.String getPlUDL()
public java.lang.String getPlMulticastUDL()
public java.lang.String getPlDescription()
public java.lang.String getPlEXPID()
public org.jlab.coda.cMsg.cMsg rcConnect()
public org.jlab.coda.cMsg.cMsgMessage rcMonitor()
public org.jlab.coda.cMsg.cMsg connect()
public org.jlab.coda.cMsg.cMsg connect(java.lang.String udl)
udl
- address of the connection
public org.jlab.coda.cMsg.cMsg multicastConnect()
public org.jlab.coda.cMsg.cMsg multicastConnect(java.lang.String udl)
udl
- multicast udl address of the connection
public org.jlab.coda.cMsg.cMsg connect(java.lang.String udl, java.lang.String name, java.lang.String description)
udl
- udl of the connectionname
- name of the requester to connectdescription
- of the connection
public boolean disconnect()
public boolean rcClientDisconnect()
public boolean rcClientConnect(java.lang.String udl)
public boolean isRcClientConnected()
public boolean isConnected()
public boolean msgForward(org.jlab.coda.cMsg.cMsgMessage msg)
public boolean send(java.lang.String subject, java.lang.String type, java.lang.String text)
subject
- of the messagetype
- of the messagetext
- of the message
public boolean send(java.lang.String subject, java.lang.String type, java.lang.Object obj)
subject
- of the messagetype
- of the messageobj
- that is going to be serialized and sent as a byte array
public boolean send(java.lang.String subject, java.lang.String type, java.lang.String text, java.lang.Object obj)
subject
- of the messagetype
- of the messagetext
- of the messageobj
- that is going to be serialized and sent as a byte array
public boolean send(java.lang.String subject, java.lang.String type, java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
subject
- of the messagetype
- of the messagepis
- of payload items of the message of the message
public boolean send(java.lang.String subject, java.lang.String type, java.lang.String text, java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
subject
- of the messagetype
- of the messagetext
- of the messagepis
- of payload items of the message of the message
public boolean send(java.lang.String subject, java.lang.String type, java.lang.Object obj, java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
subject
- of the messagetype
- of the messageobj
- that is going to be serialized and sent as a byte arraypis
- of payload items of the message of the message
public boolean send(java.lang.String subject, java.lang.String type, java.lang.String text, java.lang.Object obj, java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
subject
- of the messagetype
- of the messagetext
- of the messageobj
- that is going to be serialized and sent as a byte arraypis
- of payload items of the message of the message
public org.jlab.coda.cMsg.cMsgMessage p2pSend(java.lang.String subjectS, java.lang.String typeS, java.lang.String textS, int timeout)
subjectS
- subjecttypeS
- typetextS
- texttimeout
- timeout
cMsgMessage
objectpublic org.jlab.coda.cMsg.cMsgMessage p2pSend(java.lang.String subjectS, java.lang.String typeS, java.lang.String textS, java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis, int timeout)
subjectS
- subjecttypeS
- typetextS
- textpis
- of payload items of the message of the messagetimeout
- timeout
cMsgMessage
objectpublic org.jlab.coda.cMsg.cMsgMessage p2pSend(java.lang.String subjectS, java.lang.String typeS, java.lang.Object obj, int timeout)
subjectS
- subjecttypeS
- typeobj
- object sent through binary payload (byteArray)timeout
- timeout
cMsgMessage
objectpublic org.jlab.coda.cMsg.cMsgMessage p2pSend(java.lang.String subjectS, java.lang.String typeS, java.lang.String textS, java.lang.Object obj, int timeout)
subjectS
- subjecttypeS
- typetextS
- textobj
- object sent through binary payload (byteArray)timeout
- timeout
cMsgMessage
objectpublic boolean rcSend(java.lang.String subject, java.lang.String type, java.lang.String text)
subject
- of the messagetype
- of the messagetext
- of the message
public boolean rcSend(java.lang.String subject, java.lang.String type, java.lang.String text, int usrint)
subject
- of the messagetype
- of the messagetext
- of the messageusrint
- of the message
public boolean rcSend(java.lang.String subject, java.lang.String type, java.lang.Object obj)
subject
- of the messagetype
- of the messageobj
- that is going to be serialized and sent as a byte array
public boolean rcSend(java.lang.String subject, java.lang.String type, java.lang.String text, java.lang.Object obj)
subject
- of the messagetype
- of the messagetext
- of the messageobj
- that is going to be serialized and sent as a byte array
public boolean rcSend(java.lang.String subject, java.lang.String type, java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
subject
- of the messagetype
- of the messagepis
- ArrayListg of payload items of the message
public boolean rcSend(java.lang.String subject, java.lang.String type, java.lang.String text, java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
subject
- of the messagetype
- of the messagetext
- of the messagepis
- ArrayListg of payload items of the message
public boolean rcSend(java.lang.String subject, java.lang.String type, java.lang.Object obj, java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
subject
- of the messagetype
- of the messageobj
- that is going to be serialized and sent as a byte arraypis
- ArrayListg of payload items of the message
public boolean rcSend(java.lang.String subject, java.lang.String type, java.lang.String text, java.lang.Object obj, java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis)
subject
- of the messagetype
- of the messagetext
- of the messageobj
- that is going to be serialized and sent as a byte arraypis
- ArrayListg of payload items of the message
public org.jlab.coda.cMsg.cMsgMessage rcp2pSend(java.lang.String subjectS, java.lang.String typeS, java.lang.String textS, int timeout)
ABase.ACallback
or timeout is reached. Then it will force cMsg unsubscribe.
subjectS
- subject to send the messagetypeS
- type to send the messagetextS
- text of the send messagetimeout
- in seconds
public org.jlab.coda.cMsg.cMsgMessage rcp2pSend(java.lang.String subjectS, java.lang.String typeS, java.lang.String textS, java.util.ArrayList<org.jlab.coda.cMsg.cMsgPayloadItem> pis, int timeout)
ABase.ACallback
or timeout is reached. Then it will force cMsg unsubscribe.
subjectS
- subject to send the messagetypeS
- type to send the messagetextS
- text of the send messagepis
- ArrayListg of payload items of the messagetimeout
- in seconds
public boolean dalogMsg(AComponent c, int severityId, java.lang.String severity, java.lang.String text)
c
- AComponent
object referenceseverityId
- severity idseverity
- severity string ( ERROR, WARNING, etc.)text
- of the dalog message
public boolean dalogMsg(java.lang.String name, int severityId, java.lang.String severity, java.lang.String text)
name
- of the initiaterseverityId
- severity idseverity
- severity string ( ERROR, WARNING, etc.)text
- of the dalog message
public boolean reportAlarmMsg(java.lang.String s, AComponent c)
AConstants.AgentReportAlarm
s
- the subject of the dalog messagec
- AComponent
object reference
public boolean reporAlarmMsg(java.lang.String s, AComponent c, int severityId, java.lang.String severity, java.lang.String text)
AConstants.AgentReportAlarm
s
- the subject of the dalog messagec
- AComponent
object referenceseverityId
- severity idseverity
- severity string ( ERROR, WARNING, etc.)text
- of the alarm message
public boolean reportAlarmMsg(java.lang.String s, java.lang.String name, int severityId, java.lang.String severity, java.lang.String text)
AConstants.AgentReportAlarm
s
- the subject of the alarm message, usually receivername
- of the component sending the dalog messageseverityId
- severity idseverity
- severity string ( ERROR, WARNING, etc.)text
- of the alarm message
public byte[] O2B(java.lang.Object object) throws java.io.IOException
object
- to be converted. Probably it must be serializable
java.io.IOException
- in case there is an io problem.public java.lang.Object B2O(byte[] bytes) throws java.io.IOException, java.lang.ClassNotFoundException
bytes
- byte array
java.io.IOException
- case will return null
java.lang.ClassNotFoundException
- case will return nullpublic java.lang.String msg2xml(org.jlab.coda.cMsg.cMsgMessage m)
m
- cMsgMessage object
public void sleep(int msec)
msec
- sleep parameter is in msecods.public int isNumber(java.lang.String s)
public ShellProcess runShellCommand(java.lang.String command)
command
- string
ShellProcess
objectpublic void removeUnixShellProcess(java.lang.String name)
name
- of the processpublic java.lang.String getCurrentTime()
AConfig
class
public java.lang.String getCurrentTime(java.lang.String format)
format
- format string
AConfig
class
public long getCurrentTimeInMs()
public java.lang.String readFileAsString(java.lang.String filePath) throws java.io.IOException
java.io.IOException
public void codaInfoGetObjectType()
public java.lang.String codaInfoSyncGetObjectType(int to)
public void codaInfoGetState()
public java.lang.String rcClientInfoSyncGetState(int to)
public void codaInfoGetStatus()
public java.lang.String codaInfoSyncGetStatus(int to)
public void codaInfoGetCodaClass()
public java.lang.String codaInfoSyncGetCodaClass(int to)
public void sessionControlStartReporting()
public void sessionControlStopReporting()
public void sessionControlExit()
public void sessionControlSetState(java.lang.String s)
public void sessionControlSetSession(java.lang.String s)
public void sessionControlGetSession()
public java.lang.String sessionControlSyncGetSession(int to)
public void sessionControlSetInterval(java.lang.String s)
public void sessionControlConfigure(java.lang.String s)
public void runControlSetRunNumber(int i)
public void runControlSetRunType(java.lang.String s)
public void runControlGetRunNumber()
public int runControlSyncGetRunNumber(int to)
public void runControlGetRunType()
public java.lang.String runControlSyncGetRunType(int to)
public void runControlGetConfigId()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |