use of org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl 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 org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl in project jain-slee.diameter by RestComm.
the class ShServerSubscriptionActivityImpl method createUserDataAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.server.ShServerSubscriptionActivity#createUserDataAnswer()
*/
public UserDataAnswer createUserDataAnswer() {
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);
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 createUserDataAnswer.
public UserDataAnswer createUserDataAnswer(byte[] userData) {
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, userData);
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 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 org.mobicents.slee.resource.diameter.sh.events.DiameterShMessageImpl in project jain-slee.diameter by RestComm.
the class ShServerSubscriptionActivityImpl method createProfileUpdateAnswer.
public ProfileUpdateAnswer createProfileUpdateAnswer(long resultCode, boolean isExperimentalResult) {
ProfileUpdateAnswer answer = null;
for (int index = 0; index < stateMessages.size(); index++) {
if (stateMessages.get(index).getCommand().getCode() == ProfileUpdateRequest.commandCode) {
ProfileUpdateRequest msg = (ProfileUpdateRequest) stateMessages.get(index);
answer = this.messageFactory.createProfileUpdateAnswer(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;
}
Aggregations