org.objectweb.jonathan.apis.protocols
Interface SessionIdentifier

All Known Subinterfaces:
GIOPSessionIdentifier
All Known Implementing Classes:
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.

See Also:
Protocol

Method Summary
 Session_High bind(Session_Low hls)
          Returns a local session representing the session designated by the provided lower session interface.
 org.objectweb.jonathan.apis.kernel.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.
 

Method Detail

getProtocol

public Protocol getProtocol()
Returns the protocol that created this session identifier.

Returns:
the protocol that created this session identifier.

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".


bind

public Session_High bind(Session_Low hls)
                  throws BindException,
                         org.objectweb.jonathan.apis.kernel.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.

Parameters:
hls - a session to receive messages on the opened communication channel;
Returns:
a session to send messages to the remote session.
Throws:
BindException - if the bind process fails.
org.objectweb.jonathan.apis.kernel.JonathanException - if something else goes wrong.
See Also:
binder.bind(org.objectweb.jonathan.model.name)

next

public SessionIdentifier[] next()
                         throws org.objectweb.jonathan.apis.kernel.JonathanException
Return the session identifiers corresponding to the lower level protocol layers, if any

Throws:
org.objectweb.jonathan.apis.kernel.JonathanException

getProtocolId

public int getProtocolId()
What kind of protocol does this session identifier relate to?


getInfo

public org.objectweb.jonathan.apis.kernel.Context getInfo()
                                                   throws org.objectweb.jonathan.apis.kernel.JonathanException
Yield info about this session, as a Context.

Throws:
org.objectweb.jonathan.apis.kernel.JonathanException

isLocal

public boolean isLocal()
Return true if the target identifier corresponds to a local connection