001/*
002 * (C) Copyright 2006-2009 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 * $Id$
018 */
019package org.nuxeo.runtime.management.counters;
020
021/**
022 * Service interface to manage Counters. This services hides the Counters implementation so that Counters's updated
023 * don't have to be dependent on Simon
024 *
025 * @author Tiry (tdelprat@nuxeo.com)
026 */
027public interface CounterManager {
028
029    /**
030     * Increase a counter
031     *
032     * @param counterName
033     */
034    void increaseCounter(String counterName);
035
036    void increaseCounter(String counterName, long value);
037
038    /**
039     * Set the value of a counter
040     *
041     * @param counterName
042     * @param value
043     */
044    void setCounterValue(String counterName, long value);
045
046    /**
047     * Decrease a counter
048     *
049     * @param counterName
050     */
051    void decreaseCounter(String counterName);
052
053    void decreaseCounter(String counterName, long value);
054
055    /**
056     * Get recorder values of the counter over time
057     *
058     * @param counterName
059     * @return
060     */
061    CounterHistoryStack getCounterHistory(String counterName);
062
063    /**
064     * Enables all counters
065     */
066    void enableCounters();
067
068    /**
069     * Desable all couters
070     */
071    void disableCounters();
072
073}