public abstract class

AbstractService

extends Object
implements Service
java.lang.Object
   ↳ net.schmizz.sshj.AbstractService
Known Direct Subclasses

Class Overview

An abstract class for Service that implements common or default functionality.

Summary

Fields
protected final Logger log Logger
protected final String name Assigned name of this service
protected int timeout Timeout for blocking operations
protected final Transport trans Transport layer
Public Constructors
AbstractService(String name, Transport trans)
Public Methods
String getName()
int getTimeout()
void handle(Message msg, SSHPacket buf)
Delegate handling of some SSH packet to this object.
void notifyError(SSHException error)
Notifies this object of an error.
void notifyUnimplemented(long seqNum)
Notifies this service that a SSH_MSG_UNIMPLEMENTED was received for packet with given sequence number.
void request()
Request and install this service with the associated transport.
void setTimeout(int timeout)
[Expand]
Inherited Methods
From class java.lang.Object
From interface net.schmizz.sshj.Service
From interface net.schmizz.sshj.common.ErrorNotifiable
From interface net.schmizz.sshj.common.SSHPacketHandler

Fields

protected final Logger log

Logger

protected final String name

Assigned name of this service

protected int timeout

Timeout for blocking operations

protected final Transport trans

Transport layer

Public Constructors

public AbstractService (String name, Transport trans)

Parameters
name
trans

Public Methods

public String getName ()

public int getTimeout ()

public void handle (Message msg, SSHPacket buf)

Delegate handling of some SSH packet to this object.

Parameters
msg The SSH message identifier
buf SSHPacket containing rest of the request
Throws
SSHException

public void notifyError (SSHException error)

Notifies this object of an error.

Parameters
error

public void notifyUnimplemented (long seqNum)

Notifies this service that a SSH_MSG_UNIMPLEMENTED was received for packet with given sequence number. Meant to be invoked as a callback by the transport layer.

Parameters
seqNum Sequence number of the packet which the server claims is unimplemented
Throws
SSHException

public void request ()

Request and install this service with the associated transport. Implementations should aim to make this method idempotent by first checking the getService() currently active service}.

public void setTimeout (int timeout)

Parameters
timeout