Search in sources :

Example 11 with SubscribeNotificationsRequest

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

the class HSSClientChildSbb method subscribeSCSCFName.

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

Example 12 with SubscribeNotificationsRequest

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

the class HSSClientChildSbb method subscribeInitialFilterCriteria.

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

Example 13 with SubscribeNotificationsRequest

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

the class HSSClientChildSbb method subscribePSIActivation.

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

Example 14 with SubscribeNotificationsRequest

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

the class HSSClientChildSbb method subscribeRepositoryData.

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

Example 15 with SubscribeNotificationsRequest

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

the class ShServerActivityImpl method createSubscribeNotificationsAnswer.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.sh.server.ShServerActivity#createSubscribeNotificationsAnswer(long, boolean)
   */
public SubscribeNotificationsAnswer createSubscribeNotificationsAnswer(long resultCode, boolean isExperimentalResult) {
    // Fetch the session stored request
    SubscribeNotificationsRequest req = (SubscribeNotificationsRequest) getSessionMessage(SubscribeNotificationsRequest.commandCode);
    SubscribeNotificationsAnswer answer = null;
    if (req != null) {
        // Create answer from it
        answer = this.messageFactory.createSubscribeNotificationsAnswer(req, resultCode, isExperimentalResult);
        // Add any extra session data
        addSessionData(answer);
    // Store request data FIXME: Commented by Alex. Is this needed?
    // ((DiameterShMessageImpl)answer).setData(req);
    }
    return answer;
}
Also used : SubscribeNotificationsRequest(net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest) SubscribeNotificationsAnswer(net.java.slee.resource.diameter.sh.events.SubscribeNotificationsAnswer)

Aggregations

SubscribeNotificationsRequest (net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest)23 Test (org.junit.Test)8 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 SubscribeNotificationsAnswer (net.java.slee.resource.diameter.sh.events.SubscribeNotificationsAnswer)7 UserIdentityAvp (net.java.slee.resource.diameter.sh.events.avp.UserIdentityAvp)7 DiameterIdentity (net.java.slee.resource.diameter.base.events.avp.DiameterIdentity)5 ShClientActivity (net.java.slee.resource.diameter.sh.client.ShClientActivity)5 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)4 IOException (java.io.IOException)3 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)3 PushNotificationRequest (net.java.slee.resource.diameter.sh.events.PushNotificationRequest)3 Request (org.jdiameter.api.Request)3 SubscribeNotificationsRequestImpl (org.jdiameter.common.impl.app.sh.SubscribeNotificationsRequestImpl)3 ProfileUpdateRequest (net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest)2 UserDataRequest (net.java.slee.resource.diameter.sh.events.UserDataRequest)2 ApplicationId (org.jdiameter.api.ApplicationId)2 DiameterShMessageImpl (org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl)2 UserIdentityAvpImpl (org.mobicents.slee.resource.diameter.sh.events.avp.UserIdentityAvpImpl)2 AvpRepresentation (org.mobicents.diameter.dictionary.AvpRepresentation)1 ShClientMessageFactoryImpl (org.mobicents.slee.resource.diameter.sh.client.ShClientMessageFactoryImpl)1