Deprecate all MD-SAL APIs
[controller.git] / opendaylight / md-sal / sal-dom-compat / src / main / java / org / opendaylight / controller / sal / core / compat / LegacyDOMActionServiceAdapter.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.sal.core.compat;
9
10 import static java.util.Objects.requireNonNull;
11
12 import com.google.common.collect.ClassToInstanceMap;
13 import com.google.common.collect.ForwardingObject;
14 import com.google.common.util.concurrent.ListenableFuture;
15 import org.opendaylight.controller.md.sal.dom.api.DOMActionService;
16 import org.opendaylight.mdsal.dom.api.DOMActionResult;
17 import org.opendaylight.mdsal.dom.api.DOMActionServiceExtension;
18 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
19 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
20 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
21
22 @Deprecated
23 public class LegacyDOMActionServiceAdapter extends ForwardingObject implements DOMActionService {
24     private final org.opendaylight.mdsal.dom.api.DOMActionService delegate;
25
26     public LegacyDOMActionServiceAdapter(final org.opendaylight.mdsal.dom.api.DOMActionService delegate) {
27         this.delegate = requireNonNull(delegate);
28     }
29
30     @Override
31     protected org.opendaylight.mdsal.dom.api.DOMActionService delegate() {
32         return delegate;
33     }
34
35     @Override
36     public ListenableFuture<? extends DOMActionResult> invokeAction(final SchemaPath type,
37             final DOMDataTreeIdentifier path, final ContainerNode input) {
38         return delegate.invokeAction(type, path, input);
39     }
40
41     @Override
42     public ClassToInstanceMap<DOMActionServiceExtension> getExtensions() {
43         return delegate.getExtensions();
44     }
45 }