public abstract class AbstractService extends java.lang.Object implements Service
Service
that implements common or default functionality.ErrorNotifiable.Util
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log
Logger
|
protected java.lang.String |
name
Assigned name of this service
|
protected Transport |
trans
Transport layer
|
Constructor and Description |
---|
AbstractService(java.lang.String name,
Transport trans) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
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.
|
protected final org.slf4j.Logger log
protected final java.lang.String name
protected final Transport trans
public AbstractService(java.lang.String name, Transport trans)
public java.lang.String getName()
public void handle(Message msg, SSHPacket buf) throws SSHException
SSHPacketHandler
handle
in interface SSHPacketHandler
msg
- the SSH message identifier
buf
- SSHPacket
containing rest of the requestSSHException
- if there is a non-recoverable errorpublic void notifyError(SSHException error)
ErrorNotifiable
error
.notifyError
in interface ErrorNotifiable
public void notifyUnimplemented(long seqNum) throws SSHException
Service
SSH_MSG_UNIMPLEMENTED
was received for packet with given sequence number.
Meant to be invoked as a callback by the transport layer.notifyUnimplemented
in interface Service
seqNum
- sequence number of the packet which the server claims is unimplementedSSHException
- if the packet is unexpected and may represent a disruptionpublic void request() throws TransportException
Service
Transport.getService()
currently active
service}.request
in interface Service
TransportException
- if there is an error sending the service request