Search in sources :

Example 41 with AvpNotAllowedException

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

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

Example 43 with AvpNotAllowedException

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

the class RoServerSessionActivityImpl method sendRoCreditControlAnswer.

/*
   * (non-Javadoc)
   * 
   * @see net.java.slee.resource.diameter.cca.CreditControlServerSession#
   * sendCreditControlAnswer
   * (net.java.slee.resource.diameter.cca.events.CreditControlAnswer)
   */
public void sendRoCreditControlAnswer(RoCreditControlAnswer cca) throws IOException {
    fetchCurrentState(cca);
    DiameterMessageImpl msg = (DiameterMessageImpl) cca;
    try {
        session.sendCreditControlAnswer(new RoCreditControlAnswerImpl((Answer) 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, due to: ", e);
        }
        throw new IOException("Failed to send message, due to: " + e);
    }
}
Also used : RoCreditControlAnswer(net.java.slee.resource.diameter.ro.events.RoCreditControlAnswer) Answer(org.jdiameter.api.Answer) RoCreditControlAnswerImpl(org.jdiameter.common.impl.app.ro.RoCreditControlAnswerImpl) 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 44 with AvpNotAllowedException

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

the class RxServerSessionActivityImpl method sendAAAnswer.

/**
 * {@inheritDoc}
 */
@Override
public void sendAAAnswer(final AAAnswer aaa) throws IOException {
    fetchCurrentState(aaa);
    final DiameterMessageImpl msg = (DiameterMessageImpl) aaa;
    try {
        session.sendAAAnswer(new RxAAAnswerImpl((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 : AAAnswer(net.java.slee.resource.diameter.rx.events.AAAnswer) SessionTerminationAnswer(net.java.slee.resource.diameter.rx.events.SessionTerminationAnswer) Answer(org.jdiameter.api.Answer) RxAAAnswerImpl(org.jdiameter.common.impl.app.rx.RxAAAnswerImpl) 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 45 with AvpNotAllowedException

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

the class S13ClientSessionImpl method sendMEIdentityCheckRequest.

public void sendMEIdentityCheckRequest(MEIdentityCheckRequest ecr) throws IOException {
    DiameterMessageImpl msg = (DiameterMessageImpl) ecr;
    JMEIdentityCheckRequestImpl request = new JMEIdentityCheckRequestImpl((Request) msg.getGenericData());
    try {
        appSession.sendMEIdentityCheckRequest(request);
    } catch (org.jdiameter.api.validation.AvpNotAllowedException anae) {
        throw new AvpNotAllowedException(anae.getMessage(), anae.getAvpCode(), anae.getVendorId());
    } catch (Exception e) {
        if (logger.isDebugEnabled()) {
            logger.debug("Failed to send message.", e);
        }
        throw new IOException(e.getMessage());
    }
}
Also used : 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) InternalException(org.jdiameter.api.InternalException) JMEIdentityCheckRequestImpl(org.jdiameter.common.impl.app.s13.JMEIdentityCheckRequestImpl)

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