main/src/main/java/org/onap/policy/pap/main/comm/PdpRequests.java
/**
     * Adds a singleton request.
     *
     * @param request the request to be added
     */
Adds a singleton request.
@param request the request to be added
Adds a singleton request . @param request the request to be added
public void addSingleton(Request request) {
        if (request.getMessage().getName() == null) {
            throw new IllegalArgumentException("unexpected broadcast for " + pdpName);
        }
        if (checkExisting(request)) {
            return;
        }
        int priority = request.getPriority();
        singletons[priority] = request;
        QueueToken<PdpMessage> token = stopPublishingLowerPriority(priority);
        if (higherPrioritySingleton(priority)) {
            logger.info("{} not publishing due to priority higher than {}", pdpName, priority);
            return;
        }
        curIndex = priority;
        request.startPublishing(token);
    }
public void addSingleton ( Request request ) { if ( request . getMessage ( ) . getName ( ) == null ) { throw new IllegalArgumentException ( "unexpected broadcast for " + pdpName ) ; } if ( checkExisting ( request ) ) { return ; } int priority = request . getPriority ( ) ; singletons [ priority ] = request ; QueueToken < PdpMessage > token = stopPublishingLowerPriority ( priority ) ; if ( higherPrioritySingleton ( priority ) ) { logger . info ( "{} not publishing due to priority higher than {}" , pdpName , priority ) ; return ; } curIndex = priority ; request . startPublishing ( token ) ; }
Adds a singleton request.
Adds a singleton request .
// have an existing request that's similar - discard this request // no existing request of this type // stop publishing anything of a lower priority // start publishing if nothing of higher priority