public class ConnectionProtocol extends AsyncService
thread
ACCEPTING_SERVICE, messageStore, REQUESTING_SERVICE, startMode, state, transport
Constructor and Description |
---|
ConnectionProtocol()
Creates a new ConnectionProtocol object.
|
Modifier and Type | Method and Description |
---|---|
void |
addChannelFactory(java.lang.String channelName,
ChannelFactory cf) |
void |
allowGlobalRequest(java.lang.String requestName,
GlobalRequestHandler handler) |
protected void |
closeChannel(Channel channel) |
boolean |
containsChannelFactory(java.lang.String channelName) |
protected void |
freeChannel(Channel channel) |
protected int[] |
getAsyncMessageFilter()
Implement this method by returning the message ids of the asyncrounous
messages your implementation wants to receive.
|
boolean |
isConnected() |
protected void |
onGlobalRequest(java.lang.String requestName,
boolean wantReply,
byte[] requestData) |
protected void |
onMessageReceived(SshMessage msg)
Called by the service thread when an asyncronous message is received.
|
protected void |
onServiceAccept()
Called when the service is accepted by the remote server.
|
protected void |
onServiceInit(int startMode)
Called when the service is intialized.
|
protected void |
onServiceRequest() |
protected void |
onStop()
The service thread calls this method when the thread is exiting.
|
boolean |
openChannel(Channel channel) |
boolean |
openChannel(Channel channel,
ChannelEventListener eventListener) |
void |
removeChannelFactory(java.lang.String channelName) |
void |
sendChannelData(Channel channel,
byte[] data) |
void |
sendChannelEOF(Channel channel) |
void |
sendChannelExtData(Channel channel,
int extendedType,
byte[] data) |
protected void |
sendChannelFailure(Channel channel) |
protected void |
sendChannelOpenConfirmation(Channel channel) |
protected void |
sendChannelOpenFailure(long remoteChannelId,
long reasonCode,
java.lang.String additionalInfo,
java.lang.String languageTag) |
boolean |
sendChannelRequest(Channel channel,
java.lang.String requestType,
boolean wantReply,
byte[] requestData) |
void |
sendChannelRequestFailure(Channel channel) |
void |
sendChannelRequestSuccess(Channel channel) |
void |
sendChannelWindowAdjust(Channel channel,
long bytesToAdd) |
byte[] |
sendGlobalRequest(java.lang.String requestName,
boolean wantReply,
byte[] requestData) |
protected void |
sendGlobalRequestFailure() |
protected void |
sendGlobalRequestSuccess(byte[] requestData) |
onStart, run
getServiceName, getState, init, sendServiceAccept, start, stop
public ConnectionProtocol()
public void addChannelFactory(java.lang.String channelName, ChannelFactory cf) throws java.io.IOException
channelName
- cf
- java.io.IOException
public void removeChannelFactory(java.lang.String channelName)
channelName
- public boolean containsChannelFactory(java.lang.String channelName)
channelName
- public void allowGlobalRequest(java.lang.String requestName, GlobalRequestHandler handler)
requestName
- handler
- public boolean openChannel(Channel channel) throws java.io.IOException
channel
- java.io.IOException
public boolean isConnected()
public boolean openChannel(Channel channel, ChannelEventListener eventListener) throws java.io.IOException
channel
- eventListener
- java.io.IOException
SshException
protected void onStop()
AsyncService
The service thread calls this method when the thread is exiting.
onStop
in class AsyncService
public void sendChannelData(Channel channel, byte[] data) throws java.io.IOException
channel
- data
- java.io.IOException
public void sendChannelEOF(Channel channel) throws java.io.IOException
channel
- java.io.IOException
public void sendChannelExtData(Channel channel, int extendedType, byte[] data) throws java.io.IOException
channel
- extendedType
- data
- java.io.IOException
public boolean sendChannelRequest(Channel channel, java.lang.String requestType, boolean wantReply, byte[] requestData) throws java.io.IOException
channel
- requestType
- wantReply
- requestData
- java.io.IOException
SshException
public void sendChannelRequestFailure(Channel channel) throws java.io.IOException
channel
- java.io.IOException
public void sendChannelRequestSuccess(Channel channel) throws java.io.IOException
channel
- java.io.IOException
public void sendChannelWindowAdjust(Channel channel, long bytesToAdd) throws java.io.IOException
channel
- bytesToAdd
- java.io.IOException
public byte[] sendGlobalRequest(java.lang.String requestName, boolean wantReply, byte[] requestData) throws java.io.IOException
requestName
- wantReply
- requestData
- java.io.IOException
SshException
protected int[] getAsyncMessageFilter()
AsyncService
Implement this method by returning the message ids of the asyncrounous messages your implementation wants to receive.
getAsyncMessageFilter
in class AsyncService
protected void closeChannel(Channel channel) throws java.io.IOException
channel
- java.io.IOException
protected void onGlobalRequest(java.lang.String requestName, boolean wantReply, byte[] requestData) throws java.io.IOException
requestName
- wantReply
- requestData
- java.io.IOException
protected void onMessageReceived(SshMessage msg) throws java.io.IOException
AsyncService
Called by the service thread when an asyncronous message is received.
onMessageReceived
in class AsyncService
msg
- java.io.IOException
protected void onServiceAccept()
Service
Called when the service is accepted by the remote server.
onServiceAccept
in class Service
protected void onServiceInit(int startMode) throws java.io.IOException
Service
Called when the service is intialized.
onServiceInit
in class Service
startMode
- java.io.IOException
protected void onServiceRequest()
onServiceRequest
in class Service
protected void sendChannelFailure(Channel channel) throws java.io.IOException
channel
- java.io.IOException
protected void sendChannelOpenConfirmation(Channel channel) throws java.io.IOException
channel
- java.io.IOException
protected void sendChannelOpenFailure(long remoteChannelId, long reasonCode, java.lang.String additionalInfo, java.lang.String languageTag) throws java.io.IOException
remoteChannelId
- reasonCode
- additionalInfo
- languageTag
- java.io.IOException
protected void sendGlobalRequestFailure() throws java.io.IOException
java.io.IOException
protected void sendGlobalRequestSuccess(byte[] requestData) throws java.io.IOException
requestData
- java.io.IOException
protected void freeChannel(Channel channel)
channel
- Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.