/******************************************************************************* * Copyright 2014 Miami-Dade County * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package org.sharegov.cirm.stats; import java.util.List; /** * CirmClusterStatistics provides all data and history for each server and an aggregated cluster data history. * * @author Thomas Hilpold */ public interface ICirmClusterStatistics { /** * Constant to identify the cluster data by name (In contrast to the json configured server names). */ public static final String CLUSTER_NAME = "CirmCluster"; /** * Gets the most recent CirmStatistics holding combined cluster data from all servers. * @return */ CirmStatistics getLastClusterStatistics(); /** * Gets the number of servers this ICirmClusterStatistics is configured for. * @return */ int getNrOfServers(); /** * Gets the most recent CirmStatistics holding combined cluster data from all servers. * @return */ CirmStatistics getLastServerStatistics(int serverIndex); /** * Get's either the clusters or a servers full history by name. * @param serverOrClusterName * @return */ CirmServerStatistics getDataHistoryByName(String serverOrClusterName); /** * Gets the full history for the cluster, consisting of CirmStatistics at multiple times ordered. * @return */ CirmServerStatistics getClusterDataHistory(); /** * Gets the full history for one server, consisting of CirmStatistics at multiple times ordered. * @param serverIndex * @return */ CirmServerStatistics getServerDataHistory(int serverIndex); /** * Queries the full history of the cluster data for a key, returning an list of date/StatsValue pairs. * @param key * @return */ List<DateStatsValuePair> getClusterHistoryForKey(CirmStatistics.StatsKey key); /** * Queries the full history of one server's data for a key, returning an list of date/StatsValue pairs. * @param serverIndex * @param key * @return */ List<DateStatsValuePair> getServerHistoryForKey(int serverIndex, CirmStatistics.StatsKey key); /** * Updates all server data histories and the cluster history with the exact same timestamp. * This connects to each server as configured and retrieves data from each. */ void updateAll(); }