public interface SessionPool
SessionPoolProperties
and
after successful initialisation may be instructed to hold sessions open for
at least the time specified by the client timeout property. The client must
correctly specify the EPP server's timeout value in order for the
SessionPool to optimally prevent session timeouts. The SessionPool is not
responsible for actually running a keep-alive loop; see the implementation of
the run()
method in the package private class SessionManagerImpl for
an example of how to use the keep-alive feature. By default, the SessionManagerFactory
will provide
that implementation of SessionManager
.Modifier and Type | Method and Description |
---|---|
void |
clean()
Close all open sessions, then open the same number of sessions that
were closed.
|
void |
empty()
Close all sessions in the pool, then remove references to those
sessions.
|
Greeting |
getLastGreeting()
Get the greeting data from the most recently opened session in the pool.
|
Session |
getSession()
Get the most suitable session from the pool.
|
Session |
getSession(CommandType commandType)
Get the most suitable session from the pool based on the type of the
command to be sent over that session.
|
StatsViewer |
getStatsViewer()
Get the StatsViewer responsible for reporting operating statistics
about the sessions in the pool.
|
long |
keepAlive()
Keep a single session in the pool open by polling the EPP server at
regular intervals.
|
void |
releaseSession(Session session)
Release back to the pool a session acquired using getSession.
|
void |
setMaxSize(int size)
Set the maximum number of sessions allowed in the pool to the
specified value.
|
void empty()
void clean() throws SessionConfigurationException, SessionOpenException
void setMaxSize(int size)
Greeting getLastGreeting() throws SessionConfigurationException, SessionOpenException, java.lang.InterruptedException
SessionConfigurationException
SessionOpenException
java.lang.InterruptedException
Session getSession() throws SessionConfigurationException, SessionOpenException, java.lang.InterruptedException
SessionConfigurationException
- The pool had no available
sessions, so a new session was created but configuration of that
session failed due to invalid session properties.SessionOpenException
- The pool had no available sessions, and so
tried to open a new session which was successfully configured, but
failed to open. It should be expected that further requests to get a
session will fail.java.lang.InterruptedException
Session getSession(CommandType commandType) throws SessionConfigurationException, SessionOpenException, java.lang.InterruptedException
SessionConfigurationException
SessionOpenException
java.lang.InterruptedException
void releaseSession(Session session)
long keepAlive() throws java.io.IOException
java.io.IOException
- See Session.keepAlive.StatsViewer getStatsViewer()