1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.api.service;
|
11
|
|
12
|
import java.util.UUID;
|
13
|
|
14
|
import org.joda.time.DateTime;
|
15
|
|
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;
|
19
|
|
20
|
public interface IAuditEventService {
|
21
|
|
22
|
/**
|
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'.
|
25
|
*
|
26
|
* @param limit the maximum number of entities returned (can be null to return all entities)
|
27
|
* @param start
|
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
|
31
|
*/
|
32
|
public Pager<AuditEvent> list(Integer limit, Integer start, AuditEventSort sort);
|
33
|
|
34
|
/**
|
35
|
* Find the AuditEvent with an identifier equal to the parameter
|
36
|
*
|
37
|
* @param id
|
38
|
* @return an AuditEvent, or null if there is no AuditEvent with that identifier
|
39
|
*/
|
40
|
public AuditEvent find(Integer Id);
|
41
|
|
42
|
/**
|
43
|
* Find the AuditEvent with a uuid (surrogate key) equal to the uuid supplied
|
44
|
*
|
45
|
* @param uuid
|
46
|
* @return an AuditEvent, or null if there is no AuditEvent with a uuid which matches
|
47
|
*/
|
48
|
public AuditEvent find(UUID uuid);
|
49
|
|
50
|
/**
|
51
|
* Checks whether an AuditEvent with a matching uuid exists in the database
|
52
|
*
|
53
|
* @param uuid
|
54
|
* @return true if an AuditEvent with a matching uuid exists in the database, false otherwise
|
55
|
*/
|
56
|
public boolean exists(UUID uuid);
|
57
|
|
58
|
/**
|
59
|
* Returns the AuditEvent immediately proceeding the audit event passed as an argument
|
60
|
*
|
61
|
* @param auditEvent
|
62
|
* @return the AuditEvent immediately proceeding, or null if the AuditEvent passed is
|
63
|
* the most recent event
|
64
|
*/
|
65
|
public AuditEvent getNextAuditEvent(AuditEvent auditEvent);
|
66
|
|
67
|
/**
|
68
|
* Returns the AuditEvent immediately preceding the audit event passed as an argument
|
69
|
*
|
70
|
* @param auditEvent
|
71
|
* @return the AuditEvent immediately preceding, or null if the AuditEvent passed is
|
72
|
* the first event in the database
|
73
|
*/
|
74
|
public AuditEvent getPreviousAuditEvent(AuditEvent auditEvent);
|
75
|
|
76
|
/**
|
77
|
* Returns the AuditEvent that represents the given DateTime
|
78
|
* @param dateTime
|
79
|
* @return an AuditEvent object
|
80
|
*/
|
81
|
public AuditEvent find(DateTime dateTime);
|
82
|
}
|