GSIServerSocketFactory (Java Globus API)

org.globus.net
Class GSIServerSocketFactory

java.lang.Object
  |
  +--org.globus.net.GSIServerSocketFactory

public class GSIServerSocketFactory
extends java.lang.Object

This factory allows for creating secure server sockets (IAIK secure server sockets). If the tcp.port.range system property is set it will create server sockets within the specified port range (if the port number is set to 0).


Constructor Summary
protected GSIServerSocketFactory()
           
 
Method Summary
protected  iaik.security.ssl.SSLServerContext createContext(GlobusProxy proxy)
           
 java.net.ServerSocket createServerSocket(int port)
          Creates a secure server socket on a specified port with default user credentials.
 java.net.ServerSocket createServerSocket(int port, GlobusProxy proxy)
          Creates a secure server socket on a specified port and with specified user credentials.
 java.net.ServerSocket createServerSocket(int port, int backlog)
          Creates a secure server socket on a specified port with default user credentials.
 java.net.ServerSocket createServerSocket(int port, int backlog, java.net.InetAddress bindAddr, GlobusProxy proxy)
          Create a secure server with the specified port, listen backlog, local IP address to bind to and user credentials.
static GSIServerSocketFactory getDefault()
          Returns the default instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GSIServerSocketFactory

protected GSIServerSocketFactory()
Method Detail

getDefault

public static GSIServerSocketFactory getDefault()
Returns the default instance of this class.

Returns:
ServerSocketFactory instance of this class.

createServerSocket

public java.net.ServerSocket createServerSocket(int port)
                                         throws java.io.IOException,
                                                GlobusProxyException
Creates a secure server socket on a specified port with default user credentials. A port of 0 creates a socket on any free port or if the tcp.port.range system property is set it creates a socket within the specified port range.

The maximum queue length for incoming connection indications (a request to connect) is set to 50. If a connection indication arrives when the queue is full, the connection is refused.

Parameters:
port - the port number, or 0 to use any free port or if the tcp.port.range property set to use any available port within the specified port range.
Throws:
java.io.IOException - if an I/O error occurs when opening the socket.
GlobusProxyException - if an error occurs duing loading the default user credentials.

createServerSocket

public java.net.ServerSocket createServerSocket(int port,
                                                int backlog)
                                         throws java.io.IOException,
                                                GlobusProxyException
Creates a secure server socket on a specified port with default user credentials. A port of 0 creates a socket on any free port or if the tcp.port.range system property is set it creates a socket within the specified port range.

The maximum queue length for incoming connection indications (a request to connect) is set to the backlog parameter. If a connection indication arrives when the queue is full, the connection is refused.

Parameters:
port - the port number, or 0 to use any free port or if the tcp.port.range property set to use any available port within the specified port range.
backlog - the maximum length of the queue.
Throws:
java.io.IOException - if an I/O error occurs when opening the socket.
GlobusProxyException - if an error occurs duing loading the default user credentials.

createServerSocket

public java.net.ServerSocket createServerSocket(int port,
                                                GlobusProxy proxy)
                                         throws java.io.IOException,
                                                GlobusProxyException
Creates a secure server socket on a specified port and with specified user credentials. A port of 0 creates a socket on any free port or if the tcp.port.range system property is set it creates a socket within the specified port range.

The maximum queue length for incoming connection indications (a request to connect) is set to 50. If a connection indication arrives when the queue is full, the connection is refused.

Parameters:
port - the port number, or 0 to use any free port or if the tcp.port.range property set to use any available port within the specified port range.
proxy - the user credentials to use for the server.
Throws:
java.io.IOException - if an I/O error occurs when opening the socket.
GlobusProxyException - if an error occurs duing loading the default user credentials.

createServerSocket

public java.net.ServerSocket createServerSocket(int port,
                                                int backlog,
                                                java.net.InetAddress bindAddr,
                                                GlobusProxy proxy)
                                         throws java.io.IOException,
                                                GlobusProxyException
Create a secure server with the specified port, listen backlog, local IP address to bind to and user credentials. The bindAddr argument can be used on a multi-homed host for a ServerSocket that will only accept connect requests to one of its addresses. If bindAddr is null, it will default accepting connections on any/all local addresses. The port must be between 0 and 65535, inclusive.

Parameters:
port - the local TCP port.
backlog - the listen backlog.
bindAddr - the local InetAddress the server will bind to.
proxy - the user credentials to use for the server.
Throws:
java.io.IOException - if an I/O error occurs when opening the socket.
GlobusProxyException - if an error occurs duing loading the default user credentials.

createContext

protected iaik.security.ssl.SSLServerContext createContext(GlobusProxy proxy)