Project

General

Profile

Download (2.79 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2009 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.persistence.view;
11

    
12
import java.time.ZonedDateTime;
13
import java.util.List;
14
import java.util.UUID;
15

    
16
import eu.etaxonomy.cdm.model.view.AuditEvent;
17
import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
18

    
19

    
20
public interface IAuditEventDao {
21

    
22
	/**
23
	 * Find the AuditEvent with an identifier equal to the parameter
24
	 *
25
	 * @param id
26
	 * @return an AuditEvent, or null if there is no AuditEvent with that identifier
27
	 */
28
    public AuditEvent findById(Integer id);
29

    
30
    /**
31
     * Find the AuditEvent with a uuid (surrogate key) equal to the uuid supplied
32
     *
33
     * @param uuid
34
     * @return an AuditEvent, or null if there is no AuditEvent with a uuid which matches
35
     */
36
    public AuditEvent findByUuid(UUID uuid);
37

    
38
    /**
39
     * Count the AuditEvents in this database
40
     *
41
     * @return the total number of AuditEvents in this database
42
     */
43
    public int count();
44

    
45
    /**
46
     * Returns a sublist of AuditEvent instances stored in the database.
47
	 * A maximum of 'limit' objects are returned, starting at object with index 'start'.
48
	 *
49
     * @param limit the maximum number of entities returned (can be null to return all entities)
50
     * @param start
51
     * @param sort Whether the list is sorted going forward in time (AuditEventSort.FORWARDS)
52
     * or backwards (AuditEventSort.BACKWARDS)
53
     * @return a List of AuditEvent instances
54
     */
55
    public List<AuditEvent> list(Integer limit, Integer start,AuditEventSort sort);
56

    
57
    /**
58
     * Returns the AuditEvent immediately proceeding the audit event passed as an argument
59
     *
60
     * @param auditEvent
61
     * @return the AuditEvent immediately proceeding, or null if the AuditEvent passed is
62
     * the most recent event
63
     */
64
    public AuditEvent getNextAuditEvent(AuditEvent auditEvent);
65

    
66
    /**
67
     * Returns the AuditEvent immediately preceding the audit event passed as an argument
68
     *
69
     * @param auditEvent
70
     * @return the AuditEvent immediately preceding, or null if the AuditEvent passed is
71
     * the first event in the database
72
     */
73
    public AuditEvent getPreviousAuditEvent(AuditEvent auditEvent);
74

    
75
    /**
76
     * Checks whether an AuditEvent with a matching uuid exists in the database
77
     *
78
     * @param uuid
79
     * @return true if an AuditEvent with a matching uuid exists in the database, false otherwise
80
     */
81
    public boolean exists(UUID uuid);
82

    
83
    /**
84
     * Returns the AuditEvent that represents the given DateTime
85
     * @param dateTime
86
     * @return an AuditEvent object
87
     */
88
	public AuditEvent findByDate(ZonedDateTime dateTime);
89
}
    (1-1/1)