001: /*
002: * Copyright 1999,2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.apache.catalina.net;
018:
019: import java.io.IOException;
020: import java.net.InetAddress;
021: import java.net.ServerSocket;
022: import java.security.KeyStoreException;
023: import java.security.NoSuchAlgorithmException;
024: import java.security.cert.CertificateException;
025: import java.security.UnrecoverableKeyException;
026: import java.security.KeyManagementException;
027:
028: /**
029: * Interface that describes the common characteristics of factory classes
030: * that create server sockets which may be required by a Connector. A concrete
031: * implementation of this interface will be assigned to a Connector
032: * via the <code>setFactory()</code> method.
033: *
034: * @author db@eng.sun.com
035: * @author Harish Prabandham
036: * @author Craig R. McClanahan
037: */
038: public interface ServerSocketFactory {
039:
040: // --------------------------------------------------------- Public Methods
041:
042: /**
043: * Returns a server socket which uses all network interfaces on
044: * the host, and is bound to a the specified port. The socket is
045: * configured with the socket options (such as accept timeout)
046: * given to this factory.
047: *
048: * @param port the port to listen to
049: *
050: * @exception IOException input/output or network error
051: * @exception KeyStoreException error instantiating the
052: * KeyStore from file (SSL only)
053: * @exception NoSuchAlgorithmException KeyStore algorithm unsupported
054: * by current provider (SSL only)
055: * @exception CertificateException general certificate error (SSL only)
056: * @exception UnrecoverableKeyException internal KeyStore problem with
057: * the certificate (SSL only)
058: * @exception KeyManagementException problem in the key management
059: * layer (SSL only)
060: */
061: public ServerSocket createSocket(int port) throws IOException,
062: KeyStoreException, NoSuchAlgorithmException,
063: CertificateException, UnrecoverableKeyException,
064: KeyManagementException;
065:
066: /**
067: * Returns a server socket which uses all network interfaces on
068: * the host, is bound to a the specified port, and uses the
069: * specified connection backlog. The socket is configured with
070: * the socket options (such as accept timeout) given to this factory.
071: *
072: * @param port the port to listen to
073: * @param backlog how many connections are queued
074: *
075: * @exception IOException input/output or network error
076: * @exception KeyStoreException error instantiating the
077: * KeyStore from file (SSL only)
078: * @exception NoSuchAlgorithmException KeyStore algorithm unsupported
079: * by current provider (SSL only)
080: * @exception CertificateException general certificate error (SSL only)
081: * @exception UnrecoverableKeyException internal KeyStore problem with
082: * the certificate (SSL only)
083: * @exception KeyManagementException problem in the key management
084: * layer (SSL only)
085: */
086: public ServerSocket createSocket(int port, int backlog)
087: throws IOException, KeyStoreException,
088: NoSuchAlgorithmException, CertificateException,
089: UnrecoverableKeyException, KeyManagementException;
090:
091: /**
092: * Returns a server socket which uses only the specified network
093: * interface on the local host, is bound to a the specified port,
094: * and uses the specified connection backlog. The socket is configured
095: * with the socket options (such as accept timeout) given to this factory.
096: *
097: * @param port the port to listen to
098: * @param backlog how many connections are queued
099: * @param ifAddress the network interface address to use
100: *
101: * @exception IOException input/output or network error
102: * @exception KeyStoreException error instantiating the
103: * KeyStore from file (SSL only)
104: * @exception NoSuchAlgorithmException KeyStore algorithm unsupported
105: * by current provider (SSL only)
106: * @exception CertificateException general certificate error (SSL only)
107: * @exception UnrecoverableKeyException internal KeyStore problem with
108: * the certificate (SSL only)
109: * @exception KeyManagementException problem in the key management
110: * layer (SSL only)
111: */
112: public ServerSocket createSocket(int port, int backlog,
113: InetAddress ifAddress) throws IOException,
114: KeyStoreException, NoSuchAlgorithmException,
115: CertificateException, UnrecoverableKeyException,
116: KeyManagementException;
117:
118: }
|