Search in sources :

Example 1 with PostHrSriProcessorImpl

use of org.mobicents.smsc.mproc.impl.PostHrSriProcessorImpl in project smscgateway by RestComm.

the class MProcManagement method applyMProcHrSri.

public MProcResult applyMProcHrSri(final MProcRuleRaProvider anMProcRuleRa, CorrelationIdValue correlationIdValue) {
    if (this.mprocs.size() == 0) {
        return new MProcResult();
    }
    FastList<MProcRule> cur = this.mprocs;
    PostHrSriProcessorImpl pap = new PostHrSriProcessorImpl(logger);
    MProcMessage message = new MProcMessageHrImpl(correlationIdValue);
    try {
        for (FastList.Node<MProcRule> n = cur.head(), end = cur.tail(); (n = n.getNext()) != end; ) {
            MProcRule rule = n.getValue();
            if (rule.isForPostHrSriState() && rule.matchesPostHrSri(message)) {
                if (logger.isDebugEnabled()) {
                    logger.debug("MRule matches at HrSri phase to a message: rule: " + rule + "correlationIdValue: " + correlationIdValue);
                }
                rule.onPostHrSri(anMProcRuleRa, pap, message);
            }
        }
    } catch (Throwable e) {
        logger.error("Exception when invoking rule.matches(message) or onPostHrSri(): " + e.getMessage(), e);
        return new MProcResult();
    }
    MProcResult res = new MProcResult();
    if (pap.isHrByPassed()) {
        res.setHrIsByPassed(true);
    }
    return res;
}
Also used : MProcMessageHrImpl(org.mobicents.smsc.mproc.impl.MProcMessageHrImpl) MProcRule(org.mobicents.smsc.mproc.MProcRule) MProcResult(org.mobicents.smsc.mproc.impl.MProcResult) FastList(javolution.util.FastList) MProcMessage(org.mobicents.smsc.mproc.MProcMessage) PostHrSriProcessorImpl(org.mobicents.smsc.mproc.impl.PostHrSriProcessorImpl)

Aggregations

FastList (javolution.util.FastList)1 MProcMessage (org.mobicents.smsc.mproc.MProcMessage)1 MProcRule (org.mobicents.smsc.mproc.MProcRule)1 MProcMessageHrImpl (org.mobicents.smsc.mproc.impl.MProcMessageHrImpl)1 MProcResult (org.mobicents.smsc.mproc.impl.MProcResult)1 PostHrSriProcessorImpl (org.mobicents.smsc.mproc.impl.PostHrSriProcessorImpl)1