EPP Client -- encapsulates all the connection and communication with the
EPP Server.
connect
public void connect()
throws epp_Exception,
UnknownHostException,
SocketException,
IOException
Connects to the EPP Server using previously set hostname and port.
It is recommended to use connectAndGetGreeting() to connect and
retrieve the EPPGreeting in one single call.
connect
public void connect(String epp_client_id,
String epp_password)
throws epp_Exception,
UnknownHostException,
SocketException,
IOException
Connects to the EPP Server using the given client id and password and
using the previously set EPP hostname and port.
It is recommended to use connectAndGetGreeting() to connect and
retrieve the EPPGreeting in one single call.
epp_client_id
- The EPP client idepp_password
- The password associated with the client id
connect
public void connect(String epp_host_name,
int epp_host_port)
throws epp_Exception,
UnknownHostException,
SocketException,
IOException
Connects to the EPP Server using the given hostname and port and
using the previously set client id and password.
It is recommended to use connectAndGetGreeting() to connect and
retrieve the EPPGreeting in one single call.
epp_host_name
- The EPP Hostname (eg. "host.domain.tld")epp_host_port
- The EPP port
connect
public void connect(String epp_host_name,
int epp_host_port,
String epp_client_id,
String epp_password)
throws epp_Exception,
UnknownHostException,
SocketException,
IOException
Connects to and logs into the EPP Server using the given hostname,
port, client id and password
It is recommended to use connectAndGetGreeting() to connect and
retrieve the EPPGreeting in one single call.
epp_host_name
- The EPP Hostname (eg. "host.domain.tld")epp_host_port
- The EPP portepp_client_id
- The EPP client idepp_password
- The password associated with the client id
connectAndGetGreeting
public epp_Greeting connectAndGetGreeting()
throws epp_Exception,
IOException,
epp_XMLException
Connects to the EPP Server using previously set hostname and port.
It also reads the epp_Greeting from the server and returns it
- org.openrtk.idl.epp02.epp_Greeting the greeting from the EPP Server
disconnect
public void disconnect()
throws IOException
Closes the connection to the EPP Server
getEPPClientID
public String getEPPClientID()
Accessor method for the client id. This value is also used
in the creation of the default EPPTransID
getEPPHostName
public String getEPPHostName()
Accessor method for the EPP Hostname
getEPPHostPort
public int getEPPHostPort()
Accessor method for the EPP Host port
getEPPPassword
public String getEPPPassword()
Accessor method for the password
getEPPTimeout
public int getEPPTimeout()
Accessor method for the EPP server timeout, in milliseconds
getGreeting
public epp_Greeting getGreeting()
throws epp_Exception,
epp_XMLException
Retrieves the greeting from the EPP Server and returns it.
This method is useful if a new connection is provided to the
EPPClient (eg. in the case of an SSL connection not using the
JSSE standard) and the greeting must be read separately.
- org.openrtk.idl.epp02.epp_Greeting the greeting from the EPP Server
getLang
public String getLang()
Accessor method for the lang
getLastNetTransaction
public long getLastNetTransaction()
Accessor method for the time of the last successfull
network transaction.
useful for tracking when a keepAlive (poll) transaction
needs to be sent.
getProtocol
public int getProtocol()
Accessor method for the protocol indicator
getVersion
public String getVersion()
Accessor method for the version
hello
public epp_Greeting hello()
throws epp_Exception,
epp_XMLException
Issues a hello request to the EPP Server.
This forces the server to respond with an epp_Greeting, which
is otherwise only sent on initial connections to the EPP Server.
- org.openrtk.idl.epp02.epp_Greeting the greeting from the EPP Server
isValid
public boolean isValid()
returns if the connections is valid.
A connection is valid if the following are true
- a coonection has been established to the server
- an I/O Error has not been thrown
- a login has been successfully completed
isVersionSentOnLogin
public boolean isVersionSentOnLogin()
Returns whether RTK version number will be send on Login.
- true in case RTK version number will be send on Login, else false
login
public void login(String client_tr_id)
throws epp_XMLException,
epp_Exception
Logs into the EPP Server using previously set client id and password
epp_XMLException
- if the request XML could not be built or if the response XML could not be parsed.epp_Exception
- if the EPP Server responded with an error code
login
public void login(String client_tr_id,
String new_password)
throws epp_XMLException,
epp_Exception
Logs into the EPP Server using the previously set client id, and password
If the new password is not null, it is also passed to the server to
change your EPP client password.
This method also includes domain, host and contact object/XML information
in the services section. If you wish to omit one of the standard
EPP objects (or add any based on registry extensions to EPP),
then you'll have to populate the EPPLogin command manually and call
processAction() yourself.
new_password
- The password associated with the client id. Use null if you do not want to change the password
epp_XMLException
- if the request XML could not be built or if the response XML could not be parsed.epp_Exception
- if the EPP Server responded with an error code
login
public void login(String client_tr_id,
String epp_client_id,
String epp_password)
throws epp_XMLException,
epp_Exception
Logs into the EPP Server using the given client id, password
epp_XMLException
- if the request XML could not be built or if the response XML could not be parsed.epp_Exception
- if the EPP Server responded with an error code
login
public void login(String client_tr_id,
String client_id,
String password,
String new_password)
throws epp_XMLException,
epp_Exception
Logs into the EPP Server using the given client id, password and
new password. Use this method if you want to change your EPP client
password in the server.
client_id
- The EPP client idpassword
- The password associated with the client idnew_password
- The password associated with the client id, use null if you do not want to change the password
epp_XMLException
- if the request XML could not be built or if the response XML could not be parsed.epp_Exception
- if the EPP Server responded with an error code
processXML
public String processXML(String request_xml)
throws epp_Exception
Method required by the epp_Action interface.
Sends raw XML to the server and returns the XML response.
- processXML in interface epp_SessionOperations
readFromServer
public String readFromServer()
throws epp_Exception
Reads a complete XML message from the EPP Server. You would normally
then use this XML string in an epp_Action.fromXML().
epp_Exception
- if there was a socket error in reading from the EPP Server
setEPPClientID
public void setEPPClientID(String value)
Accessor method for the client id. This value is also used
in the creation of the default EPPTransID
value
- The client is String
setEPPHostName
public void setEPPHostName(String value)
Accessor method for the EPP Hostname
value
- The hostname string (eg. "host.domain.tld" or "100.101.200.201")
setEPPHostPort
public void setEPPHostPort(int value)
Accessor method for the EPP Host port
value
- The int port value
setEPPPassword
public void setEPPPassword(String value)
Accessor method for the password
value
- The password String
setEPPTimeout
public void setEPPTimeout(int value)
Accessor method for the EPP server timeout, in milliseconds
value
- The int timeout value, in milliseconds
setLang
public void setLang(String value)
Accessor method for the lang
value
- The lang/locale String (eg. "fr_CA")
setProtocol
public void setProtocol(int value)
Accessor method for the protocol indicator
value
- int protocol indicator
setSocketToEPPServer
public void setSocketToEPPServer(Socket value)
throws epp_Exception,
UnknownHostException,
SocketException,
IOException
Bypass to the EPPClient's connect() methods. Allows a connection
to be established externally. Mostly useful if opting to not use JSSE
in favour of another SSL package. This method also sets the SO Timeout
to the value from getEPPTimeout().
value
- The Socket to the EPP Server
setVersion
public void setVersion(String value)
Accessor method for the version
value
- The version string
setVersionSentOnLogin
public void setVersionSentOnLogin(boolean send)
Set whether to send RTK version number on Login.
send
- if true RTK version number will be send in unspec section on
Login
writeToServer
public void writeToServer(String outbound_xml)
throws epp_Exception
Sends an XML string to the EPP Server
epp_Exception
- if there was a socket error in writing to the EPP Server.
The epp_Exception will contain a result with the cope epp_Session.RTK_COMMUNICATIONS_FAILURE