Package xal.service.pvlogger
Class MachineSnapshot
java.lang.Object
xal.service.pvlogger.MachineSnapshot
MachineSnapshot is a representation of the data for a snapshot of the machine
state at some point in time.
- Author:
- tap
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChannelSnapshot[]
protected String
protected long
protected static final DateFormat
protected Date
protected String
-
Constructor Summary
ConstructorsConstructorDescriptionMachineSnapshot
(int channelCount) Constructor of a MachineSnapshot with no data.MachineSnapshot
(long id, String type, Date timestamp, String comment, ChannelSnapshot[] channelSnapshots) Primary constructor.MachineSnapshot
(long id, Date timestamp, String comment, ChannelSnapshot[] channelSnapshots) Primary constructor.MachineSnapshot
(Date timestamp, String comment, ChannelSnapshot[] channelSnapshots) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
Get the number of channel snapshot placeholders.Get the channel snapshots.Get the comment.long
getId()
Get the unique identifier of this machine snapshot.Get the timestamp.getType()
Get the group id which identifies the type of machine snapshotvoid
setChannelSnapshot
(int index, ChannelSnapshot channelSnapshot) Set the channel snapshot for the specified index.void
setComment
(String comment) Set the comment.void
setId
(long id) Set the unique identifier of this machine snapshot.void
Set the group id identifying the type of snapshottoString()
Override toString() to get a textual description of the machine snapshot.
-
Field Details
-
TIME_FORMAT
-
id
protected long id -
timestamp
-
channelSnapshots
-
type
-
comment
-
-
Constructor Details
-
MachineSnapshot
public MachineSnapshot(long id, String type, Date timestamp, String comment, ChannelSnapshot[] channelSnapshots) Primary constructor.- Parameters:
id
- The unique identifier of this instance in the persistent storage.type
- Identifies the type of machine snapshottimestamp
- The timestamp when the snapshot was taken.comment
- A comment about this snapshot.channelSnapshots
- The channel snapshots associated with this machine snapshot.
-
MachineSnapshot
Primary constructor.- Parameters:
id
- The unique identifier of this instance in the persistent storage.timestamp
- The timestamp when the snapshot was taken.comment
- A comment about this snapshot.channelSnapshots
- The channel snapshots associated with this machine snapshot.
-
MachineSnapshot
Constructor.- Parameters:
timestamp
- The timestamp when the snapshot was taken.comment
- A comment about this snapshot.channelSnapshots
- The channel snapshots associated with this machine snapshot.
-
MachineSnapshot
public MachineSnapshot(int channelCount) Constructor of a MachineSnapshot with no data. Placeholders for channel snapshots are constructed.- Parameters:
channelCount
- The number of channel placeholders to make.
-
-
Method Details
-
setChannelSnapshot
Set the channel snapshot for the specified index.- Parameters:
index
- The index identifying the channel snapshot placeholderchannelSnapshot
- The channel snapshot to associate with this machine snapshot.
-
getChannelSnapshots
Get the channel snapshots.- Returns:
- The array of channel snapshots.
-
getChannelCount
public int getChannelCount()Get the number of channel snapshot placeholders.- Returns:
- the number of channel snapshot placeholders.
-
getId
public long getId()Get the unique identifier of this machine snapshot.- Returns:
- The unique identifier of this machine snapshot.
-
setId
public void setId(long id) Set the unique identifier of this machine snapshot.- Parameters:
id
- The unique identifier to use for this machine snapshot
-
getType
Get the group id which identifies the type of machine snapshot- Returns:
- the group id identifying the type of snapshot
-
setType
Set the group id identifying the type of snapshot- Parameters:
type
- type of snapshot
-
getComment
Get the comment.- Returns:
- the comment assigned to this machine snapshot.
-
setComment
Set the comment.- Parameters:
comment
- The comment to assign to this machine snapshot.
-
getTimestamp
Get the timestamp.- Returns:
- The time when this machine snapshot was taken.
-
toString
Override toString() to get a textual description of the machine snapshot.
-