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.ObjectEPPSessionmanages a session with an EPP Server. An initialized instance ofEPPSessionis required for using any of the EPP interface classes (i.e.EPPDomain).EPPSessioncan 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.StringclientIdClient identifier to use in login.protected EPPCodeccodecEPP Codec used to encode and decode EPP messagesprotected EPPClientConconnectionSession connectionprotected java.util.VectorextensionServicesEPP extension servicesprotected java.io.InputStreaminputStreamSession input streamprotected java.lang.StringlanguageOverride EPP languageprotected EPPMessagemessageMessage being sentstatic intMODE_ASYNCAsynchronous mode contant in processing commands/responses, where for theprocessDocument(EPPCommand)will send the command and will not wait for the response.static intMODE_SYNCSynchronous mode constant in processing commands/responses, where for each command sent theEPPSessionwill immediately read for the response.protected java.lang.StringmsgIDMessage identifier associated with aEPPPollCmd.OP_ACKpoll command.protected java.lang.StringnewPasswordNew password to usestatic java.lang.StringOP_ACKPoll operation type indicating that the client has received a message and that the server can remove the message.static java.lang.StringOP_REQPoll operation type indicating that the client is requesting information from the server.protected java.io.OutputStreamoutputStreamSession output streamprotected java.lang.StringpasswordClient passwordprotected java.lang.StringpollOpPoll Operation Commandprotected EPPResponseresponseEPP response associated with last EPP commandprotected byte[]responsePacketEPP response packet associated with the last EPP commandprotected java.util.VectorservicesEPP servicesprotected java.lang.StringtransIdClient transaction identifierprotected java.lang.StringversionOverride EPP versionprotected EPPXMLStreamxmlStreamUsed 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 ofEPPSessionwith a specific host and port.EPPSession(java.lang.String aHostName, int aPortNumber, EPPSSLContext aSSLContext)Construct and initialize a new instance ofEPPSessionwith a specific host and port.EPPSession(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName)Construct and initialize a new instance ofEPPSessionwith 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 ofEPPSessionwith 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 voidendConnection()Closes the connection with the server.voidendSession()Ends a session by logging out from the server and closing the connection with the server.EPPClientCongetClientCon()Gets the client connection used for theEPPSession.java.lang.StringgetClientID()Gets the client identifier/name used ininitSession.protected EPPClientCongetConnection()Gets the client connection.java.io.InputStreamgetInputStream()Gets the session input stream.EPPLoginAdaptergetLoginAdapter()Gets theEPPLoginAdapterset in theEPPSession.intgetMode()Gets the command/response processing mode, which should be eitherMODE_SYNCorMODE_ASYNC.java.lang.StringgetMsgID()Gets the poll Message Id.java.lang.StringgetNewPassword()Gets the new client password used ininitSession.java.io.OutputStreamgetOutputStream()Gets the session output stream.java.lang.StringgetPassword()Gets the client password used ininitSession.java.lang.StringgetPollOp()Gets the poll operation, which should be eitherOP_REQorOP_ACKEPPResponsegetResponse()Gets response associated with the last command.java.lang.StringgetStatusCommandType()Gets the status command type.java.lang.StringgetStatusTransId()Gets the status client transaction identifier.java.lang.StringgetTransId()Gets an optional client transaction identifier used when sending an EPP command (i.e.java.lang.StringgetVersion()Gets the EPP version used ininitSession.EPPGreetinghello()Sends a Hello Command to the EPP Server.protected voidinit()Initializes anEPPSessionusing the defaultEPPEnvproperties, which will do the following:
Gets concrete connection factory Makes connection to EPP Server Initialize the streams for XML processing
EPPSession.initSessionneeds to be called to fully initialize a session with the EPP Server.protected voidinit(java.lang.String aHostName, int aPortNumber, EPPSSLContext aSSLContext)Initializes anEPPSessionto 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 voidinit(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName, EPPSSLContext aSSLContext)Initializes anEPPSessionto connect to a specific server host, server port from a specific client host name/IP address.protected voidinitLoginAdapter()initialize the login adapter to use.voidinitSession()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 voidinitStreams()Initializes the input stream, output stream, and XML stream from the previously initialized client connection (connection).booleanisModeSupported(int aMode)Does the session support the specified modeMODE_SYNCorMODE_ASYNC? A derived class ofEPPSessioncould 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 voidlogin()This methods does a session login.protected voidlogout()logout from the session.EPPResponseprocessDocument(EPPCommand aCommand)Process anEPPCommandinstance by writing the command to the session output stream and reading anEPPResponseinstance from the sessin input stream.EPPResponseprocessDocument(EPPCommand aCommand, java.lang.Class aExpectedResponse)Process anEPPCommandinstance by writing the command to the session output stream and reading anEPPResponseinstance from the sessin input stream and validate that theEPPResponseis of the specified type.EPPResponsereadResponse()Reads a response from the server.org.w3c.dom.DocumentrecDocument()Gets an validated EPP DOM Document from the session input stream.voidsendDocument(org.w3c.dom.Document newDoc, EPPMessage aMessage)Sends an EPP DOM Document to the session output stream.voidsendMessage(EPPMessage aMessage)Sends an EPP Message (command, hello, etc.) to the session output stream.voidsendPacket(byte[] aPacket)Sends a pre-formatted packet to theEPPSessionoutput stream as an EPP packet with the 4 byte header.EPPResponsesendPoll()This method creates an instance ofEPPPollCmdand sets the given attributes and invokes the send method associated with the command.voidsetClientID(java.lang.String newClientID)Sets the client identifier/name used ininitSession.voidsetExtensions(java.util.Vector ProtocolExtensions, java.util.Vector CommandResponseExtensions)Set the Extension Services to use with this session by EPP XML namespace URIs.voidsetInputStream(java.io.InputStream newInput)Sets the input stream for the session.java.lang.StringsetLang()Gets the language of "us" used byinitSession.voidsetLang(java.lang.String newLanguage)Overrides the default language of "us" used byinitSession.voidsetLoginAdapter(EPPLoginAdapter aLoginAdapter)Sets theEPPLoginAdapter.intsetMode(int aMode)Sets the command/response processing mode to eitherMODE_SYNCorMODE_ASYNC.voidsetMsgID(java.lang.String aMsgID)Sets the poll Message Id.voidsetNewPassword(java.lang.String newPassword)Sets the new client password used ininitSession.voidsetOutputStream(java.io.OutputStream newOutput)Sets the output stream for the session.voidsetPassword(java.lang.String newPassword)Sets the client password used ininitSession.voidsetPollOp(java.lang.String aOp)Sets the poll operation to eitherOP_REQorOP_ACKvoidsetServices(java.lang.String[] newServiceNS)Set the services to use with this session by EPP XML namespace URIs.voidsetStatusCommandType(java.lang.String aStatusCommandType)Sets the status command type.voidsetStatusTransId(java.lang.String aStatusTrans)Sets the status client transaction identifier.voidsetTransId(java.lang.String newTransId)Sets an optional client transaction identifier used when sending an EPP command (i.e.voidsetVersion(java.lang.String newVersion)Overrides the default EPP version used ininitSession.voidvalidateClientTransId(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 theEPPSessionwill 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_ACKpoll command.
-
-
Constructor Detail
-
EPPSession
public EPPSession() throws EPPCommandExceptionConstruct 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 EPPCommandExceptionConstruct and initialize a new instance ofEPPSessionwith 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 EPPCommandExceptionConstruct and initialize a new instance ofEPPSessionwith 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 EPPCommandExceptionConstruct and initialize a new instance ofEPPSessionwith 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 EPPCommandExceptionConstruct and initialize a new instance ofEPPSessionwith 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 EPPCommandExceptionInitializes anEPPSessionusing the defaultEPPEnvproperties, which will do the following:
- Gets concrete connection factory
- Makes connection to EPP Server
- Initialize the streams for XML processing
EPPSession.initSessionneeds 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 EPPCommandExceptionInitializes anEPPSessionto 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 EPPCommandExceptionInitializes anEPPSessionto 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.initSessionneeds 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 theinitializemethods of the returned connection.- Returns:
- Client connection
- Throws:
EPPCommandException- Error creating the connection
-
initStreams
protected void initStreams() throws EPPCommandExceptionInitializes 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 theEPPLoginAdapterset in theEPPSession.- Returns:
- Set
EPPLoginAdapterif defined;nullotherwise.
-
setLoginAdapter
public void setLoginAdapter(EPPLoginAdapter aLoginAdapter)
Sets theEPPLoginAdapter. This must be set prior to callinginitSession().- Parameters:
aLoginAdapter-EPPLoginAdapterto use. Set tonullto not use a login adapter.
-
login
protected void login() throws EPPCommandExceptionThis 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 ofEPPPollCmdand 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 EPPCommandExceptionlogout 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 EPPCommandExceptionGets an validated EPP DOM Document from the session input stream.- Returns:
- DOM
Documentinstance 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 EPPCommandExceptionSends an EPP DOM Document to the session output stream.- Parameters:
newDoc- DOMDocumentinstance to write to streamaMessage- Message associated withnewDocthat is used for packet logging logic. Set tonullif unavailable.- Throws:
EPPCommandException- Error writing document to stream
-
sendPacket
public void sendPacket(byte[] aPacket) throws EPPCommandExceptionSends a pre-formatted packet to theEPPSessionoutput stream as an EPP packet with the 4 byte header.- Parameters:
aPacket- Packet to send to theEPPSessionoutput stream- Throws:
EPPCommandException- Error writing packet to the stream
-
processDocument
public EPPResponse processDocument(EPPCommand aCommand) throws EPPCommandException
Process anEPPCommandinstance by writing the command to the session output stream and reading anEPPResponseinstance 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 anEPPResponsethan 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. Theresponseattribute is set as a side-effect of callingreadResponseso 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 anEPPCommandinstance by writing the command to the session output stream and reading anEPPResponseinstance from the sessin input stream and validate that theEPPResponseis of the specified type.- Parameters:
aCommand- Command to write to output streamaExpectedResponse- Expected type ofEPPResponse. IfaExpectedResponseis non-nulland the response is not of the specified type, than anEPPCommandExceptionwill be thrown.- Returns:
- Response associated with passed in command if mode is
MODE_SYNC;nullotherwise. - 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 anEPPResponsethan it was a server specified error.
-
endSession
public void endSession() throws EPPCommandExceptionEnds 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 EPPCommandExceptionCloses the connection with the server.- Throws:
EPPCommandException- Error closing connection.
-
initSession
public void initSession() throws EPPCommandExceptionInitialize 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.MapFactoriesconfiguration 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.ProtocolExtensionand theEPP.CmdRspExtensionsconfiguration 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;
nullotherwise.
-
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;
nullotherwise.
-
getInputStream
public java.io.InputStream getInputStream()
Gets the session input stream.- Returns:
- Session input stream if defined;
nullotherwise.
-
setInputStream
public void setInputStream(java.io.InputStream newInput)
Sets the input stream for the session. A default input stream is created in theEPPSessionconstructor. 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;
nullotherwise
-
setOutputStream
public void setOutputStream(java.io.OutputStream newOutput)
Sets the output stream for the session. A default output stream is created in theEPPSessionconstructor. 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 EPPCommandExceptionSet the services to use with this session by EPP XML namespace URIs. This must be called before callinginitSessionorlogin. 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,newServicesNSwould be set tonew String[]{"urn:iana:xml:ns:domain-1.0"}. Only a subset of the services loaded in theEPPFactorycan 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 EPPCommandExceptionSet the Extension Services to use with this session by EPP XML namespace URIs. This must be called before callinginitSessionorlogin. 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_REQorOP_ACK- Parameters:
aOp-OP_REQorOP_ACK.
-
getPollOp
public java.lang.String getPollOp()
Gets the poll operation, which should be eitherOP_REQorOP_ACK- Returns:
- Either
OP_REQorOP_ACK
-
getStatusTransId
public java.lang.String getStatusTransId()
Gets the status client transaction identifier.- Returns:
- Status client transaction identifier if defined;
nullotherwise.
-
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;
nullotherwise.
-
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_CREATEEPPCommand.TYPE_DELETEEPPCommand.TYPE_RENEWEPPCommand.TYPE_TRANSFEREPPCommand.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_SYNCorMODE_ASYNC.- Returns:
MODE_SYNCorMODE_ASYNC
-
setMode
public int setMode(int aMode)
Sets the command/response processing mode to eitherMODE_SYNCorMODE_ASYNC.- Parameters:
aMode-MODE_SYNCorMODE_ASYNC- Returns:
- Previous mode
-
isModeSupported
public boolean isModeSupported(int aMode)
Does the session support the specified modeMODE_SYNCorMODE_ASYNC? A derived class ofEPPSessioncould 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_SYNCorMODE_ASYNC- Returns:
trueif supported;falseotherwise.
-
-