use of net.java.slee.resource.diameter.sh.events.ProfileUpdateAnswer in project jain-slee.diameter by RestComm.
the class ShServerActivityImpl method createProfileUpdateAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.server.ShServerActivity#createProfileUpdateAnswer(long, boolean)
*/
public ProfileUpdateAnswer createProfileUpdateAnswer(long resultCode, boolean isExperimentalResult) {
// Fetch the session stored request
ProfileUpdateRequest req = (ProfileUpdateRequest) getSessionMessage(ProfileUpdateRequest.commandCode);
ProfileUpdateAnswer answer = null;
if (req != null) {
// Create answer from it
answer = this.messageFactory.createProfileUpdateAnswer(req, resultCode, isExperimentalResult);
// Add any extra session data
addSessionData(answer);
// Store request data FIXME: Commented by Alex. Is this needed?
// ((DiameterShMessageImpl)answer).setData(req);
}
return answer;
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateAnswer 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;
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateAnswer in project jain-slee.diameter by RestComm.
the class ShServerSubscriptionActivityImpl method createProfileUpdateAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.sh.server.ShServerSubscriptionActivity#createProfileUpdateAnswer()
*/
public ProfileUpdateAnswer createProfileUpdateAnswer() {
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);
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 net.java.slee.resource.diameter.sh.events.ProfileUpdateAnswer in project jain-slee.diameter by RestComm.
the class ShServerFactoriesTest method hasTFlagSetPUA.
@Test
public void hasTFlagSetPUA() throws Exception {
ProfileUpdateRequest pur = shClientFactory.createProfileUpdateRequest();
((DiameterMessageImpl) pur).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Profile-Update-Request", pur.getHeader().isPotentiallyRetransmitted());
ProfileUpdateAnswer pua = shServerFactory.createProfileUpdateAnswer(pur);
assertFalse("The 'T' flag should not be set in Profile-Update-Answer", pua.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.sh.events.ProfileUpdateAnswer in project jain-slee.diameter by RestComm.
the class ShServerFactoriesTest method hasDestinationRealmPUA.
@Test
public void hasDestinationRealmPUA() throws Exception {
ProfileUpdateAnswer pua = shServerFactory.createProfileUpdateAnswer(shClientFactory.createProfileUpdateRequest());
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", pua.getDestinationRealm());
}
Aggregations