Search in sources :

Example 1 with CreditControlMessage

use of net.java.slee.resource.diameter.cca.events.CreditControlMessage in project jain-slee.diameter by RestComm.

the class CreditControlMessageFactoryImpl method createCreditControlMessage.

// Private Methods -------------------------------------------------
private CreditControlMessage createCreditControlMessage(DiameterHeader diameterHeader, DiameterAvp[] avps) throws IllegalArgumentException {
    // List<DiameterAvp> list = (List<DiameterAvp>) this.avpList.clone();
    boolean isRequest = diameterHeader == null;
    CreditControlMessage msg = null;
    if (!isRequest) {
        Message raw = createMessage(diameterHeader, avps);
        raw.setProxiable(diameterHeader.isProxiable());
        raw.setRequest(false);
        // just in case. answers never have T flag set
        raw.setReTransmitted(false);
        msg = new CreditControlAnswerImpl(raw);
    } else {
        Message raw = createMessage(null, avps);
        raw.setProxiable(true);
        raw.setRequest(true);
        msg = new CreditControlRequestImpl(raw);
    }
    return msg;
}
Also used : Message(org.jdiameter.api.Message) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) CreditControlMessage(net.java.slee.resource.diameter.cca.events.CreditControlMessage) CreditControlRequestImpl(org.mobicents.slee.resource.diameter.cca.events.CreditControlRequestImpl) CreditControlAnswerImpl(org.mobicents.slee.resource.diameter.cca.events.CreditControlAnswerImpl) CreditControlMessage(net.java.slee.resource.diameter.cca.events.CreditControlMessage)

Aggregations

DiameterMessage (net.java.slee.resource.diameter.base.events.DiameterMessage)1 CreditControlMessage (net.java.slee.resource.diameter.cca.events.CreditControlMessage)1 Message (org.jdiameter.api.Message)1 CreditControlAnswerImpl (org.mobicents.slee.resource.diameter.cca.events.CreditControlAnswerImpl)1 CreditControlRequestImpl (org.mobicents.slee.resource.diameter.cca.events.CreditControlRequestImpl)1