public interface Session
Modifier and Type | Method and Description |
---|---|
void |
acquire()
Acquire the session for exclusive use.
|
void |
changePassword(java.lang.String newPassword)
Change the client password to the given value.
|
void |
close()
EPP sessions are closed cleanly by sending an EPP logout command,
awaiting a response from the server, then acknowledging the close
of the underlying transport mechanism initiated by the server upon
completion of sending the logout response.
|
void |
configure(SessionProperties properties)
Configure EPP session parameters such as server host name, port, client
identifier, password and authentication sources.
|
Greeting |
getGreeting()
EPP service discovery is implemented by the greeting service element.
|
StatsManager |
getStatsManager()
Get the StatsManager as described in the class documentation.
|
boolean |
isAvailable()
Determine whether a call to
acquire would block. |
boolean |
isInvalid()
Determine whether a call to read or write would result in an
IOException.
|
boolean |
isOpen()
Determine whether a call to open has previously succeeded.
|
void |
keepAlive()
Keep the Session open, as described in the class documentation.
|
void |
open()
An EPP session is opened by first establishing a connection using the
server location information and authentication sources provided in
configure , then issuing a login command with further
authentication data and options provided in configure . |
java.lang.String |
read()
Read a single EPP service element from the transport layer.
|
void |
read(Response response)
Read a single EPP service element from the transport layer and assign
values to the attributes of the given Response instance appropriately,
according to the received XML document content.
|
XMLDocument |
readToDocument()
Read a single EPP service element from the transport layer, then
construct an XMLDocument instance from the element read.
|
void |
release()
Release the Session for use by another user.
|
void |
write(Command command)
Write an EPP service element to the transport layer service, with the
intention of sending the command to the connected EPP server.
|
void |
write(java.lang.String xml)
Write an EPP service element to the transport layer service, with the
intention of sending the command to the connected EPP server.
|
void configure(SessionProperties properties) throws SessionConfigurationException
properties
- Properties as defined in the SessionProperties
interface, which govern the behaviour of a Session.SessionConfigurationException
- Session configuration failed to
prepare the session for being opened. The cause of the failure should
be available by calling getCause() on the thrown exception.void open() throws SessionOpenException
configure
, then issuing a login command with further
authentication data and options provided in configure
.
Service information provided immediately upon connection establishment
may affect options provided in the login command.SessionOpenException
- The session failed to open. The cause MUST
be made available by calling getCause()
on the exception
object thrown. Required causes are LoginException (such as is caused by
invalid username/password combination) and IOException (such as would
result from the server being unavailable at the configured location).
Other causes may include ParsingException and SSLHandshakeException.void changePassword(java.lang.String newPassword) throws SessionOpenException
newPassword
- The new client password.SessionOpenException
void close()
Greeting getGreeting()
java.lang.String read() throws java.io.IOException
java.io.IOException
- There was a failure in the transport layer in
attempting to receive data from the server. The cause of the exception
should be described in the exception message.void read(Response response) throws java.io.IOException, ParsingException
java.io.IOException
- There was a failure in the transport layer in
attempting to receive data from the server. The cause of the exception
should be described in the exception message.ParsingException
- The XML parser reported an error while trying
to construct an XMLDocument instance from the data received from the
server.XMLDocument readToDocument() throws java.io.IOException, ParsingException
java.io.IOException
- There was a failure in the transport layer in
attempting to receive data from the server. The cause of the exception
should be described in the exception message.ParsingException
- The XML parser reported an error while trying
to construct an XMLDocument instance from the data received from the
server.void write(java.lang.String xml) throws java.io.IOException
java.io.IOException
- The transport layer was unable to send the data to
the server. This condition is considered permanent and causes the
session state to become invalid, as indicated by isInvalid.void write(Command command) throws java.io.IOException, ParsingException
Command
instance. The XML representation
of the service element is obtained from the toXML method of the Command
instance.java.io.IOException
- The transport layer was unable to send the data to
the server. This condition is considered permanent and causes the
session state to become invalid, as indicated by isInvalid.ParsingException
- See the description of Command.toXML().boolean isOpen()
boolean isInvalid()
boolean isAvailable()
acquire
would block.void acquire() throws java.lang.InterruptedException, TimeoutException
TimeoutException
- The acquire timeout period elapsed while
waiting to acquire exclusive use of the session.java.lang.InterruptedException
- The thread was interrupted while waiting to
acquire the lock on the session.SessionProperties.getAcquireTimeout()
void release()
acquire
d.void keepAlive() throws java.io.IOException
java.io.IOException
StatsManager getStatsManager()