public class SshWorker
extends akka.actor.UntypedActor
Modifier and Type | Class and Description |
---|---|
private static class |
SshWorker.SshTask
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 java.util.concurrent.Future<ResponseOnSingeRequest> |
responseFuture
The response future.
|
private akka.actor.ActorRef |
sender
The sender.
|
private boolean |
sentReply
The sent reply.
|
private SshMeta |
sshMeta
The ssh meta.
|
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 |
---|
SshWorker(int actorMaxOperationTimeoutSec,
SshMeta sshMeta,
java.lang.String targetHost)
Instantiates a new ssh 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 sshResponse)
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 SshMeta sshMeta
private java.lang.String targetHost
private java.util.concurrent.Future<ResponseOnSingeRequest> responseFuture
public SshWorker(int actorMaxOperationTimeoutSec, SshMeta sshMeta, java.lang.String targetHost)
actorMaxOperationTimeoutSec
- the actor max operation timeout secsshMeta
- the ssh 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 sshResponse)
sshResponse
- 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