use of net.java.slee.resource.diameter.base.events.DiameterMessage in project jain-slee.diameter by RestComm.
the class DiameterGxResourceAdaptor method fireEvent.
/**
* {@inheritDoc}
*/
@Override
public void fireEvent(final String sessionId, final Message message) {
final DiameterMessage event = (DiameterMessage) createEvent(message);
final FireableEventType eventId = eventIdCache.getEventId(eventLookup, message);
this.fireEvent(event, getActivityHandle(sessionId), eventId, null, true, message.isRequest());
}
use of net.java.slee.resource.diameter.base.events.DiameterMessage 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 net.java.slee.resource.diameter.base.events.DiameterMessage in project jain-slee.diameter by RestComm.
the class RfSessionActivityImpl 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 RfAccountingRequest.commandCode:
answer = new RfAccountingRequestImpl(receivedMessage);
break;
default:
logger.error("Received an unknown type of Message for Rf 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 net.java.slee.resource.diameter.base.events.DiameterMessage in project jain-slee.diameter by RestComm.
the class DiameterRfResourceAdaptor method fireEvent.
/*
* (non-Javadoc)
* @see org.mobicents.slee.resource.diameter.base.handlers.BaseSessionCreationListener#fireEvent(java.lang.String, org.jdiameter.api.Request, org.jdiameter.api.Answer)
*/
public void fireEvent(String sessionId, Message message) {
DiameterMessage event = (DiameterMessage) createEvent(message);
FireableEventType eventId = eventIdCache.getEventId(eventLookup, message);
this.fireEvent(event, getActivityHandle(sessionId), eventId, null, true, message.isRequest());
}
Aggregations