use of org.mobicents.slee.resource.diameter.gq.events.GqReAuthAnswerImpl in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createGqReAuthAnswer.
@Override
public GqReAuthAnswer createGqReAuthAnswer(GqReAuthRequest rar) {
Message raw = createMessage(rar.getHeader(), new DiameterAvp[] {});
// this should be different ...
raw.setRequest(false);
// just in case. answers never have T flag set
raw.setReTransmitted(false);
GqReAuthAnswerImpl raa = new GqReAuthAnswerImpl(raw);
raa.getGenericData().getAvps().removeAvp(DiameterAvpCodes.DESTINATION_HOST);
raa.getGenericData().getAvps().removeAvp(DiameterAvpCodes.DESTINATION_REALM);
raa.getGenericData().getAvps().removeAvp(DiameterAvpCodes.ORIGIN_HOST);
raa.getGenericData().getAvps().removeAvp(DiameterAvpCodes.ORIGIN_REALM);
raa.setSessionId(rar.getSessionId());
addOrigin(raa);
return raa;
}
use of org.mobicents.slee.resource.diameter.gq.events.GqReAuthAnswerImpl in project jain-slee.diameter by RestComm.
the class DiameterGqResourceAdaptor method createEvent.
/**
* Create Event object from a JDiameter message (request or answer)
*
* @return a DiameterMessage object wrapping the request/answer
* @throws OperationNotSupportedException
*/
private DiameterMessage createEvent(Message message) {
if (message == null) {
throw new NullPointerException("Message argument cannot be null while creating event.");
}
int commandCode = message.getCommandCode();
if (message.isError()) {
return new ErrorAnswerImpl(message);
}
boolean isRequest = message.isRequest();
switch(commandCode) {
case // AAR/AAA
GqAARequest.COMMAND_CODE:
return isRequest ? new GqAARequestImpl(message) : new GqAAAnswerImpl(message);
case // ASR/ASA
GqAbortSessionRequest.COMMAND_CODE:
return isRequest ? new GqAbortSessionRequestImpl(message) : new GqAbortSessionAnswerImpl(message);
case // STR/STA
GqSessionTerminationRequest.COMMAND_CODE:
return isRequest ? new GqSessionTerminationRequestImpl(message) : new GqSessionTerminationAnswerImpl(message);
case // RAR/RAA
GqReAuthRequest.COMMAND_CODE:
return isRequest ? new GqReAuthRequestImpl(message) : new GqReAuthAnswerImpl(message);
default:
return new ExtensionDiameterMessageImpl(message);
}
}
Aggregations