Search in sources :

Example 1 with RoCreditControlRequestImpl

use of org.jdiameter.common.impl.app.ro.RoCreditControlRequestImpl 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 2 with RoCreditControlRequestImpl

use of org.jdiameter.common.impl.app.ro.RoCreditControlRequestImpl 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 3 with RoCreditControlRequestImpl

use of org.jdiameter.common.impl.app.ro.RoCreditControlRequestImpl in project jain-slee.diameter by RestComm.

the class RoClientSessionActivityImpl method sendUpdateRoCreditControlRequest.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.ro.RoClientSessionActivity#sendUpdateRoCreditControlRequest(net.java.slee.resource.diameter.ro.events.RoCreditControlRequest)
   */
public void sendUpdateRoCreditControlRequest(RoCreditControlRequest ccr) throws IOException {
    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 4 with RoCreditControlRequestImpl

use of org.jdiameter.common.impl.app.ro.RoCreditControlRequestImpl in project jain-slee.diameter by RestComm.

the class RoClientSessionActivityImpl method sendInitialRoCreditControlRequest.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.ro.RoClientSessionActivity#sendInitialRoCreditControlRequest(net.java.slee.resource.diameter.ro.events.RoCreditControlRequest)
   */
public void sendInitialRoCreditControlRequest(RoCreditControlRequest ccr) throws IOException {
    // FIXME: should this affect FSM ?
    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)

Aggregations

IOException (java.io.IOException)4 DiameterException (net.java.slee.resource.diameter.base.DiameterException)4 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)4 RoCreditControlRequest (net.java.slee.resource.diameter.ro.events.RoCreditControlRequest)4 Request (org.jdiameter.api.Request)4 RoCreditControlRequestImpl (org.jdiameter.common.impl.app.ro.RoCreditControlRequestImpl)4 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)4