Package com.verisign.epp.interfaces
Class EPPSession
- java.lang.Object
-
- com.verisign.epp.interfaces.EPPSession
-
- Direct Known Subclasses:
EPPPooledGenericSession
public class EPPSession extends java.lang.Object
EPPSession
manages a session with an EPP Server. An initialized instance ofEPPSession
is required for using any of the EPP interface classes (i.e.EPPDomain
).EPPSession
can invoke the following EPP operations:
- Login - Login to an EPP Server
- Logout - Logout from an EPP Server
- Hello - Request Greeting from the EPP Server
- Poll - Discover and retrieve client service messages
- See Also:
EPPGreeting
,EPPResponse
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
clientId
Client identifier to use in login.protected EPPCodec
codec
EPP Codec used to encode and decode EPP messagesprotected EPPClientCon
connection
Session connectionprotected java.util.Vector
extensionServices
EPP extension servicesprotected java.io.InputStream
inputStream
Session input streamprotected java.lang.String
language
Override EPP languageprotected EPPMessage
message
Message being sentstatic int
MODE_ASYNC
Asynchronous mode contant in processing commands/responses, where for theprocessDocument(EPPCommand)
will send the command and will not wait for the response.static int
MODE_SYNC
Synchronous mode constant in processing commands/responses, where for each command sent theEPPSession
will immediately read for the response.protected java.lang.String
msgID
Message identifier associated with aEPPPollCmd.OP_ACK
poll command.protected java.lang.String
newPassword
New password to usestatic java.lang.String
OP_ACK
Poll operation type indicating that the client has received a message and that the server can remove the message.static java.lang.String
OP_REQ
Poll operation type indicating that the client is requesting information from the server.protected java.io.OutputStream
outputStream
Session output streamprotected java.lang.String
password
Client passwordprotected java.lang.String
pollOp
Poll Operation Commandprotected EPPResponse
response
EPP response associated with last EPP commandprotected byte[]
responsePacket
EPP response packet associated with the last EPP commandprotected java.util.Vector
services
EPP servicesprotected java.lang.String
transId
Client transaction identifierprotected java.lang.String
version
Override EPP versionprotected EPPXMLStream
xmlStream
Used to read and write XML packets from/to streams.
-
Constructor Summary
Constructors Constructor Description EPPSession()
Construct and initialize a new instance of EPPSession using the host name and port number defined inEPPEnv
.EPPSession(java.lang.String aHostName, int aPortNumber)
Construct and initialize a new instance ofEPPSession
with a specific host and port.EPPSession(java.lang.String aHostName, int aPortNumber, EPPSSLContext aSSLContext)
Construct and initialize a new instance ofEPPSession
with a specific host and port.EPPSession(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName)
Construct and initialize a new instance ofEPPSession
with a specific server host, server port, client host name, and client port.EPPSession(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName, EPPSSLContext aSSLContext)
Construct and initialize a new instance ofEPPSession
with a specific server host, server port, client host name, and client port.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endConnection()
Closes the connection with the server.void
endSession()
Ends a session by logging out from the server and closing the connection with the server.EPPClientCon
getClientCon()
Gets the client connection used for theEPPSession
.java.lang.String
getClientID()
Gets the client identifier/name used ininitSession
.protected EPPClientCon
getConnection()
Gets the client connection.java.io.InputStream
getInputStream()
Gets the session input stream.EPPLoginAdapter
getLoginAdapter()
Gets theEPPLoginAdapter
set in theEPPSession
.int
getMode()
Gets the command/response processing mode, which should be eitherMODE_SYNC
orMODE_ASYNC
.java.lang.String
getMsgID()
Gets the poll Message Id.java.lang.String
getNewPassword()
Gets the new client password used ininitSession
.java.io.OutputStream
getOutputStream()
Gets the session output stream.java.lang.String
getPassword()
Gets the client password used ininitSession
.java.lang.String
getPollOp()
Gets the poll operation, which should be eitherOP_REQ
orOP_ACK
EPPResponse
getResponse()
Gets response associated with the last command.java.lang.String
getStatusCommandType()
Gets the status command type.java.lang.String
getStatusTransId()
Gets the status client transaction identifier.java.lang.String
getTransId()
Gets an optional client transaction identifier used when sending an EPP command (i.e.java.lang.String
getVersion()
Gets the EPP version used ininitSession
.EPPGreeting
hello()
Sends a Hello Command to the EPP Server.protected void
init()
Initializes anEPPSession
using the defaultEPPEnv
properties, which will do the following:
Gets concrete connection factory Makes connection to EPP Server Initialize the streams for XML processing
EPPSession.initSession
needs to be called to fully initialize a session with the EPP Server.protected void
init(java.lang.String aHostName, int aPortNumber, EPPSSLContext aSSLContext)
Initializes anEPPSession
to connect to a specific host and port, which will do the following:
Gets concrete connection factory Makes connection to EPP Server Initialize the streams for XML processing
initSession()
needs to be called to fully initialize a session with the EPP Server.protected void
init(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName, EPPSSLContext aSSLContext)
Initializes anEPPSession
to connect to a specific server host, server port from a specific client host name/IP address.protected void
initLoginAdapter()
initialize the login adapter to use.void
initSession()
Initialize an authenticated session with the EPP Server.
The required attributes have been set with the following methods:
setClientID
- Sets the client idenfifier/user namesetPassword
- Sets the password
The optional attributes have been set with the following:
setNewPassword
- Changes the passwordsetVersion
- Override the default EPP version.protected void
initStreams()
Initializes the input stream, output stream, and XML stream from the previously initialized client connection (connection
).boolean
isModeSupported(int aMode)
Does the session support the specified modeMODE_SYNC
orMODE_ASYNC
? A derived class ofEPPSession
could support a subset of the modes, so this method is provide to provide the client with the ability to check whether a mode is supported.protected void
login()
This methods does a session login.protected void
logout()
logout from the session.EPPResponse
processDocument(EPPCommand aCommand)
Process anEPPCommand
instance by writing the command to the session output stream and reading anEPPResponse
instance from the sessin input stream.EPPResponse
processDocument(EPPCommand aCommand, java.lang.Class aExpectedResponse)
Process anEPPCommand
instance by writing the command to the session output stream and reading anEPPResponse
instance from the sessin input stream and validate that theEPPResponse
is of the specified type.EPPResponse
readResponse()
Reads a response from the server.org.w3c.dom.Document
recDocument()
Gets an validated EPP DOM Document from the session input stream.void
sendDocument(org.w3c.dom.Document newDoc, EPPMessage aMessage)
Sends an EPP DOM Document to the session output stream.void
sendMessage(EPPMessage aMessage)
Sends an EPP Message (command, hello, etc.) to the session output stream.void
sendPacket(byte[] aPacket)
Sends a pre-formatted packet to theEPPSession
output stream as an EPP packet with the 4 byte header.EPPResponse
sendPoll()
This method creates an instance ofEPPPollCmd
and sets the given attributes and invokes the send method associated with the command.void
setClientID(java.lang.String newClientID)
Sets the client identifier/name used ininitSession
.void
setExtensions(java.util.Vector ProtocolExtensions, java.util.Vector CommandResponseExtensions)
Set the Extension Services to use with this session by EPP XML namespace URIs.void
setInputStream(java.io.InputStream newInput)
Sets the input stream for the session.java.lang.String
setLang()
Gets the language of "us" used byinitSession
.void
setLang(java.lang.String newLanguage)
Overrides the default language of "us" used byinitSession
.void
setLoginAdapter(EPPLoginAdapter aLoginAdapter)
Sets theEPPLoginAdapter
.int
setMode(int aMode)
Sets the command/response processing mode to eitherMODE_SYNC
orMODE_ASYNC
.void
setMsgID(java.lang.String aMsgID)
Sets the poll Message Id.void
setNewPassword(java.lang.String newPassword)
Sets the new client password used ininitSession
.void
setOutputStream(java.io.OutputStream newOutput)
Sets the output stream for the session.void
setPassword(java.lang.String newPassword)
Sets the client password used ininitSession
.void
setPollOp(java.lang.String aOp)
Sets the poll operation to eitherOP_REQ
orOP_ACK
void
setServices(java.lang.String[] newServiceNS)
Set the services to use with this session by EPP XML namespace URIs.void
setStatusCommandType(java.lang.String aStatusCommandType)
Sets the status command type.void
setStatusTransId(java.lang.String aStatusTrans)
Sets the status client transaction identifier.void
setTransId(java.lang.String newTransId)
Sets an optional client transaction identifier used when sending an EPP command (i.e.void
setVersion(java.lang.String newVersion)
Overrides the default EPP version used ininitSession
.void
validateClientTransId(EPPCommand myCommand, EPPResponse response)
Validates that the response client transaction identifier matches the command's client transaction identifier.
-
-
-
Field Detail
-
OP_REQ
public static final java.lang.String OP_REQ
Poll operation type indicating that the client is requesting information from the server.- See Also:
- Constant Field Values
-
OP_ACK
public static final java.lang.String OP_ACK
Poll operation type indicating that the client has received a message and that the server can remove the message.- See Also:
- Constant Field Values
-
MODE_SYNC
public static final int MODE_SYNC
Synchronous mode constant in processing commands/responses, where for each command sent theEPPSession
will immediately read for the response. This is the default mode, but can be overridden with thesetMode(int)
method.- See Also:
- Constant Field Values
-
MODE_ASYNC
public static final int MODE_ASYNC
Asynchronous mode contant in processing commands/responses, where for theprocessDocument(EPPCommand)
will send the command and will not wait for the response. The client must callreadResponse()
to read the response. The mode can be set with thesetMode(int)
method.- See Also:
- Constant Field Values
-
codec
protected EPPCodec codec
EPP Codec used to encode and decode EPP messages
-
transId
protected java.lang.String transId
Client transaction identifier
-
version
protected java.lang.String version
Override EPP version
-
language
protected java.lang.String language
Override EPP language
-
clientId
protected java.lang.String clientId
Client identifier to use in login.
-
password
protected java.lang.String password
Client password
-
newPassword
protected java.lang.String newPassword
New password to use
-
response
protected EPPResponse response
EPP response associated with last EPP command
-
responsePacket
protected byte[] responsePacket
EPP response packet associated with the last EPP command
-
services
protected java.util.Vector services
EPP services
-
extensionServices
protected java.util.Vector extensionServices
EPP extension services
-
connection
protected EPPClientCon connection
Session connection
-
inputStream
protected java.io.InputStream inputStream
Session input stream
-
outputStream
protected java.io.OutputStream outputStream
Session output stream
-
xmlStream
protected EPPXMLStream xmlStream
Used to read and write XML packets from/to streams.
-
pollOp
protected java.lang.String pollOp
Poll Operation Command
-
message
protected EPPMessage message
Message being sent
-
msgID
protected java.lang.String msgID
Message identifier associated with aEPPPollCmd.OP_ACK
poll command.
-
-
Constructor Detail
-
EPPSession
public EPPSession() throws EPPCommandException
Construct and initialize a new instance of EPPSession using the host name and port number defined inEPPEnv
.- Throws:
EPPCommandException
- Thrown if there's an error initializing theEPPSession
-
EPPSession
public EPPSession(java.lang.String aHostName, int aPortNumber) throws EPPCommandException
Construct and initialize a new instance ofEPPSession
with a specific host and port.- Parameters:
aHostName
- Host name or IP address of host to connect toaPortNumber
- Port number to connect to- Throws:
EPPCommandException
- Thrown if there's an error initializing theEPPSession
-
EPPSession
public EPPSession(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName) throws EPPCommandException
Construct and initialize a new instance ofEPPSession
with a specific server host, server port, client host name, and client port.- Parameters:
aHostName
- Host name or IP address of host to connect toaPortNumber
- Port number to connect toaClientHostName
- Host name or IP address to connect from- Throws:
EPPCommandException
- Thrown if there's an error initializing theEPPSession
-
EPPSession
public EPPSession(java.lang.String aHostName, int aPortNumber, EPPSSLContext aSSLContext) throws EPPCommandException
Construct and initialize a new instance ofEPPSession
with a specific host and port.- Parameters:
aHostName
- Host name or IP address of host to connect toaPortNumber
- Port number to connect toaSSLContext
- Optional specific SSL context to use- Throws:
EPPCommandException
- Thrown if there's an error initializing theEPPSession
-
EPPSession
public EPPSession(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName, EPPSSLContext aSSLContext) throws EPPCommandException
Construct and initialize a new instance ofEPPSession
with a specific server host, server port, client host name, and client port.- Parameters:
aHostName
- Host name or IP address of host to connect toaPortNumber
- Port number to connect toaClientHostName
- Host name or IP address to connect fromaSSLContext
- Optional specific SSL context to use- Throws:
EPPCommandException
- Thrown if there's an error initializing theEPPSession
-
-
Method Detail
-
init
protected void init() throws EPPCommandException
Initializes anEPPSession
using the defaultEPPEnv
properties, which will do the following:
- Gets concrete connection factory
- Makes connection to EPP Server
- Initialize the streams for XML processing
EPPSession.initSession
needs to be called to fully initialize a session with the EPP Server.- Throws:
EPPCommandException
- Thrown if there's an error initializing theEPPSession
-
init
protected void init(java.lang.String aHostName, int aPortNumber, EPPSSLContext aSSLContext) throws EPPCommandException
Initializes anEPPSession
to connect to a specific host and port, which will do the following:
- Gets concrete connection factory
- Makes connection to EPP Server
- Initialize the streams for XML processing
initSession()
needs to be called to fully initialize a session with the EPP Server.- Parameters:
aHostName
- Host name or IP address of host to connect toaPortNumber
- Port number to connect toaSSLContext
- Optional specific SSL context to use- Throws:
EPPCommandException
- Thrown if there's an error initializing theEPPSession
-
init
protected void init(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName, EPPSSLContext aSSLContext) throws EPPCommandException
Initializes anEPPSession
to connect to a specific server host, server port from a specific client host name/IP address. which will do the following:
- Gets concrete connection factory
- Makes connection to EPP Server
- Initialize the streams for XML processing
EPPSession.initSession
needs to be called to fully initialize a session with the EPP Server.- Parameters:
aHostName
- Host name or IP address of host to connect toaPortNumber
- Port number to connect toaClientHostName
- Host name or IP address to connect fromaSSLContext
- Optional specific SSL context to use- Throws:
EPPCommandException
- Thrown if there's an error initializing theEPPSession
-
getConnection
protected EPPClientCon getConnection() throws EPPCommandException
Gets the client connection. The connection needs to be initialized by calling theinitialize
methods of the returned connection.- Returns:
- Client connection
- Throws:
EPPCommandException
- Error creating the connection
-
initStreams
protected void initStreams() throws EPPCommandException
Initializes the input stream, output stream, and XML stream from the previously initialized client connection (connection
).- Throws:
EPPCommandException
- Error initializing streams
-
initLoginAdapter
protected void initLoginAdapter()
initialize the login adapter to use.
-
getLoginAdapter
public EPPLoginAdapter getLoginAdapter()
Gets theEPPLoginAdapter
set in theEPPSession
.- Returns:
- Set
EPPLoginAdapter
if defined;null
otherwise.
-
setLoginAdapter
public void setLoginAdapter(EPPLoginAdapter aLoginAdapter)
Sets theEPPLoginAdapter
. This must be set prior to callinginitSession()
.- Parameters:
aLoginAdapter
-EPPLoginAdapter
to use. Set tonull
to not use a login adapter.
-
login
protected void login() throws EPPCommandException
This methods does a session login. The following steps are followed:
- receives a greeting and processes it.
- sends login
- processed login response
- Throws:
EPPCommandException
- Error with login
-
hello
public EPPGreeting hello() throws EPPCommandException
Sends a Hello Command to the EPP Server. The EPP Greeting sent from the EPP Server will be returned.
- pre-condition - A connection has been established with the EPP Server
- post-condition - Error or the EPP Greeting sent by the EPP Server
- error condition - connection time out/ bad connection.
- Returns:
- Server greeting
- Throws:
EPPCommandException
- Unexpected error information
-
sendPoll
public EPPResponse sendPoll() throws EPPCommandException
This method creates an instance ofEPPPollCmd
and sets the given attributes and invokes the send method associated with the command.- Returns:
- the response from the poll command
- Throws:
EPPCommandException
- Error sending the poll command
-
logout
protected void logout() throws EPPCommandException
logout from the session.- Throws:
EPPCommandException
- Error sending the logout command
-
validateClientTransId
public void validateClientTransId(EPPCommand myCommand, EPPResponse response) throws EPPCommandException
Validates that the response client transaction identifier matches the command's client transaction identifier. Client transaction identifiers are optional, but if specified, need to be mirrored back in the response.- Parameters:
myCommand
- Command sentresponse
- Response received- Throws:
EPPCommandException
- transaction ids don't match
-
recDocument
public org.w3c.dom.Document recDocument() throws EPPCommandException
Gets an validated EPP DOM Document from the session input stream.- Returns:
- DOM
Document
instance read from stream - Throws:
EPPCommandException
- Error reading document from stream
-
sendMessage
public void sendMessage(EPPMessage aMessage) throws EPPCommandException
Sends an EPP Message (command, hello, etc.) to the session output stream. UsereadResponse()
orrecDocument()
to read the response if any from the session.- Parameters:
aMessage
- EPP Message to send to the session output stream- Throws:
EPPCommandException
- Error encoding or sending EPP message to the session output stream
-
sendDocument
public void sendDocument(org.w3c.dom.Document newDoc, EPPMessage aMessage) throws EPPCommandException
Sends an EPP DOM Document to the session output stream.- Parameters:
newDoc
- DOMDocument
instance to write to streamaMessage
- Message associated withnewDoc
that is used for packet logging logic. Set tonull
if unavailable.- Throws:
EPPCommandException
- Error writing document to stream
-
sendPacket
public void sendPacket(byte[] aPacket) throws EPPCommandException
Sends a pre-formatted packet to theEPPSession
output stream as an EPP packet with the 4 byte header.- Parameters:
aPacket
- Packet to send to theEPPSession
output stream- Throws:
EPPCommandException
- Error writing packet to the stream
-
processDocument
public EPPResponse processDocument(EPPCommand aCommand) throws EPPCommandException
Process anEPPCommand
instance by writing the command to the session output stream and reading anEPPResponse
instance from the sessin input stream.- Parameters:
aCommand
- Command to write to output stream- Returns:
- Response associated with passed in command
- Throws:
EPPCommandException
- error processing the command. This can include an error specified from the server or encountered while attempting to process the command. If the exception contains anEPPResponse
than it was a server specified error.
-
readResponse
public EPPResponse readResponse() throws EPPCommandException
Reads a response from the server. This method does no post-processing of the response, but simply reads the response from the connection, decodes it and returns the concreteEPPResponse
. Theresponse
attribute is set as a side-effect of callingreadResponse
so thatgetResponse()
can be called later.- Returns:
- Response from server
- Throws:
EPPCommandException
- Error reading or decoding the server response
-
processDocument
public EPPResponse processDocument(EPPCommand aCommand, java.lang.Class aExpectedResponse) throws EPPCommandException
Process anEPPCommand
instance by writing the command to the session output stream and reading anEPPResponse
instance from the sessin input stream and validate that theEPPResponse
is of the specified type.- Parameters:
aCommand
- Command to write to output streamaExpectedResponse
- Expected type ofEPPResponse
. IfaExpectedResponse
is non-null
and the response is not of the specified type, than anEPPCommandException
will be thrown.- Returns:
- Response associated with passed in command if mode is
MODE_SYNC
;null
otherwise. - Throws:
EPPCommandException
- error processing the command. This can include an error specified from the server or encountered while attempting to process the command. If the exception contains anEPPResponse
than it was a server specified error.
-
endSession
public void endSession() throws EPPCommandException
Ends a session by logging out from the server and closing the connection with the server.- Throws:
EPPCommandException
- Error ending session
-
endConnection
public void endConnection() throws EPPCommandException
Closes the connection with the server.- Throws:
EPPCommandException
- Error closing connection.
-
initSession
public void initSession() throws EPPCommandException
Initialize an authenticated session with the EPP Server.
The required attributes have been set with the following methods:
setClientID
- Sets the client idenfifier/user namesetPassword
- Sets the password
The optional attributes have been set with the following:
setNewPassword
- Changes the passwordsetVersion
- Override the default EPP version. A default setting is provided (i.e. 1.0).setLang
- Override the default language of "us".setServices
- Sets desired set of client EPP services by EPP XML Namespace. A default setting is automatically provided based on theEPP.MapFactories
configuration settingsetExtensions
- Sets desired set of client EPP services. This can be a subset of the EPP services loaded in the client. A default setting is automatically provided based on theEPP.ProtocolExtension
and theEPP.CmdRspExtensions
configuration settings.
- Throws:
EPPCommandException
- Error initializing the session.
-
getVersion
public java.lang.String getVersion()
Gets the EPP version used ininitSession
.- Returns:
- EPP version to use
-
setVersion
public void setVersion(java.lang.String newVersion)
Overrides the default EPP version used ininitSession
.- Parameters:
newVersion
- EPP version to use
-
setLang
public java.lang.String setLang()
Gets the language of "us" used byinitSession
.- Returns:
- Language following RFC3066 format
-
setLang
public void setLang(java.lang.String newLanguage)
Overrides the default language of "us" used byinitSession
.- Parameters:
newLanguage
- Language following RFC3066 format
-
getTransId
public java.lang.String getTransId()
Gets an optional client transaction identifier used when sending an EPP command (i.e. EPP <login> or EPP <logout>).- Returns:
- Client transaction identifier if defined;
null
otherwise.
-
setTransId
public void setTransId(java.lang.String newTransId)
Sets an optional client transaction identifier used when sending an EPP command (i.e. EPP <login> or EPP <logout>). It is recommended to use a unique transaction identifier per command.- Parameters:
newTransId
- Client transaction identifer
-
getResponse
public EPPResponse getResponse()
Gets response associated with the last command. For example, this could be the response associated with the EPP <login> command sent ininitSession
.- Returns:
- response if defined;
null
otherwise.
-
getInputStream
public java.io.InputStream getInputStream()
Gets the session input stream.- Returns:
- Session input stream if defined;
null
otherwise.
-
setInputStream
public void setInputStream(java.io.InputStream newInput)
Sets the input stream for the session. A default input stream is created in theEPPSession
constructor. It is recommended to use the default input stream.- Parameters:
newInput
- Input stream to use in session.
-
getOutputStream
public java.io.OutputStream getOutputStream()
Gets the session output stream.- Returns:
- Session output stream
-
getClientCon
public EPPClientCon getClientCon()
Gets the client connection used for theEPPSession
.- Returns:
- Client connection if defined;
null
otherwise
-
setOutputStream
public void setOutputStream(java.io.OutputStream newOutput)
Sets the output stream for the session. A default output stream is created in theEPPSession
constructor. It is recommended to use the default output stream.- Parameters:
newOutput
- Output stream to use in session.
-
getClientID
public java.lang.String getClientID()
Gets the client identifier/name used ininitSession
.- Returns:
- Client identifier
-
setClientID
public void setClientID(java.lang.String newClientID)
Sets the client identifier/name used ininitSession
.- Parameters:
newClientID
- Client identifier
-
getPassword
public java.lang.String getPassword()
Gets the client password used ininitSession
.- Returns:
- Client password
-
setPassword
public void setPassword(java.lang.String newPassword)
Sets the client password used ininitSession
.- Parameters:
newPassword
- Client password
-
getNewPassword
public java.lang.String getNewPassword()
Gets the new client password used ininitSession
.- Returns:
- New client password
-
setNewPassword
public void setNewPassword(java.lang.String newPassword)
Sets the new client password used ininitSession
.- Parameters:
newPassword
- New client password
-
setServices
public void setServices(java.lang.String[] newServiceNS) throws EPPCommandException
Set the services to use with this session by EPP XML namespace URIs. This must be called before callinginitSession
orlogin
. The default setting is to use all of the services loaded inEPPFactory
. This method allows a client to specify a subset of the services loaded in theEPPFactory
, which is useful for synchronizing with the services supported by a specific server. For example, to initialize a session that will manage domains,newServicesNS
would be set tonew String[]{"urn:iana:xml:ns:domain-1.0"}
. Only a subset of the services loaded in theEPPFactory
can be specified.- Parameters:
newServiceNS
- An array of EPP XML namespace URIs to use in sesssion- Throws:
EPPCommandException
- Invalid namespace specified.
-
setExtensions
public void setExtensions(java.util.Vector ProtocolExtensions, java.util.Vector CommandResponseExtensions) throws EPPCommandException
Set the Extension Services to use with this session by EPP XML namespace URIs. This must be called before callinginitSession
orlogin
. The default setting is to use all of the services loaded inEPPFactory
. This method allows a client to specify a subset of the extensionservices loaded in theEPPFactory
, which is useful for synchronizing with the extensionservices supported by a specific server. Either of the Paramerter ProtocolExtenions or the CommandResponseExtenisons can be null or both the parameteres can be null in which case there are no extenisons to be set.- Parameters:
ProtocolExtensions
- ProtocolExtensions An vector EPPPortocolExtension XML namespace URIs to use in sesssionCommandResponseExtensions
- CommandResponseExtensions An vector of CommandResponseExtension XML namespace URIs to use in session- Throws:
EPPCommandException
- Invalid namespace specified.
-
setPollOp
public void setPollOp(java.lang.String aOp)
Sets the poll operation to eitherOP_REQ
orOP_ACK
- Parameters:
aOp
-OP_REQ
orOP_ACK
.
-
getPollOp
public java.lang.String getPollOp()
Gets the poll operation, which should be eitherOP_REQ
orOP_ACK
- Returns:
- Either
OP_REQ
orOP_ACK
-
getStatusTransId
public java.lang.String getStatusTransId()
Gets the status client transaction identifier.- Returns:
- Status client transaction identifier if defined;
null
otherwise.
-
setStatusTransId
public void setStatusTransId(java.lang.String aStatusTrans)
Sets the status client transaction identifier.- Parameters:
aStatusTrans
- Status client transaction identifier.
-
getStatusCommandType
public java.lang.String getStatusCommandType()
Gets the status command type. The command type should be one of the validEPPCommand.TYPE_
constants.- Returns:
- Status status command type if defined;
null
otherwise.
-
setStatusCommandType
public void setStatusCommandType(java.lang.String aStatusCommandType)
Sets the status command type.- Parameters:
aStatusCommandType
- Status command type, which should be one of the following:
EPPCommand.TYPE_CREATE
EPPCommand.TYPE_DELETE
EPPCommand.TYPE_RENEW
EPPCommand.TYPE_TRANSFER
EPPCommand.TYPE_UPDATE
-
getMsgID
public java.lang.String getMsgID()
Gets the poll Message Id.- Returns:
- Message Id if defined; null otherwise.
-
setMsgID
public void setMsgID(java.lang.String aMsgID)
Sets the poll Message Id.- Parameters:
aMsgID
- Message Id
-
getMode
public int getMode()
Gets the command/response processing mode, which should be eitherMODE_SYNC
orMODE_ASYNC
.- Returns:
MODE_SYNC
orMODE_ASYNC
-
setMode
public int setMode(int aMode)
Sets the command/response processing mode to eitherMODE_SYNC
orMODE_ASYNC
.- Parameters:
aMode
-MODE_SYNC
orMODE_ASYNC
- Returns:
- Previous mode
-
isModeSupported
public boolean isModeSupported(int aMode)
Does the session support the specified modeMODE_SYNC
orMODE_ASYNC
? A derived class ofEPPSession
could support a subset of the modes, so this method is provide to provide the client with the ability to check whether a mode is supported.- Parameters:
aMode
-MODE_SYNC
orMODE_ASYNC
- Returns:
true
if supported;false
otherwise.
-
-