dk.i1.diameter.session
Class AASession

Object
  extended by dk.i1.diameter.session.BaseSession
      extended by dk.i1.diameter.session.AASession
All Implemented Interfaces:
Session

public class AASession
extends BaseSession

A session type that uses the AA messages for authentication/authorization Subclasses should override collectAARInfo() and processAAAInfo().

AAASession instances logs with the name "dk.i1.diameter.session.AASession", so you can get detailed logging (including hex-dumps of incoming and outgoing packets) by putting "dk.i1.diameter.session.AASession.level = ALL" into your log.properties file (or equivalent)


Nested Class Summary
 
Nested classes/interfaces inherited from class dk.i1.diameter.session.BaseSession
BaseSession.State
 
Field Summary
 
Fields inherited from class dk.i1.diameter.session.BaseSession
session_auth_timers
 
Constructor Summary
AASession(int auth_app_id, SessionManager session_manager)
           
 
Method Summary
protected  void collectAARInfo(Message request)
          Collect information to send in AAR.
 void handleAAA(Message msg)
          Handle a AAA message.
 void handleAnswer(Message answer, Object state)
          Handle an answer.
 void handleNonAnswer(int command_code, Object state)
          Handle an answer.
protected  boolean processAAAInfo(Message answer)
          Process information AAA message.
protected  void startAuth()
          Start the session by sending the first authentication/authorization.
protected  void startReauth()
          Send re-authorization.
 
Methods inherited from class dk.i1.diameter.session.BaseSession
addCommonStuff, authAppId, authFailed, authInProgress, authInProgress, authSuccessful, calcNextTimeout, closeSession, closeSession, collectSTRInfo, firstAuthTime, getDestinationRealm, getResultCode, getSessionIdOptionalPart, handleASR, handleRAR, handleRequest, handleSTA, handleTimeout, newStatePost, newStatePre, openSession, sessionId, sessionManager, state, stateMaintained, stateMaintained, updateSessionTimeout
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AASession

public AASession(int auth_app_id,
                 SessionManager session_manager)
Method Detail

handleAnswer

public void handleAnswer(Message answer,
                         Object state)
Handle an answer. This implementation handles AAA messages. All other messages are passed to BaseSession.handleAnswer(dk.i1.diameter.Message, java.lang.Object)

Specified by:
handleAnswer in interface Session
Overrides:
handleAnswer in class BaseSession
Parameters:
answer - The answer message
state - The state object specified in sendRequest()

handleNonAnswer

public void handleNonAnswer(int command_code,
                            Object state)
Handle an answer. This implementation handles missing AAA messages by calling authFailed(). All other non-answers are passed to BaseSession.handleNonAnswer(int, java.lang.Object) passed to BaseSession.handleAnswer(dk.i1.diameter.Message, java.lang.Object)

Specified by:
handleNonAnswer in interface Session
Overrides:
handleNonAnswer in class BaseSession
Parameters:
command_code - The command_code from the original request.
state - The state object specified in sendRequest()

handleAAA

public void handleAAA(Message msg)
Handle a AAA message. If the result-code is success then processAAAInfo and authSuccessful are called. If the result-code is multi-round-auth a new AAR is initiated. If the result-code is authorization-reject then the session is closed. If the result-code is anything else then the session is also closed.


startAuth

protected void startAuth()
Description copied from class: BaseSession
Start the session by sending the first authentication/authorization. This method is called by BaseSession when the session is opened. If there are no authentication/authorization as such for the session type you implement you can call authSuccessful() immediately.

Specified by:
startAuth in class BaseSession

startReauth

protected void startReauth()
Description copied from class: BaseSession
Send re-authorization. This method is called by BaseSession when the authorization-lifetime expires or when an RAR has been received.

Specified by:
startReauth in class BaseSession

collectAARInfo

protected void collectAARInfo(Message request)
Collect information to send in AAR. This method must be overridden in subclasses to provide essential information such as user-name, password, credenticals, etc. This implementation calls BaseSession.addCommonStuff(dk.i1.diameter.Message) and adds the auth-application-id. A subclass probably want to call this method first and then add the session-specific AVPs, eg:
           void collectAARInfo(Message request) { //method in your session class
               AASession.collectAARInfo(request);
               request.add(new AVP_UTF8String(ProtocolConstants.DI_CALLING_STATION_ID,msisdn));
               ...
           }
 


processAAAInfo

protected boolean processAAAInfo(Message answer)
Process information AAA message. This method extracts authorization-lifetime, auth-grace-period, session-timeout and auth-session-state AVPs and processes them. Subclasses probably want to override this to add additional processing.