Search in sources :

Example 46 with AvpNotAllowedException

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

the class S13ServerSessionImpl method sendMEIdentityCheckAnswer.

public void sendMEIdentityCheckAnswer(MEIdentityCheckAnswer eca) throws IOException {
    DiameterMessageImpl msg = (DiameterMessageImpl) eca;
    JMEIdentityCheckAnswerImpl answer = new JMEIdentityCheckAnswerImpl((Answer) msg.getGenericData());
    try {
        appSession.sendMEIdentityCheckAnswer(answer);
    } 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 : JMEIdentityCheckAnswerImpl(org.jdiameter.common.impl.app.s13.JMEIdentityCheckAnswerImpl) 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)

Example 47 with AvpNotAllowedException

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

the class CxDxServerSessionImpl method sendUserAuthorizationAnswer.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.cxdx.CxDxServerSession#sendUserAuthorizationAnswer(net.java.slee.resource.diameter.cxdx.events.UserAuthorizationAnswer)
   */
public void sendUserAuthorizationAnswer(UserAuthorizationAnswer userAuthorizationAnswer) throws IOException {
    DiameterMessageImpl msg = (DiameterMessageImpl) userAuthorizationAnswer;
    JUserAuthorizationAnswerImpl answer = new JUserAuthorizationAnswerImpl((Answer) msg.getGenericData());
    try {
        appSession.sendUserAuthorizationAnswer(answer);
    } 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 : JUserAuthorizationAnswerImpl(org.jdiameter.common.impl.app.cxdx.JUserAuthorizationAnswerImpl) 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) InternalException(org.jdiameter.api.InternalException) IOException(java.io.IOException)

Example 48 with AvpNotAllowedException

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

the class CreditControlClientSessionImpl method sendCreditControlRequest.

/*
   * (non-Javadoc)
   * 
   * @seenet.java.slee.resource.diameter.cca.CreditControlClientSession#
   * sendCreditControlRequest
   * (net.java.slee.resource.diameter.cca.events.CreditControlRequest)
   */
public void sendCreditControlRequest(CreditControlRequest ccr) throws IOException {
    // fetchCurrentState(ccr);
    DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
    validateState(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) {
        if (logger.isDebugEnabled()) {
            logger.debug("Failed to send message.", 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)

Example 49 with AvpNotAllowedException

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

the class CreditControlClientSessionImpl method sendUpdateCreditControlRequest.

/*
   * (non-Javadoc)
   * 
   * @seenet.java.slee.resource.diameter.cca.CreditControlClientSession#
   * sendUpdateCreditControlRequest
   * (net.java.slee.resource.diameter.cca.events.CreditControlRequest)
   */
public void sendUpdateCreditControlRequest(CreditControlRequest ccr) throws IOException {
    // FIXME: Should this come already in the CCR?
    ccr.setCcRequestType(CcRequestType.UPDATE_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)

Example 50 with AvpNotAllowedException

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

the class CxDxClientSessionImpl method sendPushProfileAnswer.

/* (non-Javadoc)
   * @see net.java.slee.resource.diameter.cxdx.CxDxClientSession#sendPushProfileAnswer(net.java.slee.resource.diameter.cxdx.events.PushProfileAnswer)
   */
public void sendPushProfileAnswer(PushProfileAnswer pushProfileAnswer) throws IOException {
    try {
        DiameterMessageImpl msg = (DiameterMessageImpl) pushProfileAnswer;
        appSession.sendPushProfileAnswer(new JPushProfileAnswerImpl((Answer) msg.getGenericData()));
    } catch (org.jdiameter.api.validation.AvpNotAllowedException anae) {
        throw new AvpNotAllowedException(anae.getMessage(), anae.getAvpCode(), anae.getVendorId());
    } catch (Exception e) {
        throw new IOException(e.getMessage());
    }
}
Also used : RegistrationTerminationAnswer(net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationAnswer) Answer(org.jdiameter.api.Answer) PushProfileAnswer(net.java.slee.resource.diameter.cxdx.events.PushProfileAnswer) JPushProfileAnswerImpl(org.jdiameter.common.impl.app.cxdx.JPushProfileAnswerImpl) 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) InternalException(org.jdiameter.api.InternalException) IOException(java.io.IOException)

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