use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createMessage.
public Message createMessage(DiameterHeader header, DiameterAvp[] avps) throws AvpNotAllowedException {
Message msg = createRawMessage(header);
AvpSet set = msg.getAvps();
for (DiameterAvp avp : avps) {
addAvp(avp, set);
}
return msg;
}
use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createGqReAuthRequest.
@Override
public GqReAuthRequest createGqReAuthRequest() {
Message raw = createRequest(GqReAuthRequest.COMMAND_CODE, new DiameterAvp[] {});
GqReAuthRequest rar = new GqReAuthRequestImpl(raw);
if (sessionId != null) {
rar.setSessionId(sessionId);
}
addOrigin(rar);
return rar;
}
use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createGqSessionTerminationAnswer.
@Override
public GqSessionTerminationAnswer createGqSessionTerminationAnswer(GqSessionTerminationRequest str) {
Message raw = createMessage(str.getHeader(), new DiameterAvp[] {});
// this should be different ...
raw.setRequest(false);
// just in case. answers never have T flag set
raw.setReTransmitted(false);
GqSessionTerminationAnswerImpl sta = new GqSessionTerminationAnswerImpl(raw);
sta.getGenericData().getAvps().removeAvp(DiameterAvpCodes.DESTINATION_HOST);
sta.getGenericData().getAvps().removeAvp(DiameterAvpCodes.DESTINATION_REALM);
sta.getGenericData().getAvps().removeAvp(DiameterAvpCodes.ORIGIN_HOST);
sta.getGenericData().getAvps().removeAvp(DiameterAvpCodes.ORIGIN_REALM);
sta.setSessionId(str.getSessionId());
addOrigin(sta);
return sta;
}
use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createGqReAuthRequest.
@Override
public GqReAuthRequest createGqReAuthRequest(String sessionId) {
Message raw = createRequest(GqReAuthRequest.COMMAND_CODE, new DiameterAvp[] {});
GqReAuthRequest rar = new GqReAuthRequestImpl(raw);
rar.setSessionId(sessionId);
addOrigin(rar);
return rar;
}
use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createGqAARequest.
@Override
public GqAARequest createGqAARequest() {
Message raw = createRequest(GqAARequest.COMMAND_CODE, new DiameterAvp[] {});
GqAARequest aar = new GqAARequestImpl(raw);
if (sessionId != null) {
aar.setSessionId(sessionId);
}
addOrigin(aar);
return aar;
}
Aggregations