import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
/**
- * Wrapping providers from restconf draft02 and draft11.
+ * Wrapping providers from restconf draft02 and draft15.
*
*/
public class RestconfWrapperProviders implements AutoCloseable, RestConnector {
// DRAFT02
private final RestconfProviderImpl providerDraft02;
- // DRAFT11
- private final RestConnectorProvider providerDraft11;
+ // DRAFT15
+ private final RestConnectorProvider providerDraft15;
/**
* Init both providers:
* <ul>
* <li>draft02 - {@link RestconfProviderImpl}
- * <li>draft11 - {@link RestConnectorProvider}
+ * <li>draft15 - {@link RestConnectorProvider}
* </ul>
*
* @param port
this.providerDraft02 = new RestconfProviderImpl();
this.providerDraft02.setWebsocketPort(port);
- // Init draft11 provider
- this.providerDraft11 = new RestConnectorProvider();
+ this.providerDraft15 = new RestConnectorProvider();
}
/**
* Register both providers, which will use the SAL layer:
* <ul>
* <li>draft02 - {@link RestconfProviderImpl}
- * <li>draft11 - {@link RestConnectorProvider}
+ * <li>draft15 - {@link RestConnectorProvider}
* </ul>
*
* @param broker
// Register draft02 provider
broker.registerProvider(this.providerDraft02);
- // Register draft11 provider
- broker.registerProvider(this.providerDraft11);
+ // Register draft15 provider
+ broker.registerProvider(this.providerDraft15);
}
/**
@Override
public void close() throws Exception {
this.providerDraft02.close();
- this.providerDraft11.close();
+ this.providerDraft15.close();
}
}
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
@Provider
-@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE, Draft11.MediaTypes.YANG })
+@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE, Draft15.MediaTypes.YANG })
public class SchemaExportContentYangBodyWriter implements MessageBodyWriter<SchemaExportContext> {
@Override
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
import javax.xml.stream.XMLStreamException;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.model.export.YinExportUtils;
@Provider
-@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE, Draft11.MediaTypes.YIN + RestconfConstants.XML })
+@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE, Draft15.MediaTypes.YIN + RestconfConstants.XML })
public class SchemaExportContentYinBodyWriter implements MessageBodyWriter<SchemaExportContext> {
@Override
*/
package org.opendaylight.netconf.sal.rest.api;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.yangtools.yang.common.QName;
/**
* @deprecated Do not use old implementation of restconf draft. It will be
- * replaced by {@link Draft11}.
+ * replaced by {@link Draft15}.
*
*/
@Deprecated
import org.opendaylight.netconf.sal.rest.api.RestconfConstants;
import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
-import org.opendaylight.restconf.utils.patch.Draft11AbstractIdentifierAwareJaxRsProvider;
+import org.opendaylight.restconf.utils.patch.Draft15AbstractIdentifierAwareJaxRsProvider;
/**
* @deprecated This class will be replaced by
- * {@link Draft11AbstractIdentifierAwareJaxRsProvider}
+ * {@link Draft15AbstractIdentifierAwareJaxRsProvider}
*/
@Deprecated
public class AbstractIdentifierAwareJaxRsProvider {
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode;
import org.slf4j.LoggerFactory;
@Provider
-@Consumes({ Draft02.MediaTypes.DATA + RestconfService.JSON, Draft11.MediaTypes.DATA + RestconfConstants.JSON,
- Draft02.MediaTypes.OPERATION + RestconfService.JSON, Draft11.MediaTypes.OPERATION + RestconfConstants.JSON,
+@Consumes({ Draft02.MediaTypes.DATA + RestconfService.JSON, Draft15.MediaTypes.DATA + RestconfConstants.JSON,
+ Draft02.MediaTypes.OPERATION + RestconfService.JSON, Draft15.MediaTypes.OPERATION + RestconfConstants.JSON,
MediaType.APPLICATION_JSON })
public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader<NormalizedNodeContext> {
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.utils.patch.Draft11JsonToPATCHBodyReader;
+import org.opendaylight.restconf.utils.patch.Draft15JsonToPATCHBodyReader;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.slf4j.LoggerFactory;
/**
- * @deprecated This class will be replaced by {@link Draft11JsonToPATCHBodyReader}
+ * @deprecated This class will be replaced by {@link Draft15JsonToPATCHBodyReader}
*/
@Deprecated
@Provider
import org.opendaylight.netconf.sal.rest.api.RestconfService;
import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@Provider
@Produces({ Draft02.MediaTypes.API + RestconfService.JSON, Draft02.MediaTypes.DATA + RestconfService.JSON,
Draft02.MediaTypes.OPERATION + RestconfService.JSON,
- Draft11.MediaTypes.API + RestconfConstants.JSON, Draft11.MediaTypes.DATA + RestconfConstants.JSON,
- Draft11.MediaTypes.OPERATION + RestconfConstants.JSON, MediaType.APPLICATION_JSON })
+ Draft15.MediaTypes.API + RestconfConstants.JSON, Draft15.MediaTypes.DATA + RestconfConstants.JSON,
+ Draft15.MediaTypes.OPERATION + RestconfConstants.JSON, MediaType.APPLICATION_JSON })
public class NormalizedNodeJsonBodyWriter implements MessageBodyWriter<NormalizedNodeContext> {
private static final int DEFAULT_INDENT_SPACES_NUM = 2;
import org.opendaylight.netconf.sal.rest.api.RestconfService;
import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@Provider
@Produces({ Draft02.MediaTypes.API + RestconfService.XML, Draft02.MediaTypes.DATA + RestconfService.XML,
Draft02.MediaTypes.OPERATION + RestconfService.XML,
- Draft11.MediaTypes.API + RestconfConstants.XML, Draft11.MediaTypes.DATA + RestconfConstants.XML,
- Draft11.MediaTypes.OPERATION + RestconfConstants.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ Draft15.MediaTypes.API + RestconfConstants.XML, Draft15.MediaTypes.DATA + RestconfConstants.XML,
+ Draft15.MediaTypes.OPERATION + RestconfConstants.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public class NormalizedNodeXmlBodyWriter implements MessageBodyWriter<NormalizedNodeContext> {
private static final XMLOutputFactory XML_FACTORY;
import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusContext;
import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusEntity;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.data.codec.gson.JsonWriterFactory;
@Provider
@Produces({Draft02.MediaTypes.PATCH_STATUS + RestconfService.JSON,
- Draft11.MediaTypes.PATCH_STATUS + RestconfConstants.JSON})
+ Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.JSON})
public class PATCHJsonBodyWriter implements MessageBodyWriter<PATCHStatusContext> {
@Override
import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusContext;
import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusEntity;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
@Provider
@Produces({Draft02.MediaTypes.PATCH_STATUS + RestconfService.XML,
- Draft11.MediaTypes.PATCH_STATUS + RestconfConstants.XML})
+ Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.XML})
public class PATCHXmlBodyWriter implements MessageBodyWriter<PATCHStatusContext> {
private static final XMLOutputFactory XML_FACTORY;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.w3c.dom.Element;
@Provider
-@Consumes({ Draft02.MediaTypes.DATA + RestconfService.XML, Draft11.MediaTypes.DATA + RestconfConstants.XML,
- Draft02.MediaTypes.OPERATION + RestconfService.XML, Draft11.MediaTypes.OPERATION + RestconfConstants.XML,
+@Consumes({ Draft02.MediaTypes.DATA + RestconfService.XML, Draft15.MediaTypes.DATA + RestconfConstants.XML,
+ Draft02.MediaTypes.OPERATION + RestconfService.XML, Draft15.MediaTypes.OPERATION + RestconfConstants.XML,
MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public class XmlNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader<NormalizedNodeContext> {
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.utils.patch.Draft11XmlToPATCHBodyReader;
+import org.opendaylight.restconf.utils.patch.Draft15XmlToPATCHBodyReader;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.w3c.dom.NodeList;
/**
- * @deprecated This class will be replaced by {@link Draft11XmlToPATCHBodyReader}
+ * @deprecated This class will be replaced by {@link Draft15XmlToPATCHBodyReader}
*/
@Deprecated
@Provider
* </ul>
* </ul>
*
- * We used old revision {@link Draft11.RestconfModule#REVISION} of restconf yang
+ * We used old revision {@link Draft15.RestconfModule#REVISION} of restconf yang
* because the latest restconf draft has to be supported by Yang 1.1 and we are
* not. Then, this is only partial implementation of the latest restconf draft.
*/
-public final class Draft11 {
+public final class Draft15 {
- private Draft11() {
+ private Draft15() {
throw new UnsupportedOperationException("Util class");
}
public static final String ERROR_LIST_SCHEMA_NODE = "error";
- public static final QName IETF_RESTCONF_QNAME = QName.create(Draft11.RestconfModule.NAMESPACE, Draft11.RestconfModule.REVISION,
- Draft11.RestconfModule.NAME);
+ public static final QName IETF_RESTCONF_QNAME = QName.create(Draft15.RestconfModule.NAMESPACE, Draft15.RestconfModule.REVISION,
+ Draft15.RestconfModule.NAME);
public static final QName ERRORS_CONTAINER_QNAME = QName.create(IETF_RESTCONF_QNAME, ERRORS_CONTAINER_SCHEMA_NODE);
import org.opendaylight.controller.sal.core.api.model.SchemaService;
import org.opendaylight.netconf.sal.rest.api.RestConnector;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
-import org.opendaylight.restconf.common.wrapper.services.Draft11ServicesWrapperImpl;
+import org.opendaylight.restconf.common.wrapper.services.Draft15ServicesWrapperImpl;
import org.opendaylight.restconf.handlers.DOMDataBrokerHandler;
import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.handlers.RpcServiceHandler;
import org.slf4j.LoggerFactory;
/**
- * Provider for restconf draft11.
+ * Provider for restconf draft15.
*
*/
public class RestConnectorProvider implements Provider, RestConnector, AutoCloseable {
public void onSessionInitiated(final ProviderSession session) {
final SchemaService schemaService = Preconditions.checkNotNull(session.getService(SchemaService.class));
- final Draft11ServicesWrapperImpl wrapperServices = Draft11ServicesWrapperImpl.getInstance();
+ final Draft15ServicesWrapperImpl wrapperServices = Draft15ServicesWrapperImpl.getInstance();
final SchemaContextHandler schemaCtxHandler = new SchemaContextHandler();
this.listenerRegistration = schemaService.registerSchemaContextListener(schemaCtxHandler);
import org.opendaylight.netconf.sal.rest.impl.PATCHXmlBodyWriter;
import org.opendaylight.netconf.sal.rest.impl.RestconfDocumentedExceptionMapper;
import org.opendaylight.netconf.sal.rest.impl.XmlNormalizedNodeBodyReader;
-import org.opendaylight.restconf.common.wrapper.services.Draft11ServicesWrapperImpl;
-import org.opendaylight.restconf.utils.patch.Draft11JsonToPATCHBodyReader;
-import org.opendaylight.restconf.utils.patch.Draft11XmlToPATCHBodyReader;
+import org.opendaylight.restconf.common.wrapper.services.Draft15ServicesWrapperImpl;
+import org.opendaylight.restconf.utils.patch.Draft15JsonToPATCHBodyReader;
+import org.opendaylight.restconf.utils.patch.Draft15XmlToPATCHBodyReader;
public class RestconfApplication extends Application {
return ImmutableSet.<Class<?>> builder().add(NormalizedNodeJsonBodyWriter.class)
.add(NormalizedNodeXmlBodyWriter.class).add(JsonNormalizedNodeBodyReader.class)
.add(XmlNormalizedNodeBodyReader.class).add(SchemaExportContentYinBodyWriter.class)
- .add(Draft11JsonToPATCHBodyReader.class).add(Draft11XmlToPATCHBodyReader.class)
+ .add(Draft15JsonToPATCHBodyReader.class).add(Draft15XmlToPATCHBodyReader.class)
.add(PATCHJsonBodyWriter.class).add(PATCHXmlBodyWriter.class)
.add(SchemaExportContentYangBodyWriter.class).add(RestconfDocumentedExceptionMapper.class)
.build();
@Override
public Set<Object> getSingletons() {
final Set<Object> singletons = new HashSet<>();
- singletons.add(Draft11ServicesWrapperImpl.getInstance());
+ singletons.add(Draft15ServicesWrapperImpl.getInstance());
return singletons;
}
}
import java.util.Date;
import java.util.Set;
import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
/**
* Get {@link Module} by ietf-restconf qname from
- * {@link Draft11.RestconfModule}
+ * {@link Draft15.RestconfModule}
*
* @return {@link Module}
*/
public Module getRestconfModule() {
- return this.findModuleByNamespaceAndRevision(Draft11.RestconfModule.IETF_RESTCONF_QNAME.getNamespace(),
- Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
+ return this.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME.getNamespace(),
+ Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
}
/**
import org.opendaylight.restconf.handlers.RpcServiceHandler;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.handlers.TransactionChainHandler;
-import org.opendaylight.restconf.rest.services.api.Draft11BaseServicesWrapper;
+import org.opendaylight.restconf.rest.services.api.Draft15BaseServicesWrapper;
import org.opendaylight.restconf.rest.services.api.RestconfModulesService;
import org.opendaylight.restconf.rest.services.api.RestconfOperationsService;
import org.opendaylight.restconf.rest.services.api.RestconfSchemaService;
import org.opendaylight.restconf.rest.services.impl.RestconfOperationsServiceImpl;
import org.opendaylight.restconf.rest.services.impl.RestconfSchemaServiceImpl;
import org.opendaylight.restconf.rest.services.impl.RestconfStreamsServiceImpl;
-import org.opendaylight.restconf.restful.services.api.Draft11TransactionServicesWrapper;
+import org.opendaylight.restconf.restful.services.api.Draft15TransactionServicesWrapper;
import org.opendaylight.restconf.restful.services.api.RestconfDataService;
import org.opendaylight.restconf.restful.services.api.RestconfInvokeOperationsService;
import org.opendaylight.restconf.restful.services.api.RestconfStreamsSubscriptionService;
/**
* Wrapper for services:
* <ul>
- * <li>{@link Draft11BaseServicesWrapper}
- * <li>{@link Draft11TransactionServicesWrapper}
+ * <li>{@link Draft15BaseServicesWrapper}
+ * <li>{@link Draft15TransactionServicesWrapper}
* </ul>
*
*/
@Path("/")
-public class Draft11ServicesWrapperImpl implements Draft11BaseServicesWrapper, Draft11TransactionServicesWrapper {
+public class Draft15ServicesWrapperImpl implements Draft15BaseServicesWrapper, Draft15TransactionServicesWrapper {
private RestconfDataService delegRestconfDataService;
private RestconfInvokeOperationsService delegRestconfInvokeOpsService;
private RestconfStreamsService delegRestStrsService;
private RestconfSchemaService delegRestSchService;
- private Draft11ServicesWrapperImpl() {
+ private Draft15ServicesWrapperImpl() {
}
private static class InstanceHolder {
- public static final Draft11ServicesWrapperImpl INSTANCE = new Draft11ServicesWrapperImpl();
+ public static final Draft15ServicesWrapperImpl INSTANCE = new Draft15ServicesWrapperImpl();
}
- public static Draft11ServicesWrapperImpl getInstance() {
+ public static Draft15ServicesWrapperImpl getInstance() {
return InstanceHolder.INSTANCE;
}
* </ul>
*
*/
-public interface Draft11BaseServicesWrapper
+public interface Draft15BaseServicesWrapper
extends RestconfModulesService, RestconfOperationsService, RestconfStreamsService, RestconfSchemaService {
}
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
*/
@GET
@Path("data/ietf-yang-library:modules")
- @Produces({ Draft11.MediaTypes.API + RestconfConstants.JSON, Draft11.MediaTypes.API + RestconfConstants.XML,
+ @Produces({ Draft15.MediaTypes.API + RestconfConstants.JSON, Draft15.MediaTypes.API + RestconfConstants.XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getModules(@Context UriInfo uriInfo);
*/
@GET
@Path("data/ietf-yang-library:modules/{identifier:.+}")
- @Produces({ Draft11.MediaTypes.API + RestconfConstants.JSON, Draft11.MediaTypes.API + RestconfConstants.XML,
+ @Produces({ Draft15.MediaTypes.API + RestconfConstants.JSON, Draft15.MediaTypes.API + RestconfConstants.XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getModules(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
*/
@GET
@Path("data/ietf-yang-library:modules/module/{identifier:.+}")
- @Produces({ Draft11.MediaTypes.API + RestconfConstants.JSON, Draft11.MediaTypes.API + RestconfConstants.XML,
+ @Produces({ Draft15.MediaTypes.API + RestconfConstants.JSON, Draft15.MediaTypes.API + RestconfConstants.XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getModule(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
}
\ No newline at end of file
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
*/
@GET
@Path("/operations")
- @Produces({ Draft11.MediaTypes.API + RestconfConstants.JSON, Draft11.MediaTypes.API + RestconfConstants.XML,
+ @Produces({ Draft15.MediaTypes.API + RestconfConstants.JSON, Draft15.MediaTypes.API + RestconfConstants.XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getOperations(@Context UriInfo uriInfo);
*/
@GET
@Path("/operations/{identifier:.+}")
- @Produces({ Draft11.MediaTypes.API + RestconfConstants.JSON, Draft11.MediaTypes.API + RestconfConstants.XML,
+ @Produces({ Draft15.MediaTypes.API + RestconfConstants.JSON, Draft15.MediaTypes.API + RestconfConstants.XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getOperations(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
}
\ No newline at end of file
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContext;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
* @return {@link SchemaExportContext}
*/
@GET
- @Produces({ Draft11.MediaTypes.YANG, Draft11.MediaTypes.YIN + RestconfConstants.XML })
+ @Produces({ Draft15.MediaTypes.YANG, Draft15.MediaTypes.YIN + RestconfConstants.XML })
@Path("data/ietf-yang-library:modules/module/{identifier:.+}/schema")
SchemaExportContext getSchema(@PathParam("identifier") String identifier);
}
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
*/
@GET
@Path("data/ietf-restconf-monitoring:restconf-state/streams")
- @Produces({ Draft11.MediaTypes.API + RestconfConstants.JSON, Draft11.MediaTypes.API + RestconfConstants.XML,
+ @Produces({ Draft15.MediaTypes.API + RestconfConstants.JSON, Draft15.MediaTypes.API + RestconfConstants.XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
public NormalizedNodeContext getAvailableStreams(@Context UriInfo uriInfo);
}
\ No newline at end of file
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.common.references.SchemaContextRef;
import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
final MapNode moduleMap = RestconfMappingNodeUtil
.restconfMappingNode(schemaContextRef.getRestconfModule(), modules);
final DataSchemaNode moduleSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode(
- schemaContextRef.getRestconfModule(), Draft11.RestconfModule.MODULE_LIST_SCHEMA_NODE);
+ schemaContextRef.getRestconfModule(), Draft15.RestconfModule.MODULE_LIST_SCHEMA_NODE);
Preconditions.checkState(moduleSchemaNode instanceof ListSchemaNode);
if (mountPoint == null) {
return new NormalizedNodeContext(
final MapNode mapNodes = RestconfMappingNodeUtil.restconfMappingNode(restconfModule, modules);
final DataSchemaNode schemaNode = RestconfSchemaUtil.getRestconfSchemaNode(restconfModule,
- Draft11.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE);
+ Draft15.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE);
Preconditions.checkState(schemaNode instanceof ContainerSchemaNode);
final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> modulContainerSchemaNodeBuilder = Builders
.containerBuilder((ContainerSchemaNode) schemaNode);
import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
import org.opendaylight.netconf.sal.streams.listeners.Notificator;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.common.references.SchemaContextRef;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.rest.services.api.RestconfStreamsService;
final Set<String> availableStreams = Notificator.getStreamNames();
final DataSchemaNode streamListSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode(
- schemaContextRef.getRestconfModule(), Draft11.MonitoringModule.STREAM_LIST_SCHEMA_NODE);
+ schemaContextRef.getRestconfModule(), Draft15.MonitoringModule.STREAM_LIST_SCHEMA_NODE);
Preconditions.checkState(streamListSchemaNode instanceof ListSchemaNode);
final CollectionNodeBuilder<MapEntryNode, MapNode> listStreamBuilder = Builders
.mapBuilder((ListSchemaNode) streamListSchemaNode);
}
final DataSchemaNode streamContSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode(
- schemaContextRef.getRestconfModule(), Draft11.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE);
+ schemaContextRef.getRestconfModule(), Draft15.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE);
Preconditions.checkState(streamContSchemaNode instanceof ContainerSchemaNode);
final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> streamsContainerBuilder = Builders
.containerBuilder((ContainerSchemaNode) streamContSchemaNode);
* </ul>
*
*/
-public interface Draft11TransactionServicesWrapper
+public interface Draft15TransactionServicesWrapper
extends RestconfDataService, RestconfInvokeOperationsService, RestconfStreamsSubscriptionService {
}
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
import org.opendaylight.netconf.sal.restconf.impl.PATCHContext;
import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusContext;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
*/
@GET
@Path("/data/{identifier:.+}")
- @Produces({ Draft11.MediaTypes.DATA + RestconfConstants.JSON, Draft11.MediaTypes.DATA + RestconfConstants.XML,
+ @Produces({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA + RestconfConstants.XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
NormalizedNodeContext readData(@Encoded @PathParam("identifier") String identifier,
@Context UriInfo uriInfo);
*/
@PUT
@Path("/data/{identifier:.+}")
- @Consumes({ Draft11.MediaTypes.DATA + RestconfConstants.JSON, Draft11.MediaTypes.DATA + RestconfConstants.XML,
+ @Consumes({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA + RestconfConstants.XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
Response putData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload);
*/
@POST
@Path("/data/{identifier:.+}")
- @Consumes({ Draft11.MediaTypes.DATA + RestconfConstants.JSON, Draft11.MediaTypes.DATA + RestconfConstants.XML,
+ @Consumes({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA + RestconfConstants.XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
Response postData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload,
@Context UriInfo uriInfo);
*/
@POST
@Path("/data")
- @Consumes({ Draft11.MediaTypes.DATA + RestconfConstants.JSON, Draft11.MediaTypes.DATA + RestconfConstants.XML,
+ @Consumes({ Draft15.MediaTypes.DATA + RestconfConstants.JSON, Draft15.MediaTypes.DATA + RestconfConstants.XML,
MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
Response postData(NormalizedNodeContext payload, @Context UriInfo uriInfo);
*/
@PATCH
@Path("/data/{identifier:.+}")
- @Consumes({ Draft11.MediaTypes.PATCH + RestconfConstants.JSON, Draft11.MediaTypes.PATCH + RestconfConstants.XML })
- @Produces({ Draft11.MediaTypes.PATCH_STATUS + RestconfConstants.JSON,
- Draft11.MediaTypes.PATCH_STATUS + RestconfConstants.XML })
+ @Consumes({ Draft15.MediaTypes.PATCH + RestconfConstants.JSON, Draft15.MediaTypes.PATCH + RestconfConstants.XML })
+ @Produces({ Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.JSON,
+ Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.XML })
PATCHStatusContext patchData(@Encoded @PathParam("identifier") String identifier, PATCHContext context,
@Context UriInfo uriInfo);
*/
@PATCH
@Path("/data")
- @Consumes({ Draft11.MediaTypes.PATCH + RestconfConstants.JSON, Draft11.MediaTypes.PATCH + RestconfConstants.XML })
- @Produces({ Draft11.MediaTypes.PATCH_STATUS + RestconfConstants.JSON,
- Draft11.MediaTypes.PATCH_STATUS + RestconfConstants.XML })
+ @Consumes({ Draft15.MediaTypes.PATCH + RestconfConstants.JSON, Draft15.MediaTypes.PATCH + RestconfConstants.XML })
+ @Produces({ Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.JSON,
+ Draft15.MediaTypes.PATCH_STATUS + RestconfConstants.XML })
PATCHStatusContext patchData(PATCHContext context, @Context UriInfo uriInfo);
}
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
/**
*/
@POST
@Path("/operations/{identifier:.+}")
- @Produces({ Draft11.MediaTypes.OPERATION + RestconfConstants.JSON,
- Draft11.MediaTypes.OPERATION + RestconfConstants.XML, Draft11.MediaTypes.DATA + RestconfConstants.JSON,
- Draft11.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML,
+ @Produces({ Draft15.MediaTypes.OPERATION + RestconfConstants.JSON,
+ Draft15.MediaTypes.OPERATION + RestconfConstants.XML, Draft15.MediaTypes.DATA + RestconfConstants.JSON,
+ Draft15.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML,
MediaType.TEXT_XML })
- @Consumes({ Draft11.MediaTypes.OPERATION + RestconfConstants.JSON,
- Draft11.MediaTypes.OPERATION + RestconfConstants.XML, Draft11.MediaTypes.DATA + RestconfConstants.JSON,
- Draft11.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML,
+ @Consumes({ Draft15.MediaTypes.OPERATION + RestconfConstants.JSON,
+ Draft15.MediaTypes.OPERATION + RestconfConstants.XML, Draft15.MediaTypes.DATA + RestconfConstants.JSON,
+ Draft15.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML,
MediaType.TEXT_XML })
NormalizedNodeContext invokeRpc(@Encoded @PathParam("identifier") String identifier,
NormalizedNodeContext payload, @Context UriInfo uriInfo);
import com.google.common.base.Preconditions;
import java.util.Collection;
import java.util.Set;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.restconf.utils.schema.context.RestconfSchemaUtil;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
*/
public static MapNode restconfMappingNode(final Module restconfModule, final Set<Module> modules) {
final DataSchemaNode modulListSchemaNode = RestconfSchemaUtil.getRestconfSchemaNode(restconfModule,
- Draft11.RestconfModule.MODULE_LIST_SCHEMA_NODE);
+ Draft15.RestconfModule.MODULE_LIST_SCHEMA_NODE);
Preconditions.checkState(modulListSchemaNode instanceof ListSchemaNode);
final CollectionNodeBuilder<MapEntryNode, MapNode> listModuleBuilder = Builders
import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext;
import org.opendaylight.restconf.utils.parser.ParserIdentifier;
-public class Draft11AbstractIdentifierAwareJaxRsProvider {
+public class Draft15AbstractIdentifierAwareJaxRsProvider {
private static final String POST = "POST";
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.slf4j.LoggerFactory;
@Provider
-@Consumes({Draft11.MediaTypes.PATCH + RestconfConstants.JSON})
-public class Draft11JsonToPATCHBodyReader extends Draft11AbstractIdentifierAwareJaxRsProvider
+@Consumes({Draft15.MediaTypes.PATCH + RestconfConstants.JSON})
+public class Draft15JsonToPATCHBodyReader extends Draft15AbstractIdentifierAwareJaxRsProvider
implements MessageBodyReader<PATCHContext> {
- private final static Logger LOG = LoggerFactory.getLogger(Draft11JsonToPATCHBodyReader.class);
+ private final static Logger LOG = LoggerFactory.getLogger(Draft15JsonToPATCHBodyReader.class);
private String patchId;
@Override
private List<PATCHEntity> read(final JsonReader in, final InstanceIdentifierContext path) throws IOException {
final List<PATCHEntity> resultCollection = new ArrayList<>();
- final Draft11StringModuleInstanceIdentifierCodec codec = new Draft11StringModuleInstanceIdentifierCodec(
+ final Draft15StringModuleInstanceIdentifierCodec codec = new Draft15StringModuleInstanceIdentifierCodec(
path.getSchemaContext());
- final Draft11JsonToPATCHBodyReader.PatchEdit edit = new Draft11JsonToPATCHBodyReader.PatchEdit();
+ final Draft15JsonToPATCHBodyReader.PatchEdit edit = new Draft15JsonToPATCHBodyReader.PatchEdit();
while (in.hasNext()) {
switch (in.peek()) {
*/
private void parseByName(@Nonnull final String name, @Nonnull final PatchEdit edit,
@Nonnull final JsonReader in, @Nonnull final InstanceIdentifierContext path,
- @Nonnull final Draft11StringModuleInstanceIdentifierCodec codec,
+ @Nonnull final Draft15StringModuleInstanceIdentifierCodec codec,
@Nonnull final List<PATCHEntity> resultCollection) throws IOException {
switch (name) {
case "edit" :
*/
private void readEditDefinition(@Nonnull final PatchEdit edit, @Nonnull final JsonReader in,
@Nonnull final InstanceIdentifierContext path,
- @Nonnull final Draft11StringModuleInstanceIdentifierCodec codec) throws IOException {
+ @Nonnull final Draft15StringModuleInstanceIdentifierCodec codec) throws IOException {
final StringBuffer value = new StringBuffer();
in.beginObject();
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-final class Draft11StringModuleInstanceIdentifierCodec extends AbstractModuleStringInstanceIdentifierCodec {
+final class Draft15StringModuleInstanceIdentifierCodec extends AbstractModuleStringInstanceIdentifierCodec {
private final DataSchemaContextTree dataContextTree;
private final SchemaContext context;
private final String defaultPrefix;
- Draft11StringModuleInstanceIdentifierCodec(SchemaContext context) {
+ Draft15StringModuleInstanceIdentifierCodec(SchemaContext context) {
this.context = Preconditions.checkNotNull(context);
this.dataContextTree = DataSchemaContextTree.from(context);
this.defaultPrefix = "";
}
- Draft11StringModuleInstanceIdentifierCodec(SchemaContext context, @Nonnull String defaultPrefix) {
+ Draft15StringModuleInstanceIdentifierCodec(SchemaContext context, @Nonnull String defaultPrefix) {
this.context = Preconditions.checkNotNull(context);
this.dataContextTree = DataSchemaContextTree.from(context);
this.defaultPrefix = defaultPrefix;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.w3c.dom.NodeList;
@Provider
-@Consumes({Draft11.MediaTypes.PATCH + RestconfConstants.XML})
-public class Draft11XmlToPATCHBodyReader extends Draft11AbstractIdentifierAwareJaxRsProvider implements
+@Consumes({Draft15.MediaTypes.PATCH + RestconfConstants.XML})
+public class Draft15XmlToPATCHBodyReader extends Draft15AbstractIdentifierAwareJaxRsProvider implements
MessageBodyReader<PATCHContext> {
- private final static Logger LOG = LoggerFactory.getLogger(Draft11XmlToPATCHBodyReader.class);
+ private final static Logger LOG = LoggerFactory.getLogger(Draft15XmlToPATCHBodyReader.class);
private static final DocumentBuilderFactory BUILDERFACTORY;
static {
URI.create(namespace)).iterator().next();
// initialize codec + set default prefix derived from module name
- final Draft11StringModuleInstanceIdentifierCodec codec = new Draft11StringModuleInstanceIdentifierCodec(
+ final Draft15StringModuleInstanceIdentifierCodec codec = new Draft15StringModuleInstanceIdentifierCodec(
pathContext.getSchemaContext(), module.getName());
// find complete path to target and target schema node
/**
* Prepare non-conditional XPath suitable for deserialization
- * with {@link Draft11StringModuleInstanceIdentifierCodec}
+ * with {@link Draft15StringModuleInstanceIdentifierCodec}
* @param schemaNode Top schema node
* @param target Edit operation target
* @param value Element with value
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
final Set<GroupingDefinition> groupings = restconfModule.getGroupings();
final GroupingDefinition restGroup = findSchemaNodeInCollection(groupings,
- Draft11.RestconfModule.RESTCONF_GROUPING_SCHEMA_NODE);
+ Draft15.RestconfModule.RESTCONF_GROUPING_SCHEMA_NODE);
final Collection<DataSchemaNode> childNodes = restGroup.getChildNodes();
final DataSchemaNode restCont = childNodes.iterator().next();
private static DataSchemaNode findSchemaNode(final DataSchemaNode restCont, final String schemaNodeName) {
switch (schemaNodeName) {
//MODULES
- case Draft11.RestconfModule.MODULE_LIST_SCHEMA_NODE:
+ case Draft15.RestconfModule.MODULE_LIST_SCHEMA_NODE:
final DataSchemaNode moduleListSchNode = findSchemaNodeInCollection(
((DataNodeContainer) findSchemaNode(restCont,
- Draft11.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE)).getChildNodes(),
- Draft11.RestconfModule.MODULE_LIST_SCHEMA_NODE);
+ Draft15.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE)).getChildNodes(),
+ Draft15.RestconfModule.MODULE_LIST_SCHEMA_NODE);
Preconditions.checkNotNull(moduleListSchNode);
return moduleListSchNode;
- case Draft11.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE:
+ case Draft15.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE:
final DataSchemaNode modulesContSchNode = findSchemaNodeInCollection(((DataNodeContainer) restCont).getChildNodes(),
- Draft11.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE);
+ Draft15.RestconfModule.MODULES_CONTAINER_SCHEMA_NODE);
Preconditions.checkNotNull(modulesContSchNode);
return modulesContSchNode;
//STREAMS
- case Draft11.MonitoringModule.STREAM_LIST_SCHEMA_NODE:
+ case Draft15.MonitoringModule.STREAM_LIST_SCHEMA_NODE:
final DataSchemaNode streamListSchNode = findSchemaNodeInCollection(
((DataNodeContainer) findSchemaNode(restCont,
- Draft11.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE)).getChildNodes(),
- Draft11.MonitoringModule.STREAM_LIST_SCHEMA_NODE);
+ Draft15.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE)).getChildNodes(),
+ Draft15.MonitoringModule.STREAM_LIST_SCHEMA_NODE);
Preconditions.checkNotNull(streamListSchNode);
return streamListSchNode;
- case Draft11.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE:
+ case Draft15.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE:
final DataSchemaNode streamsContSchNode = findSchemaNodeInCollection(
((DataNodeContainer) restCont).getChildNodes(),
- Draft11.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE);
+ Draft15.MonitoringModule.STREAMS_CONTAINER_SCHEMA_NODE);
Preconditions.checkNotNull(streamsContSchNode);
return streamsContSchNode;
default:
<servlet-mapping>
<servlet-name>Restconf</servlet-name>
- <url-pattern>/11/*</url-pattern>
+ <url-pattern>/15/*</url-pattern>
</servlet-mapping>
<filter>
import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
import org.opendaylight.netconf.sal.restconf.impl.PATCHContext;
-import org.opendaylight.restconf.utils.patch.Draft11AbstractIdentifierAwareJaxRsProvider;
+import org.opendaylight.restconf.utils.patch.Draft15AbstractIdentifierAwareJaxRsProvider;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public abstract class Draft11AbstractBodyReaderTest {
public Draft11AbstractBodyReaderTest() throws NoSuchFieldException,
SecurityException {
- uriField = Draft11AbstractIdentifierAwareJaxRsProvider.class
+ uriField = Draft15AbstractIdentifierAwareJaxRsProvider.class
.getDeclaredField("uriInfo");
uriField.setAccessible(true);
- requestField = Draft11AbstractIdentifierAwareJaxRsProvider.class
+ requestField = Draft15AbstractIdentifierAwareJaxRsProvider.class
.getDeclaredField("request");
requestField.setAccessible(true);
mediaType = getMediaType();
return TestRestconfUtils.loadSchemaContext(yangPath, schemaContext);
}
- protected static <T extends Draft11AbstractIdentifierAwareJaxRsProvider> void mockBodyReader(
+ protected static <T extends Draft15AbstractIdentifierAwareJaxRsProvider> void mockBodyReader(
final String identifier, final T normalizedNodeProvider,
final boolean isPost) throws NoSuchFieldException,
SecurityException, IllegalArgumentException, IllegalAccessException {
import org.junit.Test;
import org.opendaylight.netconf.sal.restconf.impl.PATCHContext;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
-import org.opendaylight.restconf.utils.patch.Draft11JsonToPATCHBodyReader;
+import org.opendaylight.restconf.utils.patch.Draft15JsonToPATCHBodyReader;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public class TestDraft11JsonPATCHBodyReader extends Draft11AbstractBodyReaderTest {
- private final Draft11JsonToPATCHBodyReader jsonPATCHBodyReader;
+ private final Draft15JsonToPATCHBodyReader jsonPATCHBodyReader;
private static SchemaContext schemaContext;
public TestDraft11JsonPATCHBodyReader() throws NoSuchFieldException, SecurityException {
super();
- jsonPATCHBodyReader = new Draft11JsonToPATCHBodyReader();
+ jsonPATCHBodyReader = new Draft15JsonToPATCHBodyReader();
}
@Override
import org.junit.Test;
import org.opendaylight.netconf.sal.restconf.impl.PATCHContext;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
-import org.opendaylight.restconf.utils.patch.Draft11XmlToPATCHBodyReader;
+import org.opendaylight.restconf.utils.patch.Draft15XmlToPATCHBodyReader;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
public class TestDraft11XmlPATCHBodyReader extends Draft11AbstractBodyReaderTest {
- private final Draft11XmlToPATCHBodyReader xmlPATCHBodyReader;
+ private final Draft15XmlToPATCHBodyReader xmlPATCHBodyReader;
private static SchemaContext schemaContext;
public TestDraft11XmlPATCHBodyReader() throws NoSuchFieldException, SecurityException {
super();
- xmlPATCHBodyReader = new Draft11XmlToPATCHBodyReader();
+ xmlPATCHBodyReader = new Draft15XmlToPATCHBodyReader();
}
@Override
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.Draft11.RestconfModule;
+import org.opendaylight.restconf.Draft15.RestconfModule;
import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.rest.services.api.RestconfModulesService;
import org.opendaylight.controller.md.sal.dom.broker.impl.mount.DOMMountPointServiceImpl;
import org.opendaylight.controller.md.sal.dom.broker.spi.mount.SimpleDOMMountPoint;
import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.utils.RestconfConstants;
when(schemaContext.findModuleByNamespaceAndRevision(any(URI.class), any(Date.class))).thenAnswer(invocation -> {
final Object[] args = invocation.getArguments();
- if (args[0] == Draft11.RestconfModule.IETF_RESTCONF_QNAME.getNamespace()
- && args[1] == Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision()) {
+ if (args[0] == Draft15.RestconfModule.IETF_RESTCONF_QNAME.getNamespace()
+ && args[1] == Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()) {
return parseCustomRestconfSource(restconfModuleName).findModuleByName(
restconfModuleName, (Date) args[1]);
} else {
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
import org.opendaylight.netconf.sal.streams.listeners.Notificator;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.restconf.handlers.SchemaContextHandler;
import org.opendaylight.restconf.rest.services.api.RestconfStreamsService;
import org.opendaylight.restconf.utils.mapping.RestconfMappingNodeConstants;
public void getAvailableStreamsTest() throws Exception {
// prepare conditions - get correct Restconf module
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft11.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("ietf-restconf"));
// make test
public void getAvailableStreamsMissingRestconfModuleNegativeTest() {
// prepare conditions - get null Restconf module
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft11.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision())).thenReturn(null);
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision())).thenReturn(null);
// make test
this.thrown.expect(NullPointerException.class);
public void getAvailableStreamsMissingListStreamNegativeTest() {
// prepare conditions - get Restconf module with missing list stream
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft11.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-missing-list-stream"));
// make test and verify
public void getAvailableStreamsMissingContainerStreamsNegativeTest() {
// prepare conditions - get Restconf module with missing container streams
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft11.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-missing-container-streams"));
// make test and verify
public void getAvailableStreamsIllegalListStreamNegativeTest() {
// prepare conditions - get Restconf module with illegal list stream
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft11.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-illegal-list-stream"));
// make test
public void getAvailableStreamsIllegalContainerStreamsNegativeTest() {
// prepare conditions - get Restconf module with illegal container streams
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft11.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-illegal-container-streams"));
// make test
public void getAvailableStreamsIllegalLeafDescriptionNegativeTest() {
// prepare conditions - get Restconf module with illegal leaf description in list stream
when(this.contextHandler.get()).thenReturn(this.mockSchemaContext);
- when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft11.RestconfModule.IETF_RESTCONF_QNAME
- .getNamespace(), Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
+ when(this.mockSchemaContext.findModuleByNamespaceAndRevision(Draft15.RestconfModule.IETF_RESTCONF_QNAME
+ .getNamespace(), Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision()))
.thenReturn(getTestingRestconfModule("restconf-module-with-illegal-leaf-description"));
// make test
* @return Restconf module
*/
private Module getTestingRestconfModule(final String s) {
- return this.schemaContext.findModuleByName(s, Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
+ return this.schemaContext.findModuleByName(s, Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
}
/**
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType;
-import org.opendaylight.restconf.Draft11;
-import org.opendaylight.restconf.Draft11.MonitoringModule;
-import org.opendaylight.restconf.Draft11.RestconfModule;
+import org.opendaylight.restconf.Draft15;
+import org.opendaylight.restconf.Draft15.MonitoringModule;
+import org.opendaylight.restconf.Draft15.RestconfModule;
import org.opendaylight.restconf.utils.schema.context.RestconfSchemaUtil;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
*/
private Module getTestingRestconfModule(final String s) {
return RestconfMappingNodeUtilTest.schemaContext.findModuleByName(
- s, Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
+ s, Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
}
/**
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
-import static org.opendaylight.restconf.Draft11.MonitoringModule;
-import static org.opendaylight.restconf.Draft11.RestconfModule;
+import static org.opendaylight.restconf.Draft15.MonitoringModule;
+import static org.opendaylight.restconf.Draft15.RestconfModule;
import com.google.common.collect.Sets;
import java.util.NoSuchElementException;
import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException;
import org.opendaylight.netconf.sal.restconf.impl.RestconfError;
-import org.opendaylight.restconf.Draft11;
+import org.opendaylight.restconf.Draft15;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
* @return Restconf module
*/
private Module getTestingRestconfModule(final String s) {
- return schemaContext.findModuleByName(s, Draft11.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
+ return schemaContext.findModuleByName(s, Draft15.RestconfModule.IETF_RESTCONF_QNAME.getRevision());
}
}