Author: baranowb
Date: Thu Oct  2 10:05:46 2008
New Revision: 3012

Modified:
   wiki/MobicentsDiameterRA.wiki

Log:
Preliminary commit.

Modified: wiki/MobicentsDiameterRA.wiki
==============================================================================
--- wiki/MobicentsDiameterRA.wiki       (original)
+++ wiki/MobicentsDiameterRA.wiki       Thu Oct  2 10:05:46 2008
@@ -1,4 +1,4 @@
-#labels Phase-Support
+#labels Phase-Implementation
 =Mobicents Diameter RA=

 ==Introduction==
@@ -9,11 +9,21 @@

• Base: Base application defines common part for each application/node. Half of its messages (CER-CEA/DWR-DWA/DPR-DPA) are meant to manage connection between peers. Other half (ACR-ACA/ASR-ASA/STR-STA/ACR-ACA) are used by applications for accounting/authorization purposes and of course session handling (particularly for session termination). Second half does not define stand alone functionality, rather as mentioned before common part.

+• Sh: Sh application (vendorId=10415, AppId=16777217) defines messages used to interact with HSS (Home Subscriber Server) - it defines message pairs as follows: PUR/PUA, PNR/PNA,UDR/UDA,SNR/SNA. Defined messages allow nodes to interact with each other and exchange user information. Possible scenarios:
+  * Client updates user data - it sends PUR to HSS which replies with PUA
+ * Client requests certain data - it sends UDR to HSS which replies with UDA + * Client subscribes to profile changes (on each profile change (or certain data) HSS will send notification) - it send SNR to HSS which replies with SNA
+  * HSS notifices subscribed clients - it sends PNR, clients reply with PNA
+In case of first two session is short lived (activity), its life span is only request/response.
+
+Last two scenarios have long living sessions - which is alive during whole subscription time. As of now only Sh-Client RA is available, Sh-Server is next on list.
+
+
 • CCA: TODO

 • Ro/Rf: TODO

-• Sh: TODO
+• Sh-Server: TODO


 ==Build from source==
@@ -30,9 +40,33 @@

 `ant –f servers/jain-slee/examples/diameter/build.xml deploy-all`

+For Sh-Client Ra it is very similar, run those commands to deploy:
+
+`mvn –f servers/jain-slee/resources/diameter/sh-client/pom.xml install`
+
+To build example client application do:
+
+ `mvn –f servers/jain-slee/examples/diameter/pom.xml install`
+
+Important change to previous version is that all RAs are using the same stack. To use Sh-Client You need Base RA to be deployed first. Currently base provides embeded stack which is server to other RAs
+
+==Multiple RA instances==
+It is possible to deploy multiple RA isntances. However one needs to follow instructions below:
+* change entity name of another base instance
+* put this name as config property into slave ra - for instance Sh-Client has config property:
+{{{
+        <config-property>
+ <description>uS after which dialog if it has not received/send any message is considered to be dead and is expunged</description>
+            <config-property-name>baseEntityName</config-property-name>
+            <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>DiameterBaseResourceAdaptor</config-property-value>
+        </config-property>
+}}}
+
+
 ==Configuration==

-The Mobicents Diameter RA uses the jDiameter v1.5.1 stack (https://jdiameter.dev.java.net/) and so the only configuration needed for the RA resides on the XML configuration file located at ./servers/jain-slee/resources/diameter/base/ra/src/main/resources/org/mobicents/slee/resource/diameter/base/jdiameter-config.xml. +The Mobicents Diameter RA uses the jDiameter v1.5.1 stack (https://jdiameter.dev.java.net/) and so the only configuration needed for the RA resides on the XML configuration file located at ./servers/jain-slee/resources/diameter/base/ra/src/main/resources/org/mobicents/slee/resource/diameter/base/stack/jdiameter-config.xml.
 {{{
   * LocalPeer – describe parameters of local peer such as:
     * OverloadMonitor (Optional) – overload monitor section
@@ -135,9 +169,89 @@
 </Configuration>
 }}}

+Another sample configuration which allows to connect to host on port 21812 running accounting application (same as above) and another one running Sh-Application on port 386 would look as follows:
+
+{{{
+<?xml version="1.0"?>
+<Configuration xmlns="http://www.jdiameter.org/jdiameter-server";>
+
+       <LocalPeer>
+               <URI value="aaa://127.0.0.1:1812" />
+               <IPAddresses>
+                       <IPAddress value="127.0.0.1" />
+               </IPAddresses>
+               <Realm value="mobicents.org" />
+               <VendorID value="193" />
+               <ProductName value="jDiameter" />
+               <FirmwareRevision value="1" />
+               <OverloadMonitor>
+                       <Entry index="1" lowThreshold="0.5" highThreshold="0.6">
+                               <ApplicationID>
+                                       <VendorId value="193" />
+                                       <AuthApplId value="0" />
+                                       <AcctApplId value="19302" />
+                               </ApplicationID>
+                       </Entry>
+               </OverloadMonitor>
+       </LocalPeer>
+
+       <Parameters>
+               <AcceptUndefinedPeer value="true" />
+               <DuplicateProtection value="true" />
+               <DuplicateTimer value="240000" />
+               <UseUriAsFqdn value="true" /> <!-- Needed for Ericsson Emulator 
-->
+               <QueueSize value="10000" />
+               <MessageTimeOut value="60000" />
+               <StopTimeOut value="10000" />
+               <CeaTimeOut value="10000" />
+               <IacTimeOut value="30000" />
+               <DwaTimeOut value="10000" />
+               <DpaTimeOut value="5000" />
+               <RecTimeOut value="10000" />
+       </Parameters>
+
+       <Network>
+               <Peers>
+                       <!-- Ericsson SDK Client -->
+                       <!--
+                               Peer name="aaa://127.0.0.1:11812" 
attempt_connect="false"
+                               rating="1"/
+                       -->
+                       <!-- Ericsson SDK Emulator -->
+                       <Peer name="aaa://127.0.0.1:21812" 
attempt_connect="true"
+                               rating="1" />
+                       <!-- Sh -->
+                       <Peer name="aaa://127.0.0.1:3868" attempt_connect="true" 
rating="1" />
+               </Peers>
+               <Realms>
+                       <Realm name="mobicents.org" peers="127.0.0.1" 
local_action="LOCAL"
+                               dynamic="false" exp_time="1">
+                               <ApplicationID>
+                                       <VendorId value="193" />
+                                       <AuthApplId value="0" />
+                                       <AcctApplId value="19302" />
+                               </ApplicationID>
+                       </Realm>
+                       <!-- Sh -->
+                       <Realm name="mobicents.org" peers="127.0.0.1" 
local_action="LOCAL"
+                               dynamic="false" exp_time="1">
+                               <ApplicationID>
+                                       <VendorId value="10415" />
+                                       <AuthApplId value="0" />
+                                       <AcctApplId value="16777217" />
+                               </ApplicationID>
+                       </Realm>
+               </Realms>
+       </Network>
+
+       <Extensions />
+
+</Configuration>
+}}}
+
 ==Example Applications==

-There are two example applications provided. One of them shows the RA acting as a server, the other one shows it acting as a client. Both of them use the Ericsson SDK. +There are two example applications provided for base. One of them shows the RA acting as a server, the other one shows it acting as a client. Both of them use the Ericsson SDK.

 ===Server Example===

@@ -290,4 +404,458 @@
In here, again, we have internal Ericsson SDK data, identifying the TrafficCase (Type 14) with the value “20”. This field will be set to 20 for the Originating Service Charging (normal end-user initiated) and 21 for Terminating Service Charging.


-If you look into Config > Account in Ericsson Emulator you’ll see that the corresponding amount has been deducted from user account.
\ No newline at end of file
+If you look into Config > Account in Ericsson Emulator you’ll see that the corresponding amount has been deducted from user account.
+
+
+==Sh-Client==
+
+Sh Client example consits of two cases:
+
+  # We act per single reqeust (request user data)
+  # We try to subscribe - this succedes depending on seagul setting.
+
+To run both one needs:
+  * second configuration file (see examples above)
+ * installed seagull: installation instructions can be found: http://gull.sourceforge.net/doc/core.html
+
+NOTE: All files required to run (except one scenario are already in seagull: seagull/exe-env/diameter-env/* - under run,scenario, config directories)
+
+====UDR-UDA====
+
+Seagull scenario:
+{{{
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<scenario>
+
+       <init>
+               <receive channel="channel-1">
+                       <command name="CER">
+                       </command>
+                       <action>
+                               <store name="ven" entity="Vendor-Id"></store>
+                       </action>
+               </receive>
+
+               <send channel="channel-1">
+                       <command name="CEA">
+                               <avp name="Result-Code" value="2001"></avp>
+                               <avp name="Origin-Host" value="sh-server"></avp>
+                               <avp name="Origin-Realm" value="seagull"></avp>
+                               <avp name="Host-IP-Address" 
value="0x00017F000001"></avp>
+                               <avp name="Vendor-Id" value="0"></avp>
+                               <avp name="Product-Name" value="HSS"></avp>
+                               <avp name="Firmware-Revision" value="1"></avp>
+                       </command>
+               </send>
+       </init>
+
+       <traffic>
+               <receive channel="channel-1">
+                       <command name="UDR">
+                               <!-- Only need to specify what needs to be parsed 
-->
+                               <avp name="Session-Id" value="dont_care"></avp>
+                       </command>
+                       <!-- Store action is at the end of the command -->
+                       <action>
+                               <store name="HbH" entity="HbH-id"></store>
+                               <store name="E2E" entity="EtE-id"></store>
+                               <store name="sid" entity="Session-Id"></store>
+                       </action>
+               </receive>
+
+               <send channel="channel-1">
+                       <!-- Restore action is before the command -->
+                       <action>
+                               <restore name="HbH" entity="HbH-id"></restore>
+                               <restore name="E2E" entity="EtE-id"></restore>
+                               <restore name="sid" 
entity="Session-Id"></restore>
+                       </action>
+                       <command name="UDA">
+                               <avp name="Session-Id" 
value="will_be_erased"></avp>
+                               <avp name="Origin-Host" value="sh-server"></avp>
+                               <avp name="Origin-Realm" value="seagull"></avp>
+                               <avp name="Auth-Session-State" value="1"></avp>
+                               <avp name="Result-Code" value="2001"></avp>
+ <avp name="User-Data" value="<Sh-Data><PublicIdentifiers><MSISDN>216543210</MSISDN><IMSPublicIdentity>sip:[EMAIL PROTECTED]</IMSPublicIdentity><IMSPublicIdentity>TEL:+64216543210</IMSPublicIdentity></PublicIdentifiers><CSLocationInformation><CellGlobalId>123</CellGlobalId><GeographicalInformation>456</GeographicalInformation><LocationAreaId>789</LocationAreaId></CSLocationInformation></Sh-Data>"></avp>
+                       </command>
+               </send>
+       </traffic>
+</scenario>
+}}}
+
+We assume that requests is for user with two user identities: sip:[EMAIL PROTECTED] and TEL:+64216543210. +to run seagull scenario for UDR-UDA go into seagull/exe-env/diameter-env/run and run:
+  * `start_server_sh.ksh` - than press 3
+Now - in example sbb file see that onTimer event handler looks as follows:
+{{{
+public void onTimerEvent(TimerEvent event, ActivityContextInterface aci)
+  {
+         doSimpleTestsSendUDR();
+       
+         ///doSimpleTestSendSNR();
+  }
+}}}
+Second method is for second scenario. Now deploy base ra, sh-client ra and sh-client example.
+Run mobicents and observer output.
+Here is example code that requests user data from HSS:
+{{{
+ActivityContextInterface localACI=acif.getActivityContextInterface(basicClientActivity);
+                       logger.info(" On TimerEvent: ACI created for 
basicClientActivity");
+                       
+                       localACI.attach(getSbbContext().getSbbLocalObject());
+                       
+                       
+                       DiameterIdentityAvp[] 
peers=provider.getConnectedPeers();
+                       
+                       for(DiameterIdentityAvp peer: peers)
+                       {
+                               logger.info(" On TimerEvent: Connected Peer: 
"+peer.stringValue());
+                       }
+                       
+                       logger.info(" On TimerEvent: creating UDR");
+                       
+ UserDataRequest udr=((ShClientMessageFactory)basicClientActivity.getDiameterMessageFactory()).createUserDataRequest();
+                       
+                       List<DiameterAvp> avps = new ArrayList<DiameterAvp>();
+               
+ avps.add(avpFactory.getBaseFactory().createAvp(Avp.SESSION_ID, basicClientActivity.getSessionId().getBytes() ));
+               
+ DiameterAvp avpVendorId = avpFactory.getBaseFactory().createAvp( Avp.VENDOR_ID, 10415 ); + DiameterAvp avpAcctApplicationId = avpFactory.getBaseFactory().createAvp( Avp.ACCT_APPLICATION_ID, MessageFactory._SH_APP_ID );
+               
+ avps.add( avpFactory.getBaseFactory().createAvp( Avp.VENDOR_SPECIFIC_APPLICATION_ID, new DiameterAvp[]{avpVendorId, avpAcctApplicationId} ) );
+               
+ avps.add(avpFactory.getBaseFactory().createAvp(Avp.ORIGIN_HOST, "aaa://127.0.0.1:1812".getBytes() )); + avps.add(avpFactory.getBaseFactory().createAvp(Avp.ORIGIN_REALM, "mobicents.org".getBytes() ));
+               
+ avps.add(avpFactory.getBaseFactory().createAvp(Avp.DESTINATION_HOST, "aaa://127.0.0.1:3868".getBytes() )); + avps.add(avpFactory.getBaseFactory().createAvp(Avp.DESTINATION_REALM, "mobicents.org".getBytes() ));
+                     UserIdentityAvp ui=avpFactory.createUserIdentity();
+                     ui.setPublicIdentity("sip:[EMAIL PROTECTED]");
+
+                     avps.add(ui);
+                     ui=avpFactory.createUserIdentity();
+                     ui.setPublicIdentity("TEL:+64216543210");
+
+                     avps.add(ui);
+                     udr.setExtensionAvps(avps.toArray(new 
DiameterAvp[avps.size()]));
+               
+                     logger.info(" On TimerEvent: Sending message:\n"+udr);
+                     basicClientActivity.sendUserDataRequest(udr);
+               
+                       logger.info(" On TimerEvent: Message send");
+}}}
+
+Second example requires different scenario that is nto present in seagull. Here is scenario file:
+{{{
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<scenario>
+
+       <init>
+               <receive channel="channel-1">
+                       <command name="CER">
+                       </command>
+                       <action>
+                               <store name="ven" entity="Vendor-Id"></store>
+                       </action>
+               </receive>
+
+               <send channel="channel-1">
+                       <command name="CEA">
+                               <avp name="Result-Code" value="2001"></avp>
+                               <avp name="Origin-Host" value="sh-server"></avp>
+                               <avp name="Origin-Realm" value="seagull"></avp>
+                               <avp name="Host-IP-Address" 
value="0x00017F000001"></avp>
+                               <avp name="Vendor-Id" value="0"></avp>
+                               <avp name="Product-Name" value="HSS"></avp>
+                               <avp name="Firmware-Revision" value="1"></avp>
+                       </command>
+               </send>
+       </init>
+
+       <traffic>
+               <receive channel="channel-1">
+                       <command name="SNR">
+                               <!-- Only need to specify what needs to be parsed 
-->
+                               <avp name="Session-Id" value="dont_care"></avp>
+                       </command>
+                       <!-- Store action is at the end of the command -->
+                       <action>
+                               <store name="HbH" entity="HbH-id"></store>
+                               <store name="E2E" entity="EtE-id"></store>
+                               <store name="sid" entity="Session-Id"></store>
+ <!-- <store name="sessionState" entity="Auth-Session-State"></store> -->
+                       </action>
+               </receive>
+
+               <send channel="channel-1">
+                       <!-- Restore action is before the command -->
+                       <action>
+                               <restore name="HbH" entity="HbH-id"></restore>
+                               <restore name="E2E" entity="EtE-id"></restore>
+                               <restore name="sid" 
entity="Session-Id"></restore>
+ <!-- <restore name="sessionState" entity="Auth-Session-State"></restore> -->
+                       </action>
+                       <command name="SNA">
+                               <avp name="Session-Id" 
value="will_be_erased"></avp>
+                               <avp name="Origin-Host" value="sh-server"></avp>
+                               <avp name="Origin-Realm" value="seagull"></avp>
+                               <avp name="Result-Code" value="3004"></avp><!-- 
TOO_BUSSY answer -->
+                       </command>
+               </send>
+       </traffic>
+</scenario>
+}}}
+To run it one needs to alter start script as follows and save above file as *logs/snr-sna.server.log*:
+{{{
+export LD_LIBRARY_PATH=/usr/local/bin
+seagull -conf ../config/conf.server.xml -dico ../config/base_sh.xml -scen ../scenario/snr-sna.server.xml -log ../logs/snr-sna.server.log -llevel ET
+}}}
+
+Steps to run this example are almost the same as in case of *UDR-UDA*, however on timer event handler has to look as follows:
+{{{
+public void onTimerEvent(TimerEvent event, ActivityContextInterface aci)
+  {
+         //doSimpleTestsSendUDR();
+       
+         doSimpleTestSendSNR();
+  }
+}}}
+
+
+Application example code whihc subscribes to notifications looks as follows:
+
+{{{
+         try {
+ ShClientSubscriptionActivity shClientSubscriptionActivity=this.provider.createShClientSubscriptionActivity();
+               logger.info(" On TimerEvent: Client Subscrition Activity 
created");
+               
+               shClientSubscriptionActivity.getDiameterAvpFactory();
+               shClientSubscriptionActivity.getDiameterMessageFactory();
+               
+               logger.info(" On TimerEvent: Subscription activity methods 
tested");
+ ActivityContextInterface localACI=this.acif.getActivityContextInterface(shClientSubscriptionActivity);
+               localACI.attach(getSbbContext().getSbbLocalObject());
+               logger.info(" On TimerEvent: Subscription activity acif 
created");
+               List<DiameterAvp> avps = new ArrayList<DiameterAvp>();
+ SubscribeNotificationsRequest snr=((ShClientMessageFactory)shClientSubscriptionActivity.getDiameterMessageFactory()).createSubscribeNotificationsRequest(); + //< Subscribe-Notifications-Request > ::= < Diameter Header: 308, REQ, PXY, 16777217 >
+               //                              < Session-Id >
+ avps.add(avpFactory.getBaseFactory().createAvp(Avp.SESSION_ID, shClientSubscriptionActivity.getSessionId().getBytes() ));
+               //                              { 
Vendor-Specific-Application-Id }
+ DiameterAvp avpVendorId = avpFactory.getBaseFactory().createAvp( Avp.VENDOR_ID, MessageFactory._SH_VENDOR_ID ); + DiameterAvp avpAcctApplicationId = avpFactory.getBaseFactory().createAvp( Avp.ACCT_APPLICATION_ID, MessageFactory._SH_APP_ID );
+       
+ avps.add( avpFactory.getBaseFactory().createAvp( Avp.VENDOR_SPECIFIC_APPLICATION_ID, new DiameterAvp[]{avpVendorId, avpAcctApplicationId} ) );
+       
+       
+       
+       
+               //                              { Auth-Session-State }
+               //                              { Origin-Host }
+ avps.add(avpFactory.getBaseFactory().createAvp(Avp.ORIGIN_HOST, "aaa://127.0.0.1:1812".getBytes() ));
+               //                              { Origin-Realm }
+ avps.add(avpFactory.getBaseFactory().createAvp(Avp.ORIGIN_REALM, "mobicents.org".getBytes() ));
+               //                              [ Destination-Host ]
+ avps.add(avpFactory.getBaseFactory().createAvp(Avp.DESTINATION_HOST, "aaa://127.0.0.1:3868".getBytes() ));
+               //                              { Destination-Realm }
+ avps.add(avpFactory.getBaseFactory().createAvp(Avp.DESTINATION_REALM, "mobicents.org".getBytes() ));
+               //                              *[ Supported-Features ]
+               //                              { User-Identity }
+             UserIdentityAvp ui=avpFactory.createUserIdentity();
+             ui.setPublicIdentity("sip:[EMAIL PROTECTED]");
+             avps.add(ui);
+               //                              [ Wildcarded-PSI ]
+               //                              [ Wildcarded-IMPU ]
+               //                              *[ Service-Indication ]
+               //                              [ Send-Data-Indication ]
+               //                              [ Server-Name ]
+               //                              { Subs-Req-Type }
+               //                              *{ Data-Reference }
+             //Its enumerated: 0 == Whole data
+ DiameterAvp avp=avpFactory.getBaseFactory().createAvp(MessageFactory._SH_VENDOR_ID,DiameterShAvpCodes.DATA_REFERENCE, 0);
+             avps.add(avp);
+               //                              [ Identity-Set ]
+               //                              [ Expiry-Time ]
+             //We can user setters, but this is faster :)
+ snr.setExtensionAvps(avps.toArray(avps.toArray(new DiameterAvp[avps.size()])));
+             logger.info("---> Sending SNR");
+ shClientSubscriptionActivity.sendSubscriptionNotificationRequest(snr);
+             logger.info("---> Send SNR:\n"+snr);
+
+         } catch (Exception e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+}}}
+
+*NOTE:* This is required for avp facotry to work: One has to pass vendor id defined for avp (this will change in dedicated factories for applications, however for generic creation its required), see code below:
+{{{
+ DiameterAvp avp=avpFactory.getBaseFactory().createAvp(MessageFactory._SH_VENDOR_ID,DiameterShAvpCodes.DATA_REFERENCE, 0);
+}}}
+
+When running this example two things can happen base on Result-Code set in seagull scenario - if its 2001, subscription will be a succes and session will live for certain amount of time, for 3001 it will be terminated along with activity.
+
+
+==Interfaces==
+Here is a list of exposed interfaces with either javadoc description or dedicated exmplanation.
+===Base===
+{{{
+public interface AccountingSessionActivity extends DiameterActivity{
+
+       /**
+ * Returns accounting session state of underlying session. Valid values are: Idle,PendingS,PendingE,PendingB,Open,PendingI,PendingL
+        * [EMAIL PROTECTED] AccountingSessionState}
+        * @return
+        */
+       AccountingSessionState getAccountingSessionState();
+       
+}
+public interface AccountingClientSessionActivity extends
+               AccountingSessionActivity {
+
+       /**
+        * Send Account Request to Server
+        * @param request
+        * @throws IOException
+        */
+        void   sendAccountRequest(AccountingRequest request) throws 
IOException;
+
+       
+}
+public interface AccountingServerSessionActivity extends
+               AccountingSessionActivity {
+
+       /**
+        * Sends generated answer back to client
+        * @param answer
+        * @throws IOException
+        */
+       void sendAccountAnswer(AccountingAnswer answer) throws IOException;
+
+       
+}
+public interface AuthClientSessionActivity extends AuthSessionActivity{
+
+       /**
+        * Send abort session answer to server
+        *
+        * @param answer
+        * @throws IOException
+        */
+       void sendAbortSessionAnswer(AbortSessionAnswer answer) throws 
IOException;
+
+       /**
+        * Send authentication session request to server FIXME: baranowb; whats
+        * this?
+        *
+        * @param request
+        * @throws IOException
+        */
+       void sendAuthRequest(DiameterMessage request) throws IOException;
+
+       /**
+        * Send re-authentication session answer to server
+        *
+        * @param answer
+        * @throws IOException
+        */
+       void sendReAuthAnswer(ReAuthAnswer answer) throws IOException;
+
+       /**
+        * Send session termination request to server
+        *
+        * @param request
+        * @throws IOException
+        */
+ void sendSessionTerminationRequest(SessionTerminationRequest request) throws IOException;
+       
+}
+public interface AuthServerSessionActivity extends AuthSessionActivity {
+
+       /**
+        * Send session abort session request to client
+        *
+        * @param request
+        * @throws IOException
+        */
+ void sendAbortSessionRequest(AbortSessionRequest request) throws IOException;
+
+       /**
+        * Send authenticate answer to client
+        *
+        * @param answer
+        * @throws IOException
+        */
+       void sendAuthAnswer(DiameterMessage answer) throws IOException;
+
+       /**
+        * Send re-authenticate request to client
+        *
+        * @param request
+        * @throws IOException
+        */
+       void sendReAuthRequest(ReAuthRequest request) throws IOException;
+
+       /**
+        * Send session termination answer to client
+        *
+        * @param request
+        * @throws IOException
+        */
+ void sendSessionTerminationAnswer(SessionTerminationAnswer request) throws IOException;
+
+}
+public interface AuthSessionActivity extends DiameterActivity{
+       
+       /**
+ * Return current auth session state - it can have values as follows: Idle,Pending,Open,Disconnected.<br>
+        * Disconnected value implies that activity is ending
+        * @return
+        */
+       AuthSessionState getSessionState();
+
+}
+/**
+ * /**
+ * Represents a session with a Diameter peer.
+ * DiameterMessages (both requests and responses) are received as events fired on DiameterActivity objects.
+ *
+ * @author baranowb
+ */
+public interface DiameterActivity {
+
+    /**
+     * Return a DiameterMessageFactory implementation to be used to create
+ * instances to of [EMAIL PROTECTED] DiameterMessage} object to be fired on this Activity.
+     * <br> returned type depends on implementation
+     * @return a DiameterMessageFactory implementation
+     */
+    Object getDiameterMessageFactory();
+    /**
+ * Returns a DiameterAvp factory which can be used to create instances of avps.
+     * <br> Return type depends on implementing object.
+     * @return
+     */
+    Object getDiameterAvpFactory();
+
+    /**
+     * Sends the given DiameterMessage on the DiameterActivity.
+     * The response to the message (if any) will be fired on this activity.
+     * @param message the Diameter message to send
+     */
+    void sendMessage(DiameterMessage message) throws IOException;
+
+    /**
+     * Return the Session ID for this activity.
+     * @return the Session ID for this activity
+     */
+    String getSessionId();
+    /**
+     * Terminates underlying session
+     */
+    void endActivity();
+
+
+}
+}}}
\ No newline at end of file

Reply via email to