ConnectionManager.java 1.05 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 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
package org.jivesoftware.messenger;

import java.net.Socket;
import java.util.Iterator;
import javax.xml.stream.XMLStreamException;

/**
 * <p>Coordinates connections (accept, read, termination) on the server.</p>
 *
 * @author Iain Shigeoka
 */
public interface ConnectionManager {
    /**
     * <p>Obtain an array of the ports managed by this connection manager.</p>
     *
     * @return Iterator of the ports managed by this connection manager (can be an empty but never null)
     */
    public Iterator getPorts();

    /**
     * <p>Adds a socket to be managed by the connection manager.</p>
     *
     * @param sock     The socket to add to this manager for management
     * @param isSecure True if this is a secure connection
     */
    public void addSocket(Socket sock, boolean isSecure) throws XMLStreamException;
}