class AdminPortTask extends AbstractTask
Modifier and Type | Field and Description |
---|---|
private static Logger |
LOGGER
Logger instance for this class.
|
private StatusResult |
result
Server administration port status check result.
|
private String |
TASK_NAME
Task name for logging purposes.
|
(package private) int |
timeout
Socked connecting timeout [ms].
|
private String |
TM_SUFFIX
Log message identifier suffix when using message with timestamp.
|
private long |
tmStart
Task start time.
|
cancelled, job, stateListeners, task, type
Constructor and Description |
---|
AdminPortTask(StatusJob job,
StatusJob.Task task,
int timeout)
Creates an instance of administration port status check.
|
Modifier and Type | Method and Description |
---|---|
private void |
closeSocket(Socket socket)
Close socket and handle
IOException that could
be thrown. |
(package private) StatusResult |
getResult()
Get last command task execution result.
|
private void |
handleIOException(IOException ioe,
String host,
int port,
String method,
String message)
Handle IO Exception caught in server administration port verification
task.
|
void |
run()
Thread main method to be executed.
|
(package private) String[] |
stateChangeArgs(String exMessage)
Build arguments for operationStateChanged method listening for state
changes.
|
(package private) static String |
tm(long tm)
Format time value in miliseconds to be printed as value in seconds
and miliseconds
s.ms |
cancel, handleStateChange
private static final Logger LOGGER
private final String TM_SUFFIX
private final String TASK_NAME
int timeout
private StatusResult result
private long tmStart
-1
means that start time was not set.AdminPortTask(StatusJob job, StatusJob.Task task, int timeout)
job
- Server status check job internal data.task
- Individual status check task data.timeout
- Socked connecting timeout.static String tm(long tm)
s.ms.
tm
- Time value in milisecondss.ms.
StatusResult getResult()
String[] stateChangeArgs(String exMessage)
false
display argument to operationStateChanged method
to not display GUI message about this event.
exMessage
- Exception message.private void closeSocket(Socket socket)
IOException
that could
be thrown.
socket
- Socket to be closed.private void handleIOException(IOException ioe, String host, int port, String method, String message)
ioe
- IOException
caught.host
- Server administration host.port
- Server administration port.message
- Message to be logged. Shall not be null
.public void run()
Copyright © 2013. All Rights Reserved.