View Javadoc

1   /*
2    * #%L
3    * Bitrepository Monitoring Service
4    * %%
5    * Copyright (C) 2010 - 2012 The State and University Library, The Royal Library and The State Archives, Denmark
6    * %%
7    * This program is free software: you can redistribute it and/or modify
8    * it under the terms of the GNU Lesser General Public License as 
9    * published by the Free Software Foundation, either version 2.1 of the 
10   * License, or (at your option) any later version.
11   * 
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Lesser Public License for more details.
16   * 
17   * You should have received a copy of the GNU General Lesser Public 
18   * License along with this program.  If not, see
19   * <http://www.gnu.org/licenses/lgpl-2.1.html>.
20   * #L%
21   */
22  package org.bitrepository.monitoringservice.status;
23  
24  import java.util.Map;
25  
26  import org.bitrepository.bitrepositoryelements.ResultingStatus;
27  
28  /**
29   * Interface for the storage of statuses.
30   */
31  public interface StatusStore {
32      /**
33       * Updates the status of a given component.
34       * @param componentID The id of the component to update.
35       * @param status The resulting status for the given component.
36       */
37      void updateStatus(String componentID, ResultingStatus status);
38      
39      /**
40       * Tells the store that new statuses have been requested from the components.
41       * This should increase the 'missingReplies' for each component, and whenever the component delivers its
42       * reply, then the 'missingReplies' are set to zero again.
43       */
44      void updateReplyCounts();
45      
46      /**
47       * @return The mapping between components and their status.
48       */
49      Map<String, ComponentStatus> getStatusMap();
50  }