org.identityconnectors.framework.server
Class ConnectorServer

java.lang.Object
  extended by org.identityconnectors.framework.server.ConnectorServer
Direct Known Subclasses:
ConnectorServerImpl

public abstract class ConnectorServer
extends Object

Connector server interface.


Constructor Summary
ConnectorServer()
           
 
Method Summary
abstract  void awaitStop()
          Waits for the server to stop.
 ClassLoader getBundleParentClassLoader()
          Gets the class loader that will be used as the parent of the bundle class loaders.
 List<URL> getBundleURLs()
          Gets the bundle URLs for connectors to expose by this server.
 InetAddress getIfAddress()
          Returns the network interface address to bind to.
 String getKeyHash()
          Returns the base-64 encoded SHA1 hash of the key
 List<KeyManager> getKeyManagers()
          Returns the key managers to use for the SSL connection.
 int getMaxConnections()
          Returns the max connections to queue
 int getMaxWorkers()
          Returns the max worker threads to allow.
 int getMinWorkers()
          Returns the min worker threads to allow.
 int getPort()
          Returns the port to listen on.
 boolean getUseSSL()
          Returns true iff we are to use SSL.
abstract  boolean isStarted()
          Return true iff the server is started.
static ConnectorServer newInstance()
          Get the singleton instance of the ConnectorServer.
 void setBundleParentClassLoader(ClassLoader bundleParentClassLoader)
          Sets the class loader that will be used as the parent of the bundle class loaders.
 void setBundleURLs(List<URL> urls)
          Sets the bundle URLs for connectors to expose by this server.
 void setIfAddress(InetAddress addr)
          Sets the interface address to bind to.
 void setKeyHash(String hash)
          Sets the base-64 encoded SHA1 hash of the key
 void setKeyManagers(List<KeyManager> keyManagers)
          Sets the key managers to use for the SSL connection.
 void setMaxConnections(int max)
          Sets the max connections to queue.
 void setMaxWorkers(int maxWorkers)
          Sets the max worker thread to allow.
 void setMinWorkers(int minWorkers)
          Sets the min worker thread to allow.
 void setPort(int port)
          Sets the port to listen on.
 void setUseSSL(boolean ssl)
          Sets whether we should use ssl.
abstract  void start()
          Starts the server.
abstract  void stop()
          Stops the server gracefully.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectorServer

public ConnectorServer()
Method Detail

newInstance

public static ConnectorServer newInstance()
Get the singleton instance of the ConnectorServer.


getPort

public int getPort()
Returns the port to listen on.

Returns:
The port to listen on.

setPort

public void setPort(int port)
Sets the port to listen on.

Parameters:
port - The port to listen on

getMaxConnections

public int getMaxConnections()
Returns the max connections to queue

Returns:
The max connections to queue

setMaxConnections

public void setMaxConnections(int max)
Sets the max connections to queue.

Parameters:
max - The max connections to queue.

getMaxWorkers

public int getMaxWorkers()
Returns the max worker threads to allow.

Returns:
The max worker threads to allow.

setMaxWorkers

public void setMaxWorkers(int maxWorkers)
Sets the max worker thread to allow.

Parameters:
maxWorkers - The max worker threads to allow.

getMinWorkers

public int getMinWorkers()
Returns the min worker threads to allow.

Returns:
The min worker threads to allow.

setMinWorkers

public void setMinWorkers(int minWorkers)
Sets the min worker thread to allow.

Parameters:
minWorkers - The min worker threads to allow.

getIfAddress

public InetAddress getIfAddress()
Returns the network interface address to bind to. May be null.

Returns:
The network interface address to bind to or null.

setIfAddress

public void setIfAddress(InetAddress addr)
Sets the interface address to bind to.

Parameters:
addr - The network interface address to bind to or null.

getUseSSL

public boolean getUseSSL()
Returns true iff we are to use SSL.

Returns:
true iff we are to use SSL.

setUseSSL

public void setUseSSL(boolean ssl)
Sets whether we should use ssl.

Parameters:
ssl - true iff we are to use SSL.

getKeyHash

public String getKeyHash()
Returns the base-64 encoded SHA1 hash of the key

Returns:
the base-64 encoded SHA1 hash of the key

setKeyHash

public void setKeyHash(String hash)
Sets the base-64 encoded SHA1 hash of the key

Parameters:
hash - the base-64 encoded SHA1 hash of the key

getKeyManagers

public List<KeyManager> getKeyManagers()
Returns the key managers to use for the SSL connection. If empty, use the JVM default.

Returns:
the key managers to use for the SSL connection.

setKeyManagers

public void setKeyManagers(List<KeyManager> keyManagers)
Sets the key managers to use for the SSL connection.

Parameters:
keyManagers - the key managers to use for the SSL connection. If null or empty, uses the JVM default.

getBundleURLs

public List<URL> getBundleURLs()
Gets the bundle URLs for connectors to expose by this server.

Returns:
The bundle URLs for connectors to expose by this server.

setBundleURLs

public void setBundleURLs(List<URL> urls)
Sets the bundle URLs for connectors to expose by this server.

Parameters:
urls - The bundle URLs for connectors to expose by this server.

getBundleParentClassLoader

public ClassLoader getBundleParentClassLoader()
Gets the class loader that will be used as the parent of the bundle class loaders.

Returns:
the class loader that will be used as the parent of the bundle class loaders.

setBundleParentClassLoader

public void setBundleParentClassLoader(ClassLoader bundleParentClassLoader)
Sets the class loader that will be used as the parent of the bundle class loaders.

Parameters:
bundleParentClassLoader - the class loader that will be used as the parent of the bundle class loaders.

start

public abstract void start()
Starts the server. All server settings must be configured prior to calling. The following methods are required to be called:


stop

public abstract void stop()
Stops the server gracefully. Returns when all in-progress connections have been serviced.


isStarted

public abstract boolean isStarted()
Return true iff the server is started. Note that started is a logical state (start method has been called). It does not necessarily reflect the health of the server

Returns:
true iff the server is started.

awaitStop

public abstract void awaitStop()
                        throws InterruptedException
Waits for the server to stop. Similarly to the isStarted() method, this method depends on the server's logical state. The trigger that wakes up waiting threads is a call to the stop() method, not the health of the server.

Throws:
InterruptedException - if the waiting thread is interrupted.


Copyright © 2011. All Rights Reserved.