Class LastModificationState
- java.lang.Object
-
- ch.systemsx.cisd.openbis.generic.shared.basic.dto.LastModificationState
-
- All Implemented Interfaces:
java.io.Serializable
public class LastModificationState extends java.lang.Object implements java.io.Serializable
Stores information about the time andDatabaseModificationKind
of the last modification, separately for each kind of database object.A
DatabaseModificationKind
has two bits of information:- The kind of database object (e.g. Sample, Experiment etc. see
DatabaseModificationKind.ObjectKind
). - The kind of operation either update or creation/deletion (see
DatabaseModificationKind.OperationKind
).
LastModificationState
store for each combination of object kind and operation kind the time stamp of last invocation of a service method annotated with eitherDatabaseCreateOrDeleteModification
orDatabaseUpdateModification
.The method
getLastModificationTime(DatabaseModificationKind)
allows to retrieve this time stamp.The service method
ICommonServer.getLastModificationState(String)
provides an instance of this class with the latest time stamps. It can be used by a client to update views (see for example ch.systemsx .cisd.openbis.generic.client.web.client.application.framework.LastModificationStateUpdater).Note, that only the kind of object not the actual type or even instance is stored. That means for example that the creation of a new sample will lead to an update of any sample detailed view in the Web GUI.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LastModificationState()
Creates a state marking all
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getLastModificationTime(DatabaseModificationKind kind)
To avoid expensive computation of the last modification time at the beginning (which would require browsing the whole database) at the beginning we assume that it's equal to the initialization time of the whole state.void
registerModification(DatabaseModificationKind kind, long currentTimestamp)
java.lang.String
toString()
-
-
-
Method Detail
-
registerModification
public void registerModification(DatabaseModificationKind kind, long currentTimestamp)
-
getLastModificationTime
public long getLastModificationTime(DatabaseModificationKind kind)
To avoid expensive computation of the last modification time at the beginning (which would require browsing the whole database) at the beginning we assume that it's equal to the initialization time of the whole state. We can do this since all the future modifications will happen after this moment.- Returns:
- The last registered time of the specified kind of database modification.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-