Top Fields Constructors Methods
org.apache.sshd.server

public Class StandardEnvironment

extends AbstractLoggingBean
implements Environment
Class Inheritance
All Implemented Interfaces
org.apache.sshd.server.Environment
Imports
java.util.Collection, .Map, java.util.concurrent.ConcurrentHashMap, .CopyOnWriteArraySet, org.apache.sshd.common.channel.Channel, .PtyMode, org.apache.sshd.common.util.GenericUtils, .ValidateUtils, org.apache.sshd.common.util.logging.AbstractLoggingBean

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final Map<String, String>
private final Map<Signal, Collection<SignalListener>>
private final Map<PtyMode, Integer>
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addSignalListener(SignalListener
the SignalListener to register
listener
,
Collection<Signal>
the Signals the listener is interested in
signals
)

Implements org.apache.sshd.server.Environment.addSignalListener.

Add a qualified listener for the specific signals

public Map<String, String>
getEnv()

Implements org.apache.sshd.server.Environment.getEnv.

Retrieve the environment map

public Map<PtyMode, Integer>
getPtyModes()

Implements org.apache.sshd.server.Environment.getPtyModes.

Retrieve the PTY modes settings

protected Collection<SignalListener>

Returns:

The Collection of listeners registered for the signal - may be null in case create is false
getSignalListeners
(Signal
The specified Signal
signal
,
boolean
If true and no current listeners are mapped then creates a new Collection
create
)

Retrieves the set of listeners registered for a signal

public void
removeSignalListener(SignalListener
the SignalListener to remove
listener
)

Implements org.apache.sshd.server.Environment.removeSignalListener.

Remove a previously registered listener for all the signals it was registered

public void
set(String
environment variable name - never null/empty
key
,
String
environment variable value
value
)

Adds a variable to the environment.

public void
signal(Channel channel, Signal signal)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

envback to summary
private final Map<String, String> env
listenersback to summary
private final Map<Signal, Collection<SignalListener>> listeners
ptyModesback to summary
private final Map<PtyMode, Integer> ptyModes

Constructor Detail

StandardEnvironmentback to summary
public StandardEnvironment()

Method Detail

addSignalListenerback to summary
public void addSignalListener(SignalListener listener, Collection<Signal> signals)

Implements org.apache.sshd.server.Environment.addSignalListener.

Doc from org.apache.sshd.server.Environment.addSignalListener.

Add a qualified listener for the specific signals

Parameters
listener:SignalListener

the SignalListener to register

signals:Collection<Signal>

the Signals the listener is interested in

Annotations
@Override
getEnvback to summary
public Map<String, String> getEnv()

Implements org.apache.sshd.server.Environment.getEnv.

Doc from org.apache.sshd.server.Environment.getEnv.

Retrieve the environment map

Returns:Map<String, String>

the environment Map - never null

Annotations
@Override
getPtyModesback to summary
public Map<PtyMode, Integer> getPtyModes()

Implements org.apache.sshd.server.Environment.getPtyModes.

Doc from org.apache.sshd.server.Environment.getPtyModes.

Retrieve the PTY modes settings

Returns:Map<PtyMode, Integer>

the Map of PtyModes - never null

Annotations
@Override
getSignalListenersback to summary
protected Collection<SignalListener> getSignalListeners(Signal signal, boolean create)

Retrieves the set of listeners registered for a signal

Parameters
signal:Signal

The specified Signal

create:boolean

If true and no current listeners are mapped then creates a new Collection

Returns:Collection<SignalListener>

The Collection of listeners registered for the signal - may be null in case create is false

removeSignalListenerback to summary
public void removeSignalListener(SignalListener listener)

Implements org.apache.sshd.server.Environment.removeSignalListener.

Doc from org.apache.sshd.server.Environment.removeSignalListener.

Remove a previously registered listener for all the signals it was registered

Parameters
listener:SignalListener

the SignalListener to remove

Annotations
@Override
setback to summary
public void set(String key, String value)

Adds a variable to the environment. This method is called set according to the name of the appropriate posix command set

Parameters
key:String

environment variable name - never null/empty

value:String

environment variable value

signalback to summary
public void signal(Channel channel, Signal signal)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override