Package xal.service.pvlogger
Class LoggerService
java.lang.Object
xal.service.pvlogger.LoggerService
- All Implemented Interfaces:
RemoteLogging
LoggerService is the implementation of LoggerPortal that responds to requests
from remote clients on behalf of the logger model.
- Author:
- tap
-
Field Summary
FieldsFields inherited from interface xal.service.pvlogger.RemoteLogging
CHANNEL_CONNECTED, CHANNEL_SIGNAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBegin broadcasting the serviceintgetChannelCount(String groupType) Get the number of channels we wish to log.getChannels(String groupType) Get the list of channel info tables.Get the list of group typesGet a heartbeat from the service.Get the name of the host where the application is running.getLastChannelEventTime(String groupType) Get the timestamp of the last channel event (e.g. channel connected/disconnected event)getLastLoggerEventTime(String groupType) Get the timestamp of the last logger eventgetLastPublishedSnapshotDump(String groupType) Get the textual dump of the last published snapshotGet the launch time of the service.doublegetLoggingPeriod(String groupType) Get the logging period.getTimestampOfLastPublishedSnapshot(String groupType) Get the timestamp of the last published snapshotbooleanhasLoggerSession(String groupID) Determine if a logger session exists for the specified groupbooleanDetermine if the logger is presently loggingvoidpublish snapshots in the snapshot bufferbooleanreloadLoggerSession(String groupType) reload the logger session identified by the group typevoidStop logging, reload groups from the database and resume logging.voidResume the logger logging.voidsetLoggingPeriod(String groupType, double period) Set the period between events where we take and store machine snapshots.voidshutdown(int code) Shutdown the process.voidStop the logger.inttakeAndPublishSnapshot(String groupID, String comment) Take a snapshot and publish it.
-
Field Details
-
IDENTITY
- See Also:
-
model
-
-
Constructor Details
-
LoggerService
LoggerService constructor
-
-
Method Details
-
broadcast
public void broadcast()Begin broadcasting the service -
setLoggingPeriod
Set the period between events where we take and store machine snapshots.- Specified by:
setLoggingPeriodin interfaceRemoteLogging- Parameters:
groupType- identifies the group by typeperiod- The period in seconds between events where we take and store machine snapshots.
-
getLoggingPeriod
Get the logging period.- Specified by:
getLoggingPeriodin interfaceRemoteLogging- Parameters:
groupType- identifies the group by type- Returns:
- The period in seconds between events where we take and store machine snapshots.
-
takeAndPublishSnapshot
Take a snapshot and publish it.- Specified by:
takeAndPublishSnapshotin interfaceRemoteLogging- Parameters:
groupID- ID of the group for which to take the snapshotcomment- snapshot comment- Returns:
- machine snapshot ID or an error code (less than 0) if the attempt fails
-
publishSnapshots
public void publishSnapshots()publish snapshots in the snapshot buffer- Specified by:
publishSnapshotsin interfaceRemoteLogging
-
hasLoggerSession
Determine if a logger session exists for the specified group- Specified by:
hasLoggerSessionin interfaceRemoteLogging- Parameters:
groupID- group ID of the logger session for which to look- Returns:
- true if a session exists for the group and false if not
-
isLogging
Determine if the logger is presently logging- Specified by:
isLoggingin interfaceRemoteLogging- Parameters:
groupType- identifies the group by type- Returns:
- true if the logger is logging and false if not
-
reloadLoggerSession
reload the logger session identified by the group type- Specified by:
reloadLoggerSessionin interfaceRemoteLogging
-
restartLogger
public void restartLogger()Stop logging, reload groups from the database and resume logging.- Specified by:
restartLoggerin interfaceRemoteLogging
-
resumeLogging
public void resumeLogging()Resume the logger logging.- Specified by:
resumeLoggingin interfaceRemoteLogging
-
stopLogging
public void stopLogging()Stop the logger.- Specified by:
stopLoggingin interfaceRemoteLogging
-
shutdown
public void shutdown(int code) Shutdown the process.- Specified by:
shutdownin interfaceRemoteLogging- Parameters:
code- The shutdown code which is normally just 0.
-
getHostName
Get the name of the host where the application is running.- Specified by:
getHostNamein interfaceRemoteLogging- Returns:
- The name of the host where the application is running.
-
getLaunchTime
Get the launch time of the service.- Specified by:
getLaunchTimein interfaceRemoteLogging- Returns:
- the launch time in seconds since the Java epoch of January 1, 1970.
-
getHeartbeat
Get a heartbeat from the service.- Specified by:
getHeartbeatin interfaceRemoteLogging- Returns:
- the time measured from the service at which the heartbeat was sent
-
getLastChannelEventTime
Get the timestamp of the last channel event (e.g. channel connected/disconnected event)- Specified by:
getLastChannelEventTimein interfaceRemoteLogging- Parameters:
groupType- identifies the group by type- Returns:
- the wall clock timestamp of the last channel event
-
getLastLoggerEventTime
Get the timestamp of the last logger event- Specified by:
getLastLoggerEventTimein interfaceRemoteLogging- Parameters:
groupType- identifies the group by type- Returns:
- the wall clock timestamp of the last logger event
-
getGroupTypes
Get the list of group types- Specified by:
getGroupTypesin interfaceRemoteLogging- Returns:
- a list of the group types
-
getChannelCount
Get the number of channels we wish to log.- Specified by:
getChannelCountin interfaceRemoteLogging- Parameters:
groupType- identifies the group by type- Returns:
- the number of channels we wish to log
-
getChannels
Get the list of channel info tables. Each channel info table contains the PV signal name and the channel connection status.- Specified by:
getChannelsin interfaceRemoteLogging- Parameters:
groupType- identifies the group by type- Returns:
- The list channel info tables corresponding to the channels we wish to log
-
getTimestampOfLastPublishedSnapshot
Get the timestamp of the last published snapshot- Specified by:
getTimestampOfLastPublishedSnapshotin interfaceRemoteLogging- Parameters:
groupType- identifies the group by type- Returns:
- the timestamp of the last published snapshot
-
getLastPublishedSnapshotDump
Get the textual dump of the last published snapshot- Specified by:
getLastPublishedSnapshotDumpin interfaceRemoteLogging- Parameters:
groupType- identifies the group by type- Returns:
- the textual dump of the last published snapshot or null if none exists
-