2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.api
.service
;
12 import java
.util
.UUID
;
14 import org
.joda
.time
.DateTime
;
16 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
17 import eu
.etaxonomy
.cdm
.model
.view
.AuditEvent
;
18 import eu
.etaxonomy
.cdm
.persistence
.dao
.common
.AuditEventSort
;
20 public interface IAuditEventService
{
23 * Returns a paged sublist of AuditEvent instances stored in the database.
24 * A maximum of 'limit' objects are returned, starting at object with index 'start'.
26 * @param limit the maximum number of entities returned (can be null to return all entities)
28 * @param sort Whether the list is sorted going forward in time (AuditEventSort.FORWARDS)
29 * or backwards (AuditEventSort.BACKWARDS)
30 * @return a Pager containing AuditEvent instances
32 public Pager
<AuditEvent
> list(Integer limit
, Integer start
, AuditEventSort sort
);
35 * Find the AuditEvent with an identifier equal to the parameter
38 * @return an AuditEvent, or null if there is no AuditEvent with that identifier
40 public AuditEvent
find(Integer Id
);
43 * Find the AuditEvent with a uuid (surrogate key) equal to the uuid supplied
46 * @return an AuditEvent, or null if there is no AuditEvent with a uuid which matches
48 public AuditEvent
find(UUID uuid
);
51 * Checks whether an AuditEvent with a matching uuid exists in the database
54 * @return true if an AuditEvent with a matching uuid exists in the database, false otherwise
56 public boolean exists(UUID uuid
);
59 * Returns the AuditEvent immediately proceeding the audit event passed as an argument
62 * @return the AuditEvent immediately proceeding, or null if the AuditEvent passed is
63 * the most recent event
65 public AuditEvent
getNextAuditEvent(AuditEvent auditEvent
);
68 * Returns the AuditEvent immediately preceding the audit event passed as an argument
71 * @return the AuditEvent immediately preceding, or null if the AuditEvent passed is
72 * the first event in the database
74 public AuditEvent
getPreviousAuditEvent(AuditEvent auditEvent
);
77 * Returns the AuditEvent that represents the given DateTime
79 * @return an AuditEvent object
81 public AuditEvent
find(DateTime dateTime
);