- isOk = false;
- }
- //
- // NOTE: We need a way to find the acceptable recipe values (either Enum or a database that has these)
- //
- ImmutableMap<String, List<String>> recipes = new ImmutableMap.Builder<String, List<String>>()
- .put("APPC", ImmutableList.of("Restart", "Rebuild", "Migrate", "ModifyConfig"))
- .put("SDNC", ImmutableList.of("Reroute"))
- .put("SDNR", ImmutableList.of("ModifyConfig"))
- .put("SO", ImmutableList.of("VF Module Create", "VF Module Delete"))
- .put("VFC", ImmutableList.of("Restart"))
- .build();
- //
- if (operPolicy.getRecipe() != null
- && (!recipes.getOrDefault(operPolicy.getActor(),
- Collections.emptyList()).contains(operPolicy.getRecipe()))) {
- if (callback != null) {
- callback.onError("Policy recipe is invalid");
- }
- isOk = false;