use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createGqSessionTerminationRequest.
@Override
public GqSessionTerminationRequest createGqSessionTerminationRequest(String sessionId) {
Message raw = createRequest(GqSessionTerminationRequest.COMMAND_CODE, new DiameterAvp[] {});
GqSessionTerminationRequest str = new GqSessionTerminationRequestImpl(raw);
str.setSessionId(sessionId);
addOrigin(str);
return str;
}
use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createRequest.
public Message createRequest(int code, DiameterAvp[] avps) {
Message raw = createMessage(code, new DiameterAvp[] {});
raw.setProxiable(true);
raw.setRequest(true);
return raw;
}
use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.
the class GqMessageFactoryImpl method createMessage.
public Message createMessage(int commandCode, DiameterAvp[] avps) throws AvpNotAllowedException {
Message msg = createRawMessage(commandCode);
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 GqSessionActivityImpl method sendSyncMessage.
@Override
public DiameterMessage sendSyncMessage(DiameterMessage message) {
DiameterMessage answer = null;
Message receivedMessage = doSendMessage(message);
if (receivedMessage != null) {
if (!receivedMessage.isRequest()) {
if (receivedMessage.isError()) {
answer = new ErrorAnswerImpl(receivedMessage);
} else {
switch(receivedMessage.getCommandCode()) {
case GqAARequest.COMMAND_CODE:
answer = new GqAARequestImpl(receivedMessage);
break;
case GqAbortSessionRequest.COMMAND_CODE:
answer = new GqAbortSessionRequestImpl(receivedMessage);
break;
case GqReAuthRequest.COMMAND_CODE:
answer = new GqReAuthRequestImpl(receivedMessage);
break;
case GqSessionTerminationRequest.COMMAND_CODE:
answer = new GqSessionTerminationRequestImpl(receivedMessage);
break;
default:
logger.error("Received an unknown type of Message for Gq' Activity: " + receivedMessage);
break;
}
}
} else {
logger.error("Received a REQUEST message when expecting an ANSWER.");
}
} else {
logger.debug("No answer received. Returning null.");
}
return answer;
}
use of org.jdiameter.api.Message in project jain-slee.diameter by RestComm.
the class RfMessageFactoryImpl 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;
}
Aggregations