|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.beep4j.internal.profile.ChannelManagementProfileImpl
public class ChannelManagementProfileImpl
Implementation of ChannelManagementProfile interface.
Constructor Summary | |
---|---|
ChannelManagementProfileImpl(boolean initiator)
|
Method Summary | |
---|---|
void |
channelClosed()
Invoked by the framework when the other peer decided to close this channel. |
void |
channelCloseRequested(CloseChannelRequest request)
Invoked by the framework when the other peer requested to close the channel. |
void |
channelOpened(Channel c)
Invoked by the framework when the channel has been successfully started. |
void |
channelStartFailed(int code,
java.lang.String message)
This method is only called on channels created through the startChannel methods of the Session. |
void |
closeChannel(int channelNumber,
CloseChannelCallback callback)
Send a close channel message. |
void |
closeSession(CloseCallback callback)
Closes the session. |
boolean |
connectionEstablished(java.net.SocketAddress address,
SessionHandler sessionHandler,
Reply response)
Invoked by the session when the connection has been established. |
ChannelHandler |
createChannelHandler(SessionManager manager)
Invoked by the framework to initialize the channel and to get the ChannelHandler for the profile. |
protected ChannelManagementMessageBuilder |
createChannelManagementMessageBuilder()
|
protected ChannelManagementMessageParser |
createChannelManagementMessageParser()
|
Message |
createError(int code,
java.lang.String diagnostics)
|
Message |
createGreeting(java.lang.String[] profiles)
|
protected MessageBuilder |
createMessageBuilder()
|
void |
messageReceived(Message message,
Reply handler)
Invoked by the framework when the other peer sent a message to this peer on this channel. |
BEEPError |
receivedError(Message message)
Invoked by the session when an error has been received during the session startup. |
Greeting |
receivedGreeting(Message message)
Invoked by the session when a greeting has been received during the session startup. |
void |
startChannel(int channelNumber,
ProfileInfo[] infos,
StartChannelCallback callback)
Sends a start channel message to the other peer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChannelManagementProfileImpl(boolean initiator)
Method Detail |
---|
protected ChannelManagementMessageBuilder createChannelManagementMessageBuilder()
protected ChannelManagementMessageParser createChannelManagementMessageParser()
protected MessageBuilder createMessageBuilder()
public void channelStartFailed(int code, java.lang.String message)
channelStartFailed
in interface ChannelHandler
code
- the error codemessage
- the human readable error message
java.lang.UnsupportedOperationException
- unconditionallypublic void channelOpened(Channel c)
ChannelHandler
channelOpened
in interface ChannelHandler
c
- the channel that was openedpublic void messageReceived(Message message, Reply handler)
ChannelHandler
messageReceived
in interface ChannelHandler
message
- the received messagehandler
- the handler used to return a response.public void channelCloseRequested(CloseChannelRequest request)
ChannelHandler
channelCloseRequested
in interface ChannelHandler
request
- the requestpublic void channelClosed()
ChannelHandler
channelClosed
in interface ChannelHandler
public ChannelHandler createChannelHandler(SessionManager manager)
ChannelManagementProfile
createChannelHandler
in interface ChannelManagementProfile
manager
- the SessionManager to be used by the profile
public boolean connectionEstablished(java.net.SocketAddress address, SessionHandler sessionHandler, Reply response)
ChannelManagementProfile
connectionEstablished
in interface ChannelManagementProfile
address
- address of remote peersessionHandler
- the SessionHandler of the sessionresponse
- the ResponseHandler to be used to generate a response
public Message createGreeting(java.lang.String[] profiles)
public Message createError(int code, java.lang.String diagnostics)
public Greeting receivedGreeting(Message message)
ChannelManagementProfile
receivedGreeting
in interface ChannelManagementProfile
message
- the message to be parsed
public BEEPError receivedError(Message message)
ChannelManagementProfile
receivedError
in interface ChannelManagementProfile
message
- the message to be parsed
public void startChannel(int channelNumber, ProfileInfo[] infos, StartChannelCallback callback)
ChannelManagementProfile
startChannel
in interface ChannelManagementProfile
channelNumber
- the channel number of the new peerinfos
- the ProfileInfos to be passed inside the profile element in
the requestcallback
- the callback that is invoked when the response is receivedpublic void closeChannel(int channelNumber, CloseChannelCallback callback)
ChannelManagementProfile
closeChannel
in interface ChannelManagementProfile
channelNumber
- the channel to be closedcallback
- the callback that is invoked when the response is receivedpublic void closeSession(CloseCallback callback)
ChannelManagementProfile
closeSession
in interface ChannelManagementProfile
callback
- the callback used to notify about the response
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |