Search in sources :

Example 1 with Request

use of org.jdiameter.api.Request in project jain-slee.diameter by RestComm.

the class RoClientSessionActivityImpl method sendTerminationRoCreditControlRequest.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.ro.RoClientSessionActivity#sendTerminationRoCreditControlRequest(net.java.slee.resource.diameter.ro.events.RoCreditControlRequest)
   */
public void sendTerminationRoCreditControlRequest(RoCreditControlRequest ccr) throws IOException {
    // This should not be used to terminate sub-sessions!
    validateState(ccr);
    DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
    try {
        session.sendCreditControlRequest(new RoCreditControlRequestImpl((Request) msg.getGenericData()));
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        throw new IOException("Failed to send message, due to: " + e);
    }
}
Also used : RoCreditControlRequestImpl(org.jdiameter.common.impl.app.ro.RoCreditControlRequestImpl) RoCreditControlRequest(net.java.slee.resource.diameter.ro.events.RoCreditControlRequest) Request(org.jdiameter.api.Request) IOException(java.io.IOException) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) DiameterException(net.java.slee.resource.diameter.base.DiameterException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)

Example 2 with Request

use of org.jdiameter.api.Request in project jain-slee.diameter by RestComm.

the class RoClientSessionActivityImpl method sendEventRoCreditControlRequest.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.ro.RoClientSessionActivity#sendEventRoCreditControlRequest(net.java.slee.resource.diameter.ro.events.RoCreditControlRequest)
   */
public void sendEventRoCreditControlRequest(RoCreditControlRequest ccr) throws IOException {
    // fetchCurrentState(ccr);
    DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
    validateState(ccr);
    try {
        session.sendCreditControlRequest(new RoCreditControlRequestImpl((Request) msg.getGenericData()));
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        if (logger.isDebugEnabled()) {
            logger.debug("Failed to send message.", e);
        }
        throw new IOException("Failed to send message, due to: " + e);
    }
}
Also used : RoCreditControlRequestImpl(org.jdiameter.common.impl.app.ro.RoCreditControlRequestImpl) RoCreditControlRequest(net.java.slee.resource.diameter.ro.events.RoCreditControlRequest) Request(org.jdiameter.api.Request) IOException(java.io.IOException) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) DiameterException(net.java.slee.resource.diameter.base.DiameterException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)

Example 3 with Request

use of org.jdiameter.api.Request in project jain-slee.diameter by RestComm.

the class ShClientActivityImpl method sendSubscribeNotificationsRequest.

public void sendSubscribeNotificationsRequest(SubscribeNotificationsRequest message) throws IOException {
    // FIXME: IMHO this should not be here.
    try {
        DiameterMessageImpl msg = (DiameterMessageImpl) message;
        this.clientSession.sendSubscribeNotificationsRequest(new SubscribeNotificationsRequestImpl((Request) msg.getGenericData()));
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        throw new IOException("Failed to send message, due to: " + e);
    }
}
Also used : Request(org.jdiameter.api.Request) ProfileUpdateRequest(net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest) SubscribeNotificationsRequest(net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest) UserDataRequest(net.java.slee.resource.diameter.sh.events.UserDataRequest) SubscribeNotificationsRequestImpl(org.jdiameter.common.impl.app.sh.SubscribeNotificationsRequestImpl) IOException(java.io.IOException) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)

Example 4 with Request

use of org.jdiameter.api.Request in project jain-slee.diameter by RestComm.

the class ShClientSubscriptionActivityImpl method sendUnsubscribeRequest.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.sh.ShClientSubscriptionActivity#sendUnsubscribeRequest()
   */
public void sendUnsubscribeRequest() throws IOException {
    try {
        SubscribeNotificationsRequest snr = this.messageFactory.createSubscribeNotificationsRequest(getSubscribedUserIdentity(), this.dataReferenceType[0], SubsReqType.UNSUBSCRIBE);
        snr.setDataReferences(this.dataReferenceType);
        snr.setDestinationRealm(remoteRealm);
        snr.setAuthSessionState(authSessionState);
        DiameterMessageImpl msg = (DiameterMessageImpl) snr;
        this.clientSession.sendSubscribeNotificationsRequest(new SubscribeNotificationsRequestImpl((Request) msg.getGenericData()));
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        throw new IOException("Failed to send message, due to: " + e.getLocalizedMessage());
    }
}
Also used : SubscribeNotificationsRequest(net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest) SubscribeNotificationsRequest(net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest) Request(org.jdiameter.api.Request) PushNotificationRequest(net.java.slee.resource.diameter.sh.events.PushNotificationRequest) SubscribeNotificationsRequestImpl(org.jdiameter.common.impl.app.sh.SubscribeNotificationsRequestImpl) IOException(java.io.IOException) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException)

Example 5 with Request

use of org.jdiameter.api.Request in project jain-slee.diameter by RestComm.

the class CreditControlClientSessionImpl method sendTerminationCreditControlRequest.

/*
   * (non-Javadoc)
   * 
   * @seenet.java.slee.resource.diameter.cca.CreditControlClientSession#
   * sendTerminationCreditControlRequest
   * (net.java.slee.resource.diameter.cca.events.CreditControlRequest)
   */
public void sendTerminationCreditControlRequest(CreditControlRequest ccr) throws IOException {
    // This should not be used to terminate sub-sessions!
    // FIXME: Should this come already in the CCR?
    ccr.setCcRequestType(CcRequestType.TERMINATION_REQUEST);
    validateState(ccr);
    DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
    try {
        session.sendCreditControlRequest(new JCreditControlRequestImpl((Request) msg.getGenericData()));
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        throw new IOException("Failed to send message, due to: " + e);
    }
}
Also used : JCreditControlRequestImpl(org.jdiameter.common.impl.app.cca.JCreditControlRequestImpl) Request(org.jdiameter.api.Request) CreditControlRequest(net.java.slee.resource.diameter.cca.events.CreditControlRequest) IOException(java.io.IOException) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) DiameterException(net.java.slee.resource.diameter.base.DiameterException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)

Aggregations

IOException (java.io.IOException)18 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)18 Request (org.jdiameter.api.Request)18 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)17 DiameterException (net.java.slee.resource.diameter.base.DiameterException)12 SubscribeNotificationsRequest (net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest)6 CreditControlRequest (net.java.slee.resource.diameter.cca.events.CreditControlRequest)4 GxCreditControlRequest (net.java.slee.resource.diameter.gx.events.GxCreditControlRequest)4 GxReAuthRequest (net.java.slee.resource.diameter.gx.events.GxReAuthRequest)4 RoCreditControlRequest (net.java.slee.resource.diameter.ro.events.RoCreditControlRequest)4 ProfileUpdateRequest (net.java.slee.resource.diameter.sh.events.ProfileUpdateRequest)4 UserDataRequest (net.java.slee.resource.diameter.sh.events.UserDataRequest)4 JCreditControlRequestImpl (org.jdiameter.common.impl.app.cca.JCreditControlRequestImpl)4 GxCreditControlRequestImpl (org.jdiameter.common.impl.app.gx.GxCreditControlRequestImpl)4 RoCreditControlRequestImpl (org.jdiameter.common.impl.app.ro.RoCreditControlRequestImpl)4 PushNotificationRequest (net.java.slee.resource.diameter.sh.events.PushNotificationRequest)3 SubscribeNotificationsRequestImpl (org.jdiameter.common.impl.app.sh.SubscribeNotificationsRequestImpl)3 ProfileUpdateRequestImpl (org.jdiameter.common.impl.app.sh.ProfileUpdateRequestImpl)1 PushNotificationRequestImpl (org.jdiameter.common.impl.app.sh.PushNotificationRequestImpl)1 UserDataRequestImpl (org.jdiameter.common.impl.app.sh.UserDataRequestImpl)1