View Javadoc

1   /* AlertManager.java
2    *
3    * Created Aug 4, 2005
4    *
5    * Copyright (C) 2005 Internet Archive.
6    *
7    * This file is part of the Heritrix web crawler (crawler.archive.org).
8    *
9    * 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  /***
31   * Manager for application alerts.
32   * An alert is a message to a human operator created by Heritrix when
33   * exceptional conditions.
34   * @author stack
35   * @version $Date: 2006-09-25 23:59:43 +0000 (Mon, 25 Sep 2006) $ $Revision: 4664 $
36   */
37  public interface AlertManager {
38      /***
39       * @param record The new alert to add.
40       */
41      public void add(final SinkHandlerLogRecord record);
42      
43      /***
44       * @param alertID the ID of the alert to remove.
45       */
46      public void remove(final String alertID);
47  
48      /***
49       * @param alertID The ID of the alert to return.
50       * @return an alert with the given ID or null if none found.
51       */
52      public SinkHandlerLogRecord get(final String alertID);
53  
54      /***
55       * @return All current alerts
56       */
57      public Vector getAll();
58  
59      /***
60       * @return Vector of all new alerts.
61       */
62      public Vector getNewAll();
63  
64      /***
65       * @return The number of alerts
66       */
67      public int getCount();
68  
69      /***
70       * @return The number of new alerts
71       */
72      public int getNewCount();
73      
74      /***
75       * @param alertID of the ID of the alert to mark as 'seen'.
76       */
77      public void read(final String alertID);
78  }