Revision: 16251
Author: brainslog
Date: Fri Jan  7 10:09:04 2011
Log: Updating IMS User Profile Enabler

Update Issue 2124
Update to code and Docs


http://code.google.com/p/mobicents/source/detail?r=16251

Modified:
/trunk/servers/jain-slee/enablers/ims-user-profile/docs/sources/src/main/resources/en-US/Chapter-Integrating_The_Enabler.xml /trunk/servers/jain-slee/enablers/ims-user-profile/docs/sources/src/main/resources/en-US/Chapter-Using_The_Enabler.xml /trunk/servers/jain-slee/enablers/ims-user-profile/sbb/src/main/java/org/mobicents/slee/enabler/ims/userprofile/IMSUserProfileChild.java /trunk/servers/jain-slee/enablers/ims-user-profile/sbb/src/main/java/org/mobicents/slee/enabler/ims/userprofile/IMSUserProfileChildSbb.java /trunk/servers/jain-slee/enablers/ims-user-profile/sbb/src/main/java/org/mobicents/slee/enabler/ims/userprofile/IMSUserProfileParent.java

=======================================
--- /trunk/servers/jain-slee/enablers/ims-user-profile/docs/sources/src/main/resources/en-US/Chapter-Integrating_The_Enabler.xml Thu Jan 6 13:29:47 2011 +++ /trunk/servers/jain-slee/enablers/ims-user-profile/docs/sources/src/main/resources/en-US/Chapter-Integrating_The_Enabler.xml Fri Jan 7 10:09:04 2011
@@ -75,6 +75,11 @@
             long resultCode);

public String subscribePSIActivationResponse(String publicIdentity, long resultCode);
+
+ // Sh-Notify Operations Callbacks -------------------------------------------
+
+ public void receivedProfileUpdate(String userIdentity, byte[] msisdn, ShData data,
+            String originRealm, String originHost);

 }
                ]]>
@@ -201,6 +206,13 @@
                 </listitem>
             </varlistentry>

+            <varlistentry>
+ <term>The <literal>receivedProfileUpdate(String, byte[], ShData, String, String)</literal> method:</term>
+                <listitem>
+ <para>Callback from the Enabler providing a received Profile Update for a subscribed profile, for any data type.</para>
+                </listitem>
+            </varlistentry>
+
                </variablelist>

        </section>
=======================================
--- /trunk/servers/jain-slee/enablers/ims-user-profile/docs/sources/src/main/resources/en-US/Chapter-Using_The_Enabler.xml Fri Jan 7 03:06:33 2011 +++ /trunk/servers/jain-slee/enablers/ims-user-profile/docs/sources/src/main/resources/en-US/Chapter-Using_The_Enabler.xml Fri Jan 7 10:09:04 2011
@@ -27,181 +27,201 @@

   public void setParentSbb(IMSUserProfileParentSbbLocalObject parentSbb);

+  public UserDataObjectFactory getUserDataObjectFactory();
+
// Sh-Pull Operations -------------------------------------------------------

- public String getRepositoryData(String publicIdentity, byte[][] serviceIndications)
-            throws IOException;
-
- public String getIMSPublicIdentity(String publicIdentity, byte[] msisdn, int identitySet)
-            throws IOException;
-
-  public String getIMSUserState(String publicIdentity) throws IOException;
-
-  public String getSCSCFName(String publicIdentity) throws IOException;
-
- public String getInitialFilterCriteria(String publicIdentity, String serverName) + public String getRepositoryData(String publicIdentity, byte[][] serviceIndications, + String destinationRealm, String destinationHost) throws IOException;
+
+ public String getIMSPublicIdentity(String publicIdentity, byte[] msisdn, int identitySet, + String destinationRealm, String destinationHost) throws IOException;
+
+ public String getIMSUserState(String publicIdentity, String destinationRealm,
+            String destinationHost) throws IOException;
+
+ public String getSCSCFName(String publicIdentity, String destinationRealm, String destinationHost)
             throws IOException;

- public String getLocationInformation(byte[] msisdn, int requestedDomain) throws IOException;
-
- public String getUserState(byte[] msisdn, int requestedDomain) throws IOException;
-
- public String getChargingInformation(String publicIdentity, byte[] msisdn) throws IOException;
-
- public String getMSISDN(String publicIdentity, byte[] msisdn) throws IOException;
-
-  public String getPSIActivation(String publicIdentity) throws IOException;
+ public String getInitialFilterCriteria(String publicIdentity, String serverName, + String destinationRealm, String destinationHost) throws IOException;
+
+ public String getLocationInformation(byte[] msisdn, int requestedDomain, String destinationRealm,
+            String destinationHost) throws IOException;
+
+ public String getUserState(byte[] msisdn, int requestedDomain, String destinationRealm,
+            String destinationHost) throws IOException;
+
+ public String getChargingInformation(String publicIdentity, byte[] msisdn, String destinationRealm,
+            String destinationHost) throws IOException;
+
+ public String getMSISDN(String publicIdentity, byte[] msisdn, String destinationRealm,
+            String destinationHost) throws IOException;
+
+ public String getPSIActivation(String publicIdentity, String destinationRealm,
+            String destinationHost) throws IOException;

// Sh-Update Operations -----------------------------------------------------

- public String updateRepositoryData(String publicIdentity, ShData data) throws IOException;
-
- public String updatePSIActivation(String publicIdentity, ShData data) throws IOException; + public String updateRepositoryData(String publicIdentity, ShData data, String destinationRealm,
+            String destinationHost) throws IOException;
+
+ public String updatePSIActivation(String publicIdentity, ShData data, String destinationRealm,
+            String destinationHost) throws IOException;

// Sh-Subscribe Operations --------------------------------------------------

public String subscribeRepositoryData(String publicIdentity, byte[][] serviceIndications,
-            int subscriptionRequestType) throws IOException;
-
- public String subscribeIMSUserState(String publicIdentity, int subscriptionRequestType) + int subscriptionRequestType, String destinationRealm, String destinationHost)
             throws IOException;

- public String subscribeSCSCFName(String publicIdentity, int subscriptionRequestType)
-            throws IOException;
-
- public String subscribeInitialFilterCriteria(String publicIdentity, String serverName,
-            int subscriptionRequestType) throws IOException;
-
- public String subscribePSIActivation(String publicIdentity, int subscriptionRequestType) + public String subscribeIMSUserState(String publicIdentity, int subscriptionRequestType, + String destinationRealm, String destinationHost) throws IOException;
+
+ public String subscribeSCSCFName(String publicIdentity, int subscriptionRequestType, + String destinationRealm, String destinationHost) throws IOException;
+
+ public String subscribeInitialFilterCriteria(String publicIdentity, String serverName, + int subscriptionRequestType, String destinationRealm, String destinationHost)
             throws IOException;

+ public String subscribePSIActivation(String publicIdentity, int subscriptionRequestType, + String destinationRealm, String destinationHost) throws IOException;
+
 }
                ]]>
                </programlisting>

                <variablelist>

-                       <varlistentry>
- <term>The <literal>setParentSbb(IMSUserProfileParentSbbLocalObject)</literal> method:</term>
-                               <listitem>
- <para>Passes the Parent's SbbLocalObject, which will be used by the Child Sbb to provide async results. If not invoked after the child creation the Enabler won't be able to callback the Parent Sbb.</para>
-                               </listitem>
-                       </varlistentry>
+            <varlistentry>
+ <term>The <literal>setParentSbb(IMSUserProfileParentSbbLocalObject)</literal> method:</term>
+                <listitem>
+ <para>Passes the Parent's SbbLocalObject, which will be used by the Child Sbb to provide async results. If not invoked after the child creation the Enabler won't be able to callback the Parent Sbb.</para>
+                </listitem>
+            </varlistentry>

             <varlistentry>
- <term>The <literal>getRepositoryData(String, byte[][])</literal> method:</term> + <term>The <literal>getUserDataObjectFactory()</literal> method:</term>
+                <listitem>
+ <para>Returns the UserDataObjectFactory to allow to create ShData objects to be passed while updating profiles.</para>
+                </listitem>
+            </varlistentry>
+
+            <varlistentry>
+ <term>The <literal>getRepositoryData(String, byte[][], String, String)</literal> method:</term>
                 <listitem>
<para>Retrieves the "Repository Data" data type from the HSS, for the specified Public Identity and Service Indication(s). Response is provided through parent's callback deliverRepositoryData(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>getIMSPublicIdentity(String, byte[], int)</literal> method:</term> + <term>The <literal>getIMSPublicIdentity(String, byte[], int, String, String)</literal> method:</term>
                 <listitem>
<para>Retrieves the "IMS Public Identity" data type from the HSS, for the specified Public Identity or MSISDN, and Identity Set. Response is provided through parent's callback deliverIMSPublicIdentity(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>getIMSUserState(String)</literal> method:</term> + <term>The <literal>getIMSUserState(String, String, String)</literal> method:</term>
                 <listitem>
<para>Retrieves the "IMS User State" data type from the HSS, for the specified Public Identity. Response is provided through parent's callback deliverIMSUserState(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getSCSCFName(String)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getSCSCFName(String, String, String)</literal> method:</term>
                 <listitem>
<para>Retrieves the "S-CSCF Name" data type from the HSS, for the specified Public Identity. Response is provided through parent's callback deliverSCSCFName(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getInitialFilterCriteria(String, String)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getInitialFilterCriteria(String, String, String, String)</literal> method:</term>
                 <listitem>
<para>Retrieves the "Initial Filter Criteria" data type from the HSS, for the specified Public Identity and Server Name. Response is provided through parent's callback deliverInitialFilterCriteria(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getLocationInformation(byte[], int)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getLocationInformation(byte[], int, String, String)</literal> method:</term>
                 <listitem>
<para>Retrieves the "Location Information" data type from the HSS, for the specified MSISDN and Requested Domain. Response is provided through parent's callback deliverLocationInformation(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getUserState(byte[], int)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getUserState(byte[], int, String, String)</literal> method:</term>
                 <listitem>
<para>Retrieves the "User State" data type from the HSS, for the specified MSISDN and Requested Domain. Response is provided through parent's callback deliverUserState(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getChargingInformation(String, byte[])</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getChargingInformation(String, byte[], String, String)</literal> method:</term>
                 <listitem>
<para>Retrieves the "Charging Information" data type from the HSS, for the specified Public Identity or MSISDN. Response is provided through parent's callback deliverChargingInformation(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getMSISDN(String, byte[])</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getMSISDN(String, byte[], String, String)</literal> method:</term>
                 <listitem>
<para>Retrieves the "MSISDN" data type from the HSS, for the specified Public Identity or MSISDN. Response is provided through parent's callback deliverMSISDN(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getPSIActivation(String)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.getPSIActivation(String, String, String)</literal> method:</term>
                 <listitem>
<para>Retrieves the "PSI Activation" data type from the HSS, for the specified Public Identity. Response is provided through parent's callback deliverPSIActivation(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.updateRepositoryData(String, ShData)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.updateRepositoryData(String, ShData, String, String)</literal> method:</term>
                 <listitem>
<para>Updates the "Repository Data" data type from the HSS, for the specified Public Identity. Response is provided through parent's callback updateRepositoryDataResponse(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.updatePSIActivation(String, ShData)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.updatePSIActivation(String, ShData, String, String)</literal> method:</term>
                 <listitem>
<para>Updates the "PSI Activation" data type from the HSS, for the specified Public Identity. Response is provided through parent's callback updatePSIActivationResponse(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.subscribeRepositoryData(String, byte[][], int)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.subscribeRepositoryData(String, byte[][], int, String, String)</literal> method:</term>
                 <listitem>
<para>Subscribes/Unsubcribes (depending on Subscription-Request-Type value) to the "Repository Data" data type from the HSS, for the specified Public Identity and Service Indication(s). Response is provided through parent's callback subscribeRepositoryDataResponse(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.subscribeIMSUserState(String, int)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.subscribeIMSUserState(String, int, String, String)</literal> method:</term>
                 <listitem>
<para>Subscribes/Unsubcribes (depending on Subscription-Request-Type value) to the "IMS User State" data type from the HSS, for the specified Public Identity. Response is provided through parent's callback subscribeIMSUserStateResponse(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.subscribeSCSCFName(String, int)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.subscribeSCSCFName(String, int, String, String)</literal> method:</term>
                 <listitem>
<para>Subscribes/Unsubcribes (depending on Subscription-Request-Type value) to the "S-CSCF Name" data type from the HSS, for the specified Public Identity. Response is provided through parent's callback subscribeSCSCFNameResponse(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.subscribeInitialFilterCriteria(String, String, int)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.subscribeInitialFilterCriteria(String, String, int, String, String)</literal> method:</term>
                 <listitem>
<para>Subscribes/Unsubcribes (depending on Subscription-Request-Type value) to the "Initial Filter Criteria" data type from the HSS, for the specified Public Identity and Server Name. Response is provided through parent's callback subscribeInitialFilterCriteriaResponse(...).</para>
                 </listitem>
             </varlistentry>

             <varlistentry>
- <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.subsribePSIActivation(String, int)</literal> method:</term> + <term>The <literal>org.mobicents.slee.enabler.ims.userprofile.IMSUserProfileChild.subsribePSIActivation(String, int, String, String)</literal> method:</term>
                 <listitem>
<para>Subscribes/Unsubcribes (depending on Subscription-Request-Type value) to the "PSIActivation" data type from the HSS, for the specified Public Identity and Service Indication(s). Response is provided through parent's callback subsribePSIActivationResponse(...).</para>
                 </listitem>
=======================================
--- /trunk/servers/jain-slee/enablers/ims-user-profile/sbb/src/main/java/org/mobicents/slee/enabler/ims/userprofile/IMSUserProfileChild.java Thu Jan 6 13:29:47 2011 +++ /trunk/servers/jain-slee/enablers/ims-user-profile/sbb/src/main/java/org/mobicents/slee/enabler/ims/userprofile/IMSUserProfileChild.java Fri Jan 7 10:09:04 2011
@@ -80,42 +80,42 @@

// Sh-Pull Operations -------------------------------------------------------

- public String getRepositoryData(String publicIdentity, byte[][] serviceIndication) throws IOException;
-
- public String getIMSPublicIdentity(String publicIdentity, byte[] msisdn, int identitySet) throws IOException;
-
-  public String getIMSUserState(String publicIdentity) throws IOException;
-
-  public String getSCSCFName(String publicIdentity) throws IOException;
-
- public String getInitialFilterCriteria(String publicIdentity, String serverName) throws IOException;
-
- public String getLocationInformation(byte[] msisdn, int requestedDomain) throws IOException;
-
- public String getUserState(byte[] msisdn, int requestedDomain) throws IOException;
-
- public String getChargingInformation(String publicIdentity, byte[] msisdn) throws IOException;
-
- public String getMSISDN(String publicIdentity, byte[] msisdn) throws IOException;
-
-  public String getPSIActivation(String publicIdentity) throws IOException;
+ public String getRepositoryData(String publicIdentity, byte[][] serviceIndication, String destinationRealm, String destinationHost) throws IOException;
+
+ public String getIMSPublicIdentity(String publicIdentity, byte[] msisdn, int identitySet, String destinationRealm, String destinationHost) throws IOException;
+
+ public String getIMSUserState(String publicIdentity, String destinationRealm, String destinationHost) throws IOException;
+
+ public String getSCSCFName(String publicIdentity, String destinationRealm, String destinationHost) throws IOException;
+
+ public String getInitialFilterCriteria(String publicIdentity, String serverName, String destinationRealm, String destinationHost) throws IOException;
+
+ public String getLocationInformation(byte[] msisdn, int requestedDomain, String destinationRealm, String destinationHost) throws IOException;
+
+ public String getUserState(byte[] msisdn, int requestedDomain, String destinationRealm, String destinationHost) throws IOException;
+
+ public String getChargingInformation(String publicIdentity, byte[] msisdn, String destinationRealm, String destinationHost) throws IOException;
+
+ public String getMSISDN(String publicIdentity, byte[] msisdn, String destinationRealm, String destinationHost) throws IOException;
+
+ public String getPSIActivation(String publicIdentity, String destinationRealm, String destinationHost) throws IOException;

// Sh-Update Operations -----------------------------------------------------

- public String updateRepositoryData(String publicIdentity, ShData data) throws IOException;
-
- public String updatePSIActivation(String publicIdentity, ShData data) throws IOException; + public String updateRepositoryData(String publicIdentity, ShData data, String destinationRealm, String destinationHost) throws IOException;
+
+ public String updatePSIActivation(String publicIdentity, ShData data, String destinationRealm, String destinationHost) throws IOException;

// Sh-Subscribe Operations --------------------------------------------------

- public String subscribeRepositoryData(String publicIdentity, byte[][] serviceIndication, int subscriptionRequestType) throws IOException;
-
- public String subscribeIMSUserState(String publicIdentity, int subscriptionRequestType) throws IOException;
-
- public String subscribeSCSCFName(String publicIdentity, int subscriptionRequestType) throws IOException;
-
- public String subscribeInitialFilterCriteria(String publicIdentity, String serverName, int subscriptionRequestType) throws IOException;
-
- public String subscribePSIActivation(String publicIdentity, int subscriptionRequestType) throws IOException; + public String subscribeRepositoryData(String publicIdentity, byte[][] serviceIndication, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException;
+
+ public String subscribeIMSUserState(String publicIdentity, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException;
+
+ public String subscribeSCSCFName(String publicIdentity, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException;
+
+ public String subscribeInitialFilterCriteria(String publicIdentity, String serverName, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException;
+
+ public String subscribePSIActivation(String publicIdentity, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException;

 }
=======================================
--- /trunk/servers/jain-slee/enablers/ims-user-profile/sbb/src/main/java/org/mobicents/slee/enabler/ims/userprofile/IMSUserProfileChildSbb.java Fri Jan 7 03:06:33 2011 +++ /trunk/servers/jain-slee/enablers/ims-user-profile/sbb/src/main/java/org/mobicents/slee/enabler/ims/userprofile/IMSUserProfileChildSbb.java Fri Jan 7 10:09:04 2011
@@ -36,11 +36,13 @@

import org.mobicents.slee.resource.diameter.sh.events.avp.userdata.ObjectFactory;

+import net.java.slee.resource.diameter.base.events.avp.DiameterIdentity;
 import net.java.slee.resource.diameter.sh.DiameterShAvpFactory;
 import net.java.slee.resource.diameter.sh.client.ShClientActivity;
import net.java.slee.resource.diameter.sh.client.ShClientActivityContextInterfaceFactory;
 import net.java.slee.resource.diameter.sh.client.ShClientMessageFactory;
 import net.java.slee.resource.diameter.sh.client.ShClientProvider;
+import net.java.slee.resource.diameter.sh.client.ShClientSubscriptionActivity;
 import net.java.slee.resource.diameter.sh.events.DiameterShMessage;
 import net.java.slee.resource.diameter.sh.events.ProfileUpdateAnswer;
 import net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest;
@@ -82,11 +84,17 @@
     return new ObjectFactory();
   }

- public String getRepositoryData(String publicIdentity, byte[][] serviceIndications) throws IOException { + public String getRepositoryData(String publicIdentity, byte[][] serviceIndications, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.REPOSITORY_DATA);
     udr.setServiceIndications(serviceIndications);
+
+    // Set destination -- Realm is mandatory, host is optional
+    udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      udr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendUserDataRequest(udr);
@@ -98,11 +106,17 @@
     return activity.getSessionId();
   }

- public String getIMSPublicIdentity(String publicIdentity, byte[] msisdn, int identitySet) throws IOException { + public String getIMSPublicIdentity(String publicIdentity, byte[] msisdn, int identitySet, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, msisdn);

UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.IMS_PUBLIC_IDENTITY);
     udr.setIdentitySet(IdentitySetType.fromInt(identitySet));
+
+    // Set destination -- Realm is mandatory, host is optional
+    udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      udr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendUserDataRequest(udr);
@@ -114,10 +128,16 @@
     return activity.getSessionId();
   }

-  public String getIMSUserState(String publicIdentity) throws IOException {
+ public String getIMSUserState(String publicIdentity, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.IMS_USER_STATE);
+
+    // Set destination -- Realm is mandatory, host is optional
+    udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      udr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendUserDataRequest(udr);
@@ -129,10 +149,16 @@
     return activity.getSessionId();
   }

-  public String getSCSCFName(String publicIdentity) throws IOException {
+ public String getSCSCFName(String publicIdentity, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.S_CSCFNAME);
+
+    // Set destination -- Realm is mandatory, host is optional
+    udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      udr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendUserDataRequest(udr);
@@ -144,11 +170,17 @@
     return activity.getSessionId();
   }

- public String getInitialFilterCriteria(String publicIdentity, String serverName) throws IOException { + public String getInitialFilterCriteria(String publicIdentity, String serverName, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.INITIAL_FILTER_CRITERIA);
     udr.setServerName(serverName);
+
+    // Set destination -- Realm is mandatory, host is optional
+    udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      udr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendUserDataRequest(udr);
@@ -160,11 +192,17 @@
     return activity.getSessionId();
   }

- public String getLocationInformation(byte[] msisdn, int requestedDomain) throws IOException { + public String getLocationInformation(byte[] msisdn, int requestedDomain, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(null, msisdn);

UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.LOCATION_INFORMATION);
     udr.setRequestedDomain(RequestedDomainType.fromInt(requestedDomain));
+
+    // Set destination -- Realm is mandatory, host is optional
+    udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      udr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendUserDataRequest(udr);
@@ -176,11 +214,17 @@
     return activity.getSessionId();
   }

- public String getUserState(byte[] msisdn, int requestedDomain) throws IOException { + public String getUserState(byte[] msisdn, int requestedDomain, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(null, msisdn);

UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.USER_STATE);
     udr.setRequestedDomain(RequestedDomainType.fromInt(requestedDomain));
+
+    // Set destination -- Realm is mandatory, host is optional
+    udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      udr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendUserDataRequest(udr);
@@ -192,10 +236,16 @@
     return activity.getSessionId();
   }

- public String getChargingInformation(String publicIdentity, byte[] msisdn) throws IOException { + public String getChargingInformation(String publicIdentity, byte[] msisdn, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, msisdn);

UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.CHARGING_INFORMATION);
+
+    // Set destination -- Realm is mandatory, host is optional
+    udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      udr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendUserDataRequest(udr);
@@ -207,10 +257,16 @@
     return activity.getSessionId();
   }

- public String getMSISDN(String publicIdentity, byte[] msisdn) throws IOException { + public String getMSISDN(String publicIdentity, byte[] msisdn, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, msisdn);

UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.MSISDN);
+
+    // Set destination -- Realm is mandatory, host is optional
+    udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      udr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendUserDataRequest(udr);
@@ -222,10 +278,16 @@
     return activity.getSessionId();
   }

- public String getPSIActivation(String publicIdentity) throws IOException { + public String getPSIActivation(String publicIdentity, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.PSI_ACTIVATION);
+
+    // Set destination -- Realm is mandatory, host is optional
+    udr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      udr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendUserDataRequest(udr);
@@ -237,7 +299,7 @@
     return activity.getSessionId();
   }

- public String updateRepositoryData(String publicIdentity, ShData data) throws IOException { + public String updateRepositoryData(String publicIdentity, ShData data, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

// Constructor does not allow to use ShData directly, using empty and filling separately
@@ -246,6 +308,12 @@
     pur.setUserIdentity(publicIdentityAvp);
     pur.setDataReference(DataReferenceType.REPOSITORY_DATA);
     pur.setUserDataObject(data);
+
+    // Set destination -- Realm is mandatory, host is optional
+    pur.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      pur.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendProfileUpdateRequest(pur);
@@ -257,7 +325,7 @@
     return activity.getSessionId();
   }

- public String updatePSIActivation(String publicIdentity, ShData data) throws IOException { + public String updatePSIActivation(String publicIdentity, ShData data, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

// Constructor does not allow to use ShData directly, using empty and filling separately
@@ -266,6 +334,12 @@
     pur.setUserIdentity(publicIdentityAvp);
     pur.setDataReference(DataReferenceType.PSI_ACTIVATION);
     pur.setUserDataObject(data);
+
+    // Set destination -- Realm is mandatory, host is optional
+    pur.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      pur.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendProfileUpdateRequest(pur);
@@ -277,7 +351,7 @@
     return activity.getSessionId();
   }

- public String subscribeRepositoryData(String publicIdentity, byte[][] serviceIndications, int subscriptionRequestType) throws IOException { + public String subscribeRepositoryData(String publicIdentity, byte[][] serviceIndications, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

SubscribeNotificationsRequest snr = diameterShClientMessageFactory.createSubscribeNotificationsRequest(publicIdentityAvp, DataReferenceType.REPOSITORY_DATA, SubsReqType.fromInt(subscriptionRequestType));
@@ -289,6 +363,12 @@
     }

     snr.setServiceIndications(serviceIndicationStrings);
+
+    // Set destination -- Realm is mandatory, host is optional
+    snr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      snr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendSubscribeNotificationsRequest(snr);
@@ -300,10 +380,16 @@
     return activity.getSessionId();
   }

- public String subscribeIMSUserState(String publicIdentity, int subscriptionRequestType) throws IOException { + public String subscribeIMSUserState(String publicIdentity, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

SubscribeNotificationsRequest snr = diameterShClientMessageFactory.createSubscribeNotificationsRequest(publicIdentityAvp, DataReferenceType.IMS_USER_STATE, SubsReqType.fromInt(subscriptionRequestType));
+
+    // Set destination -- Realm is mandatory, host is optional
+    snr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      snr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendSubscribeNotificationsRequest(snr);
@@ -315,10 +401,16 @@
     return activity.getSessionId();
   }

- public String subscribeSCSCFName(String publicIdentity, int subscriptionRequestType) throws IOException { + public String subscribeSCSCFName(String publicIdentity, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

SubscribeNotificationsRequest snr = diameterShClientMessageFactory.createSubscribeNotificationsRequest(publicIdentityAvp, DataReferenceType.S_CSCFNAME, SubsReqType.fromInt(subscriptionRequestType));
+
+    // Set destination -- Realm is mandatory, host is optional
+    snr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      snr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendSubscribeNotificationsRequest(snr);
@@ -330,11 +422,17 @@
     return activity.getSessionId();
   }

- public String subscribeInitialFilterCriteria(String publicIdentity, String serverName, int subscriptionRequestType) throws IOException { + public String subscribeInitialFilterCriteria(String publicIdentity, String serverName, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

SubscribeNotificationsRequest snr = diameterShClientMessageFactory.createSubscribeNotificationsRequest(publicIdentityAvp, DataReferenceType.INITIAL_FILTER_CRITERIA, SubsReqType.fromInt(subscriptionRequestType));
     snr.setServerName(serverName);
+
+    // Set destination -- Realm is mandatory, host is optional
+    snr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      snr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendSubscribeNotificationsRequest(snr);
@@ -346,10 +444,16 @@
     return activity.getSessionId();
   }

- public String subscribePSIActivation(String publicIdentity, int subscriptionRequestType) throws IOException { + public String subscribePSIActivation(String publicIdentity, int subscriptionRequestType, String destinationRealm, String destinationHost) throws IOException { UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);

SubscribeNotificationsRequest snr = diameterShClientMessageFactory.createSubscribeNotificationsRequest(publicIdentityAvp, DataReferenceType.PSI_ACTIVATION, SubsReqType.fromInt(subscriptionRequestType));
+
+    // Set destination -- Realm is mandatory, host is optional
+    snr.setDestinationRealm(new DiameterIdentity(destinationRealm));
+    if(destinationHost != null) {
+      snr.setDestinationHost(new DiameterIdentity(destinationHost));
+    }

     ShClientActivity activity = getShClientActivity();
     activity.sendSubscribeNotificationsRequest(snr);
@@ -491,7 +595,30 @@
   }

public void onPushNotificationRequest(PushNotificationRequest event, RequestMappingACI aci) {
-    // TODO: Fill method
+    // Send success response
+    try {
+ ShClientSubscriptionActivity activity = (ShClientSubscriptionActivity) aci.getActivity();
+      activity.sendPushNotificationAnswer(2001L, true);
+    }
+    catch (IOException e) {
+      tracer.warning("Failed to sen Push-Notification-Answer.", e);
+    }
+
+    // Retrieve useful data from request
+    String [] userIdentityValues = getUserIdentityValues(event);
+
+    ShData data = null;
+
+    try {
+      data = event.getUserDataObject();
+    }
+    catch (Exception e) {
+ tracer.severe("Unable to extract User-Data from Push-Notification-Request.", e);
+      return;
+    }
+
+    // Deliver to parent
+ getParentSbbCMP().receivedProfileUpdate(userIdentityValues[0], userIdentityValues[1].getBytes(), data, event.getOriginRealm().toString(), event.getOriginHost().toString());
   }

public void onUserDataAnswer(UserDataAnswer event, RequestMappingACI aci) {
=======================================
--- /trunk/servers/jain-slee/enablers/ims-user-profile/sbb/src/main/java/org/mobicents/slee/enabler/ims/userprofile/IMSUserProfileParent.java Fri Jan 7 03:06:33 2011 +++ /trunk/servers/jain-slee/enablers/ims-user-profile/sbb/src/main/java/org/mobicents/slee/enabler/ims/userprofile/IMSUserProfileParent.java Fri Jan 7 10:09:04 2011
@@ -70,4 +70,8 @@

public String subscribePSIActivationResponse(String publicIdentity, int subscriptionRequestType, long resultCode);

-}
+ // Sh-Notify Operations Callbacks -------------------------------------------
+
+ public void receivedProfileUpdate(String userIdentity, byte[] msisdn, ShData data, String originRealm, String originHost);
+
+}

Reply via email to