Package net.schmizz.sshj
Class AbstractService
java.lang.Object
net.schmizz.sshj.AbstractService
- All Implemented Interfaces:
ErrorNotifiable
,SSHPacketHandler
,Service
- Direct Known Subclasses:
ConnectionImpl
,TransportImpl.NullService
,UserAuthImpl
An abstract class for
Service
that implements common or default functionality.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.schmizz.sshj.common.ErrorNotifiable
ErrorNotifiable.Util
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()
void
Delegate handling of some SSH packet to this object.void
notifyError
(SSHException error) Notifies this object of anerror
.void
notifyUnimplemented
(long seqNum) Notifies this service that aSSH_MSG_UNIMPLEMENTED
was received for packet with given sequence number.void
request()
Request and install this service with the associated transport.
-
Field Details
-
log
protected final org.slf4j.Logger logLogger -
name
Assigned name of this service -
trans
Transport layer
-
-
Constructor Details
-
AbstractService
-
-
Method Details
-
getName
-
handle
Description copied from interface:SSHPacketHandler
Delegate handling of some SSH packet to this object.- Specified by:
handle
in interfaceSSHPacketHandler
- Parameters:
msg
- the SSHmessage identifier
buf
-SSHPacket
containing rest of the request- Throws:
SSHException
- if there is a non-recoverable error
-
notifyError
Description copied from interface:ErrorNotifiable
Notifies this object of anerror
.- Specified by:
notifyError
in interfaceErrorNotifiable
-
notifyUnimplemented
Description copied from interface:Service
Notifies this service that aSSH_MSG_UNIMPLEMENTED
was received for packet with given sequence number. Meant to be invoked as a callback by the transport layer.- Specified by:
notifyUnimplemented
in interfaceService
- Parameters:
seqNum
- sequence number of the packet which the server claims is unimplemented- Throws:
SSHException
- if the packet is unexpected and may represent a disruption
-
request
Description copied from interface:Service
Request and install this service with the associated transport. Implementations should aim to make this method idempotent by first checking theTransport.getService()
currently active service}.- Specified by:
request
in interfaceService
- Throws:
TransportException
- if there is an error sending the service request
-