|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Session
Represents an SSH session
Nested Class Summary | |
---|---|
static class |
Session.AttributeKey<T>
Type safe key for storage within the user attributes of AbstractSession . |
Method Summary | ||
---|---|---|
void |
addListener(SessionListener listener)
Add a session |listener|. |
|
Buffer |
createBuffer(SshConstants.Message cmd,
int estimatedSize)
Create a new buffer for the specified SSH packet and reserve the needed space (5 bytes) for the packet header. |
|
void |
exceptionCaught(Throwable t)
Handle any exceptions that occured on this session. |
|
|
getAttribute(Session.AttributeKey<T> key)
Returns the value of the user-defined attribute of this session. |
|
FactoryManager |
getFactoryManager()
Retrieve the FactoryManager that has created this session |
|
int |
getIntProperty(String name,
int defaultValue)
Retrieve a configuration property as an integer |
|
String |
getUsername()
Retrieve the name of the user authenticated on this session or null if the session has not been authenticated yet. |
|
int |
registerChannel(Channel channel)
Register a newly created channel with a new unique identifier |
|
void |
removeListener(SessionListener listener)
Remove a session |listener|. |
|
|
setAttribute(Session.AttributeKey<T> key,
E value)
Sets a user-defined attribute. |
|
void |
unregisterChannel(Channel channel)
Remove this channel from the list of managed channels |
|
org.apache.mina.core.future.WriteFuture |
writePacket(Buffer buffer)
Encode and send the given buffer. |
Method Detail |
---|
<T> T getAttribute(Session.AttributeKey<T> key)
key
- the key of the attribute; must not be null.
<T,E extends T> T setAttribute(Session.AttributeKey<T> key, E value)
key
- the key of the attribute; must not be null.value
- the value of the attribute; must not be null.
String getUsername()
FactoryManager getFactoryManager()
int getIntProperty(String name, int defaultValue)
name
- the name of the propertydefaultValue
- the default value
Buffer createBuffer(SshConstants.Message cmd, int estimatedSize)
cmd
- the SSH commandestimatedSize
- estimated number of bytes the buffer will hold, 0 if unknown.
org.apache.mina.core.future.WriteFuture writePacket(Buffer buffer) throws IOException
buffer
- the buffer to encode and send
IOException
- if an error occured when encoding sending the packetvoid exceptionCaught(Throwable t)
SshException
.
t
- the exception to process
IOException
int registerChannel(Channel channel) throws Exception
channel
- the channel to register
Exception
void unregisterChannel(Channel channel)
channel
- the channelvoid addListener(SessionListener listener)
listener
- the session listener to addvoid removeListener(SessionListener listener)
listener
- the session listener to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |