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);
}
}
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);
}
Aggregations