ConnectionManager.java 1.22 KB
Newer Older
Matt Tucker's avatar
Matt Tucker committed
1 2 3 4 5
/**
 * $RCSfile$
 * $Revision$
 * $Date$
 *
Matt Tucker's avatar
Matt Tucker committed
6
 * Copyright (C) 2004 Jive Software. All rights reserved.
Matt Tucker's avatar
Matt Tucker committed
7
 *
Matt Tucker's avatar
Matt Tucker committed
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
 */
Matt Tucker's avatar
Matt Tucker committed
11

Matt Tucker's avatar
Matt Tucker committed
12 13 14 15
package org.jivesoftware.messenger;

import java.net.Socket;
import java.util.Iterator;
Derek DeMoro's avatar
Derek DeMoro committed
16
import org.xmlpull.v1.XmlPullParserException;
Matt Tucker's avatar
Matt Tucker committed
17 18

/**
19
 * Coordinates connections (accept, read, termination) on the server.
Matt Tucker's avatar
Matt Tucker committed
20 21 22 23
 *
 * @author Iain Shigeoka
 */
public interface ConnectionManager {
24

Matt Tucker's avatar
Matt Tucker committed
25
    /**
26
     * Returns an array of the ports managed by this connection manager.
Matt Tucker's avatar
Matt Tucker committed
27
     *
28 29
     * @return an iterator of the ports managed by this connection manager
     *      (can be an empty but never null).
Matt Tucker's avatar
Matt Tucker committed
30
     */
31
    public Iterator<ServerPort> getPorts();
Matt Tucker's avatar
Matt Tucker committed
32 33

    /**
34
     * Adds a socket to be managed by the connection manager.
Matt Tucker's avatar
Matt Tucker committed
35
     *
36 37
     * @param socket the socket to add to this manager for management.
     * @param isSecure true if the connection is secure.
38 39
     * @param serverPort holds information about the port on which the server is listening for
     *        connections.
Matt Tucker's avatar
Matt Tucker committed
40
     */
41 42
    public void addSocket(Socket socket, boolean isSecure, ServerPort serverPort)
            throws XmlPullParserException;
Matt Tucker's avatar
Matt Tucker committed
43
}