Search in sources :

Example 1 with AvpNotAllowedException

use of org.jdiameter.api.validation.AvpNotAllowedException in project jain-slee.diameter by RestComm.

the class RxSessionActivityImpl method doSendMessage.

// some override from base
protected Message doSendMessage(DiameterMessage message) {
    Message receivedMessage = null;
    try {
        if (message instanceof DiameterMessageImpl) {
            Future<Message> future = session.send(((DiameterMessageImpl) message).getGenericData());
            receivedMessage = future.get();
        } else {
            throw new OperationNotSupportedException((new StringBuilder()).append("Trying to send wrong type of message? [").append(message.getClass()).append("] \n").append(message).toString());
        }
    } catch (AvpNotAllowedException e) {
        throw new net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        logger.error("Failure sending sync request.", e);
    }
    return receivedMessage;
}
Also used : OperationNotSupportedException(javax.naming.OperationNotSupportedException) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) Message(org.jdiameter.api.Message) DiameterMessageImpl(org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl) AvpNotAllowedException(org.jdiameter.api.validation.AvpNotAllowedException) AvpNotAllowedException(org.jdiameter.api.validation.AvpNotAllowedException) OperationNotSupportedException(javax.naming.OperationNotSupportedException)

Aggregations

OperationNotSupportedException (javax.naming.OperationNotSupportedException)1 DiameterMessage (net.java.slee.resource.diameter.base.events.DiameterMessage)1 Message (org.jdiameter.api.Message)1 AvpNotAllowedException (org.jdiameter.api.validation.AvpNotAllowedException)1 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)1