org.objectweb.jonathan.protocols.api
Interface SessionIdentifier
- HttpSessionIdentifier, IpSessionIdentifier
public interface SessionIdentifier
A session identifier represents an exported session. In other words, it is a
name
, managed by a specific
naming context
of type
Protocol
, and representing a
session
.
The internal structure of a session identifier
is protocol specific: each protocol may define its own SessionIdentifier type
so that it can contain protocol specific information: host name, port...
Session identifiers are created when "server" objects are exported, and
can typically be encoded in
identifiers
. On the
"client" side, they can be decoded and used to establish communication channels.
Protocol
Session_High | bind(Session_Low hls) - Returns a local session representing the session designated by the provided
lower session interface.
|
Context | getInfo() - Yield info about this session, as a Context.
|
Protocol | getProtocol() - Returns the protocol that created this session identifier.
|
int | getProtocolId() - What kind of protocol does this session identifier relate to?
|
boolean | isLocal() - Return true if the target identifier corresponds to a local
connection
|
SessionIdentifier[] | next() - Return the session identifiers corresponding to the lower level
protocol layers, if any
|
void | unexport() - Unexporting a session identifier means that the target session identifier
no longer designates the session it was created for.
|
bind
public Session_High bind(Session_Low hls)
throws BindException,
JonathanException
Returns a local session representing the session designated by the provided
lower session interface.
This operation is used by a protocol to establish a communication channel
to the session specified by the target session identifier. The provided lower
session interface is used to receive messages using the opened channel.
hls
- a session to receive messages on the opened communication channel;
- a session to send messages to the remote session.
BindException
- if the bind process fails.
org.objectweb.jonathan.model.binder.bind(org.objectweb.jonathan.model.name)
getInfo
public Context getInfo()
throws JonathanException
Yield info about this session, as a Context.
getProtocol
public Protocol getProtocol()
Returns the protocol that created this session identifier.
- the protocol that created this session identifier.
getProtocolId
public int getProtocolId()
What kind of protocol does this session identifier relate to?
isLocal
public boolean isLocal()
Return true if the target identifier corresponds to a local
connection
next
public SessionIdentifier[] next()
throws JonathanException
Return the session identifiers corresponding to the lower level
protocol layers, if any
unexport
public void unexport()
Unexporting a session identifier means that the target session identifier
no longer designates the session it was created for. A session
identifier must no longer be used after it has been "unexported".