Package com.verisign.epp.pool

## Class EPPHttpSessionPoolableFactory

- java.lang.Object
- - com.verisign.epp.pool.EPPSessionPoolableFactory
  - - com.verisign.epp.pool.EPPHttpSessionPoolableFactory

- All Implemented Interfaces:
    `org.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>`

      public class EPPHttpSessionPoolableFactory
      extends EPPSessionPoolableFactory
      implements org.apache.commons.pool2.PooledObjectFactory<EPPPooledSession>

  Customized `EPPSessionPoolableFactory` for creating a pool of `EPPHttpSession` objects.

- - ### 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
    --- | ---
    `EPPHttpSessionPoolableFactory()` | Default constructor.
    `EPPHttpSessionPoolableFactory​(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.
    `EPPHttpSessionPoolableFactory​(java.lang.String aClientId, java.lang.String aPassword, long aMinAbsoluteTimeout, long aMaxAbsoluteTimeout, long aIdleTimeout, java.lang.String aServerName)` | Create an EPP session poolable factory with the client id, password, and target URL for an HTTP connection.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `activateObject​(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession)` | Session being borrowed from the pool.
    `void` | `destroyObject​(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 EPPPooledSession` | `makeSession()` | Make an HTTP EPP session instance for pool.
    `void` | `passivateObject​(org.apache.commons.pool2.PooledObject<EPPPooledSession> aSession)` | Session is being returned to the pool.
    `boolean` | `validateObject​(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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.commons.pool2.PooledObjectFactory

      `destroyObject`

- - ### Constructor Detail

    - #### EPPHttpSessionPoolableFactory

          public EPPHttpSessionPoolableFactory()

      Default constructor.

    - #### EPPHttpSessionPoolableFactory

          public EPPHttpSessionPoolableFactory​(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. The kind of EPP session created default to `KIND_GENERIC`.
      Parameters:
        `aClientId` - Login id used to authenticate
        `aPassword` - Password used to authenticate
        `aAbsoluteTimeout` - Session absolute timeout
        `aIdleTimeout` - Session idle timeout

    - #### EPPHttpSessionPoolableFactory

          public EPPHttpSessionPoolableFactory​(java.lang.String aClientId,
                                               java.lang.String aPassword,
                                               long aMinAbsoluteTimeout,
                                               long aMaxAbsoluteTimeout,
                                               long aIdleTimeout,
                                               java.lang.String aServerName)

      Create an EPP session poolable factory with the client id, password, and target URL for an HTTP connection. The session kind is automatically set to `KIND_HTTP`.
      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
        `aServerName` - Server URL name (e.g., https://epp.example.com)

  - ### 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:
        `activateObject` in interface `org.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:
        `destroyObject` in interface `org.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:
        `makeObject` in interface `org.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:
        `passivateObject` in interface `org.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:
        `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 EPPPooledSession makeSession()
                                          throws java.lang.Exception

      Make an HTTP EPP session instance for pool.
      Returns:
        `EPPHttpSession` instance
      Throws:
        `java.lang.Exception` - if something goes wrong