Class ReconcileUtil


  • public final class ReconcileUtil
    extends Object
    Util methods for group reconcil task (future chaining, transforms).
    • Method Detail

      • createRpcResultCondenser

        public static <D> com.google.common.base.Function<List<org.opendaylight.yangtools.yang.common.RpcResult<D>>,​org.opendaylight.yangtools.yang.common.RpcResult<Void>> createRpcResultCondenser​(String previousItemAction)
        Creates a single rpc result of type Void honoring all partial rpc results.
        Type Parameters:
        D - type of rpc output (gathered in list)
        Parameters:
        previousItemAction - description for case when the triggering future contains failure
        Returns:
        single rpc result of type Void honoring all partial rpc results
      • createRpcResultToVoidFunction

        public static <D> com.google.common.base.Function<org.opendaylight.yangtools.yang.common.RpcResult<D>,​org.opendaylight.yangtools.yang.common.RpcResult<Void>> createRpcResultToVoidFunction​(String actionDescription)
        Creates a single rpc result of type Void honoring all partial rpc results.
        Type Parameters:
        D - type of rpc output (gathered in list)
        Parameters:
        actionDescription - description for case when the triggering future contains failure
        Returns:
        single rpc result of type Void honoring all partial rpc results
      • chainBarrierFlush

        public static com.google.common.util.concurrent.AsyncFunction<org.opendaylight.yangtools.yang.common.RpcResult<Void>,​org.opendaylight.yangtools.yang.common.RpcResult<Void>> chainBarrierFlush​(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeIdent,
                                                                                                                                                                                                             FlowCapableTransactionService flowCapableTransactionService)
        Flushes a chain barrier.
        Parameters:
        nodeIdent - flow capable node path - target device for routed rpc
        flowCapableTransactionService - barrier rpc service
        Returns:
        async barrier result
      • resolveAndDivideGroupDiffs

        public static List<ItemSyncBox<Group>> resolveAndDivideGroupDiffs​(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId,
                                                                          Map<org.opendaylight.yangtools.yang.common.Uint32,​Group> installedGroupsArg,
                                                                          Collection<Group> pendingGroups)
        Returns a list of safe synchronization steps with updates.
        Parameters:
        nodeId - target node
        installedGroupsArg - groups resent on device
        pendingGroups - groups configured for device
        Returns:
        list of safe synchronization steps with updates
      • resolveAndDivideGroupDiffs

        public static List<ItemSyncBox<Group>> resolveAndDivideGroupDiffs​(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId,
                                                                          Map<org.opendaylight.yangtools.yang.common.Uint32,​Group> installedGroupsArg,
                                                                          Collection<Group> pendingGroups,
                                                                          boolean gatherUpdates)
        Returns a list of safe synchronization steps.
        Parameters:
        nodeId - target node
        installedGroupsArg - groups resent on device
        pendingGroups - groups configured for device
        gatherUpdates - check content of pending item if present on device (and create update task eventually)
        Returns:
        list of safe synchronization steps
      • checkGroupPrecondition

        public static boolean checkGroupPrecondition​(Set<org.opendaylight.yangtools.yang.common.Uint32> installedGroupIds,
                                                     Group pendingGroup)
      • countTotalPushed

        public static <E> int countTotalPushed​(Iterable<ItemSyncBox<E>> groupsAddPlan)
      • countTotalUpdated

        public static <E> int countTotalUpdated​(Iterable<ItemSyncBox<E>> groupsAddPlan)
      • resolveMeterDiffs

        public static ItemSyncBox<Meter> resolveMeterDiffs​(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId,
                                                           Map<MeterId,​Meter> meterOperationalMap,
                                                           Collection<Meter> metersConfigured,
                                                           boolean gatherUpdates)
        Resolves meter differences.
        Parameters:
        nodeId - target node
        meterOperationalMap - meters present on device
        metersConfigured - meters configured for device
        gatherUpdates - check content of pending item if present on device (and create update task eventually)
        Returns:
        synchronization box
      • resolveFlowDiffsInAllTables

        public static Map<TableKey,​ItemSyncBox<Flow>> resolveFlowDiffsInAllTables​(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId,
                                                                                        Map<org.opendaylight.yangtools.yang.common.Uint8,​Table> tableOperationalMap,
                                                                                        Collection<Table> tablesConfigured,
                                                                                        boolean gatherUpdates)
        Resolves flow differences in all tables.
        Parameters:
        nodeId - target node
        tableOperationalMap - flow-tables resent on device
        tablesConfigured - flow-tables configured for device
        gatherUpdates - check content of pending item if present on device (and create update task eventually)
        Returns:
        map : key=TableKey, value=ItemSyncBox of safe synchronization steps