ConnectionManager.java 1.53 KB
Newer Older
Matt Tucker's avatar
Matt Tucker committed
1 2 3 4 5
/**
 * $RCSfile$
 * $Revision$
 * $Date$
 *
6
 * Copyright (C) 2004 Jive Software. All rights reserved.
Matt Tucker's avatar
Matt Tucker committed
7
 *
8 9
 * This software is published under the terms of the GNU Public License (GPL),
 * a copy of which is included in this distribution.
Matt Tucker's avatar
Matt Tucker committed
10
 */
11

Matt Tucker's avatar
Matt Tucker committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
package org.jivesoftware.net;

import java.util.Iterator;

import org.jivesoftware.util.BasicResultFilter;

/**
 * Manages and maintains server connections.<p>
 *
 * Beyond simple access to active connections on the server, the
 * connection manager can ensure connections are alive, and boot
 * connections that are idle according to an idle policy.
 *
 * @author Iain Shigeoka
 */
public interface ConnectionManager {

    int getConnectionCount();
    Iterator getConnections();
    Iterator getConnections(BasicResultFilter filter);
    void addConnection(Connection conn);
    void removeConnection(Connection conn);
    ConnectionMonitor getConnectedMonitor();

    /**
     * Connection configuration monitors records any changes in a connection's
     * configuration for administration and use in determining runtime behavior.<p>
     *
     * Samples are the number of connection changes and the rate is measured
     * in connections per second. Although some administration events may
     * change connection configurations, it is expected that the primary events
     * recorded are in protocol-level connection state changes such as the
     * establishment of TLS over a previously insecure connection via SASL.
     */
    ConnectionMonitor getConfigMonitor();

    ConnectionMonitor getDisconnectedMonitor();
}