Class CurrentService
java.lang.Object
org.apache.sshd.common.session.helpers.CurrentService
- Direct Known Subclasses:
ClientSessionImpl.Services
Holds the current SSH service for a
Session.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Serviceprotected final SessionThe session thisCurrentServicebelongs to. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCurrentService(Session session) Creates a newCurrentServiceinstance belonging to the givenSession. -
Method Summary
-
Field Details
-
session
The session thisCurrentServicebelongs to. -
currentName
-
currentService
-
-
Constructor Details
-
CurrentService
Creates a newCurrentServiceinstance belonging to the givenSession.- Parameters:
session-Sessionthe instance belongs to
-
-
Method Details
-
getName
Retrieves the name of the current service.- Returns:
- the name, or
nullif none is set
-
getService
Retrieves the current service.- Returns:
- the current service, or
nullif none is set
-
set
Sets the current service and its name, and optionally starts the service.- Parameters:
service-Serviceto setname- Name of the service (the name of theServiceFactorythat created it)start- whether to start the service
-
start
public void start()Starts the current service. -
process
Processes a service request.- Parameters:
cmd- the commandbuffer- the data received with the command- Returns:
trueif a current service is set,falseif no current service exists- Throws:
Exception- when the current service fails
-