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>
  • Constructor Details

    • EPPGenericSessionPoolableFactory

      public EPPGenericSessionPoolableFactory()
      Default constructor. Must set the following attributes for using:

      • clientId
      • password
      • absoluteTimeout
      • idleTimeout
    • EPPGenericSessionPoolableFactory

      public EPPGenericSessionPoolableFactory(String aClientId, 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 authenticate
      aPassword - Password used to authenticate
      aAbsoluteTimeout - Session absolute timeout
      aIdleTimeout - Session idle timeout
    • EPPGenericSessionPoolableFactory

      public EPPGenericSessionPoolableFactory(String aClientId, 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 authenticate
      aPassword - Password used to authenticate
      aMinAbsoluteTimeout - Session minimum absolute timeout
      aMaxAbsoluteTimeout - Session maximum absolute timeout
      aIdleTimeout - Session idle timeout
  • Method Details

    • activateObject

      public void activateObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession) throws Exception
      Session being borrowed from the pool.
      Specified by:
      activateObject in interface org.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>
      Parameters:
      aSession - Session being returned
      Throws:
      Exception
    • destroyObject

      public void destroyObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession) throws Exception
      Destroy object from the pool.
      Specified by:
      destroyObject in interface org.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>
      Parameters:
      aSession - Session being destroyed
      Throws:
      Exception
    • makeObject

      public org.apache.commons.pool2.PooledObject<EPPPooledSession> makeObject() throws Exception
      Creates a new session object.
      Specified by:
      makeObject in interface org.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>
      Throws:
      Exception
    • passivateObject

      public void passivateObject(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession) throws Exception
      Session is being returned to the pool.
      Specified by:
      passivateObject in interface org.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>
      Parameters:
      aSession - Session being returned
      Throws:
      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:
      validateObject in interface org.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>
      Parameters:
      aSession - Session to validate
      Returns:
      true if the session is valid; false otherwise.
    • makeSession

      protected EPPPooledGenericSession makeSession() throws 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:
      EPPSession instance
      Throws:
      Exception - Configuration error or error creating pooled session.