use of org.jdiameter.common.impl.app.cca.JCreditControlRequestImpl in project jain-slee.diameter by RestComm.
the class CreditControlClientSessionImpl method sendInitialCreditControlRequest.
/*
* (non-Javadoc)
*
* @seenet.java.slee.resource.diameter.cca.CreditControlClientSession#
* sendInitialCreditControlRequest
* (net.java.slee.resource.diameter.cca.events.CreditControlRequest)
*/
public void sendInitialCreditControlRequest(CreditControlRequest ccr) throws IOException {
// FIXME: should this affect FSM ?
ccr.setCcRequestType(CcRequestType.INITIAL_REQUEST);
validateState(ccr);
DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
try {
session.sendCreditControlRequest(new JCreditControlRequestImpl((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.jdiameter.common.impl.app.cca.JCreditControlRequestImpl in project jain-slee.diameter by RestComm.
the class CreditControlClientSessionImpl method sendTerminationCreditControlRequest.
/*
* (non-Javadoc)
*
* @seenet.java.slee.resource.diameter.cca.CreditControlClientSession#
* sendTerminationCreditControlRequest
* (net.java.slee.resource.diameter.cca.events.CreditControlRequest)
*/
public void sendTerminationCreditControlRequest(CreditControlRequest ccr) throws IOException {
// This should not be used to terminate sub-sessions!
// FIXME: Should this come already in the CCR?
ccr.setCcRequestType(CcRequestType.TERMINATION_REQUEST);
validateState(ccr);
DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
try {
session.sendCreditControlRequest(new JCreditControlRequestImpl((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.jdiameter.common.impl.app.cca.JCreditControlRequestImpl in project jain-slee.diameter by RestComm.
the class CreditControlClientSessionImpl method sendCreditControlRequest.
/*
* (non-Javadoc)
*
* @seenet.java.slee.resource.diameter.cca.CreditControlClientSession#
* sendCreditControlRequest
* (net.java.slee.resource.diameter.cca.events.CreditControlRequest)
*/
public void sendCreditControlRequest(CreditControlRequest ccr) throws IOException {
// fetchCurrentState(ccr);
DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
validateState(ccr);
try {
session.sendCreditControlRequest(new JCreditControlRequestImpl((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.jdiameter.common.impl.app.cca.JCreditControlRequestImpl in project jain-slee.diameter by RestComm.
the class CreditControlClientSessionImpl method sendUpdateCreditControlRequest.
/*
* (non-Javadoc)
*
* @seenet.java.slee.resource.diameter.cca.CreditControlClientSession#
* sendUpdateCreditControlRequest
* (net.java.slee.resource.diameter.cca.events.CreditControlRequest)
*/
public void sendUpdateCreditControlRequest(CreditControlRequest ccr) throws IOException {
// FIXME: Should this come already in the CCR?
ccr.setCcRequestType(CcRequestType.UPDATE_REQUEST);
validateState(ccr);
DiameterMessageImpl msg = (DiameterMessageImpl) ccr;
try {
session.sendCreditControlRequest(new JCreditControlRequestImpl((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);
}
}
Aggregations