org.jdiameter.api
Interface Session

All Superinterfaces:
BaseSession, Wrapper

public interface Session
extends BaseSession, Wrapper

This interface append to base interface specific methods for creating and send diameter requests and responses

Version:
1.5.1 Final
Author:
erick.svenson@yahoo.com, artem.litvinov@gmail.com, Alexandre Mendonca , Bartosz Baranowski

Method Summary
 Request createRequest(int commandCode, ApplicationId appId, java.lang.String destRealm)
          Returns a new Request object with the specified command code, applicationId, realm and predefined system avps.
 Request createRequest(int commandCode, ApplicationId appId, java.lang.String destRealm, java.lang.String destHost)
          Returns a new Request object with the specified command code, applicationId, realm, host and predefined system avps.
 Request createRequest(Request prevRequest)
          Returns a new Request object base on previous request.(header is copied)
 java.util.concurrent.Future<Message> send(Message message)
          Sends and wait response message with default timeout
 void send(Message message, EventListener<Request,Answer> listener)
          Sends and wait response message with default timeout
 void send(Message message, EventListener<Request,Answer> listener, long timeOut, java.util.concurrent.TimeUnit timeUnit)
          Sends and wait response message with defined timeout
 java.util.concurrent.Future<Message> send(Message message, long timeOut, java.util.concurrent.TimeUnit timeUnit)
          Sends and wait response message with defined timeout
 void setRequestListener(NetworkReqListener listener)
          Set session request listener
 
Methods inherited from interface org.jdiameter.api.BaseSession
getCreationTime, getLastAccessedTime, getSessionId, isAppSession, isReplicable, isValid, release
 
Methods inherited from interface org.jdiameter.api.Wrapper
isWrapperFor, unwrap
 

Method Detail

setRequestListener

void setRequestListener(NetworkReqListener listener)
Set session request listener

Parameters:
listener - session request listener

createRequest

Request createRequest(int commandCode,
                      ApplicationId appId,
                      java.lang.String destRealm)
Returns a new Request object with the specified command code, applicationId, realm and predefined system avps.

Parameters:
commandCode - code of message
appId - applicationId of destination application
destRealm - name of destination Realm
Returns:
new message object

createRequest

Request createRequest(int commandCode,
                      ApplicationId appId,
                      java.lang.String destRealm,
                      java.lang.String destHost)
Returns a new Request object with the specified command code, applicationId, realm, host and predefined system avps.

Parameters:
commandCode - code of message
appId - applicationId of destination application
destRealm - name of destination Realm
destHost - name of destination Host
Returns:
new Request object

createRequest

Request createRequest(Request prevRequest)
Returns a new Request object base on previous request.(header is copied)

Parameters:
prevRequest - previous request (header is copied)
Returns:
new Request object

send

void send(Message message,
          EventListener<Request,Answer> listener)
          throws InternalException,
                 IllegalDiameterStateException,
                 RouteException,
                 OverloadException
Sends and wait response message with default timeout

Parameters:
message - request/answer diameter message
listener - event listener
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

void send(Message message,
          EventListener<Request,Answer> listener,
          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
listener - event listener
timeOut - value of timeout
timeUnit - type of timeOut value
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)
                                          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.


Copyright © 2013. All Rights Reserved.