Class EPPPlainClientSocket
- java.lang.Object
-
- com.verisign.epp.transport.client.EPPPlainClientSocket
-
- All Implemented Interfaces:
EPPClientCon
- Direct Known Subclasses:
EPPPlainProxyClientSocket
public class EPPPlainClientSocket extends java.lang.Object implements EPPClientCon
Plain client socket class that can be configured to connect to a server over TCP using theEPP.ClientSocketName
configuration property. Creating theEPPPlainClientSocket
using one of the constructors that takes aEPPSSLContext
parameters will result in an error.
-
-
Constructor Summary
Constructors Constructor Description EPPPlainClientSocket()
Default constructor that gets the following settings fromEPPEnv
:
hostName
- Defined with theEPPEnv.getServerName()
method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closing the connection.protected java.lang.String
getClientHostName()
Gets the client host name to use for the connection.protected int
getConTimeout()
Gets the connection timeout setting.protected java.lang.String
getHostName()
Gets the host name or IP address to connect to.java.io.InputStream
getInputStream()
Gets the input stream of theSocket
connection.java.io.OutputStream
getOutputStream()
Gets the output stream of theSocket
connection.protected int
getPortNumber()
Gets the port number to connect to.protected java.net.Socket
getSocket()
Gets the enclosingSocket
of the connection.void
initialize()
Initializes an connection to the host and port defined by the server name and the server port properties ofEPPEnv
.void
initialize(java.lang.String aHostName, int aPortNumber, EPPSSLContext aSSLContext)
Initializes a SSL connection to a specific host and port.void
initialize(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName, EPPSSLContext aSSLContext)
Initializes a SSL connection to a specific host and port.protected boolean
isConnected()
Is the connection established?protected void
setClientHostName(java.lang.String aClientHostName)
Sets the client host name to use for the connection.protected void
setConnected(boolean aIsConnected)
Sets whether the connection is established.protected void
setConTimeout(int aConTimeout)
Sets the connection timeout setting.protected void
setHostName(java.lang.String aHostName)
Sets the host name or IP address to connect to.protected void
setInputStream(java.io.InputStream aInputStream)
Sets the input stream of theSocket
connection.protected void
setOutputStream(java.io.OutputStream aOutputStream)
Sets the output stream of theSocket
connection.protected void
setPortNumber(int aPortNumber)
Sets the port number to connect to.protected void
setSocket(java.net.Socket aSocket)
Sets theSocket
to use.
-
-
-
Constructor Detail
-
EPPPlainClientSocket
public EPPPlainClientSocket() throws EPPConException
Default constructor that gets the following settings fromEPPEnv
:
hostName
- Defined with theEPPEnv.getServerName()
method.portNumber
- Defined with theEPPEnv.getServerPort()
method.conTimeout
- Defined with theEPPEnv.getConTimeOut()
method.readTimeout
- Defined with theEPPEnv.getReadTimeOut()
method.clientHostName
- Defined with theEPPEnv.getClientHost()
method.
- Throws:
EPPConException
- If there is a problem getting the default connection properties fromEPPEnv
.
-
-
Method Detail
-
initialize
public void initialize() throws EPPConException
Initializes an connection to the host and port defined by the server name and the server port properties ofEPPEnv
.- Specified by:
initialize
in interfaceEPPClientCon
- Throws:
EPPConException
- Error initializing the connection.
-
initialize
public void initialize(java.lang.String aHostName, int aPortNumber, EPPSSLContext aSSLContext) throws EPPConException
Initializes a SSL connection to a specific host and port. There remainder of the connection settings is derived from theEPPEnv
properties.- Specified by:
initialize
in interfaceEPPClientCon
- Parameters:
aHostName
- Host name or IP address of host to connect toaPortNumber
- Port number to connect toaSSLContext
- If passed it will silently be ignored since SSL is not supported by this class- Throws:
EPPConException
- Error initializing the connection.
-
initialize
public void initialize(java.lang.String aHostName, int aPortNumber, java.lang.String aClientHostName, EPPSSLContext aSSLContext) throws EPPConException
Initializes a SSL connection to a specific host and port. There remainder of the connection settings is derived from theEPPEnv
properties.- Specified by:
initialize
in interfaceEPPClientCon
- 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
- If passed it will silently be ignored since SSL is not supported by this class- Throws:
EPPConException
- Error initializing the connection.
-
getInputStream
public java.io.InputStream getInputStream() throws EPPConException
Gets the input stream of theSocket
connection.- Specified by:
getInputStream
in interfaceEPPClientCon
- Returns:
InputStream
of the connectedSocket
- Throws:
EPPConException
- Input stream not set
-
setInputStream
protected void setInputStream(java.io.InputStream aInputStream)
Sets the input stream of theSocket
connection. This can only be set by a derived class to support tunneling and other extensions.- Parameters:
aInputStream
- Input stream to set
-
getOutputStream
public java.io.OutputStream getOutputStream() throws EPPConException
Gets the output stream of theSocket
connection.- Specified by:
getOutputStream
in interfaceEPPClientCon
- Returns:
OutputStream
of the connectedSocket
- Throws:
EPPConException
- Output stream not set
-
setOutputStream
protected void setOutputStream(java.io.OutputStream aOutputStream)
Sets the output stream of theSocket
connection. This can only be set by a derived class to support tunneling and other extensions.- Parameters:
aOutputStream
- Output stream to set
-
getSocket
protected java.net.Socket getSocket()
Gets the enclosingSocket
of the connection.- Returns:
- Gets the enclosing
Socket
if defined;null
otherwise.
-
setSocket
protected void setSocket(java.net.Socket aSocket)
Sets theSocket
to use.- Parameters:
aSocket
-Socket
to use
-
getClientHostName
protected java.lang.String getClientHostName()
Gets the client host name to use for the connection.- Returns:
- Client host name if set;
null
otherwise.
-
setClientHostName
protected void setClientHostName(java.lang.String aClientHostName)
Sets the client host name to use for the connection.- Parameters:
aClientHostName
- Client host name to use
-
getHostName
protected java.lang.String getHostName()
Gets the host name or IP address to connect to.- Returns:
- host name or IP address to connect to
-
setHostName
protected void setHostName(java.lang.String aHostName)
Sets the host name or IP address to connect to.- Parameters:
aHostName
- Host name or IP address to connect to
-
getPortNumber
protected int getPortNumber()
Gets the port number to connect to.- Returns:
- port number to connect to
-
setPortNumber
protected void setPortNumber(int aPortNumber)
Sets the port number to connect to.- Parameters:
aPortNumber
- Port number to connect to
-
getConTimeout
protected int getConTimeout()
Gets the connection timeout setting.- Returns:
- connection timeout
-
setConTimeout
protected void setConTimeout(int aConTimeout)
Sets the connection timeout setting.- Parameters:
aConTimeout
- connection timeout
-
isConnected
protected boolean isConnected()
Is the connection established?- Returns:
true
if connected;false
otherwise.
-
setConnected
protected void setConnected(boolean aIsConnected)
Sets whether the connection is established.- Parameters:
aIsConnected
-true
if connected;false
otherwise
-
close
public void close() throws EPPConException
Closing the connection.- Specified by:
close
in interfaceEPPClientCon
- Throws:
EPPConException
- Error closing the connection
-
-