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 TypeMethodDescriptionvoid
Begin broadcasting the serviceint
getChannelCount
(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.double
getLoggingPeriod
(String groupType) Get the logging period.getTimestampOfLastPublishedSnapshot
(String groupType) Get the timestamp of the last published snapshotboolean
hasLoggerSession
(String groupID) Determine if a logger session exists for the specified groupboolean
Determine if the logger is presently loggingvoid
publish snapshots in the snapshot bufferboolean
reloadLoggerSession
(String groupType) reload the logger session identified by the group typevoid
Stop logging, reload groups from the database and resume logging.void
Resume the logger logging.void
setLoggingPeriod
(String groupType, double period) Set the period between events where we take and store machine snapshots.void
shutdown
(int code) Shutdown the process.void
Stop the logger.int
takeAndPublishSnapshot
(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:
setLoggingPeriod
in 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:
getLoggingPeriod
in 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:
takeAndPublishSnapshot
in 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:
publishSnapshots
in interfaceRemoteLogging
-
hasLoggerSession
Determine if a logger session exists for the specified group- Specified by:
hasLoggerSession
in 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:
isLogging
in 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:
reloadLoggerSession
in interfaceRemoteLogging
-
restartLogger
public void restartLogger()Stop logging, reload groups from the database and resume logging.- Specified by:
restartLogger
in interfaceRemoteLogging
-
resumeLogging
public void resumeLogging()Resume the logger logging.- Specified by:
resumeLogging
in interfaceRemoteLogging
-
stopLogging
public void stopLogging()Stop the logger.- Specified by:
stopLogging
in interfaceRemoteLogging
-
shutdown
public void shutdown(int code) Shutdown the process.- Specified by:
shutdown
in 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:
getHostName
in interfaceRemoteLogging
- Returns:
- The name of the host where the application is running.
-
getLaunchTime
Get the launch time of the service.- Specified by:
getLaunchTime
in interfaceRemoteLogging
- Returns:
- the launch time in seconds since the Java epoch of January 1, 1970.
-
getHeartbeat
Get a heartbeat from the service.- Specified by:
getHeartbeat
in 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:
getLastChannelEventTime
in 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:
getLastLoggerEventTime
in 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:
getGroupTypes
in interfaceRemoteLogging
- Returns:
- a list of the group types
-
getChannelCount
Get the number of channels we wish to log.- Specified by:
getChannelCount
in 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:
getChannels
in 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:
getTimestampOfLastPublishedSnapshot
in 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:
getLastPublishedSnapshotDump
in interfaceRemoteLogging
- Parameters:
groupType
- identifies the group by type- Returns:
- the textual dump of the last published snapshot or null if none exists
-