org.jdiameter.api
Interface BaseSession

All Superinterfaces:
java.io.Serializable, Wrapper
All Known Subinterfaces:
RawSession, Session

public interface BaseSession
extends Wrapper, java.io.Serializable

The session delivery objects are responsible for delivering all incomming Message to a specific session. It determines the Diameter Session object that the message belongs to by querying the message's session id AVP. The delivery object searches the local session database for a matching session. If no matching session is found, the delivery object will lookup a matching session factory object that has an application id matching the application id of the message. If there is a registered session factory, then the delivery object will ask the factory to create a new session and delivery the message to the newly created session. If non of these lookup's are successful, the session delivery object will silently discard the message. Wrapper interface allows adapt message to any driver vendor specific interface Serializable interface allows use this class in SLEE Event objects

Version:
1.5.1 Final

Method Summary
 long getCreationTime()
          Returns the time when this session was created (milliseconds) Start point of time January 1, 1970 GMT.
 long getLastAccessedTime()
          Returns the last time an event occurred on this session (milliseconds) Start point of time January 1, 1970 GMT.
 boolean isValid()
          Return true if session is not released
 void release()
          Release all resources append to session
 java.util.concurrent.Future<Message> send(Message message)
          Sends and wait response message with default timeout
 java.util.concurrent.Future<Message> send(Message message, long timeOut, java.util.concurrent.TimeUnit timeUnit)
          Sends and wait response message with defined timeout
 
Methods inherited from interface org.jdiameter.api.Wrapper
isWrapperFor, unwrap
 

Method Detail

getCreationTime

long getCreationTime()
Returns the time when this session was created (milliseconds) Start point of time January 1, 1970 GMT.

Returns:
long specifying when this session was created

getLastAccessedTime

long getLastAccessedTime()
Returns the last time an event occurred on this session (milliseconds) Start point of time January 1, 1970 GMT.

Returns:
long specifying when last time an event occurred on this session

isValid

boolean isValid()
Return true if session is not released

Returns:
true if session is not released

send

java.util.concurrent.Future<Message> send(Message message)
                                          throws InternalException,
                                                 IllegalDiameterStateException,
                                                 RouteException,
                                                 OverloadException
Sends and wait response message with default timeout

Parameters:
message - request/answer diameter message
Returns:
InFuture result of an asynchronous operation
Throws:
InternalException - The InternalException signals that internal error is occurred.
IllegalDiameterStateException - The IllegalStateException signals that session has incorrect state (invalid).
RouteException - The NoRouteException signals that no route exist for a given realm.
OverloadException - The OverloadException signals that destination host is overloaded.

send

java.util.concurrent.Future<Message> send(Message message,
                                          long timeOut,
                                          java.util.concurrent.TimeUnit timeUnit)
                                          throws InternalException,
                                                 IllegalDiameterStateException,
                                                 RouteException,
                                                 OverloadException
Sends and wait response message with defined timeout

Parameters:
message - request/answer diameter message
timeOut - value of timeout
timeUnit - type of timeOut value
Returns:
InFuture result of an asynchronous operation
Throws:
InternalException - The InternalException signals that internal error is occurred.
IllegalDiameterStateException - The IllegalStateException signals that session has incorrect state (invalid).
RouteException - The NoRouteException signals that no route exist for a given realm.
OverloadException - The OverloadException signals that destination host is overloaded.

release

void release()
Release all resources append to session



Copyright © 2010. All Rights Reserved.