com.maverick.sshd
Class ConnectionProtocol

java.lang.Object
  extended bycom.maverick.sshd.ConnectionProtocol
All Implemented Interfaces:
com.maverick.sshd.Service

public class ConnectionProtocol
extends java.lang.Object
implements com.maverick.sshd.Service

This class implements the SSH Connection Protocol as an SSH Transport Protocol service.

Author:
Lee David Painter

Method Summary
 void addGlobalRequestHandler(GlobalRequestHandler handler)
           
 void disconnect()
          Disconnect the current connection.
 SshContext getContext()
          Get the connections ConfigurationContext.
 java.net.InetAddress getLocalAddress()
          Get the local address to which the remote socket is connected.
 int getLocalPort()
          Get the local port ro which the remote socket is connected.
 int getQueueSize()
           
 java.net.SocketAddress getRemoteAddress()
          Get the address of the remote client.
 byte[] getSessionIdentifier()
           
 TransportProtocol getTransport()
          Get the underlying transport.
 java.lang.String getUsername()
          Get the username for the connected user.
 void init(TransportProtocol transport)
          Initialize the service.
 boolean openChannel(Channel channel)
           
 boolean processMessage(byte[] msg)
          Process a transport message.
 void sendChannelOpenConfirmation(Channel channel, byte[] responsedata)
           
 void sendChannelOpenFailure(Channel channel, int reason, java.lang.String desc)
           
 void sendGlobalRequest(com.maverick.ssh2.GlobalRequest request)
           
 void start()
          Start the service.
 void stop()
          Stop the service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public void init(TransportProtocol transport)
          throws java.io.IOException
Description copied from interface: com.maverick.sshd.Service
Initialize the service.

Specified by:
init in interface com.maverick.sshd.Service
Parameters:
transport -
Throws:
java.io.IOException

addGlobalRequestHandler

public void addGlobalRequestHandler(GlobalRequestHandler handler)

getRemoteAddress

public java.net.SocketAddress getRemoteAddress()
Get the address of the remote client.

Returns:
SocketAddress

getLocalAddress

public java.net.InetAddress getLocalAddress()
Get the local address to which the remote socket is connected.

Returns:
InetAddress

getLocalPort

public int getLocalPort()
Get the local port ro which the remote socket is connected.

Returns:
int

getUsername

public java.lang.String getUsername()
Get the username for the connected user.

Returns:
String

stop

public void stop()
Description copied from interface: com.maverick.sshd.Service
Stop the service

Specified by:
stop in interface com.maverick.sshd.Service

getSessionIdentifier

public byte[] getSessionIdentifier()

openChannel

public boolean openChannel(Channel channel)

disconnect

public void disconnect()
Disconnect the current connection.


processMessage

public boolean processMessage(byte[] msg)
                       throws java.io.IOException
Description copied from interface: com.maverick.sshd.Service
Process a transport message. When a message is received by the TransportProtocol that is not a transport level message the message is passed onto the active service using this method. The service processes the message and returns a value to indicate whether the message was used.

Specified by:
processMessage in interface com.maverick.sshd.Service
Parameters:
msg -
Returns:
true if the message was processed, otherwise false
Throws:
java.io.IOException

sendGlobalRequest

public void sendGlobalRequest(com.maverick.ssh2.GlobalRequest request)

getQueueSize

public int getQueueSize()

sendChannelOpenConfirmation

public void sendChannelOpenConfirmation(Channel channel,
                                        byte[] responsedata)

sendChannelOpenFailure

public void sendChannelOpenFailure(Channel channel,
                                   int reason,
                                   java.lang.String desc)

getContext

public SshContext getContext()
Get the connections ConfigurationContext.

Returns:
SshContext

getTransport

public TransportProtocol getTransport()
Get the underlying transport. Use with Caution.

Returns:
TransportProtocol

start

public void start()
Description copied from interface: com.maverick.sshd.Service
Start the service.

Specified by:
start in interface com.maverick.sshd.Service


Copyright © 2003-2008 SSHTools LTD. All Rights Reserved.