2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.netconf.confignetconfconnector.operations.editconfig;
11 import com.google.common.collect.Multimap;
13 import java.util.EnumSet;
16 public enum EditStrategyType {
19 // additional per element
22 private static final Set<EditStrategyType> defaultStrats = EnumSet.of(merge, replace, none);
24 public static EditStrategyType getDefaultStrategy() {
28 public boolean isEnforcing() {
39 throw new IllegalStateException("Default edit strategy can be only of value " + defaultStrats + " but was "
44 public EditConfigStrategy getFittingStrategy(Multimap<String, String> providedServices) {
47 return new MergeEditConfigStrategy(providedServices);
49 return new ReplaceEditConfigStrategy(providedServices);
51 return new DeleteEditConfigStrategy(providedServices);
53 return new RemoveEditConfigStrategy();
55 return new NoneEditConfigStrategy();
57 throw new UnsupportedOperationException("Unimplemented edit config strategy" + this);