本文整理汇总了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);
}
示例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);
}
}
示例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();
}
示例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);
}
示例5: getType
import org.opendaylight.controller.config.api.IdentityAttributeRef; //导入依赖的package包/类
public String getType() {
return IdentityAttributeRef.class.getName();
}