public class EPPSSLServer extends java.lang.Object implements EPPServerCon
EPPServerCon
interface and handles SSL communication with a SSL client.Constructor and Description |
---|
EPPSSLServer()
Creates an
EPPSSLServer that initializes
the SSL configuration and gets the port number to listen
on. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closing the server socket
|
protected java.lang.String |
getSSLPropertyListString(java.lang.String[] aList)
Gets an SSL property list as a string for logging purposes.
|
boolean |
isListening()
Is the server actively listening for connections?
|
void |
loop()
Run the accept loop, where the server will continue
listening while the listening flag is
true as
defined by the getListening and the
setListening(boolean) methods. |
void |
RunServer(ServerEventHandler aHandler)
Starts the server by creating the SSL server socket and
going into connection accept loop.
|
void |
setListening(boolean aListening)
Sets the server listing property that can be used
to stop the server from listening for new connections.
|
public EPPSSLServer() throws EPPConException
EPPSSLServer
that initializes
the SSL configuration and gets the port number to listen
on. The server will listen on all interfaces.EPPConException
- Error initializing SSL serverprotected java.lang.String getSSLPropertyListString(java.lang.String[] aList)
aList
- Array
of String
's.String
representing the property
list if aList
is not null
;
null
otherwisepublic void RunServer(ServerEventHandler aHandler) throws EPPConException
RunServer
in interface EPPServerCon
aHandler
- Connection handlerEPPConException
- Error creating server socketpublic void loop() throws EPPConException
true
as
defined by the getListening
and the
setListening(boolean)
methods. Inside the
loop, the server will accept a client connection and
spawn a new thread to handle the connection.EPPConException
- Any error with accepting
or handling a client connectionpublic void close() throws EPPConException
EPPConException
- Error closing the server socketpublic boolean isListening()
public void setListening(boolean aListening)
aListening
- false
to stop the server
from listening to new connections.