Search in sources :

Example 1 with PushNotificationAnswerImpl

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

the class ShClientSubscriptionActivityImpl method sendPushNotificationAnswer.

/*
   * (non-Javadoc)
   * @see net.java.slee.resource.diameter.sh.ShClientSubscriptionActivity#sendPushNotificationAnswer(net.java.slee.resource.diameter.sh.server.events.PushNotificationAnswer)
   */
public void sendPushNotificationAnswer(PushNotificationAnswer answer) throws IOException {
    try {
        DiameterMessageImpl msg = (DiameterMessageImpl) answer;
        this.clientSession.sendPushNotificationAnswer(new PushNotificationAnswerImpl((Answer) msg.getGenericData()));
        clean((DiameterShMessageImpl) answer);
        fetchSessionData(answer, false);
    } catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
        throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
    } catch (Exception e) {
        // FIXME: extent this exception to add trace....
        throw new IOException("Failed to send message, due to: " + e.getLocalizedMessage());
    }
}
Also used : Answer(org.jdiameter.api.Answer) PushNotificationAnswer(net.java.slee.resource.diameter.sh.events.PushNotificationAnswer) 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) PushNotificationAnswerImpl(org.jdiameter.common.impl.app.sh.PushNotificationAnswerImpl)

Aggregations

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