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.base.services.impl;
10 import org.opendaylight.restconf.base.services.api.RestconfSchemaService;
11 import org.opendaylight.restconf.common.references.SchemaContextRef;
12 import org.opendaylight.restconf.common.schema.SchemaExportContext;
13 import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
14 import org.opendaylight.restconf.handlers.SchemaContextHandler;
15 import org.opendaylight.restconf.utils.parser.ParserIdentifier;
16 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
19 * Implementation of {@link RestconfSchemaService}.
21 * @deprecated move to splitted module restconf-nb-rfc8040
24 public class RestconfSchemaServiceImpl implements RestconfSchemaService {
26 private final SchemaContextHandler schemaContextHandler;
27 private final DOMMountPointServiceHandler domMountPointServiceHandler;
30 * Set {@link SchemaContextHandler} for getting actual {@link SchemaContext}
33 * @param schemaContextHandler
34 * handling schema context
35 * @param domMountPointServiceHandler
36 * handling dom mount point service
38 public RestconfSchemaServiceImpl(final SchemaContextHandler schemaContextHandler,
39 final DOMMountPointServiceHandler domMountPointServiceHandler) {
40 this.schemaContextHandler = schemaContextHandler;
41 this.domMountPointServiceHandler = domMountPointServiceHandler;
45 public SchemaExportContext getSchema(final String identifier) {
46 final SchemaContextRef schemaContextRef = new SchemaContextRef(this.schemaContextHandler.get());
47 return ParserIdentifier.toSchemaExportContextFromIdentifier(schemaContextRef.get(), identifier,
48 this.domMountPointServiceHandler.get());