use of org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl in project jain-slee.diameter by RestComm.
the class ShServerSubscriptionActivityImpl method createUserDataAnswer.
public UserDataAnswer createUserDataAnswer(long resultCode, boolean isExperimentalResult) {
UserDataAnswer answer = null;
for (int index = 0; index < stateMessages.size(); index++) {
if (stateMessages.get(index).getCommand().getCode() == UserDataRequest.commandCode) {
UserDataRequest msg = (UserDataRequest) stateMessages.get(index);
answer = this.messageFactory.createUserDataAnswer(msg, resultCode, isExperimentalResult);
if (answer.getAuthSessionState() == null && this.authSessionState != null) {
answer.setAuthSessionState(this.authSessionState);
}
((DiameterShMessageImpl) answer).setData(msg);
break;
}
}
// answer.setSessionId(super.session.getSessionId());
return answer;
}
use of org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl in project jain-slee.diameter by RestComm.
the class ShServerSubscriptionActivityImpl method sendSubscribeNotificationsAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.server.ShServerSubscriptionActivity#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) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to send message.", e);
}
throw new IOException("Failed to send message, due to: " + e);
}
}
use of org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl in project jain-slee.diameter by RestComm.
the class ShServerSubscriptionActivityImpl method createSubscribeNotificationsAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.server.ShServerSubscriptionActivity#createSubscribeNotificationsAnswer()
*/
public SubscribeNotificationsAnswer createSubscribeNotificationsAnswer() {
SubscribeNotificationsAnswer answer = null;
for (int index = 0; index < stateMessages.size(); index++) {
if (stateMessages.get(index).getCommand().getCode() == SubscribeNotificationsRequest.commandCode) {
SubscribeNotificationsRequest msg = (SubscribeNotificationsRequest) stateMessages.get(index);
answer = this.messageFactory.createSubscribeNotificationsAnswer(msg);
if (answer.getAuthSessionState() == null && this.authSessionState != null) {
answer.setAuthSessionState(this.authSessionState);
}
((DiameterShMessageImpl) answer).setData(msg);
break;
}
}
// answer.setSessionId(super.session.getSessionId());
return answer;
}
use of org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl in project jain-slee.diameter by RestComm.
the class ShServerSubscriptionActivityImpl method sendPushNotificationRequest.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.server.ShServerSubscriptionActivity#sendPushNotificationRequest(net.java.slee.resource.diameter.sh.events.PushNotificationRequest)
*/
public void sendPushNotificationRequest(PushNotificationRequest message) throws IOException {
try {
DiameterShMessageImpl msg = (DiameterShMessageImpl) message;
fetchSessionData(msg, false);
this.serverSession.sendPushNotificationRequest(new PushNotificationRequestImpl((Request) 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 org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl in project jain-slee.diameter by RestComm.
the class ShClientSubscriptionActivityImpl method createPushNotificationAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.ShClientSubscriptionActivity#createPushNotificationAnswer()
*/
public PushNotificationAnswer createPushNotificationAnswer() {
PushNotificationAnswer pna = null;
for (int index = 0; index < stateMessages.size(); index++) {
if (stateMessages.get(index).getCommand().getCode() == PushNotificationAnswer.commandCode) {
PushNotificationRequest msg = (PushNotificationRequest) stateMessages.get(index);
pna = this.messageFactory.createPushNotificationAnswer(msg);
if (pna.getAuthSessionState() == null && this.authSessionState != null) {
pna.setAuthSessionState(this.authSessionState);
}
((DiameterShMessageImpl) pna).setData(msg);
break;
}
}
return pna;
}
Aggregations