本文整理汇总了Java中org.opendaylight.yangtools.yang.binding.Identifiable类的典型用法代码示例。如果您正苦于以下问题:Java Identifiable类的具体用法?Java Identifiable怎么用?Java Identifiable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Identifiable类属于org.opendaylight.yangtools.yang.binding包,在下文中一共展示了Identifiable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: create
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public static BindingContext create(final String logName, final Class<? extends DataObject> klass,
final String appConfigListKeyValue) {
if (Identifiable.class.isAssignableFrom(klass)) {
// The binding class corresponds to a yang list.
if (Strings.isNullOrEmpty(appConfigListKeyValue)) {
throw new ComponentDefinitionException(String.format(
"%s: App config binding class %s represents a yang list therefore \"%s\" must be specified",
logName, klass.getName(), DataStoreAppConfigMetadata.LIST_KEY_VALUE));
}
try {
return ListBindingContext.newInstance(klass, appConfigListKeyValue);
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | NoSuchMethodException | SecurityException e) {
throw new ComponentDefinitionException(String.format(
"%s: Error initializing for app config list binding class %s",
logName, klass.getName()), e);
}
} else {
return new ContainerBindingContext(klass);
}
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:BindingContext.java
示例2: extractRemoved
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
protected Map<InstanceIdentifier<Node>, List<T>> extractRemoved(
Collection<DataTreeModification<Node>> changes, Class<T> class1) {
Map<InstanceIdentifier<Node>, List<T>> result = new HashMap<>();
if (changes != null && !changes.isEmpty()) {
for (DataTreeModification<Node> change : changes) {
final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
Class<? extends Identifiable> classType = (Class<? extends Identifiable>) getClassType();
List<T> removed;
if (getOperationalState().isInReconciliation()) {
removed = getRemoved(change);
} else {
removed = (List<T>) getOperationalState().getDeletedData(key, classType);
}
removed.addAll(getCascadeDeleteData(change));
result.put(key, removed);
}
}
return result;
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:20,代码来源:AbstractTransactCommand.java
示例3: extractUpdated
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
protected Map<InstanceIdentifier<Node>, List<T>> extractUpdated(
Collection<DataTreeModification<Node>> changes, Class<T> class1) {
Map<InstanceIdentifier<Node>, List<T>> result = new HashMap<>();
if (changes != null && !changes.isEmpty()) {
for (DataTreeModification<Node> change : changes) {
InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
Class<? extends Identifiable> classType = (Class<? extends Identifiable>) getClassType();
List<T> updated = null;
if (getOperationalState().isInReconciliation()) {
updated = getUpdated(change);
} else {
updated = (List<T>) getOperationalState().getUpdatedData(key, classType);
}
result.put(key, updated);
}
}
return result;
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:19,代码来源:AbstractTransactCommand.java
示例4: retrieveUnMetDependencies
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
Map<Class<? extends Identifiable>, List<InstanceIdentifier>> retrieveUnMetDependencies(
HwvtepOperationalState opState, HwvtepDeviceInfo deviceInfo, T data) {
Map<Class<? extends Identifiable>, List<InstanceIdentifier>> result = new HashMap<>();
Map<Class<? extends Identifiable>, List<InstanceIdentifier<?>>> allKeys = new HashMap<>();
allKeys.put(LogicalSwitches.class, getLogicalSwitchDependencies(data));
allKeys.put(TerminationPoint.class, getTerminationPointDependencies(data));
for (Class<? extends Identifiable> cls : allKeys.keySet()) {
List<InstanceIdentifier<? extends DataObject>> keysToCheck = allKeys.get(cls);
for (InstanceIdentifier<? extends DataObject> key : keysToCheck) {
if (!isDependencyMet(opState, deviceInfo, cls, key)) {
result = addToResultMap(result, cls, key);
}
}
}
return result;
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:19,代码来源:UnMetDependencyGetter.java
示例5: onDataTreeChanged
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
private void onDataTreeChanged(final Collection<DataTreeModification<Node>> changes) {
boolean readOperationalNodes = false;
for (DataTreeModification<Node> change : changes) {
final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
final DataObjectModification<Node> mod = change.getRootNode();
final Map<Class<? extends Identifiable>, List<Identifiable>> updatedData = new HashMap<>();
final Map<Class<? extends Identifiable>, List<Identifiable>> deletedData = new HashMap<>();
extractDataChanged(key, mod, updatedData, deletedData);
modifiedData.put(key, Pair.of(updatedData, deletedData));
operationalState.setModifiedData(modifiedData);
if (!isMacOnlyUpdate(updatedData, deletedData)) {
readOperationalNodes = true;
}
}
if (readOperationalNodes) {
operationalState.readOperationalNodes();
}
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:19,代码来源:TransactCommandAggregator.java
示例6: extractDataChanged
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
private void extractDataChanged(final InstanceIdentifier<Node> key,
final DataObjectModification<Node> mod,
final Map<Class<? extends Identifiable>, List<Identifiable>> updatedData,
final Map<Class<? extends Identifiable>, List<Identifiable>> deletedData) {
extractDataChanged(mod.getModifiedChildren(), updatedData, deletedData);
DataObjectModification<HwvtepGlobalAugmentation> aug = mod.getModifiedAugmentation(
HwvtepGlobalAugmentation.class);
if (aug != null && getModificationType(aug) != null) {
extractDataChanged(aug.getModifiedChildren(), updatedData, deletedData);
}
DataObjectModification<PhysicalSwitchAugmentation> psAug = mod.getModifiedAugmentation(
PhysicalSwitchAugmentation.class);
if (psAug != null && getModificationType(psAug) != null) {
extractDataChanged(psAug.getModifiedChildren(), updatedData, deletedData);
}
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:18,代码来源:TransactCommandAggregator.java
示例7: updateDeviceOpData
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
private void updateDeviceOpData(InstanceIdentifier<Node> key, DataObjectModification<? extends DataObject> mod) {
ModificationType type = getModificationType(mod);
if (type == null) {
return;
}
Class<? extends Identifiable> childClass = (Class<? extends Identifiable>) mod.getDataType();
InstanceIdentifier instanceIdentifier = getKey(key, mod, mod.getDataAfter());
switch(type) {
case WRITE:
connectionInstance.getDeviceInfo().updateDeviceOperData(childClass, instanceIdentifier,
new UUID("uuid"), mod.getDataAfter());
break;
case DELETE:
connectionInstance.getDeviceInfo().clearDeviceOperData(childClass, instanceIdentifier);
break;
case SUBTREE_MODIFIED:
}
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:19,代码来源:HwvtepOperationalDataChangeListener.java
示例8: getModifiedChildListItem
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <C extends Identifiable<K> & ChildOf<? super T>, K extends Identifier<C>> DataObjectModification<C>
getModifiedChildListItem(final Class<C> listItem, final K listKey) {
return (DataObjectModification<C>) getModifiedChild(
new InstanceIdentifier.IdentifiableItem<>(listItem, listKey));
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:8,代码来源:DataObjectModificationImpl.java
示例9: getConfigData
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public Object getConfigData(Class<? extends Identifiable> cls, InstanceIdentifier key) {
DeviceData deviceData = HwvtepSouthboundUtil.getData(configKeyVsData, cls, key);
if (deviceData != null) {
return deviceData.getData();
}
return null;
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:8,代码来源:HwvtepDeviceInfo.java
示例10: markKeyAsInTransit
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public void markKeyAsInTransit(Class<? extends Identifiable> cls, InstanceIdentifier key) {
LOG.debug("Marking device data as intransit {}", key);
DeviceData deviceData = getDeviceOperData(cls, key);
UUID uuid = null;
Object data = null;
if (deviceData != null) {
uuid = deviceData.getUuid();
data = deviceData.getData();
}
HwvtepSouthboundUtil.updateData(opKeyVsData, cls, key,
new DeviceData(key, uuid, data, DeviceDataStatus.IN_TRANSIT));
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:13,代码来源:HwvtepDeviceInfo.java
示例11: clearDeviceOperData
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public void clearDeviceOperData(Class<? extends Identifiable> cls, InstanceIdentifier key) {
DeviceData deviceData = HwvtepSouthboundUtil.getData(opKeyVsData, cls, key);
if (deviceData != null && deviceData.uuid != null) {
HwvtepSouthboundUtil.clearData(uuidVsData, cls, deviceData.uuid);
}
HwvtepSouthboundUtil.clearData(opKeyVsData, cls, key);
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:8,代码来源:HwvtepDeviceInfo.java
示例12: getUUID
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public UUID getUUID(Class<? extends Identifiable> cls, InstanceIdentifier key) {
DeviceData data = HwvtepSouthboundUtil.getData(opKeyVsData, cls, key);
if (data != null) {
return data.uuid;
}
return null;
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:8,代码来源:HwvtepDeviceInfo.java
示例13: clearInTransit
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public void clearInTransit(Class<? extends Identifiable> cls, InstanceIdentifier key) {
DeviceData deviceData = getDeviceOperData(cls, key);
if (deviceData != null && deviceData.isInTransitState()) {
if (deviceData.getData() != null) {
HwvtepSouthboundUtil.updateData(opKeyVsData, cls, key,
new DeviceData(key, deviceData.getUuid(), deviceData.getData(), DeviceDataStatus.AVAILABLE));
} else {
clearDeviceOperData(cls, key);
}
}
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:12,代码来源:HwvtepDeviceInfo.java
示例14: addToUpdates
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
void addToUpdates(InstanceIdentifier key, T data) {
T oldData = null;
Type type = getClass().getGenericSuperclass();
Type classType = ((ParameterizedType) type).getActualTypeArguments()[0];
if (getDeviceInfo().getConfigData((Class<? extends Identifiable>) classType, key) != null) {
oldData = (T) getDeviceInfo().getConfigData((Class<? extends Identifiable>) classType, key);
}
updates.putIfAbsent(getDeviceTransaction(), new ArrayList<MdsalUpdate<T>>());
updates.get(getDeviceTransaction()).add(new MdsalUpdate<T>(key, data, oldData));
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:11,代码来源:AbstractTransactCommand.java
示例15: onFailure
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public void onFailure(TransactionBuilder deviceTransaction) {
if (deviceTransaction == null || !updates.containsKey(deviceTransaction)) {
return;
}
for (MdsalUpdate mdsalUpdate : updates.get(deviceTransaction)) {
getDeviceInfo().clearInTransit((Class<? extends Identifiable>) mdsalUpdate.getClass(),
mdsalUpdate.getKey());
}
onCommandFailed();
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:11,代码来源:AbstractTransactCommand.java
示例16: addToResultMap
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
Map<Class<? extends Identifiable>, List<InstanceIdentifier>> addToResultMap(
Map<Class<? extends Identifiable>, List<InstanceIdentifier>> result,
Class<? extends Identifiable> cls, InstanceIdentifier<? extends DataObject> key) {
if (null == result) {
result = new HashMap<>();
}
if (!result.containsKey(cls)) {
result.put(cls, new ArrayList<>());
}
result.get(cls).add(key);
return result;
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:13,代码来源:UnMetDependencyGetter.java
示例17: getUpdatedData
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public List<? extends Identifiable> getUpdatedData(final InstanceIdentifier<Node> key,
final Class<? extends Identifiable> cls) {
List<Identifiable> result = null;
if (modifiedData.get(key) != null && modifiedData.get(key).getLeft() != null) {
result = modifiedData.get(key).getLeft().get(cls);
}
if (result == null) {
result = Collections.EMPTY_LIST;
}
return result;
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:12,代码来源:HwvtepOperationalState.java
示例18: getDeletedData
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public List<? extends Identifiable> getDeletedData(final InstanceIdentifier<Node> key,
final Class<? extends Identifiable> cls) {
List<Identifiable> result = null;
if (modifiedData.get(key) != null && modifiedData.get(key).getRight() != null) {
result = modifiedData.get(key).getRight().get(cls);
}
if (result == null) {
result = Collections.EMPTY_LIST;
}
return result;
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:12,代码来源:HwvtepOperationalState.java
示例19: updateData
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public static <KeyType, D> void updateData(Map<Class<? extends Identifiable>, Map<KeyType, D>> map,
Class<? extends Identifiable> cls, KeyType key, D data) {
if (key == null) {
return;
}
if (!map.containsKey(cls)) {
map.put(cls, new ConcurrentHashMap<>());
}
map.get(cls).put(key, data);
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:11,代码来源:HwvtepSouthboundUtil.java
示例20: getData
import org.opendaylight.yangtools.yang.binding.Identifiable; //导入依赖的package包/类
public static <KeyType, D> D getData(Map<Class<? extends Identifiable>, Map<KeyType, D>> map,
Class<? extends Identifiable> cls, KeyType key) {
if (key == null) {
return null;
}
if (map.containsKey(cls)) {
return map.get(cls).get(key);
}
return null;
}
开发者ID:opendaylight,项目名称:ovsdb,代码行数:11,代码来源:HwvtepSouthboundUtil.java
注:本文中的org.opendaylight.yangtools.yang.binding.Identifiable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论