65d50dfde3f03aee158c31a4ebbf474cd6290418
[netconf.git] / restconf / restconf-openapi / src / main / java / org / opendaylight / restconf / openapi / impl / MountPointOpenApiGeneratorRFC8040.java
1 /*
2  * Copyright (c) 2018 Inocybe Technologies 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.openapi.impl;
9
10 import java.util.Optional;
11 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
12 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
13 import org.opendaylight.restconf.openapi.mountpoints.MountPointOpenApi;
14
15 /**
16  * MountPoint generator implementation for RFC 8040.
17  *
18  * @author Thomas Pantelis
19  */
20 public class MountPointOpenApiGeneratorRFC8040 extends BaseYangOpenApiGeneratorRFC8040 implements AutoCloseable {
21     private final MountPointOpenApi mountPointOpenApi;
22
23     public MountPointOpenApiGeneratorRFC8040(final DOMSchemaService schemaService,
24             final DOMMountPointService mountService) {
25         super(Optional.of(schemaService));
26         mountPointOpenApi = new MountPointOpenApi(schemaService, mountService, this);
27         mountPointOpenApi.init();
28     }
29
30     public MountPointOpenApiGeneratorRFC8040(final DOMSchemaService schemaService,
31             final DOMMountPointService mountService, final String basePath) {
32         super(Optional.of(schemaService), basePath);
33         mountPointOpenApi = new MountPointOpenApi(schemaService, mountService, this);
34         mountPointOpenApi.init();
35     }
36
37     public MountPointOpenApi getMountPointOpenApi() {
38         return mountPointOpenApi;
39     }
40
41     @Override
42     public void close() {
43         mountPointOpenApi.close();
44     }
45 }