Split Restconf implementations (draft02 and RFC) - move providers
[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 com.google.common.base.Optional;
11 import com.google.common.base.Preconditions;
12 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
13
14 /**
15  * Implementation of {@link DOMMountPointServiceHandler}.
16  *
17  */
18 public class DOMMountPointServiceHandler implements Handler<DOMMountPointService> {
19
20     private final DOMMountPointService domMountPointService;
21     private static DOMMountPointService actualDomMountPointService;
22
23     /**
24      * Prepare mount point service for Restconf services.
25      *
26      * @param domMountPointService
27      *             mount point service
28      */
29     public DOMMountPointServiceHandler(final DOMMountPointService domMountPointService) {
30         Preconditions.checkNotNull(domMountPointService);
31         this.domMountPointService = domMountPointService;
32         actualDomMountPointService = domMountPointService;
33     }
34
35     @Override
36     public DOMMountPointService get() {
37         return this.domMountPointService;
38     }
39
40     public static Optional<DOMMountPointService> getActualMountPointService() {
41         return Optional.fromNullable(actualDomMountPointService);
42     }
43
44 }