public class ConnectionProtocol extends AsyncService
threadACCEPTING_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, rungetServiceName, getState, init, sendServiceAccept, start, stoppublic ConnectionProtocol()
public void addChannelFactory(java.lang.String channelName,
ChannelFactory cf)
throws java.io.IOException
channelName - cf - java.io.IOExceptionpublic 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.IOExceptionpublic boolean isConnected()
public boolean openChannel(Channel channel, ChannelEventListener eventListener) throws java.io.IOException
channel - eventListener - java.io.IOExceptionSshExceptionprotected void onStop()
AsyncServiceThe service thread calls this method when the thread is exiting.
onStop in class AsyncServicepublic void sendChannelData(Channel channel, byte[] data) throws java.io.IOException
channel - data - java.io.IOExceptionpublic void sendChannelEOF(Channel channel) throws java.io.IOException
channel - java.io.IOExceptionpublic void sendChannelExtData(Channel channel, int extendedType, byte[] data) throws java.io.IOException
channel - extendedType - data - java.io.IOExceptionpublic boolean sendChannelRequest(Channel channel, java.lang.String requestType, boolean wantReply, byte[] requestData) throws java.io.IOException
channel - requestType - wantReply - requestData - java.io.IOExceptionSshExceptionpublic void sendChannelRequestFailure(Channel channel) throws java.io.IOException
channel - java.io.IOExceptionpublic void sendChannelRequestSuccess(Channel channel) throws java.io.IOException
channel - java.io.IOExceptionpublic void sendChannelWindowAdjust(Channel channel, long bytesToAdd) throws java.io.IOException
channel - bytesToAdd - java.io.IOExceptionpublic byte[] sendGlobalRequest(java.lang.String requestName,
boolean wantReply,
byte[] requestData)
throws java.io.IOException
requestName - wantReply - requestData - java.io.IOExceptionSshExceptionprotected int[] getAsyncMessageFilter()
AsyncServiceImplement this method by returning the message ids of the asyncrounous messages your implementation wants to receive.
getAsyncMessageFilter in class AsyncServiceprotected void closeChannel(Channel channel) throws java.io.IOException
channel - java.io.IOExceptionprotected void onGlobalRequest(java.lang.String requestName,
boolean wantReply,
byte[] requestData)
throws java.io.IOException
requestName - wantReply - requestData - java.io.IOExceptionprotected void onMessageReceived(SshMessage msg) throws java.io.IOException
AsyncServiceCalled by the service thread when an asyncronous message is received.
onMessageReceived in class AsyncServicemsg - java.io.IOExceptionprotected void onServiceAccept()
ServiceCalled when the service is accepted by the remote server.
onServiceAccept in class Serviceprotected void onServiceInit(int startMode)
throws java.io.IOException
ServiceCalled when the service is intialized.
onServiceInit in class ServicestartMode - java.io.IOExceptionprotected void onServiceRequest()
onServiceRequest in class Serviceprotected void sendChannelFailure(Channel channel) throws java.io.IOException
channel - java.io.IOExceptionprotected void sendChannelOpenConfirmation(Channel channel) throws java.io.IOException
channel - java.io.IOExceptionprotected void sendChannelOpenFailure(long remoteChannelId,
long reasonCode,
java.lang.String additionalInfo,
java.lang.String languageTag)
throws java.io.IOException
remoteChannelId - reasonCode - additionalInfo - languageTag - java.io.IOExceptionprotected void sendGlobalRequestFailure()
throws java.io.IOException
java.io.IOExceptionprotected void sendGlobalRequestSuccess(byte[] requestData)
throws java.io.IOException
requestData - java.io.IOExceptionprotected void freeChannel(Channel channel)
channel - Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.