public class PingWorker
extends akka.actor.UntypedActor
Modifier and Type | Class and Description |
---|---|
private static class |
PingWorker.PingTask
thread to return the future.
|
Modifier and Type | Field and Description |
---|---|
private int |
actorMaxOperationTimeoutSec
The actor max operation timeout sec.
|
private java.lang.Throwable |
cause
The cause.
|
private static org.slf4j.Logger |
logger
The logger.
|
private PingMeta |
pingMeta
The ping meta.
|
private java.util.concurrent.Future<ResponseOnSingeRequest> |
responseFuture
The response future.
|
private akka.actor.ActorRef |
sender
The sender.
|
private boolean |
sentReply
The sent reply.
|
private java.lang.String |
targetHost
The target host.
|
private scala.concurrent.duration.FiniteDuration |
timeoutDuration
The timeout duration.
|
private akka.actor.Cancellable |
timeoutMessageCancellable
The timeout message cancellable.
|
private int |
tryCount
The try count.
|
Constructor and Description |
---|
PingWorker(int actorMaxOperationTimeoutSec,
PingMeta pingMeta,
java.lang.String targetHost)
Instantiates a new ping worker.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelCancellable()
Cancel cancellable.
|
static org.slf4j.Logger |
getLogger()
Gets the logger.
|
java.util.concurrent.Future<ResponseOnSingeRequest> |
getResponseFuture()
Gets the response future.
|
boolean |
isSentReply()
Checks if is sent reply.
|
void |
onComplete(ResponseOnSingeRequest pingResponse)
On complete.
|
void |
onReceive(java.lang.Object message) |
private void |
reply(java.lang.String response,
boolean failObtainResponse,
java.lang.String errorMessage,
java.lang.String stackTrace,
java.lang.String statusCode,
int statusCodeInt)
Reply.
|
static void |
setLogger(org.slf4j.Logger logger)
Sets the logger.
|
void |
setResponseFuture(java.util.concurrent.Future<ResponseOnSingeRequest> responseFuture)
Sets the response future.
|
void |
setSentReply(boolean sentReply)
Sets the sent reply.
|
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, getContext, getSelf, getSender, postRestart, postStop, preRestart, preStart, receive, self, sender, supervisorStrategy, unhandled
private static org.slf4j.Logger logger
private int actorMaxOperationTimeoutSec
private akka.actor.ActorRef sender
private java.lang.Throwable cause
private int tryCount
private akka.actor.Cancellable timeoutMessageCancellable
private scala.concurrent.duration.FiniteDuration timeoutDuration
private boolean sentReply
private java.lang.String targetHost
private PingMeta pingMeta
private java.util.concurrent.Future<ResponseOnSingeRequest> responseFuture
public PingWorker(int actorMaxOperationTimeoutSec, PingMeta pingMeta, java.lang.String targetHost)
actorMaxOperationTimeoutSec
- the actor max operation timeout secpingMeta
- the ping metatargetHost
- the target hostpublic void onReceive(java.lang.Object message) throws java.lang.Exception
onReceive
in class akka.actor.UntypedActor
java.lang.Exception
public void onComplete(ResponseOnSingeRequest pingResponse)
pingResponse
- the ssh responsepublic void cancelCancellable()
private void reply(java.lang.String response, boolean failObtainResponse, java.lang.String errorMessage, java.lang.String stackTrace, java.lang.String statusCode, int statusCodeInt)
response
- the responsefailObtainResponse
- the fail obtain responseerrorMessage
- the error messagestackTrace
- the stack tracestatusCode
- the status codestatusCodeInt
- the status code intpublic boolean isSentReply()
public void setSentReply(boolean sentReply)
sentReply
- the new sent replypublic java.util.concurrent.Future<ResponseOnSingeRequest> getResponseFuture()
public void setResponseFuture(java.util.concurrent.Future<ResponseOnSingeRequest> responseFuture)
responseFuture
- the new response futurepublic static org.slf4j.Logger getLogger()
public static void setLogger(org.slf4j.Logger logger)
logger
- the new logger