Bug 5527 - Re-implement ControllerContext.toInstanceIdentifier() method
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / restconf / rest / impl / services / Draft11ServicesWrapperImpl.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.rest.impl.services;
9
10 import javax.ws.rs.core.UriInfo;
11 import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContext;
12 import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
13 import org.opendaylight.restconf.rest.api.schema.context.SchemaContextHandler;
14 import org.opendaylight.restconf.rest.api.services.Draft11ServicesWrapper;
15 import org.opendaylight.restconf.rest.api.services.RestconfModulesService;
16 import org.opendaylight.restconf.rest.api.services.RestconfOperationsService;
17 import org.opendaylight.restconf.rest.api.services.RestconfStreamsService;
18 import org.opendaylight.restconf.rest.api.services.schema.RestconfSchemaService;
19 import org.opendaylight.restconf.rest.handlers.api.DOMMountPointServiceHandler;
20 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
21
22 /**
23  * Implementation of {@link Draft11ServicesWrapper}
24  *
25  */
26 public class Draft11ServicesWrapperImpl implements Draft11ServicesWrapper {
27
28     private final RestconfModulesService delegRestModService;
29     private final RestconfOperationsService delegRestOpsService;
30     private final RestconfStreamsService delegRestStrsService;
31     private final RestconfSchemaService delegRestSchService;
32
33     /**
34      * Creating delegates to all implemented services
35      *
36      * @param schemaContextHandler
37      *            - for handling {@link SchemaContext}
38      * @param domMountPointServiceHandler
39      *            - for handling {@link DOMMountPointServiceHandler}
40      */
41     public Draft11ServicesWrapperImpl(final SchemaContextHandler schemaContextHandler,
42             final DOMMountPointServiceHandler domMountPointServiceHandler) {
43         this.delegRestModService = new RestconfModulesServiceImpl(schemaContextHandler, domMountPointServiceHandler);
44         this.delegRestOpsService = new RestconfOperationsServiceImpl(schemaContextHandler, domMountPointServiceHandler);
45         this.delegRestStrsService = new RestconfStreamsServiceImpl(schemaContextHandler);
46         this.delegRestSchService = new RestconfSchemaServiceImpl(schemaContextHandler, domMountPointServiceHandler);
47     }
48
49     @Override
50     public NormalizedNodeContext getModules(final UriInfo uriInfo) {
51         return this.delegRestModService.getModules(uriInfo);
52     }
53
54     @Override
55     public NormalizedNodeContext getModules(final String identifier, final UriInfo uriInfo) {
56         return this.delegRestModService.getModules(identifier, uriInfo);
57     }
58
59     @Override
60     public NormalizedNodeContext getModule(final String identifier, final UriInfo uriInfo) {
61         return this.delegRestModService.getModule(identifier, uriInfo);
62     }
63
64     @Override
65     public NormalizedNodeContext getOperations(final UriInfo uriInfo) {
66         return this.delegRestOpsService.getOperations(uriInfo);
67     }
68
69     @Override
70     public NormalizedNodeContext getOperations(final String identifier, final UriInfo uriInfo) {
71         return this.delegRestOpsService.getOperations(identifier, uriInfo);
72     }
73
74     @Override
75     public NormalizedNodeContext getAvailableStreams(final UriInfo uriInfo) {
76         return this.delegRestStrsService.getAvailableStreams(uriInfo);
77     }
78
79     @Override
80     public SchemaExportContext getSchema(final String mountAndModuleId) {
81         return this.delegRestSchService.getSchema(mountAndModuleId);
82     }
83
84 }