2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.restconf.rest.impl.services;
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;
23 * Implementation of {@link Draft11ServicesWrapper}
26 public class Draft11ServicesWrapperImpl implements Draft11ServicesWrapper {
28 private final RestconfModulesService delegRestModService;
29 private final RestconfOperationsService delegRestOpsService;
30 private final RestconfStreamsService delegRestStrsService;
31 private final RestconfSchemaService delegRestSchService;
34 * Creating delegates to all implemented services
36 * @param schemaContextHandler
37 * - for handling {@link SchemaContext}
38 * @param domMountPointServiceHandler
39 * - for handling {@link DOMMountPointServiceHandler}
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);
50 public NormalizedNodeContext getModules(final UriInfo uriInfo) {
51 return this.delegRestModService.getModules(uriInfo);
55 public NormalizedNodeContext getModules(final String identifier, final UriInfo uriInfo) {
56 return this.delegRestModService.getModules(identifier, uriInfo);
60 public NormalizedNodeContext getModule(final String identifier, final UriInfo uriInfo) {
61 return this.delegRestModService.getModule(identifier, uriInfo);
65 public NormalizedNodeContext getOperations(final UriInfo uriInfo) {
66 return this.delegRestOpsService.getOperations(uriInfo);
70 public NormalizedNodeContext getOperations(final String identifier, final UriInfo uriInfo) {
71 return this.delegRestOpsService.getOperations(identifier, uriInfo);
75 public NormalizedNodeContext getAvailableStreams(final UriInfo uriInfo) {
76 return this.delegRestStrsService.getAvailableStreams(uriInfo);
80 public SchemaExportContext getSchema(final String mountAndModuleId) {
81 return this.delegRestSchService.getSchema(mountAndModuleId);