当前位置: 首页>>代码示例>>Java>>正文


Java GroupBuilder类代码示例

本文整理汇总了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;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:21,代码来源:PipelineL2Forwarding.java

示例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);
    }
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:22,代码来源:PipelineL2Forwarding.java

示例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);
    }
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:19,代码来源:PipelineL2Forwarding.java


注:本文中的org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.GroupBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。