View Javadoc

1   /*
2    * #%L
3    * bitrepository-access-client
4    * *
5    * $Id$
6    * $HeadURL$
7    * %%
8    * Copyright (C) 2010 - 2011 The State and University Library, The Royal Library and The State Archives, Denmark
9    * %%
10   * This program is free software: you can redistribute it and/or modify
11   * it under the terms of the GNU Lesser General Public License as 
12   * published by the Free Software Foundation, either version 2.1 of the 
13   * License, or (at your option) any later version.
14   * 
15   * This program is distributed in the hope that it will be useful,
16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18   * GNU General Lesser Public License for more details.
19   * 
20   * You should have received a copy of the GNU General Lesser Public 
21   * License along with this program.  If not, see
22   * <http://www.gnu.org/licenses/lgpl-2.1.html>.
23   * #L%
24   */
25  package org.bitrepository.alarm;
26  
27  import java.util.Collection;
28  import java.util.Date;
29  
30  import org.bitrepository.alarm.handling.AlarmHandler;
31  import org.bitrepository.bitrepositoryelements.Alarm;
32  import org.bitrepository.bitrepositoryelements.AlarmCode;
33  import org.bitrepository.service.LifeCycledService;
34  
35  /**
36   * The interface for an alarm service
37   */
38  public interface AlarmService extends LifeCycledService {
39      /**
40       * Adds a handler for a specific queue. 
41       * 
42       * @param handler The handler for the Alarm messages.
43       */
44      void addHandler(AlarmHandler handler);
45      
46      /**
47       * Extracts the alarms based on the given optional restictions.
48       * @param componentID [OPTIONAL] The id of the component.
49       * @param alarmCode [OPTIONAL] The alarm code.
50       * @param minDate [OPTIONAL] The earliest date for the alarms.
51       * @param maxDate [OPTIONAL] The latest date for the alarms.
52       * @param fileID [OPTIONAL] The id of the file, which the alarms are connected.
53       * @param collectionID [OPTIONAL] the collectionID, for which alarms are from
54       * @param maxResults [OPTIONAL] The maximum number of alarms to retrieve from the store.
55       * @param ascending Whether the alarms should be delivered ascending.
56       * @return The requested collection of alarms from the store.
57       */
58      Collection<Alarm> extractAlarms(String componentID, AlarmCode alarmCode, Date minDate, Date maxDate, 
59              String fileID, String collectionID, Integer maxResults, boolean ascending);
60      
61  }