Search in sources :

Example 16 with GroupEntity

use of org.opendaylight.genius.mdsalutil.GroupEntity in project netvirt by opendaylight.

the class PolicyServiceFlowUtil method updateGroupToTx.

public void updateGroupToTx(BigInteger dpId, long groupId, String groupName, GroupTypes groupType, int addOrRemove, WriteTransaction tx) {
    if (addOrRemove == NwConstants.ADD_FLOW && mdsalManager.groupExists(dpId, groupId)) {
        LOG.trace("Group {} id {} already exists", groupName, groupId);
        return;
    }
    GroupEntity groupEntity = MDSALUtil.buildGroupEntity(dpId, groupId, groupName, groupType, Collections.emptyList());
    if (addOrRemove == NwConstants.ADD_FLOW) {
        LOG.debug("Add group {} to DPN {}", groupId, dpId);
        mdsalManager.addGroupToTx(groupEntity, tx);
    } else {
        LOG.debug("Remove group {} from DPN {}", groupId, dpId);
        mdsalManager.removeGroupToTx(groupEntity, tx);
    }
}
Also used : GroupEntity(org.opendaylight.genius.mdsalutil.GroupEntity)

Example 17 with GroupEntity

use of org.opendaylight.genius.mdsalutil.GroupEntity in project genius by opendaylight.

the class MdSalUtilTest method testInstallGroup.

@Test
public void testInstallGroup() throws Exception {
    // Install Group 1
    String inport = "2";
    int vlanid = 100;
    GroupEntity grpEntity1 = createGroupEntity(NODE_ID, inport, vlanid);
    mdSalMgr.installGroupInternal(grpEntity1).get();
    grpFwder.awaitDataChangeCount(1);
    // Install Group 2
    inport = "3";
    vlanid = 100;
    GroupEntity grpEntity2 = createGroupEntity(NODE_ID, inport, vlanid);
    mdSalMgr.installGroupInternal(grpEntity2).get();
    grpFwder.awaitDataChangeCount(2);
}
Also used : GroupEntity(org.opendaylight.genius.mdsalutil.GroupEntity) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) AbstractConcurrentDataBrokerTest(org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest) Test(org.junit.Test)

Aggregations

GroupEntity (org.opendaylight.genius.mdsalutil.GroupEntity)17 FlowEntity (org.opendaylight.genius.mdsalutil.FlowEntity)5 BigInteger (java.math.BigInteger)4 ArrayList (java.util.ArrayList)4 BucketInfo (org.opendaylight.genius.mdsalutil.BucketInfo)4 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)3 ExecutionException (java.util.concurrent.ExecutionException)2 Test (org.junit.Test)2 AbstractConcurrentDataBrokerTest (org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest)2 InstructionInfo (org.opendaylight.genius.mdsalutil.InstructionInfo)2 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)2 ActionGroup (org.opendaylight.genius.mdsalutil.actions.ActionGroup)2 ActionSetFieldTunnelId (org.opendaylight.genius.mdsalutil.actions.ActionSetFieldTunnelId)2 InstructionApplyActions (org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions)2 MatchEthernetType (org.opendaylight.genius.mdsalutil.matches.MatchEthernetType)2 MatchMetadata (org.opendaylight.genius.mdsalutil.matches.MatchMetadata)2 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)2 VpnNexthop (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3nexthop.rev150409.l3nexthop.vpnnexthops.VpnNexthop)2 VpnNexthopBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3nexthop.rev150409.l3nexthop.vpnnexthops.VpnNexthopBuilder)2 VpnNexthopKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3nexthop.rev150409.l3nexthop.vpnnexthops.VpnNexthopKey)2