use of net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException in project jain-slee.diameter by RestComm.
the class ShServerActivityImpl method sendSubscribeNotificationsAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.server.ShServerActivity#sendSubscribeNotificationsAnswer(net.java.slee.resource.diameter.sh.events.SubscribeNotificationsAnswer)
*/
public void sendSubscribeNotificationsAnswer(SubscribeNotificationsAnswer message) throws IOException {
try {
DiameterShMessageImpl msg = (DiameterShMessageImpl) message;
fetchSessionData(msg, false);
this.serverSession.sendSubscribeNotificationsAnswer(new SubscribeNotificationsAnswerImpl((Answer) msg.getGenericData()));
clean(msg);
} 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);
}
}
use of net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException in project jain-slee.diameter by RestComm.
the class ShServerMessageFactoryImpl method createMessage.
protected Message createMessage(DiameterHeader header, DiameterAvp[] avps) throws AvpNotAllowedException {
try {
Message msg = createRawMessage(header);
AvpSet set = msg.getAvps();
for (DiameterAvp avp : avps) {
addAvp(avp, set);
}
return msg;
} catch (Exception e) {
logger.error("Failed to create message.", e);
}
return null;
}
use of net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException in project jain-slee.diameter by RestComm.
the class ShServerSubscriptionActivityImpl method sendUserDataAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.server.ShServerSubscriptionActivity#sendUserDataAnswer(net.java.slee.resource.diameter.sh.events.UserDataAnswer)
*/
public void sendUserDataAnswer(UserDataAnswer message) throws IOException {
try {
DiameterShMessageImpl msg = (DiameterShMessageImpl) message;
this.serverSession.sendUserDataAnswer(new UserDataAnswerImpl((Answer) msg.getGenericData()));
clean(msg);
} 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);
}
}
use of net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException in project jain-slee.diameter by RestComm.
the class ShClientSubscriptionActivityImpl method sendUnsubscribeRequest.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.ShClientSubscriptionActivity#sendUnsubscribeRequest()
*/
public void sendUnsubscribeRequest() throws IOException {
try {
SubscribeNotificationsRequest snr = this.messageFactory.createSubscribeNotificationsRequest(getSubscribedUserIdentity(), this.dataReferenceType[0], SubsReqType.UNSUBSCRIBE);
snr.setDataReferences(this.dataReferenceType);
snr.setDestinationRealm(remoteRealm);
snr.setAuthSessionState(authSessionState);
DiameterMessageImpl msg = (DiameterMessageImpl) snr;
this.clientSession.sendSubscribeNotificationsRequest(new SubscribeNotificationsRequestImpl((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.getLocalizedMessage());
}
}
use of net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException in project jain-slee.diameter by RestComm.
the class ShClientActivityImpl method sendSubscribeNotificationsRequest.
public void sendSubscribeNotificationsRequest(SubscribeNotificationsRequest message) throws IOException {
// FIXME: IMHO this should not be here.
try {
DiameterMessageImpl msg = (DiameterMessageImpl) message;
this.clientSession.sendSubscribeNotificationsRequest(new SubscribeNotificationsRequestImpl((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);
}
}
Aggregations