Package gov.usgs.earthquake.distribution
Class AdminSocketServer
java.lang.Object
gov.usgs.util.DefaultConfigurable
gov.usgs.earthquake.distribution.AdminSocketServer
- All Implemented Interfaces:
Configurable
,SocketListenerInterface
Telnet to this socket to get a "command prompt".
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes socket with default thread pool size and portAdminSocketServer
(int port, int threads, ProductClient client) Initializes socket with custom port, threads, and client -
Method Summary
Modifier and TypeMethodDescriptionint
getPort()
int
void
Called with any sockets to be read.protected void
processLine
(String line, OutputStream out) Process a line of input.void
setClient
(ProductClient client) void
setPort
(int port) void
setThreads
(int threads) void
shutdown()
Stop any processing/background threads.void
startup()
Start any processing/background threads.Methods inherited from class gov.usgs.util.DefaultConfigurable
configure, getName, setName
-
Constructor Details
-
AdminSocketServer
public AdminSocketServer()Initializes socket with default thread pool size and port -
AdminSocketServer
Initializes socket with custom port, threads, and client- Parameters:
port
- Admind portthreads
- Thread pool sizeclient
- Product Client
-
-
Method Details
-
startup
Description copied from class:DefaultConfigurable
Start any processing/background threads.- Specified by:
startup
in interfaceConfigurable
- Overrides:
startup
in classDefaultConfigurable
- Throws:
Exception
- if exceptions occur while starting.
-
shutdown
Description copied from class:DefaultConfigurable
Stop any processing/background threads.- Specified by:
shutdown
in interfaceConfigurable
- Overrides:
shutdown
in classDefaultConfigurable
- Throws:
Exception
- if exceptions occur while starting.
-
processLine
Process a line of input.- Parameters:
line
- inputout
- write generated output to stream- Throws:
Exception
- if misconfigured or the client quits.
-
onSocket
Description copied from interface:SocketListenerInterface
Called with any sockets to be read.- Specified by:
onSocket
in interfaceSocketListenerInterface
- Parameters:
socket
- socket to be processed.
-
getPort
public int getPort()- Returns:
- port
-
setPort
public void setPort(int port) - Parameters:
port
- port number
-
getThreads
public int getThreads()- Returns:
- threads
-
setThreads
public void setThreads(int threads) - Parameters:
threads
- set number of threads
-
getClient
- Returns:
- product client
-
setClient
- Parameters:
client
- set product client
-