Package com.verisign.epp.pool
Class EPPGenericSessionPoolableFactory
- java.lang.Object
-
- com.verisign.epp.pool.EPPSessionPoolableFactory
-
- com.verisign.epp.pool.EPPGenericSessionPoolableFactory
-
- All Implemented Interfaces:
org.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>
public class EPPGenericSessionPoolableFactory extends EPPSessionPoolableFactory implements org.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>
-
-
Field Summary
-
Fields inherited from class com.verisign.epp.pool.EPPSessionPoolableFactory
absoluteTimeout, clientHost, clientId, clientTransIdGenerator, idleTimeout, initSessionOnMake, maxAbsoluteTimeout, minAbsoluteTimeout, password, serverName, serverPort, sslContext, TIMEOUT_UNSET
-
-
Constructor Summary
Constructors Constructor Description EPPGenericSessionPoolableFactory()Default constructor.EPPGenericSessionPoolableFactory(java.lang.String aClientId, java.lang.String aPassword, long aAbsoluteTimeout, long aIdleTimeout)Create an EPP session poolable factory with the client id, password used to authenticate the session along with the timeout settings.EPPGenericSessionPoolableFactory(java.lang.String aClientId, java.lang.String aPassword, long aMinAbsoluteTimeout, long aMaxAbsoluteTimeout, long aIdleTimeout)Create an EPP session poolable factory with the client id, password used to authenticate the session along with the timeout settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession)Session being borrowed from the pool.voiddestroyObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession)Destroy object from the pool.org.apache.commons.pool2.PooledObject<EPPPooledSession>makeObject()Creates a new session object.protected EPPPooledGenericSessionmakeSession()Make an EPP session instance for pool.voidpassivateObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession)Session is being returned to the pool.booleanvalidateObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession)Validates a session by sending a keep alive.-
Methods inherited from class com.verisign.epp.pool.EPPSessionPoolableFactory
getAbsoluteTimeout, getClientHost, getClientId, getClientTransIdGenerator, getIdleTimeout, getMaxAbsoluteTimeout, getMinAbsoluteTimeout, getPassword, getServerName, getServerPort, getSSLContext, isInitSessionOnMake, isRandomAbsoluteTimeout, setAbsoluteTimeout, setClientHost, setClientId, setClientTransIdGenerator, setIdleTimeout, setInitSessionOnMake, setMaxAbsoluteTimeout, setMinAbsoluteTimeout, setPassword, setServerName, setServerPort, setSSLContext
-
-
-
-
Constructor Detail
-
EPPGenericSessionPoolableFactory
public EPPGenericSessionPoolableFactory()
Default constructor. Must set the following attributes for using:
- clientId
- password
- absoluteTimeout
- idleTimeout
-
EPPGenericSessionPoolableFactory
public EPPGenericSessionPoolableFactory(java.lang.String aClientId, java.lang.String aPassword, long aAbsoluteTimeout, long aIdleTimeout)Create an EPP session poolable factory with the client id, password used to authenticate the session along with the timeout settings.- Parameters:
aClientId- Login id used to authenticateaPassword- Password used to authenticateaAbsoluteTimeout- Session absolute timeoutaIdleTimeout- Session idle timeout
-
EPPGenericSessionPoolableFactory
public EPPGenericSessionPoolableFactory(java.lang.String aClientId, java.lang.String aPassword, long aMinAbsoluteTimeout, long aMaxAbsoluteTimeout, long aIdleTimeout)Create an EPP session poolable factory with the client id, password used to authenticate the session along with the timeout settings.- Parameters:
aClientId- Login id used to authenticateaPassword- Password used to authenticateaMinAbsoluteTimeout- Session minimum absolute timeoutaMaxAbsoluteTimeout- Session maximum absolute timeoutaIdleTimeout- Session idle timeout
-
-
Method Detail
-
activateObject
public void activateObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession) throws java.lang.Exception
Session being borrowed from the pool.- Specified by:
activateObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>- Parameters:
aSession- Session being returned- Throws:
java.lang.Exception
-
destroyObject
public void destroyObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession) throws java.lang.Exception
Destroy object from the pool.- Specified by:
destroyObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>- Parameters:
aSession- Session being destroyed- Throws:
java.lang.Exception
-
makeObject
public org.apache.commons.pool2.PooledObject<EPPPooledSession> makeObject() throws java.lang.Exception
Creates a new session object.- Specified by:
makeObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>- Throws:
java.lang.Exception
-
passivateObject
public void passivateObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession) throws java.lang.Exception
Session is being returned to the pool.- Specified by:
passivateObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>- Parameters:
aSession- Session being returned- Throws:
java.lang.Exception
-
validateObject
public boolean validateObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession)
Validates a session by sending a keep alive. If an exception occurs from the keep alive, than the session is not valid.- Specified by:
validateObjectin interfaceorg.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>- Parameters:
aSession- Session to validate- Returns:
trueif the session is valid;falseotherwise.
-
makeSession
protected EPPPooledGenericSession makeSession() throws java.lang.Exception
Make an EPP session instance for pool. This can be overridden by a derived class to create a custom EPP session instance (i.e. HTTP).- Returns:
EPPSessioninstance- Throws:
java.lang.Exception- Configuration error or error creating pooled session.
-
-