3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.cdm
.api
.service
;
13 import java
.util
.UUID
;
15 import org
.joda
.time
.DateTime
;
17 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
18 import eu
.etaxonomy
.cdm
.model
.view
.AuditEvent
;
19 import eu
.etaxonomy
.cdm
.persistence
.dao
.common
.AuditEventSort
;
21 public interface IAuditEventService
{
24 * Returns a paged sublist of AuditEvent instances stored in the database.
25 * A maximum of 'limit' objects are returned, starting at object with index 'start'.
27 * @param limit the maximum number of entities returned (can be null to return all entities)
29 * @param sort Whether the list is sorted going forward in time (AuditEventSort.FORWARDS)
30 * or backwards (AuditEventSort.BACKWARDS)
31 * @return a Pager containing AuditEvent instances
33 public Pager
<AuditEvent
> list(Integer limit
, Integer start
, AuditEventSort sort
);
36 * Find the AuditEvent with an identifier equal to the parameter
39 * @return an AuditEvent, or null if there is no AuditEvent with that identifier
41 public AuditEvent
find(Integer Id
);
44 * Find the AuditEvent with a uuid (surrogate key) equal to the uuid supplied
47 * @return an AuditEvent, or null if there is no AuditEvent with a uuid which matches
49 public AuditEvent
find(UUID uuid
);
52 * Checks whether an AuditEvent with a matching uuid exists in the database
55 * @return true if an AuditEvent with a matching uuid exists in the database, false otherwise
57 public boolean exists(UUID uuid
);
60 * Returns the AuditEvent immediately proceeding the audit event passed as an argument
63 * @return the AuditEvent immediately proceeding, or null if the AuditEvent passed is
64 * the most recent event
66 public AuditEvent
getNextAuditEvent(AuditEvent auditEvent
);
69 * Returns the AuditEvent immediately preceding the audit event passed as an argument
72 * @return the AuditEvent immediately preceding, or null if the AuditEvent passed is
73 * the first event in the database
75 public AuditEvent
getPreviousAuditEvent(AuditEvent auditEvent
);
78 * Returns the AuditEvent that represents the given DateTime
80 * @return an AuditEvent object
82 public AuditEvent
find(DateTime dateTime
);