/** * Applies all contexts to flow objective service. */ public void apply() { if (pendingContexts.isEmpty()) { moveNextPendingToPending(); } final Set<ObjectiveContext> contextsToApply = pendingContexts(); contextsToApply.forEach(ctx -> { FlowObjectiveInstallationContext foiCtx = (FlowObjectiveInstallationContext) ctx; flowObjectiveService.apply(foiCtx.deviceId, foiCtx.objective); }); }
ctx.setObjective(newObj, ctx.deviceId); ctx.increaseRetryValue(); flowObjectiveService.apply(ctx.deviceId, ctx.objective); } else { pendingContexts.remove(ctx); flowObjectiveService.apply(ctx.deviceId, ctx.objective); break; case GROUPMISSING: ctx.setObjective(newObj, ctx.deviceId); ctx.increaseRetryValue(); flowObjectiveService.apply(ctx.deviceId, ctx.objective); } else if (ctx.objective.op() == Objective.Operation.REMOVE || ctx.objective.op() == Objective.Operation.REMOVE_FROM_EXISTING) { flowObjectiveService.apply(ctx.deviceId, ctx.objective); flowObjectiveService.apply(ctx.deviceId, ctx.objective); break; default:
flowObjectiveService.apply(nextContext.deviceId, nextContext.objective); intentInstallationContext.removePendingContext(this); contextsToApply.forEach(ctx -> { FlowObjectiveInstallationContext foiCtx = (FlowObjectiveInstallationContext) ctx; flowObjectiveService.apply(foiCtx.deviceId, foiCtx.objective); });