use of org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl in project jain-slee.diameter by RestComm.
the class RoClientSessionActivityImpl method sendEventRoCreditControlRequest.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.ro.RoClientSessionActivity#sendEventRoCreditControlRequest(net.java.slee.resource.diameter.ro.events.RoCreditControlRequest)
*/
public void sendEventRoCreditControlRequest(RoCreditControlRequest ccr) throws IOException {
// fetchCurrentState(ccr);
DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
validateState(ccr);
try {
session.sendCreditControlRequest(new RoCreditControlRequestImpl((Request) msg.getGenericData()));
} catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
} catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to send message.", e);
}
throw new IOException("Failed to send message, due to: " + e);
}
}
use of org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl in project jain-slee.diameter by RestComm.
the class RoClientSessionActivityImpl method sendTerminationRoCreditControlRequest.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.ro.RoClientSessionActivity#sendTerminationRoCreditControlRequest(net.java.slee.resource.diameter.ro.events.RoCreditControlRequest)
*/
public void sendTerminationRoCreditControlRequest(RoCreditControlRequest ccr) throws IOException {
// This should not be used to terminate sub-sessions!
validateState(ccr);
DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
try {
session.sendCreditControlRequest(new RoCreditControlRequestImpl((Request) msg.getGenericData()));
} catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
throw new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
} catch (Exception e) {
throw new IOException("Failed to send message, due to: " + e);
}
}
use of org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl in project jain-slee.diameter by RestComm.
the class RxServerSessionActivityImpl method sendSessionTermAnswer.
/**
* {@inheritDoc}
*/
@Override
public void sendSessionTermAnswer(final SessionTerminationAnswer sta) throws IOException {
fetchCurrentState(sta);
final DiameterMessageImpl msg = (DiameterMessageImpl) sta;
try {
session.sendSessionTermAnswer(new RxSessionTermAnswerImpl((Answer) msg.getGenericData()));
} catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
final AvpNotAllowedException anae = new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
throw anae;
} catch (Exception e) {
throw new IOException("Failed to send message.", e);
}
}
use of org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl in project jain-slee.diameter by RestComm.
the class RxSessionActivityImpl method doSendMessage.
// some override from base
protected Message doSendMessage(DiameterMessage message) {
Message receivedMessage = null;
try {
if (message instanceof DiameterMessageImpl) {
Future<Message> future = session.send(((DiameterMessageImpl) message).getGenericData());
receivedMessage = future.get();
} else {
throw new OperationNotSupportedException((new StringBuilder()).append("Trying to send wrong type of message? [").append(message.getClass()).append("] \n").append(message).toString());
}
} catch (AvpNotAllowedException e) {
throw new net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
} catch (Exception e) {
logger.error("Failure sending sync request.", e);
}
return receivedMessage;
}
use of org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl in project jain-slee.diameter by RestComm.
the class S6aClientSessionImpl method sendPurgeUERequest.
public void sendPurgeUERequest(PurgeUERequest pur) throws IOException {
DiameterMessageImpl msg = (DiameterMessageImpl) pur;
JPurgeUERequestImpl answer = new JPurgeUERequestImpl((Request) msg.getGenericData());
try {
appSession.sendPurgeUERequest(answer);
} catch (org.jdiameter.api.validation.AvpNotAllowedException anae) {
throw new AvpNotAllowedException(anae.getMessage(), anae.getAvpCode(), anae.getVendorId());
} catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to send message.", e);
}
throw new IOException(e.getMessage());
}
}
Aggregations