Search in sources :

Example 16 with UserDataRequest

use of net.java.slee.resource.diameter.sh.events.UserDataRequest in project jain-slee.diameter by RestComm.

the class HSSClientChildSbb method getSCSCFName.

public String getSCSCFName(String publicIdentity, String destinationRealm, String destinationHost) throws IOException {
    UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, null);
    UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.S_CSCFNAME);
    udr.setAuthSessionState(AuthSessionStateType.NO_STATE_MAINTAINED);
    // 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);
    // Store request for future matching
    storeRequestInACI(activity, udr);
    // Return Session-Id, may be used as identifier
    return activity.getSessionId();
}
Also used : ShClientActivity(net.java.slee.resource.diameter.sh.client.ShClientActivity) UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) DiameterIdentity(net.java.slee.resource.diameter.base.events.avp.DiameterIdentity) UserIdentityAvp(net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)

Example 17 with UserDataRequest

use of net.java.slee.resource.diameter.sh.events.UserDataRequest in project jain-slee.diameter by RestComm.

the class HSSClientChildSbb method getUserState.

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.setAuthSessionState(AuthSessionStateType.NO_STATE_MAINTAINED);
    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);
    // Store request for future matching
    storeRequestInACI(activity, udr);
    // Return Session-Id, may be used as identifier
    return activity.getSessionId();
}
Also used : ShClientActivity(net.java.slee.resource.diameter.sh.client.ShClientActivity) UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) DiameterIdentity(net.java.slee.resource.diameter.base.events.avp.DiameterIdentity) UserIdentityAvp(net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)

Example 18 with UserDataRequest

use of net.java.slee.resource.diameter.sh.events.UserDataRequest in project jain-slee.diameter by RestComm.

the class HSSClientChildSbb method getUserIdentityValues.

private String[] getUserIdentityValues(DiameterShMessage shMessage) {
    UserIdentityAvp uIdAvp = null;
    if (shMessage instanceof UserDataRequest) {
        uIdAvp = ((UserDataRequest) shMessage).getUserIdentity();
    } else if (shMessage instanceof ProfileUpdateRequest) {
        uIdAvp = ((ProfileUpdateRequest) shMessage).getUserIdentity();
    } else if (shMessage instanceof SubscribeNotificationsRequest) {
        uIdAvp = ((SubscribeNotificationsRequest) shMessage).getUserIdentity();
    } else if (shMessage instanceof PushNotificationRequest) {
        uIdAvp = ((PushNotificationRequest) shMessage).getUserIdentity();
    }
    String publicIdentity = null;
    String msisdn = null;
    if (uIdAvp != null) {
        publicIdentity = uIdAvp.getPublicIdentity();
        msisdn = uIdAvp.getMsisdn();
        if (publicIdentity == null && msisdn == null) {
            tracer.warning("Unable to retrieve Public User/Service Identity OR MSISDN. At least one of them should be present.");
        }
    } else {
        tracer.warning("User-Identity AVP missing in Diameter Sh Message.");
    }
    return new String[] { publicIdentity, msisdn };
}
Also used : UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) SubscribeNotificationsRequest(net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest) PushNotificationRequest(net.java.slee.resource.diameter.sh.events.PushNotificationRequest) ProfileUpdateRequest(net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest) UserIdentityAvp(net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)

Example 19 with UserDataRequest

use of net.java.slee.resource.diameter.sh.events.UserDataRequest in project jain-slee.diameter by RestComm.

the class HSSClientChildSbb method getIMSPublicIdentity.

public String getIMSPublicIdentity(String publicIdentity, byte[] msisdn, int[] identitySets, String destinationRealm, String destinationHost) throws IOException {
    UserIdentityAvp publicIdentityAvp = createUserIdentityAvp(publicIdentity, msisdn);
    UserDataRequest udr = diameterShClientMessageFactory.createUserDataRequest(publicIdentityAvp, DataReferenceType.IMS_PUBLIC_IDENTITY);
    udr.setAuthSessionState(AuthSessionStateType.NO_STATE_MAINTAINED);
    IdentitySetType[] typeIdentitySets = new IdentitySetType[identitySets.length];
    for (int i = 0; i < identitySets.length; i++) {
        typeIdentitySets[i] = IdentitySetType.fromInt(identitySets[i]);
    }
    udr.setIdentitySets(typeIdentitySets);
    // 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);
    // Store request for future matching
    storeRequestInACI(activity, udr);
    // Return Session-Id, may be used as identifier
    return activity.getSessionId();
}
Also used : ShClientActivity(net.java.slee.resource.diameter.sh.client.ShClientActivity) UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) DiameterIdentity(net.java.slee.resource.diameter.base.events.avp.DiameterIdentity) UserIdentityAvp(net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp) IdentitySetType(net.java.slee.resource.diameter.sh.events.avp.IdentitySetType)

Example 20 with UserDataRequest

use of net.java.slee.resource.diameter.sh.events.UserDataRequest in project jain-slee.diameter by RestComm.

the class HSSClientChildSbb method getInitialFilterCriteria.

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.setAuthSessionState(AuthSessionStateType.NO_STATE_MAINTAINED);
    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);
    // Store request for future matching
    storeRequestInACI(activity, udr);
    // Return Session-Id, may be used as identifier
    return activity.getSessionId();
}
Also used : ShClientActivity(net.java.slee.resource.diameter.sh.client.ShClientActivity) UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) DiameterIdentity(net.java.slee.resource.diameter.base.events.avp.DiameterIdentity) UserIdentityAvp(net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)

Aggregations

UserDataRequest (net.java.slee.resource.diameter.sh.events.UserDataRequest)29 UserIdentityAvp (net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)12 DiameterIdentity (net.java.slee.resource.diameter.base.events.avp.DiameterIdentity)10 ShClientActivity (net.java.slee.resource.diameter.sh.client.ShClientActivity)10 Test (org.junit.Test)10 UserDataAnswer (net.java.slee.resource.diameter.sh.events.UserDataAnswer)9 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 ShClientMessageFactoryImpl (org.mobicents.slee.resource.diameter.sh.client.ShClientMessageFactoryImpl)3 DiameterShMessageImpl (org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl)3 ShServerMessageFactoryImpl (org.mobicents.slee.resource.diameter.sh.server.ShServerMessageFactoryImpl)3 ArrayList (java.util.ArrayList)2 DiameterMessage (net.java.slee.resource.diameter.base.events.DiameterMessage)2 ProfileUpdateRequest (net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest)2 SubscribeNotificationsRequest (net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest)2 ApplicationId (org.jdiameter.api.ApplicationId)2 ServerShSession (org.jdiameter.api.sh.ServerShSession)2 ShServerSessionDataLocalImpl (org.jdiameter.server.impl.app.sh.ShServerSessionDataLocalImpl)2 ShServerSessionImpl (org.jdiameter.server.impl.app.sh.ShServerSessionImpl)2 DiameterMessageFactoryImpl (org.mobicents.slee.resource.diameter.base.DiameterMessageFactoryImpl)2 ShClientActivityAnswerCreationTest (org.mobicents.slee.resource.diameter.sh.client.tests.activities.ShClientActivityAnswerCreationTest)2