application/yin+xml media type is an RFC6020 definition, and hence
its common definition lives in YangConstants. Use it for there
instead of brewing our own.
Change-Id: I6d9f9fd123ffa6db41994d55400bd8c640c6a1f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
fe99fcac52d3bd524f8046e0ea151b7704f3d90e)
import javax.ws.rs.ext.Provider;
import javax.xml.stream.XMLStreamException;
import org.opendaylight.restconf.common.schema.SchemaExportContext;
+import org.opendaylight.yangtools.yang.common.YangConstants;
import org.opendaylight.yangtools.yang.model.export.YinExportUtils;
@Provider
-@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE })
+@Produces({ YangConstants.RFC6020_YIN_MEDIA_TYPE })
public class SchemaExportContentYinBodyWriter implements MessageBodyWriter<SchemaExportContext> {
@Override
} catch (final XMLStreamException e) {
throw new IllegalStateException(e);
}
-
}
}
@Deprecated
@Beta
public interface SchemaRetrievalService {
-
- String YIN_MEDIA_TYPE = "application/yin+xml";
-
@GET
- @Produces({YIN_MEDIA_TYPE, YangConstants.RFC6020_YANG_MEDIA_TYPE})
+ @Produces({YangConstants.RFC6020_YIN_MEDIA_TYPE, YangConstants.RFC6020_YANG_MEDIA_TYPE})
@Path("/modules/module/{identifier:.+}/schema")
SchemaExportContext getSchema(@PathParam("identifier") String mountAndModuleId);
}
public static final String DATA = "application/yang-data";
public static final String YANG_PATCH = "application/yang.patch";
public static final String YANG_PATCH_STATUS = "application/yang.patch-status";
- public static final String YIN = "application/yin";
}
/**
import javax.ws.rs.ext.Provider;
import javax.xml.stream.XMLStreamException;
import org.opendaylight.restconf.common.schema.SchemaExportContext;
-import org.opendaylight.restconf.nb.rfc8040.Rfc8040;
-import org.opendaylight.restconf.nb.rfc8040.utils.RestconfConstants;
+import org.opendaylight.yangtools.yang.common.YangConstants;
import org.opendaylight.yangtools.yang.model.export.YinExportUtils;
@Provider
-@Produces({ Rfc8040.MediaTypes.YIN + RestconfConstants.XML })
+@Produces({ YangConstants.RFC6020_YIN_MEDIA_TYPE })
public class SchemaExportContentYinBodyWriter implements MessageBodyWriter<SchemaExportContext> {
@Override
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import org.opendaylight.restconf.common.schema.SchemaExportContext;
-import org.opendaylight.restconf.nb.rfc8040.Rfc8040;
-import org.opendaylight.restconf.nb.rfc8040.utils.RestconfConstants;
import org.opendaylight.yangtools.yang.common.YangConstants;
/**
* @return {@link SchemaExportContext}
*/
@GET
- @Produces({ Rfc8040.MediaTypes.YIN + RestconfConstants.XML, YangConstants.RFC6020_YANG_MEDIA_TYPE })
+ @Produces({ YangConstants.RFC6020_YIN_MEDIA_TYPE, YangConstants.RFC6020_YANG_MEDIA_TYPE })
@Path("modules/{identifier:.+}")
SchemaExportContext getSchema(@PathParam("identifier") String identifier);
}