Search in sources :

Example 1 with IdentitySetType

use of net.java.slee.resource.diameter.sh.events.avp.IdentitySetType 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 2 with IdentitySetType

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

the class HSSClientChildSbb method onUserDataAnswer.

public void onUserDataAnswer(UserDataAnswer event, RequestMappingACI aci) {
    MessageData udrData = aci.getRequestData();
    String data = new String(event.getUserData());
    long resultCode = event.getResultCode();
    // only one data ref should be present.. but at least one must!
    DataReferenceType dataRef = udrData.getDataReferences()[0];
    switch(dataRef.getValue()) {
        case DataReferenceType._REPOSITORY_DATA:
            getParent().deliverRepositoryData(udrData.getPublicIdentity(), udrData.getServiceIndications(), resultCode, data);
            break;
        case DataReferenceType._IMS_PUBLIC_IDENTITY:
            IdentitySetType[] identitySets = udrData.getIdentitySets();
            int[] intIdentitySets = new int[identitySets.length];
            for (int i = 0; i < identitySets.length; i++) {
                intIdentitySets[i] = identitySets[i].getValue();
            }
            getParent().deliverIMSPublicIdentity(udrData.getPublicIdentity(), udrData.getMsisdn(), intIdentitySets, resultCode, data);
            break;
        case DataReferenceType._IMS_USER_STATE:
            getParent().deliverIMSUserState(udrData.getPublicIdentity(), resultCode, data);
            break;
        case DataReferenceType._S_CSCFNAME:
            getParent().deliverSCSCFName(udrData.getPublicIdentity(), resultCode, data);
            break;
        case DataReferenceType._INITIAL_FILTER_CRITERIA:
            getParent().deliverInitialFilterCriteria(udrData.getPublicIdentity(), udrData.getServerName(), resultCode, data);
            break;
        case DataReferenceType._LOCATION_INFORMATION:
            RequestedDomainType requestedDomain = udrData.getRequestedDomain();
            getParent().deliverLocationInformation(udrData.getMsisdn(), requestedDomain != null ? requestedDomain.getValue() : null, resultCode, data);
            break;
        case DataReferenceType._USER_STATE:
            requestedDomain = udrData.getRequestedDomain();
            getParent().deliverUserState(udrData.getMsisdn(), requestedDomain != null ? requestedDomain.getValue() : null, resultCode, data);
            break;
        case DataReferenceType._CHARGING_INFORMATION:
            getParent().deliverChargingInformation(udrData.getPublicIdentity(), udrData.getMsisdn(), resultCode, data);
            break;
        case DataReferenceType._MSISDN:
            getParent().deliverMSISDN(udrData.getPublicIdentity(), udrData.getMsisdn(), resultCode, data);
            break;
        case DataReferenceType._PSI_ACTIVATION:
            getParent().deliverPSIActivation(udrData.getPublicIdentity(), resultCode, data);
            break;
        default:
    }
    aci.detach(sbbContext.getSbbLocalObject());
}
Also used : IdentitySetType(net.java.slee.resource.diameter.sh.events.avp.IdentitySetType) DataReferenceType(net.java.slee.resource.diameter.sh.events.avp.DataReferenceType) RequestedDomainType(net.java.slee.resource.diameter.sh.events.avp.RequestedDomainType)

Aggregations

IdentitySetType (net.java.slee.resource.diameter.sh.events.avp.IdentitySetType)2 DiameterIdentity (net.java.slee.resource.diameter.base.events.avp.DiameterIdentity)1 ShClientActivity (net.java.slee.resource.diameter.sh.client.ShClientActivity)1 UserDataRequest (net.java.slee.resource.diameter.sh.events.UserDataRequest)1 DataReferenceType (net.java.slee.resource.diameter.sh.events.avp.DataReferenceType)1 RequestedDomainType (net.java.slee.resource.diameter.sh.events.avp.RequestedDomainType)1 UserIdentityAvp (net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)1