本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder类的典型用法代码示例。如果您正苦于以下问题:Java GroupBuilder类的具体用法?Java GroupBuilder怎么用?Java GroupBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GroupBuilder类属于org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups包,在下文中一共展示了GroupBuilder类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGroup
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder; //导入依赖的package包/类
private Group getGroup(GroupBuilder groupBuilder, NodeBuilder nodeBuilder) {
InstanceIdentifier<Group> path1 = InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
nodeBuilder.getKey())
.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(groupBuilder.getGroupId()))
.build();
DataBroker databroker = getDataBroker();
ReadOnlyTransaction readTx = databroker.newReadOnlyTransaction();
try {
Optional<Group> data = readTx.read(LogicalDatastoreType.CONFIGURATION, path1).get();
if (data.isPresent()) {
return data.get();
}
} catch (InterruptedException | ExecutionException e) {
LOG.error(e.getMessage(), e);
}
LOG.debug("Cannot find data for Group " + groupBuilder.getGroupName());
return null;
}
示例2: writeGroup
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder; //导入依赖的package包/类
private void writeGroup(GroupBuilder groupBuilder, NodeBuilder nodeBuilder) {
DataBroker databroker = getDataBroker();
ReadWriteTransaction modification = databroker.newReadWriteTransaction();
InstanceIdentifier<Group> path1 = InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
nodeBuilder.getKey())
.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(groupBuilder.getGroupId()))
.build();
// modification.put(LogicalDatastoreType.CONFIGURATION, path1,
// groupBuilder.build(), true /*createMissingParents*/);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, groupBuilder.build(),
true /* createMissingParents */);
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
try {
commitFuture.get();
LOG.debug("Transaction success for write of Group " + groupBuilder.getGroupName());
} catch (InterruptedException | ExecutionException e) {
LOG.error(e.getMessage(), e);
}
}
示例3: removeGroup
import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder; //导入依赖的package包/类
private void removeGroup(GroupBuilder groupBuilder, NodeBuilder nodeBuilder) {
DataBroker databroker = getDataBroker();
WriteTransaction modification = databroker.newWriteOnlyTransaction();
InstanceIdentifier<Group> path1 = InstanceIdentifier.builder(Nodes.class)
.child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class,
nodeBuilder.getKey())
.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(groupBuilder.getGroupId()))
.build();
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
try {
commitFuture.get();
LOG.debug("Transaction success for deletion of Group " + groupBuilder.getGroupName());
} catch (InterruptedException | ExecutionException e) {
LOG.error(e.getMessage(), e);
}
}