import java.lang.reflect.Type;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.ext.MessageBodyWriter;
-import org.opendaylight.restconf.nb.rfc8040.rests.services.api.SchemaExportContext;
+import org.opendaylight.restconf.nb.rfc8040.legacy.SchemaExportContext;
abstract class AbstractSchemaExportBodyWriter implements MessageBodyWriter<SchemaExportContext> {
@Override
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.Provider;
-import org.opendaylight.restconf.nb.rfc8040.rests.services.api.SchemaExportContext;
+import org.opendaylight.restconf.nb.rfc8040.legacy.SchemaExportContext;
import org.opendaylight.yangtools.yang.common.Revision;
import org.opendaylight.yangtools.yang.common.YangConstants;
import org.opendaylight.yangtools.yang.model.api.Module;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.Provider;
import javax.xml.stream.XMLStreamException;
-import org.opendaylight.restconf.nb.rfc8040.rests.services.api.SchemaExportContext;
+import org.opendaylight.restconf.nb.rfc8040.legacy.SchemaExportContext;
import org.opendaylight.yangtools.yang.common.YangConstants;
import org.opendaylight.yangtools.yang.model.export.YinExportUtils;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.restconf.nb.rfc8040.rests.services.api;
+package org.opendaylight.restconf.nb.rfc8040.legacy;
import static java.util.Objects.requireNonNull;
+++ /dev/null
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.restconf.nb.rfc8040.rests.services.api;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import org.opendaylight.yangtools.yang.common.YangConstants;
-
-/**
- * Retrieval of the YANG modules which server supports.
- */
-@Path("/")
-public interface RestconfSchemaService {
- /**
- * Get schema of specific module.
- *
- * @param identifier path parameter
- * @return {@link SchemaExportContext}
- */
- @GET
- @Produces({ YangConstants.RFC6020_YIN_MEDIA_TYPE, YangConstants.RFC6020_YANG_MEDIA_TYPE })
- @Path("modules/{identifier:.+}")
- SchemaExportContext getSchema(@PathParam("identifier") String identifier);
-}
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
+import javax.ws.rs.GET;
import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
import org.opendaylight.mdsal.dom.api.DOMMountPointService;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.mdsal.dom.api.DOMYangTextSourceProvider;
-import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfSchemaService;
-import org.opendaylight.restconf.nb.rfc8040.rests.services.api.SchemaExportContext;
+import org.opendaylight.restconf.nb.rfc8040.legacy.SchemaExportContext;
import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier;
+import org.opendaylight.yangtools.yang.common.YangConstants;
/**
- * Implementation of {@link RestconfSchemaService}.
+ * Retrieval of the YANG modules which server supports.
*/
@Path("/")
-public class RestconfSchemaServiceImpl implements RestconfSchemaService {
+public class RestconfSchemaServiceImpl {
private final DOMSchemaService schemaService;
private final DOMMountPointService mountPointService;
private final DOMYangTextSourceProvider sourceProvider;
checkArgument(sourceProvider != null, "No DOMYangTextSourceProvider available in %s", schemaService);
}
- @Override
- public SchemaExportContext getSchema(final String identifier) {
+ /**
+ * Get schema of specific module.
+ *
+ * @param identifier path parameter
+ * @return {@link SchemaExportContext}
+ */
+ @GET
+ @Produces({ YangConstants.RFC6020_YIN_MEDIA_TYPE, YangConstants.RFC6020_YANG_MEDIA_TYPE })
+ @Path("modules/{identifier:.+}")
+ public SchemaExportContext getSchema(@PathParam("identifier") final String identifier) {
return ParserIdentifier.toSchemaExportContextFromIdentifier(schemaService.getGlobalContext(), identifier,
mountPointService, sourceProvider);
}
* <p>The URL is expected to be requested by {@link org.opendaylight.netconf.yanglib.writer.YangLibraryWriter
* YangLibraryWriter} when yang-library data is being constructed, only default module-set name ("ODL_modules")
* is supported. The composed URL for resource download expected to be served by
- * {@link org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfSchemaService RestconfSchemaService}.
+ * {@link RestconfSchemaServiceImpl}.
*/
@Singleton
@Component(immediate = true, service = YangLibrarySchemaSourceUrlProvider.class)
import org.opendaylight.restconf.api.ApiPath;
import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
import org.opendaylight.restconf.nb.rfc8040.legacy.InstanceIdentifierContext;
-import org.opendaylight.restconf.nb.rfc8040.rests.services.api.SchemaExportContext;
+import org.opendaylight.restconf.nb.rfc8040.legacy.SchemaExportContext;
import org.opendaylight.yangtools.yang.common.ErrorTag;
import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.Revision;
import org.opendaylight.mdsal.dom.spi.FixedDOMSchemaService;
import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
import org.opendaylight.restconf.nb.rfc8040.legacy.ErrorTags;
-import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfSchemaService;
import org.opendaylight.yangtools.yang.common.ErrorTag;
import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.QName;
YangParserTestUtils.parseYangResourceDirectory("/modules/mount-points");
// service under test
- private RestconfSchemaService schemaService;
+ private RestconfSchemaServiceImpl schemaService;
// handlers
@Mock