public abstract class AbstractService extends 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 String |
name
Assigned name of this service
|
protected Transport |
trans
Transport layer
|
| Constructor and Description |
|---|
AbstractService(String name,
Transport trans) |
| Modifier and Type | Method and Description |
|---|---|
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 String name
protected final Transport trans
public String getName()
public void handle(Message msg, SSHPacket buf) throws SSHException
SSHPacketHandlerhandle in interface SSHPacketHandlermsg - the SSH message identifierbuf - SSHPacket containing rest of the requestSSHException - if there is a non-recoverable errorpublic void notifyError(SSHException error)
ErrorNotifiableerror.notifyError in interface ErrorNotifiablepublic void notifyUnimplemented(long seqNum)
throws SSHException
ServiceSSH_MSG_UNIMPLEMENTED was received for packet with given sequence number.
Meant to be invoked as a callback by the transport layer.notifyUnimplemented in interface ServiceseqNum - 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
ServiceTransport.getService() currently active
service}.request in interface ServiceTransportException - if there is an error sending the service requestCopyright © 2009–2014. All rights reserved.