public class EPPSystemSessionPool
extends java.lang.Object
init
methods
must be called before useing the pool. The init()
method uses
configuration settings defined in the
Environment
class. The
Environment
settings include the following
based on the system name defined by <system>:EPP.SessionPool.<system>.poolableClassName
-
(required) EPPSessionPoolableFactory class used by the pool.
EPP.SessionPool.<system>.clientId
- (required) Login
name
EPP.SessionPool.<system>.password
- (required)
password
EPP.SessionPool.<system>.serverName
- Name or IP
address of TCP server or URL of HTTP server
EPP.SessionPool.<system>.serverPort
- (optional) TCP
server port number. This is not used for a HTTP server connection
EPP.SessionPool.<system>.absoluteTimeout
- (optional)
Session absolute timeout. Default is 24 hours
EPP.SessionPool.<system>.idleTimeout
- (optional)
Session idle timeout used to determine when keep alive messages are sent.
Default is 10 minutes.
EPP.SessionPool.<system>.maxIdle
- (optional) Maximum
number of idle sessions in pool. Default is 10.
EPP.SessionPool.<system>.initMaxActive
- (optional)
Boolean value indicating if the maxActive
sessions should be
pre-initialized at initialization in the init()
method. Default is
false
.
EPP.SessionPool.<system>.maxActive
- (optional)
Maximum number of active sessions in pool. Default is 10.
EPP.SessionPool.<system>.maxWait
- (optional) Maximum
time in milliseconds for a client to block waiting for a pooled session.
Default is 60 seconds.
EPP.SessionPool.<system>.minIdle
- (optional) Minimum
number of idle sessions in the pool. Default is 0.
EPP.SessionPool.<system>.timeBetweenEvictionRunsMillis
- (optional) Frequency in milliseconds of scanning the pool for idle and
absolute timeout sessions. Default is 60 seconds.
EPP.SessionPool.<system>.borrowRetries
- (optional)
Number of retries to get/create a session when calling
borrowObject()
. Default is 0
.
EPP.SessionPool.<system>.SSLProtocol
- (optional) SSL
protocol to use. If defined the pool will have its own SSL configuration. The
required SSL properties include SSLKeyStore
,
SSLKeyFileName
, and SSLKeyPassPhrase
EPP.SessionPool.<system>.SSLKeyStore
- (optional) Type
of identity KeyStore. Required if SSLProtocol
is defined for
pool.
EPP.SessionPool.<system>.SSLKeyFileName
- (optional)
Name of the identity KeyStore file. Required if SSLProtocol
is
defined for pool.
EPP.SessionPool.<system>.SSLPassPhrase
- (optional)
The passphrase/password to access the identity KeyStore file defined by
SSLKeyFileName
. Required if SSLProtocol
is defined
for pool.
EPP.SessionPool.<system>.SSLKeyPassPhrase
- (optional)
the passphrase/password for the private key stored in the identity KeyStore.
EPP.SessionPool.<system>.SSLTrustStore
- (optional)
KeyStore type of the Trust Store
EPP.SessionPool.<system>.SSLTrustStoreFileName
-
(optional) The name of the Trust Store file. If not defined for the pool, the
default JDK Trust Store will be used that is located at the path
$JAVA_HOME/lib/security/cacerts
.
EPP.SessionPool.<system>.SSLTrustStorePassPhrase
-
(optional) The passphrase/password to access the Trust Store file defined by
the pool SSLTrustStoreFileName
property.
EPP.SessionPool.<system>.SSLEnabledProtocols
-
(optional) The space delimited list of enabled SSL protocols.
EPP.SessionPool.<system>.SSLEnabledCipherSuites
-
(optional) The space delimited list of SSL cipher suites.
EPP.SessionPool.<system>.SSLDebug
- (optional) Defines
the SSL debug Java system property javax.net.debug
value.
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_ABSOLUTE_TIMEOUT
The default session absolute timeout.
|
static long |
DEFAULT_IDLE_TIMEOUT
The default session absolute timeout.
|
static int |
DEFAULT_MAX_ACTIVE
The default cap on the total number of active instances from the pool.
|
static int |
DEFAULT_MAX_IDLE
The default cap on the number of "sleeping" instances in the pool.
|
static long |
DEFAULT_MAX_WAIT
The default maximum amount of time (in millis) the
borrowObject()
method should block before throwing an exception. |
static int |
DEFAULT_MIN_IDLE
The default minimum number of "sleeping" instances in the pool before
before the evictor thread (if active) spawns new objects.
|
static long |
DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
The default "time between eviction runs" value.
|
Modifier and Type | Method and Description |
---|---|
EPPSession |
borrowObject()
Borrows a session from the pool.
|
void |
close()
Closes the session pool contained in
EPPSystemSessionPool
cleanly. |
long |
getAbsoluteTimeout()
Gets the session absolute timeout.
|
java.lang.String |
getClientHost()
Gets the TCP server IP address or host name to connect from.
|
java.lang.String |
getClientId()
Gets the client identifier used to authenticate.
|
org.apache.commons.pool.impl.GenericObjectPool.Config |
getConfig()
Gets the configuration for the
GenericObjectPool . |
EPPSessionPoolableFactory |
getFactory()
Gets the factory associated with the pool.
|
org.apache.commons.pool.impl.GenericObjectPool |
getGenericObjectPool()
Gets the contained
GenericObjectPool . |
long |
getIdleTimeout()
Gets the session idle timeout.
|
java.lang.String |
getPassword()
Gets the password used for authentication.
|
java.lang.String |
getServerName()
Gets the TCP server IP address or host name, or the URL of the HTTP
server.
|
java.lang.Integer |
getServerPort()
Gets the TCP server port number.
|
java.lang.String |
getSystem()
Gets the system name associated with this pool.
|
void |
init()
Initialize the pool using configuration values defined by
Environment class. |
void |
init(EPPSessionPoolableFactory aFactory,
org.apache.commons.pool.impl.GenericObjectPool.Config aConfig)
Initialize the pool with a specific
EPPSessionPoolableFactory
and GenericObjectPool.Config setting. |
void |
invalidateObject(EPPSession aSession)
Remove a borrowed session from the pool based on a known issue with it.
|
void |
returnObject(EPPSession aSession)
Returned a borrowed session to the pool.
|
void |
setClientHost(java.lang.String aClientHost)
Sets the TCP server IP address or host name to connect from.
|
void |
setServerName(java.lang.String aServerName)
Sets the TCP server IP address or host name or the URL of the HTTP server.
|
void |
setServerPort(java.lang.Integer aServerPort)
Sets the TCP server port number.
|
public static final long DEFAULT_ABSOLUTE_TIMEOUT
public static final long DEFAULT_IDLE_TIMEOUT
public static final long DEFAULT_MAX_WAIT
borrowObject()
method should block before throwing an exception.public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
public static final int DEFAULT_MAX_IDLE
public static final int DEFAULT_MAX_ACTIVE
public static final int DEFAULT_MIN_IDLE
public void init(EPPSessionPoolableFactory aFactory, org.apache.commons.pool.impl.GenericObjectPool.Config aConfig)
EPPSessionPoolableFactory
and GenericObjectPool.Config
setting.aFactory
- EPP session poolable object factoryaConfig
- Configuration attributes for poolpublic void init() throws EPPSessionPoolException
Environment
class. The
Environment
class and logging must be
initialized before calling this method.EPPSessionPoolException
- On errorpublic void close()
EPPSystemSessionPool
cleanly. Cleanly closing the pool means clearing the pool that will
execute an EPP logout for each of the idle sessions and close the pool.public EPPSession borrowObject() throws EPPSessionPoolException
invalidateObject(com.verisign.epp.interfaces.EPPSession)
or returnObject(com.verisign.epp.interfaces.EPPSession)
. This
method will block if there are no idle sessions in the pool for
maxWait
time.EPPSession
instance.EPPSessionPoolException
- On errorpublic void invalidateObject(EPPSession aSession) throws EPPSessionPoolException
aSession
- Session that is invalidEPPSessionPoolException
- On errorpublic void returnObject(EPPSession aSession) throws EPPSessionPoolException
borrowObject()
.aSession
- Session to returnEPPSessionPoolException
- On errorpublic org.apache.commons.pool.impl.GenericObjectPool getGenericObjectPool()
GenericObjectPool
.GenericObjectPool
public long getAbsoluteTimeout()
public java.lang.String getClientId()
public org.apache.commons.pool.impl.GenericObjectPool.Config getConfig()
GenericObjectPool
.public EPPSessionPoolableFactory getFactory()
public long getIdleTimeout()
public java.lang.String getPassword()
public java.lang.String getSystem()
public java.lang.String getServerName()
public void setServerName(java.lang.String aServerName)
aServerName
- Server host name, IP address, or URLpublic java.lang.Integer getServerPort()
null
if
connecting to a HTTP server.null
otherwise.public void setServerPort(java.lang.Integer aServerPort)
aServerPort
- TCP server port numberpublic java.lang.String getClientHost()
null
value will use the loop back.null
otherwise.public void setClientHost(java.lang.String aClientHost)
null
value will use the loop back.aClientHost
- Client host name or IP address