1 package eu
.etaxonomy
.cdm
.persistence
.dao
.common
;
5 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
6 import eu
.etaxonomy
.cdm
.model
.view
.AuditEventRecord
;
8 public interface IVersionableDao
<T
extends VersionableEntity
> extends ICdmEntityDao
<T
> {
11 * Returns a list of audit events (in order) which affected the state of an entity t.
12 * The events returned either start at the AuditEvent in context and go forward in time
13 * (AuditEventSort.FORWARDS) or backwards in time (AuditEventSort.BACKWARDS). If the
14 * AuditEventContext is set to null, or to AuditEvent.CURRENT_VIEW, then all relevant
15 * AuditEvents are returned.
17 * @param t The versionable entity which was affected by the audit events
18 * @param pageSize The maximum number of audit event records returned (can be null for all audit event records)
19 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
20 * @param sort should the list be sorted going forward in time (AuditEventSort.FORWARDS) or backwards (AuditEventSort.BACKWARDS)
21 * @return a list of AuditEventRecords, containing the AuditEvent, the state of the entity at that event, and the type of modification
23 public List
<AuditEventRecord
<T
>> getAuditEvents(T t
, Integer pageSize
, Integer pageNumber
, AuditEventSort sort
);
26 * Returns a count of audit events which affected the state of an entity t.
27 * The events either start at the AuditEvent in context and go forward in time
28 * (AuditEventSort.FORWARDS) or backwards in time (AuditEventSort.BACKWARDS). If the
29 * AuditEventContext is set to null, or to AuditEvent.CURRENT_VIEW, then all relevant
30 * AuditEvents are considered.
32 * @param t The versionable entity which was affected by the audit events
33 * @param sort should the events considered start now and go forward in time (AuditEventSort.FORWARDS) or backwards (AuditEventSort.BACKWARDS)
34 * @return a count of audit events
36 public Integer
countAuditEvents(T t
, AuditEventSort sort
);
39 * A convenience method which returns a record of the next (relative to the audit event in context)
40 * audit event to affect the entity t.
42 * @param t The versionable entity affected by these audit events
43 * @return a record of the next audit event to affect t, or null if the current event is the last to affect t
45 public AuditEventRecord
<T
> getNextAuditEvent(T t
);
48 * A convenience method which returns a record of the previous (relative to the audit event in context)
49 * audit event to affect the entity t.
51 * @param t The versionable entity affected by these audit events
52 * @return a record of the previous audit event to affect t, or null if the current event is the first to affect t
54 public AuditEventRecord
<T
> getPreviousAuditEvent(T t
);