public class EPPSessionPoolableFactory
extends java.lang.Object
implements org.apache.commons.pool.PoolableObjectFactory
Constructor and Description |
---|
EPPSessionPoolableFactory()
Default constructor.
|
EPPSessionPoolableFactory(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.
|
Modifier and Type | Method and Description |
---|---|
void |
activateObject(java.lang.Object aSession)
Session being borrowed from the pool.
|
void |
destroyObject(java.lang.Object aSession)
Destroy object from the pool.
|
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() |
EPPClientTransIdGenerator |
getClientTransIdGenerator()
Gets the client transaction identifier generator object that is set.
|
long |
getIdleTimeout()
Gets the session idle timeout.
|
java.lang.String |
getPassword() |
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.
|
EPPSSLContext |
getSSLContext()
Gets the optional
EPPSSLContext associated with the factory. |
java.lang.Object |
makeObject()
Creates a new session object.
|
protected EPPSession |
makeSession()
Make an EPP session instance for pool.
|
void |
passivateObject(java.lang.Object aSession)
Session is being returned to the pool.
|
void |
setAbsoluteTimeout(long aAbsoluteTimeout)
Sets the session absolute timeout.
|
void |
setClientHost(java.lang.String aClientHost)
Sets the TCP server IP address or host name to connect from.
|
void |
setClientId(java.lang.String clientId) |
void |
setClientTransIdGenerator(EPPClientTransIdGenerator aClientTransIdGenerator)
Sets the client transaction identifier generator object that is used to
generate client transaction identifiers for the login and logout commands.
|
void |
setIdleTimeout(long aIdleTimeout)
Sets the session idle timeout.
|
void |
setPassword(java.lang.String password) |
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.
|
void |
setSSLContext(EPPSSLContext aSSLContext)
Gets the optional
EPPSSLContext associated with the factory. |
boolean |
validateObject(java.lang.Object aSession)
Validates a session by sending a keep alive.
|
public EPPSessionPoolableFactory()
public EPPSessionPoolableFactory(java.lang.String aClientId, java.lang.String aPassword, long aAbsoluteTimeout, long aIdleTimeout)
aClientId
- Login id used to authenticateaPassword
- Password used to authenticateaAbsoluteTimeout
- Session absolute timeoutaIdleTimeout
- Session idle timeoutpublic java.lang.String getClientId()
public void setClientId(java.lang.String clientId)
clientId
- The clientId to set.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- The password to set.public long getAbsoluteTimeout()
public void setAbsoluteTimeout(long aAbsoluteTimeout)
aAbsoluteTimeout
- Absolute timeout in milliseconds.public long getIdleTimeout()
public void setIdleTimeout(long aIdleTimeout)
aIdleTimeout
- Idle session in millisecondspublic 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 addresspublic EPPSSLContext getSSLContext()
EPPSSLContext
associated with the factory.null
otherwisepublic void setSSLContext(EPPSSLContext aSSLContext)
EPPSSLContext
associated with the factory.aSSLContext
- SSL Context to use by the factorypublic EPPClientTransIdGenerator getClientTransIdGenerator()
null
otherwise.public void setClientTransIdGenerator(EPPClientTransIdGenerator aClientTransIdGenerator)
aClientTransIdGenerator
- Client transaction identifier generator object or null
to unset the generatorpublic void activateObject(java.lang.Object aSession) throws java.lang.Exception
activateObject
in interface org.apache.commons.pool.PoolableObjectFactory
aSession
- Session being returnedjava.lang.Exception
PoolableObjectFactory.activateObject(java.lang.Object)
public void destroyObject(java.lang.Object aSession) throws java.lang.Exception
destroyObject
in interface org.apache.commons.pool.PoolableObjectFactory
aSession
- Session being destroyedjava.lang.Exception
PoolableObjectFactory.destroyObject(java.lang.Object)
public java.lang.Object makeObject() throws java.lang.Exception
makeObject
in interface org.apache.commons.pool.PoolableObjectFactory
java.lang.Exception
PoolableObjectFactory.makeObject()
public void passivateObject(java.lang.Object aSession) throws java.lang.Exception
passivateObject
in interface org.apache.commons.pool.PoolableObjectFactory
aSession
- Session being returnedjava.lang.Exception
PoolableObjectFactory.passivateObject(java.lang.Object)
public boolean validateObject(java.lang.Object aSession)
validateObject
in interface org.apache.commons.pool.PoolableObjectFactory
aSession
- Session to validatetrue
if the session is valid; false
otherwise.PoolableObjectFactory.validateObject(java.lang.Object)
protected EPPSession makeSession() throws java.lang.Exception
EPPSession
instancejava.lang.Exception
- Configuration error or error creating pooled session.