KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jaspersoft > jasperserver > api > engine > common > service > LoggingService


1 /*
2  * Copyright (C) 2006 JasperSoft http://www.jaspersoft.com
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed WITHOUT ANY WARRANTY; and without the
10  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
15  * or write to:
16  *
17  * Free Software Foundation, Inc.,
18  * 59 Temple Place - Suite 330,
19  * Boston, MA USA 02111-1307
20  */

21 package com.jaspersoft.jasperserver.api.engine.common.service;
22
23 import java.util.List JavaDoc;
24
25 import com.jaspersoft.jasperserver.api.common.domain.ExecutionContext;
26 import com.jaspersoft.jasperserver.api.common.domain.LogEvent;
27
28 /**
29  * @author Lucian Chirita (lucianc@users.sourceforge.net)
30  * @version $Id: LoggingService.java 3781 2006-06-21 16:30:51Z inedelcu $
31  */

32 public interface LoggingService {
33
34     LogEvent instantiateLogEvent();
35
36     void log(LogEvent event);
37
38     void update(LogEvent event);
39
40     List JavaDoc getUserEvents(ExecutionContext context);
41
42     List JavaDoc getUnreadEvents(ExecutionContext context);
43
44     public int getUserEventsCount(ExecutionContext context);
45
46     LogEvent getLogEvent(ExecutionContext context, long id);
47     
48     /**
49      * Get the maximum event age in days.
50      *
51      * @return the maximum event age in days
52      * @see #setMaximumAge(int)
53      */

54     int getMaximumAge();
55     
56     
57     /**
58      * Set the maximum event age in days.
59      * <p>
60      * The event is guaranteed to be kept in the log for at least this number of days.
61      * After this period the event will be eligible for {@link #purge() purge}.
62      *
63      * @param days the maximum event age in days
64      */

65     void setMaximumAge(int days);
66     
67     
68     /**
69      * Purges events that surpassed the {@link #getMaximumAge() maximum age}.
70      *
71      * @see #setMaximumAge(int)
72      */

73     void purge();
74
75     void delete(ExecutionContext context, long[] events);
76     
77 }
78
Popular Tags