Search in sources :

Example 1 with AclNodeDefaultFlowsTxBuilder

use of org.opendaylight.netvirt.aclservice.utils.AclNodeDefaultFlowsTxBuilder in project netvirt by opendaylight.

the class AclNodeListener method add.

@Override
protected void add(InstanceIdentifier<FlowCapableNode> key, FlowCapableNode dataObjectModification) {
    NodeKey nodeKey = key.firstKeyOf(Node.class);
    BigInteger dpId = MDSALUtil.getDpnIdFromNodeName(nodeKey.getId());
    LOG.info("Received ACL node [{}] add event", dpId);
    if (securityGroupMode != null && securityGroupMode != SecurityGroupMode.Stateful) {
        LOG.error("Invalid security group mode ({}) obtained from AclserviceConfig. dpId={}", securityGroupMode, dpId);
        return;
    }
    jobCoordinator.enqueueJob(String.valueOf(dpId), () -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> {
        new AclNodeDefaultFlowsTxBuilder(dpId, mdsalManager, config, tx).build();
        LOG.info("Adding default ACL flows for dpId={}", dpId);
    })), AclConstants.JOB_MAX_RETRIES);
    LOG.trace("FlowCapableNode (dpid: {}) add event is processed.", dpId);
}
Also used : BigInteger(java.math.BigInteger) AclNodeDefaultFlowsTxBuilder(org.opendaylight.netvirt.aclservice.utils.AclNodeDefaultFlowsTxBuilder) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)

Aggregations

BigInteger (java.math.BigInteger)1 AclNodeDefaultFlowsTxBuilder (org.opendaylight.netvirt.aclservice.utils.AclNodeDefaultFlowsTxBuilder)1 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)1