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 //FIXME: make thread safe
17 public enum EditStrategyType {
20 // additional per element
23 private static final Set<EditStrategyType> defaultStrats = EnumSet.of(merge, replace, none);
25 public static EditStrategyType getDefaultStrategy() {
29 public boolean isEnforcing() {
40 throw new IllegalStateException("Default edit strategy can be only of value " + defaultStrats + " but was "
45 public EditConfigStrategy getFittingStrategy(Multimap<String, String> providedServices) {
48 return new MergeEditConfigStrategy(providedServices);
50 return new ReplaceEditConfigStrategy(providedServices);
52 return new DeleteEditConfigStrategy(providedServices);
54 return new RemoveEditConfigStrategy();
56 return new NoneEditConfigStrategy();
58 throw new UnsupportedOperationException("Unimplemented edit config strategy" + this);