use of org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.BatchChoice in project openflowplugin by opendaylight.
the class FlatBatchUtil method detectBatchStepType.
@VisibleForTesting
static <T extends BatchChoice> BatchStepType detectBatchStepType(final T batchCase) {
final BatchStepType type;
final Class<? extends DataContainer> implementedInterface = batchCase.getImplementedInterface();
if (FlatBatchAddFlowCase.class.equals(implementedInterface)) {
type = BatchStepType.FLOW_ADD;
} else if (FlatBatchRemoveFlowCase.class.equals(implementedInterface)) {
type = BatchStepType.FLOW_REMOVE;
} else if (FlatBatchUpdateFlowCase.class.equals(implementedInterface)) {
type = BatchStepType.FLOW_UPDATE;
} else if (FlatBatchAddGroupCase.class.equals(implementedInterface)) {
type = BatchStepType.GROUP_ADD;
} else if (FlatBatchRemoveGroupCase.class.equals(implementedInterface)) {
type = BatchStepType.GROUP_REMOVE;
} else if (FlatBatchUpdateGroupCase.class.equals(implementedInterface)) {
type = BatchStepType.GROUP_UPDATE;
} else if (FlatBatchAddMeterCase.class.equals(implementedInterface)) {
type = BatchStepType.METER_ADD;
} else if (FlatBatchRemoveMeterCase.class.equals(implementedInterface)) {
type = BatchStepType.METER_REMOVE;
} else if (FlatBatchUpdateMeterCase.class.equals(implementedInterface)) {
type = BatchStepType.METER_UPDATE;
} else {
throw new IllegalArgumentException("Unsupported batch obtained: " + implementedInterface);
}
return type;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.BatchChoice in project openflowplugin by opendaylight.
the class SyncPlanPushStrategyFlatBatchImpl method decrementBatchFailuresCounters.
private static void decrementBatchFailuresCounters(final List<BatchFailure> batchFailures, final Map<Range<Integer>, Batch> batchMap, final SyncCrudCounters counters) {
for (BatchFailure batchFailure : batchFailures) {
for (Map.Entry<Range<Integer>, Batch> rangeBatchEntry : batchMap.entrySet()) {
if (rangeBatchEntry.getKey().contains(batchFailure.getBatchOrder())) {
// get type and decrease
final BatchChoice batchChoice = rangeBatchEntry.getValue().getBatchChoice();
decrementCounters(batchChoice, counters);
break;
}
}
}
}
Aggregations