Search in sources :

Example 1 with JCreditControlAnswerImpl

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

the class CreditControlServerSessionImpl method sendCreditControlAnswer.

/*
   * (non-Javadoc)
   * 
   * @see net.java.slee.resource.diameter.cca.CreditControlServerSession#sendCreditControlAnswer(net.java.slee.resource.diameter.cca.events.CreditControlAnswer)
   */
public void sendCreditControlAnswer(CreditControlAnswer cca) throws IOException {
    fetchCurrentState(cca);
    DiameterMessageImpl msg = (DiameterMessageImpl) cca;
    try {
        session.sendCreditControlAnswer(new JCreditControlAnswerImpl((Answer) msg.getGenericData()));
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        AvpNotAllowedException anae = new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
        throw anae;
    } catch (Exception e) {
        e.printStackTrace();
        IOException ioe = new IOException("Failed to send message, due to: " + e);
        throw ioe;
    }
}
Also used : CreditControlAnswer(net.java.slee.resource.diameter.cca.events.CreditControlAnswer) Answer(org.jdiameter.api.Answer) JCreditControlAnswerImpl(org.jdiameter.common.impl.app.cca.JCreditControlAnswerImpl) 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)

Aggregations

IOException (java.io.IOException)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 CreditControlAnswer (net.java.slee.resource.diameter.cca.events.CreditControlAnswer)1 Answer (org.jdiameter.api.Answer)1 JCreditControlAnswerImpl (org.jdiameter.common.impl.app.cca.JCreditControlAnswerImpl)1 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)1