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 TypeMethodDescriptionintgetPort()intvoidCalled with any sockets to be read.protected voidprocessLine(String line, OutputStream out) Process a line of input.voidsetClient(ProductClient client) voidsetPort(int port) voidsetThreads(int threads) voidshutdown()Stop any processing/background threads.voidstartup()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:DefaultConfigurableStart any processing/background threads.- Specified by:
startupin interfaceConfigurable- Overrides:
startupin classDefaultConfigurable- Throws:
Exception- if exceptions occur while starting.
-
shutdown
Description copied from class:DefaultConfigurableStop any processing/background threads.- Specified by:
shutdownin interfaceConfigurable- Overrides:
shutdownin 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:SocketListenerInterfaceCalled with any sockets to be read.- Specified by:
onSocketin 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
-