01: /* AlertManager.java
02: *
03: * Created Aug 4, 2005
04: *
05: * Copyright (C) 2005 Internet Archive.
06: *
07: * This file is part of the Heritrix web crawler (crawler.archive.org).
08: *
09: * Heritrix is free software; you can redistribute it and/or modify
10: * it under the terms of the GNU Lesser Public License as published by
11: * the Free Software Foundation; either version 2.1 of the License, or
12: * any later version.
13: *
14: * Heritrix is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17: * GNU Lesser Public License for more details.
18: *
19: * You should have received a copy of the GNU Lesser Public License
20: * along with Heritrix; if not, write to the Free Software
21: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22: */
23: package org.archive.crawler.framework;
24:
25: import java.util.Vector;
26:
27: import org.archive.io.SinkHandlerLogRecord;
28:
29: /**
30: * Manager for application alerts.
31: * An alert is a message to a human operator created by Heritrix when
32: * exceptional conditions.
33: * @author stack
34: * @version $Date: 2006-09-25 23:59:43 +0000 (Mon, 25 Sep 2006) $ $Revision: 4664 $
35: */
36: public interface AlertManager {
37: /**
38: * @param record The new alert to add.
39: */
40: public void add(final SinkHandlerLogRecord record);
41:
42: /**
43: * @param alertID the ID of the alert to remove.
44: */
45: public void remove(final String alertID);
46:
47: /**
48: * @param alertID The ID of the alert to return.
49: * @return an alert with the given ID or null if none found.
50: */
51: public SinkHandlerLogRecord get(final String alertID);
52:
53: /**
54: * @return All current alerts
55: */
56: public Vector getAll();
57:
58: /**
59: * @return Vector of all new alerts.
60: */
61: public Vector getNewAll();
62:
63: /**
64: * @return The number of alerts
65: */
66: public int getCount();
67:
68: /**
69: * @return The number of new alerts
70: */
71: public int getNewCount();
72:
73: /**
74: * @param alertID of the ID of the alert to mark as 'seen'.
75: */
76: public void read(final String alertID);
77: }
|