501aeafa736970014476257f713d509c9b2732cc
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / handlers / DOMMountPointServiceHandler.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. 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.restconf.nb.rfc8040.handlers;
9
10 import static java.util.Objects.requireNonNull;
11
12 import javax.inject.Inject;
13 import javax.inject.Singleton;
14 import org.apache.aries.blueprint.annotation.service.Reference;
15 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
16
17 /**
18  * Implementation of {@link DOMMountPointServiceHandler}.
19  *
20  */
21 @Singleton
22 public final class DOMMountPointServiceHandler implements Handler<DOMMountPointService> {
23     private final DOMMountPointService domMountPointService;
24
25     /**
26      * Prepare mount point service for Restconf services.
27      *
28      * @param domMountPointService
29      *             mount point service
30      */
31     @Inject
32     public DOMMountPointServiceHandler(final @Reference DOMMountPointService domMountPointService) {
33         this.domMountPointService = requireNonNull(domMountPointService);
34     }
35
36     @Deprecated
37     public static DOMMountPointServiceHandler newInstance(final DOMMountPointService domMountPointService) {
38         return new DOMMountPointServiceHandler(domMountPointService);
39     }
40
41     @Override
42     public DOMMountPointService get() {
43         return this.domMountPointService;
44     }
45 }