Class ConnectorServer
java.lang.Object
org.identityconnectors.framework.server.ConnectorServer
- Direct Known Subclasses:
ConnectorServerImpl
Connector server interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidWaits for the server to stop.Gets the class loader that will be used as the parent of the bundle class loaders.Gets the bundle URLs for connectors to expose by this server.Returns the network interface address to bind to.Returns the base-64 encoded SHA1 hash of the key.Returns the key managers to use for the SSL connection.intReturns the max connections to queue.intReturns the max worker threads to allow.intReturns the min worker threads to allow.intgetPort()Returns the port to listen on.abstract LongGets the time when the servers was started last time.booleanReturns true if we are to use SSL.abstract booleanReturn true if the server is started.static ConnectorServerGet the singleton instance of theConnectorServer.voidsetBundleParentClassLoader(ClassLoader bundleParentClassLoader) Sets the class loader that will be used as the parent of the bundle class loaders.voidsetBundleURLs(List<URL> urls) Sets the bundle URLs for connectors to expose by this server.voidsetIfAddress(InetAddress addr) Sets the interface address to bind to.voidsetKeyHash(String hash) Sets the base-64 encoded SHA1 hash of the key.voidsetKeyManagers(List<KeyManager> keyManagers) Sets the key managers to use for the SSL connection.voidsetMaxConnections(int max) Sets the max connections to queue.voidsetMaxWorkers(int maxWorkers) Sets the max worker thread to allow.voidsetMinWorkers(int minWorkers) Sets the min worker thread to allow.voidsetPort(int port) Sets the port to listen on.voidsetUseSSL(boolean ssl) Sets whether we should use ssl.abstract voidstart()Starts the server.abstract voidstop()Stops the server gracefully.
-
Constructor Details
-
ConnectorServer
public ConnectorServer()
-
-
Method Details
-
newInstance
Get the singleton instance of theConnectorServer. -
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
Returns the network interface address to bind to. May be null.- Returns:
- The network interface address to bind to or null.
-
setIfAddress
Sets the interface address to bind to.- Parameters:
addr- The network interface address to bind to or null.
-
getUseSSL
public boolean getUseSSL()Returns true if we are to use SSL.- Returns:
- true if we are to use SSL.
-
setUseSSL
public void setUseSSL(boolean ssl) Sets whether we should use ssl.- Parameters:
ssl- true if we are to use SSL.
-
getKeyHash
Returns the base-64 encoded SHA1 hash of the key.- Returns:
- the base-64 encoded SHA1 hash of the key.
-
setKeyHash
Sets the base-64 encoded SHA1 hash of the key.- Parameters:
hash- the base-64 encoded SHA1 hash of the key.
-
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
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
Gets the bundle URLs for connectors to expose by this server.- Returns:
- The bundle URLs for connectors to expose by this server.
-
setBundleURLs
Sets the bundle URLs for connectors to expose by this server.- Parameters:
urls- The bundle URLs for connectors to expose by this server.
-
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
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.
-
getStartTime
Gets the time when the servers was started last time.System.currentTimeMillis()- Returns:
- last start dateTime in milliseconds
-
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 if 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 if the server is started.
-
awaitStop
Waits for the server to stop. Similarly to theisStarted()method, this method depends on the server's logical state. The trigger that wakes up waiting threads is a call to thestop()method, not the health of the server.- Throws:
InterruptedException- if the waiting thread is interrupted.
-