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


Java IdentityAttributeRef类代码示例

本文整理汇总了Java中org.opendaylight.controller.config.api.IdentityAttributeRef的典型用法代码示例。如果您正苦于以下问题:Java IdentityAttributeRef类的具体用法?Java IdentityAttributeRef怎么用?Java IdentityAttributeRef使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: resolveIdentity

import org.opendaylight.controller.config.api.IdentityAttributeRef; //导入依赖的package包/类
@Override
public <T extends BaseIdentity> Class<? extends T> resolveIdentity(final IdentityAttributeRef identityRef,
        final Class<T> expectedBaseClass) {
    final QName qName = QName.create(identityRef.getqNameOfIdentity());
    final Class<?> deserialized = this.bindingContextProvider.getBindingContext().getIdentityClass(qName);
    if (deserialized == null) {
        throw new IllegalStateException("Unable to retrieve identity class for " + qName + ", null response from "
                + this.bindingContextProvider.getBindingContext());
    }
    if (expectedBaseClass.isAssignableFrom(deserialized)) {
        return (Class<T>) deserialized;
    }
    LOG.error("Cannot resolve class of identity {} : deserialized class {} is not a subclass of {}.", identityRef,
            deserialized, expectedBaseClass);
    throw new IllegalArgumentException(
            "Deserialized identity " + deserialized + " cannot be cast to " + expectedBaseClass);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:DependencyResolverImpl.java

示例2: getCompositeTypeForIdentity

import org.opendaylight.controller.config.api.IdentityAttributeRef; //导入依赖的package包/类
public OpenType<?> getCompositeTypeForIdentity() {
    final String[] itemNames = new String[]{IdentityAttributeRef.QNAME_ATTR_NAME};
    final String description = getNullableDescription() == null ? getAttributeYangName() : getNullableDescription();
    final OpenType<?>[] itemTypes = new OpenType[]{SimpleType.STRING};

    try {
        return new CompositeType(getUpperCaseCammelCase(), description, itemNames, itemNames, itemTypes);
    } catch (final OpenDataException e) {
        throw new RuntimeException("Unable to create " + CompositeType.class + " with inner element of type "
                + itemTypes, e);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:13,代码来源:JavaAttribute.java

示例3: testIdentities

import org.opendaylight.controller.config.api.IdentityAttributeRef; //导入依赖的package包/类
@Test
public void testIdentities() throws Exception {
    final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();

    final ObjectName nameCreated = transaction.createModule(IdentityTestModuleFactory.NAME, this.instanceName);
    final IdentityTestModuleMXBean mxBean = transaction.newMXBeanProxy(nameCreated, IdentityTestModuleMXBean.class);

    final IdentitiesContainer c = new IdentitiesContainer();
    c.setAfi(new IdentityAttributeRef(TestIdentity2.QNAME.toString()));
    mxBean.setIdentitiesContainer(c);
    transaction.commit();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:13,代码来源:NetconfTestImplModuleTest.java

示例4: validateIdentity

import org.opendaylight.controller.config.api.IdentityAttributeRef; //导入依赖的package包/类
@Override
public <T extends BaseIdentity> void validateIdentity(final IdentityAttributeRef identityRef,
        final Class<T> expectedBaseClass, final JmxAttribute jmxAttribute) {
    resolveIdentity(identityRef, expectedBaseClass);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:6,代码来源:DependencyResolverImpl.java

示例5: getType

import org.opendaylight.controller.config.api.IdentityAttributeRef; //导入依赖的package包/类
public String getType() {
    return IdentityAttributeRef.class.getName();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:4,代码来源:IdentityRefModuleField.java


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