public final class HistoryServer extends Shutdown
| Modifier and Type | Field and Description |
|---|---|
static String |
JSON_DELETED |
PRIORITY_EARLIER, PRIORITY_EARLIEST, PRIORITY_LATER, PRIORITY_LATEST, PRIORITY_NORMAL| Constructor and Description |
|---|
HistoryServer(DBServer server)
Creates a new HistoryServer object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
enqueueEntry(MetaObject mo,
User user,
Date timestamp)
Returns rather fast and only enqueues the entry instead of actually creating the history entry.
|
HistoryObject[] |
getHistory(int classId,
int objectId,
User usr,
int elements)
Returns the history of the given object of the given class.
|
boolean |
hasHistory(MetaObject mo)
Determines if there are any history entries for the given
MetaObject. |
void |
initHistory(MetaObject mo,
User usr,
Date timestamp)
Creates an initial entry for the given
MetaObject. |
addShutdown, addShutdown, createShutdown, internalShutdown, removeShutdownisDown, shutdownpublic static final String JSON_DELETED
public HistoryServer(DBServer server)
server - the DBServer that is responsible for delivering classes, connections and objectsIllegalArgumentException - if the given DBServer instance is nullpublic HistoryObject[] getHistory(int classId, int objectId, User usr, int elements) throws HistoryException
elementsThis operation initialises the history of the object if its class is history enabled and it is not initialised yet. Thus this operation never returns an empty list but always at least one object in case of a history enabled status.
classId - the id of the desired classobjectId - the id of the object of the desired classusr - the User that requests the historyelements - the number of historic elements to be retrieved or an int < 1 to retrieve all available
elementsnull if the class is not history enabledHistoryException - User is nullClassAttribute.HISTORY_ENABLED,
initHistory(Sirius.server.middleware.types.MetaObject, Sirius.server.newuser.User, java.util.Date)public boolean hasHistory(MetaObject mo) throws HistoryException
MetaObject. This operation does not care about
the ClassAttribute.HISTORY_ENABLED flag. It simply looks up whether there are entries in the database or
not.mo - the MetaObject to checkHistoryException - if the given MetaObject is null or any error occurs during database querypublic void initHistory(MetaObject mo, User usr, Date timestamp) throws HistoryException
MetaObject. Basically it does the same as the
enqueueEntry(Sirius.server.middleware.types.MetaObject, Sirius.server.newuser.User, java.util.Date)
operation except that it checks whether there is an entry already, actually runs the insertion if not and throws
an exception if an error occured.mo - the metaobject that shall be historicisedusr - the user that implicitely creates the history entrytimestamp - the timestamp when the entry is createdHistoryException - if the given MetaObject is null or the given Date is null or
an error occurred during history insertionenqueueEntry(Sirius.server.middleware.types.MetaObject, Sirius.server.newuser.User, java.util.Date)public void enqueueEntry(MetaObject mo, User user, Date timestamp)
MetaObject's MetaClass is not history enabled at all nothing will be done. If the "anonymous"
option is enabled the given user is ignored.mo - the metaobject that shall be historiciseduser - the user that implicitely creates the history entrytimestamp - the timestamp when the entry is createdClassAttribute.HISTORY_ENABLED,
ClassAttribute.HISTORY_OPTION_ANONYMOUSCopyright © 2012–2026 cismet GmbH. All rights reserved.