|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface represents the operations available for all BEEP Sessions.
A BEEP Session encapsulates a connection for a given transport.
Channel
Field Summary | |
static int |
SESSION_STATE_ABORTED
|
static int |
SESSION_STATE_ACTIVE
|
static int |
SESSION_STATE_CLOSE_PENDING
|
static int |
SESSION_STATE_CLOSED
|
static int |
SESSION_STATE_CLOSING
|
static int |
SESSION_STATE_GREETING_SENT
|
static int |
SESSION_STATE_INITIALIZED
|
static int |
SESSION_STATE_TUNING
|
static int |
SESSION_STATE_TUNING_PENDING
|
Method Summary | |
void |
addChannelListener(org.beepcore.beep.core.event.ChannelListener listener)
Adds a listener to be notified of Channel events (start, close, etc.). |
void |
addSessionListener(org.beepcore.beep.core.event.SessionListener listener)
Adds a listener to be notified of Session events (greeting, close, etc.). |
void |
close()
Request to close this Session gracefully. |
SessionCredential |
getLocalCredential()
Get the SessionCredential used to authenticate this peer
of this Session. |
SessionCredential |
getPeerCredential()
Get the SessionCredential used to authenticate the remote
peer of this Session. |
java.util.Collection |
getPeerSupportedProfiles()
Get the profiles supported by the remote peer. |
ProfileRegistry |
getProfileRegistry()
Get the ProfileRegistry for this Session . |
int |
getState()
Returns the state of Session . |
SessionTuningProperties |
getTuningProperties()
|
boolean |
isInitiator()
Indicates whehter or not this peer is the initiator of this Session. |
void |
removeChannelListener(org.beepcore.beep.core.event.ChannelListener l)
Removes the listener from the list of listeners to be notified of future events. |
void |
removeSessionListener(org.beepcore.beep.core.event.SessionListener l)
Removes the listener from the list of listeners to be notified of future events. |
Channel |
startChannel(java.util.Collection profiles,
MessageListener listener)
Deprecated. |
Channel |
startChannel(java.util.Collection profiles,
RequestHandler handler)
Sends a start channel request using the given list of profiles. |
Channel |
startChannel(StartChannelProfile profile,
RequestHandler handler)
Sends a request to start a new Channel on this Session for the specified profile. |
Channel |
startChannel(java.lang.String profile)
Sends a request to start a new Channel on this Session for the specified profile. |
Channel |
startChannel(java.lang.String profile,
boolean base64Encoding,
java.lang.String data)
Sends a request to start a new Channel on this Session for the specified profile. |
Channel |
startChannel(java.lang.String profile,
boolean base64Encoding,
java.lang.String data,
MessageListener listener)
Deprecated. |
Channel |
startChannel(java.lang.String profile,
MessageListener listener)
Deprecated. |
Channel |
startChannel(java.lang.String profile,
RequestHandler handler)
Sends a request to start a new Channel on this Session for the specified profile. |
void |
terminate(java.lang.String reason)
This method is used to terminate the session when there is an non-recoverable error. |
Field Detail |
public static final int SESSION_STATE_INITIALIZED
public static final int SESSION_STATE_GREETING_SENT
public static final int SESSION_STATE_ACTIVE
public static final int SESSION_STATE_TUNING_PENDING
public static final int SESSION_STATE_TUNING
public static final int SESSION_STATE_CLOSE_PENDING
public static final int SESSION_STATE_CLOSING
public static final int SESSION_STATE_CLOSED
public static final int SESSION_STATE_ABORTED
Method Detail |
public void addChannelListener(org.beepcore.beep.core.event.ChannelListener listener)
removeChannelListener(org.beepcore.beep.core.event.ChannelListener)
public void addSessionListener(org.beepcore.beep.core.event.SessionListener listener)
removeSessionListener(org.beepcore.beep.core.event.SessionListener)
public void close() throws BEEPException
Session
gracefully. The profiles of
the open Channels
on this Session
may veto
the close request.
BEEPException
public SessionCredential getLocalCredential()
SessionCredential
used to authenticate this peer
of this Session.
null
if this session has not been authenticatedpublic SessionCredential getPeerCredential()
SessionCredential
used to authenticate the remote
peer of this Session.
null
if this session has not been authenticatedpublic java.util.Collection getPeerSupportedProfiles()
public ProfileRegistry getProfileRegistry()
ProfileRegistry
for this Session
.
ProfileRegistry
public int getState()
Session
.
public boolean isInitiator()
public void removeChannelListener(org.beepcore.beep.core.event.ChannelListener l)
addChannelListener(org.beepcore.beep.core.event.ChannelListener)
public void removeSessionListener(org.beepcore.beep.core.event.SessionListener l)
addSessionListener(org.beepcore.beep.core.event.SessionListener)
public Channel startChannel(java.lang.String profile) throws BEEPException, BEEPError
profile
- The URI of the profile for the new Channel.
BEEPError
- Thrown if the remote peer is unable or refuses to
start a new Channel for the requested profile.
BEEPException
- Thrown for errors other than those defined by
the BEEP protocol (e.g. the Session is not in a
state to create a new Channel).public Channel startChannel(java.lang.String profile, MessageListener listener) throws BEEPException, BEEPError
startChannel
allows a
MessageListener
to be specified to be registered once the
Channel is started. This is useful for profiles that are peer-to-peer in
nature.
profile
- The URI of the profile for the new Channel.listener
- A MessageListener
to receive MSG messages
sent by the remote peer of this Session.
BEEPError
- Thrown if the remote peer is unable or refuses to
start a new Channel for the requested profile.
BEEPException
- Thrown for errors other than those defined by
the BEEP protocol (e.g. the Session is not in a
state to create a new Channel).MessageListener
public Channel startChannel(java.lang.String profile, RequestHandler handler) throws BEEPException, BEEPError
startChannel
allows a
RequestHandler
to be specified to be registered once the
Channel is started. This is useful for profiles that are peer-to-peer in
nature.
profile
- The URI of the profile for the new Channel.handler
- A RequestHandler
to receive MSG messages
sent by the remote peer of this Session.
BEEPError
- Thrown if the remote peer is unable or refuses to
start a new Channel for the requested profile.
BEEPException
- Thrown for errors other than those defined by
the BEEP protocol (e.g. the Session is not in a
state to create a new Channel).public Channel startChannel(java.lang.String profile, boolean base64Encoding, java.lang.String data) throws BEEPException, BEEPError
startChannel
allows a
MessageListener
to be specified to be registered once the
Channel is started. This is useful for profiles that are peer-to-peer in
nature.
profile
- The URI of the profile for the new Channel.base64Encoding
- Indicates whether or not data
is
base64 encoded. data
must be base64
encoded if it is not valid XML CDATA.data
- An initial request to be sent piggyback'd along with the
request to start the Channel. This request can be at most
4K in size.
BEEPError
- Thrown if the remote peer is unable or refuses to
start a new Channel for the requested profile.
BEEPException
- Thrown for errors other than those defined by
the BEEP protocol (e.g. the Session is not in a
state to create a new Channel).MessageListener
public Channel startChannel(java.lang.String profile, boolean base64Encoding, java.lang.String data, MessageListener listener) throws BEEPException, BEEPError
startChannel
allows a
MessageListener
to be specified to be registered once the
Channel is started. This is useful for profiles that are peer-to-peer in
nature.
profile
- The URI of the profile for the new Channel.base64Encoding
- Indicates whether or not data
is
base64 encoded. data
must be base64
encoded if it is not valid XML CDATA.data
- An initial request to be sent piggyback'd along with the
request to start the Channel. This request can be at most
4K in size.listener
- A MessageListener
to receive MSG messages
sent by the remote peer of this Session.
BEEPError
- Thrown if the remote peer is unable or refuses to
start a new Channel for the requested profile.
BEEPException
- Thrown for errors other than those defined by
the BEEP protocol (e.g. the Session is not in a
state to create a new Channel).MessageListener
public Channel startChannel(StartChannelProfile profile, RequestHandler handler) throws BEEPException, BEEPError
startChannel
allows a
RequestHandler
to be specified to be registered once the
Channel is started.
profile
- handler
- A RequestHandler
to receive MSG messages
sent by the remote peer of this Session.
BEEPError
- Thrown if the remote peer is unable or refuses to
start a new Channel for the requested profile.
BEEPException
- Thrown for errors other than those defined by
the BEEP protocol (e.g. the Session is not in a
state to create a new Channel).public Channel startChannel(java.util.Collection profiles, MessageListener listener) throws BEEPException, BEEPError
profiles
- A collection of StartChannelProfile
(s).listener
- A MessageListener
to receive MSG messages
sent by the remote peer of this Session.
BEEPError
- Thrown if the remote peer is unable or refuses to
start a new Channel for the requested profile.
BEEPException
- Thrown for errors other than those defined by
the BEEP protocol (e.g. the Session is not in a
state to create a new Channel).StartChannelProfile
,
MessageListener
public Channel startChannel(java.util.Collection profiles, RequestHandler handler) throws BEEPException, BEEPError
profiles
- A collection of StartChannelProfile
(s).handler
- A RequestHandler
to receive MSG messages
sent by the remote peer of this Session.
BEEPError
- Thrown if the remote peer is unable or refuses to
start a new Channel for the requested profile.
BEEPException
- Thrown for errors other than those defined by
the BEEP protocol (e.g. the Session is not in a
state to create a new Channel).StartChannelProfile
,
RequestHandler
public void terminate(java.lang.String reason)
reason
- public SessionTuningProperties getTuningProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |