use of io.fabric8.groups.Group in project openflowplugin by opendaylight.
the class OpenflowpluginGroupTestCommandProvider method writeGroup.
private void writeGroup(final CommandInterpreter ci, Group group) {
ReadWriteTransaction modification = Preconditions.checkNotNull(dataBroker).newReadWriteTransaction();
InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(group.getGroupId()));
modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode), testNode, true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, group, true);
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
@Override
public void onFailure(Throwable throwable) {
ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
}
}, MoreExecutors.directExecutor());
}
use of io.fabric8.groups.Group in project openflowplugin by opendaylight.
the class OpenflowpluginStatsTestCommandProvider method _groupDescStats.
public void _groupDescStats(CommandInterpreter ci) {
int groupCount = 0;
int groupDescStatsCount = 0;
NodeGroupDescStats data = null;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
NodeKey nodeKey = node2.getKey();
InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
if (node != null) {
if (node.getGroup() != null) {
List<Group> groups = node.getGroup();
for (Group group2 : groups) {
groupCount++;
GroupKey groupKey = group2.getKey();
InstanceIdentifier<Group> groupRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey).augmentation(FlowCapableNode.class).child(Group.class, groupKey);
Group group = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, groupRef);
if (group != null) {
data = group.getAugmentation(NodeGroupDescStats.class);
if (null != data) {
groupDescStatsCount++;
}
}
}
}
}
if (groupCount == groupDescStatsCount) {
LOG.debug("---------------------groupDescStats - Success-------------------------------");
} else {
LOG.debug("------------------------------groupDescStats - Failed--------------------------");
LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
}
}
}
use of io.fabric8.groups.Group in project genius by opendaylight.
the class MDSALManager method writeGroupInternal.
public void writeGroupInternal(BigInteger dpId, Group group, WriteTransaction tx) {
Node nodeDpn = buildDpnNode(dpId);
long groupId = group.getGroupId().getValue();
InstanceIdentifier<Group> groupInstanceId = buildGroupInstanceIdentifier(groupId, nodeDpn);
tx.put(LogicalDatastoreType.CONFIGURATION, groupInstanceId, group, true);
}
use of io.fabric8.groups.Group in project genius by opendaylight.
the class ItmTunnelAggregationHelper method createLogicalTunnelSelectGroup.
public void createLogicalTunnelSelectGroup(BigInteger srcDpnId, String interfaceName, int lportTag) {
Group group = prepareLogicalTunnelSelectGroup(interfaceName, lportTag);
LOG.debug("MULTIPLE_VxLAN_TUNNELS: group id {} installed for {} srcDpnId {}", group.getGroupId().getValue(), interfaceName, srcDpnId);
mdsalManager.syncInstallGroup(srcDpnId, group);
}
use of io.fabric8.groups.Group in project genius by opendaylight.
the class OvsInterfaceConfigRemoveHelper method removeLogicalTunnelSelectGroup.
private void removeLogicalTunnelSelectGroup(BigInteger srcDpnId, String interfaceName, int lportTag) {
long groupId = IfmUtil.getLogicalTunnelSelectGroupId(lportTag);
Group group = MDSALUtil.buildGroup(groupId, interfaceName, GroupTypes.GroupSelect, MDSALUtil.buildBucketLists(Collections.emptyList()));
LOG.debug("MULTIPLE_VxLAN_TUNNELS: group id {} removed for {} srcDpnId {}", group.getGroupId().getValue(), interfaceName, srcDpnId);
mdsalApiManager.syncRemoveGroup(srcDpnId, group);
}
Aggregations