Search in sources :

Example 1 with GxCreditControlRequestImpl

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

the class GxClientSessionActivityImpl method sendUpdateGxCreditControlRequest.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diametergx.GxClientSessionActivity#sendUpdateRoCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest)
   */
public void sendUpdateGxCreditControlRequest(final GxCreditControlRequest ccr) throws IOException {
    // FIXME: Should this come already in the CCR?
    validateState(ccr);
    final DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
    try {
        session.sendCreditControlRequest(new GxCreditControlRequestImpl((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) GxCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest) GxReAuthRequest(net.java.slee.resource.diameter.gx.events.GxReAuthRequest) GxCreditControlRequestImpl(org.jdiameter.common.impl.app.gx.GxCreditControlRequestImpl) 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 GxCreditControlRequestImpl

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

the class GxClientSessionActivityImpl method sendTerminationGxCreditControlRequest.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diametergx.GxClientSessionActivity#sendTerminationRoCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest)
   */
public void sendTerminationGxCreditControlRequest(final GxCreditControlRequest ccr) throws IOException {
    // This should not be used to terminate sub-sessions!
    validateState(ccr);
    final DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
    try {
        session.sendCreditControlRequest(new GxCreditControlRequestImpl((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) GxCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest) GxReAuthRequest(net.java.slee.resource.diameter.gx.events.GxReAuthRequest) GxCreditControlRequestImpl(org.jdiameter.common.impl.app.gx.GxCreditControlRequestImpl) 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 GxCreditControlRequestImpl

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

the class GxClientSessionActivityImpl method sendInitialGxCreditControlRequest.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diametergx.GxClientSessionActivity#sendInitialRoCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest)
   */
public void sendInitialGxCreditControlRequest(final GxCreditControlRequest ccr) throws IOException {
    // FIXME: should this affect FSM ?
    validateState(ccr);
    final DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
    try {
        session.sendCreditControlRequest(new GxCreditControlRequestImpl((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) GxCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest) GxReAuthRequest(net.java.slee.resource.diameter.gx.events.GxReAuthRequest) GxCreditControlRequestImpl(org.jdiameter.common.impl.app.gx.GxCreditControlRequestImpl) 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 GxCreditControlRequestImpl

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

the class GxClientSessionActivityImpl method sendEventGxCreditControlRequest.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diametergx.GxClientSessionActivity#sendEventGxCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest)
   */
public void sendEventGxCreditControlRequest(final GxCreditControlRequest ccr) throws IOException {
    // fetchCurrentState(ccr);
    final DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
    validateState(ccr);
    try {
        session.sendCreditControlRequest(new GxCreditControlRequestImpl((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 : Request(org.jdiameter.api.Request) GxCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest) GxReAuthRequest(net.java.slee.resource.diameter.gx.events.GxReAuthRequest) GxCreditControlRequestImpl(org.jdiameter.common.impl.app.gx.GxCreditControlRequestImpl) 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 GxCreditControlRequest (net.java.slee.resource.diameter.gx.events.GxCreditControlRequest)4 GxReAuthRequest (net.java.slee.resource.diameter.gx.events.GxReAuthRequest)4 Request (org.jdiameter.api.Request)4 GxCreditControlRequestImpl (org.jdiameter.common.impl.app.gx.GxCreditControlRequestImpl)4 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)4