Project

General

Profile

Download (2.77 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
 * Copyright (C) 2007 EDIT
4
 * European Distributed Institute of Taxonomy 
5
 * http://www.e-taxonomy.eu
6
 * 
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.
9
 */
10

    
11
package eu.etaxonomy.cdm.api.service;
12

    
13
import java.util.UUID;
14

    
15
import org.joda.time.DateTime;
16

    
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;
20

    
21
public interface IAuditEventService {
22
	
23
	 /**
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'.
26
	 * 
27
     * @param limit the maximum number of entities returned (can be null to return all entities)
28
     * @param start
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
32
     */  
33
	public Pager<AuditEvent> list(Integer limit, Integer start, AuditEventSort sort);
34
	
35
	/**
36
	 * Find the AuditEvent with an identifier equal to the parameter
37
	 * 
38
	 * @param id
39
	 * @return an AuditEvent, or null if there is no AuditEvent with that identifier
40
	 */
41
    public AuditEvent find(Integer Id);
42
    
43
    /**
44
     * Find the AuditEvent with a uuid (surrogate key) equal to the uuid supplied
45
     * 
46
     * @param uuid
47
     * @return an AuditEvent, or null if there is no AuditEvent with a uuid which matches
48
     */
49
    public AuditEvent find(UUID uuid);
50
    
51
    /**
52
     * Checks whether an AuditEvent with a matching uuid exists in the database
53
     * 
54
     * @param uuid
55
     * @return true if an AuditEvent with a matching uuid exists in the database, false otherwise
56
     */
57
    public boolean exists(UUID uuid);
58
    
59
    /**
60
     * Returns the AuditEvent immediately proceeding the audit event passed as an argument
61
     * 
62
     * @param auditEvent
63
     * @return the AuditEvent immediately proceeding, or null if the AuditEvent passed is 
64
     * the most recent event
65
     */
66
    public AuditEvent getNextAuditEvent(AuditEvent auditEvent);
67
    
68
    /**
69
     * Returns the AuditEvent immediately preceding the audit event passed as an argument
70
     * 
71
     * @param auditEvent
72
     * @return the AuditEvent immediately preceding, or null if the AuditEvent passed is 
73
     * the first event in the database
74
     */
75
    public AuditEvent getPreviousAuditEvent(AuditEvent auditEvent);
76

    
77
    /**
78
     * Returns the AuditEvent that represents the given DateTime
79
     * @param dateTime
80
     * @return an AuditEvent object
81
     */
82
	public AuditEvent find(DateTime dateTime);
83
}
(29-29/97)