Search in sources :

Example 71 with AvpNotAllowedException

use of net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException 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 72 with AvpNotAllowedException

use of net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException 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 73 with AvpNotAllowedException

use of net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException 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)

Example 74 with AvpNotAllowedException

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

the class GxServerSessionActivityImpl method sendGxCreditControlAnswer.

/**
 * {@inheritDoc}
 */
@Override
public void sendGxCreditControlAnswer(final GxCreditControlAnswer cca) throws IOException {
    fetchCurrentState(cca);
    final DiameterMessageImpl msg = (DiameterMessageImpl) cca;
    try {
        session.sendCreditControlAnswer(new GxCreditControlAnswerImpl((Answer) msg.getGenericData()));
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        final AvpNotAllowedException anae = new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
        throw anae;
    } catch (Exception e) {
        throw new IOException("Failed to send message.", e);
    }
}
Also used : GxCreditControlAnswer(net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer) Answer(org.jdiameter.api.Answer) GxCreditControlAnswerImpl(org.jdiameter.common.impl.app.gx.GxCreditControlAnswerImpl) 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 75 with AvpNotAllowedException

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

the class RfServerSessionActivityImpl method sendRfAccountingAnswer.

public void sendRfAccountingAnswer(RfAccountingAnswer answer) throws IOException {
    try {
        RfAccountingAnswerImpl aca = (RfAccountingAnswerImpl) answer;
        this.serverSession.sendAccountAnswer(new org.jdiameter.common.impl.app.rf.RfAccountingAnswerImpl((Answer) aca.getGenericData()));
        // FIXME: check this?
        if (isTerminateAfterProcessing()) {
            endActivity();
        // this.serverSession.release();
        // 
        // if(!serverSession.isValid()) {
        // String sessionId =
        // this.serverSession.getSessions().get(0).getSessionId();
        // this.baseListener.sessionDestroyed(sessionId,
        // this.serverSession);
        // }
        }
        // clean
        clean(aca);
    } 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, due to: ", e);
        }
        throw new IOException("Failed to send message, due to: " + e.getMessage());
    }
}
Also used : RfAccountingAnswer(net.java.slee.resource.diameter.rf.events.RfAccountingAnswer) Answer(org.jdiameter.api.Answer) IOException(java.io.IOException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) RfAccountingAnswerImpl(org.mobicents.slee.resource.diameter.rf.events.RfAccountingAnswerImpl) IOException(java.io.IOException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)

Aggregations

AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)75 IOException (java.io.IOException)70 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)62 InternalException (org.jdiameter.api.InternalException)32 Answer (org.jdiameter.api.Answer)19 Request (org.jdiameter.api.Request)18 DiameterException (net.java.slee.resource.diameter.base.DiameterException)12 DiameterShMessageImpl (org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl)7 ProfileUpdateAnswer (net.java.slee.resource.diameter.sh.events.ProfileUpdateAnswer)6 SubscribeNotificationsAnswer (net.java.slee.resource.diameter.sh.events.SubscribeNotificationsAnswer)6 SubscribeNotificationsRequest (net.java.slee.resource.diameter.sh.events.SubscribeNotificationsRequest)6 UserDataAnswer (net.java.slee.resource.diameter.sh.events.UserDataAnswer)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 RoCreditControlRequestImpl (org.jdiameter.common.impl.app.ro.RoCreditControlRequestImpl)4