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


Java LogicalDatastoreType.CONFIGURATION属性代码示例

本文整理汇总了Java中org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION属性的典型用法代码示例。如果您正苦于以下问题:Java LogicalDatastoreType.CONFIGURATION属性的具体用法?Java LogicalDatastoreType.CONFIGURATION怎么用?Java LogicalDatastoreType.CONFIGURATION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType的用法示例。


在下文中一共展示了LogicalDatastoreType.CONFIGURATION属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: retrieveInitialAppConfig

private void retrieveInitialAppConfig(final DataBroker dataBroker) {
    LOG.debug("{}: Got DataBroker instance - reading app config {}", logName(), bindingContext.appConfigPath);

    setDependencyDesc("Initial app config " + bindingContext.appConfigBindingClass.getSimpleName());

    // We register a DTCL to get updates and also read the app config data from the data store. If
    // the app config data is present then both the read and initial DTCN update will return it. If the
    // the data isn't present, we won't get an initial DTCN update so the read will indicate the data
    // isn't present.

    DataTreeIdentifier<DataObject> dataTreeId = new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION,
            bindingContext.appConfigPath);
    appConfigChangeListenerReg = dataBroker.registerDataTreeChangeListener(dataTreeId,
            (ClusteredDataTreeChangeListener<DataObject>) this::onAppConfigChanged);

    readInitialAppConfig(dataBroker);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:DataStoreAppConfigMetadata.java

示例2: testRegisterDataTreeChangeListener

@Test
public void testRegisterDataTreeChangeListener() {
    final BindingToNormalizedNodeCodec codec = new BindingToNormalizedNodeCodec(this.classLoadingStrategy, this.codecRegistry);

    final DataTreeChangeService service = BindingDOMDataTreeChangeServiceAdapter.create(codec, this.mockDOMService);

    doReturn(this.mockDOMReg).when(this.mockDOMService).registerDataTreeChangeListener(domDataTreeIdentifier(this.mockYangID),
            any(DOMDataTreeChangeListener.class));
    final DataTreeIdentifier<Top> treeId = new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, TOP_PATH);
    final TestClusteredDataTreeChangeListener mockClusteredListener = new TestClusteredDataTreeChangeListener();
    service.registerDataTreeChangeListener(treeId , mockClusteredListener);

    verify(this.mockDOMService).registerDataTreeChangeListener(domDataTreeIdentifier(this.mockYangID),
            isA(ClusteredDOMDataTreeChangeListener.class));

    reset(this.mockDOMService);
    doReturn(this.mockDOMReg).when(this.mockDOMService).registerDataTreeChangeListener(domDataTreeIdentifier(this.mockYangID),
            any(DOMDataTreeChangeListener.class));
    final TestDataTreeChangeListener mockNonClusteredListener = new TestDataTreeChangeListener();
    service.registerDataTreeChangeListener(treeId , mockNonClusteredListener);

    verify(this.mockDOMService).registerDataTreeChangeListener(domDataTreeIdentifier(this.mockYangID),
            not(isA(ClusteredDOMDataTreeChangeListener.class)));
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:BindingDOMDataTreeChangeServiceAdapterTest.java

示例3: getDataStoreType

protected LogicalDatastoreType getDataStoreType() {
    final LogicalDatastoreType dsType;
    if (dataStore == DataStore.CONFIG) {
        dsType = LogicalDatastoreType.CONFIGURATION;
    } else if (dataStore == DataStore.OPERATIONAL) {
        dsType = LogicalDatastoreType.OPERATIONAL;
    } else {
        if (rn.nextBoolean() == true) {
            dsType = LogicalDatastoreType.OPERATIONAL;
        } else {
            dsType = LogicalDatastoreType.CONFIGURATION;
        }
    }
    return dsType;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:15,代码来源:DatastoreAbstractWriter.java

示例4: toLegacy

private static LogicalDatastoreType toLegacy(org.opendaylight.mdsal.common.api.LogicalDatastoreType datastoreType) {
    switch (datastoreType) {
        case CONFIGURATION:
            return LogicalDatastoreType.CONFIGURATION;
        case OPERATIONAL:
            return LogicalDatastoreType.OPERATIONAL;
        default:
            throw new IllegalArgumentException("Unsupported data store type: " + datastoreType);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:10,代码来源:AbstractDOMBroker.java

示例5: treeTypeForStore

private TreeType treeTypeForStore(final LogicalDatastoreType store) {
    return store == LogicalDatastoreType.CONFIGURATION ? TreeType.CONFIGURATION : TreeType.OPERATIONAL;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:3,代码来源:ShardedDOMDataBrokerDelegatingReadWriteTransaction.java


注:本文中的org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。