application/yang media type is an RFC6020 definition, and hence its
common definition lives in YangConstants. Use it from there instead
of brewing our own.
Change-Id: I75d2c2849e8d4e98760445148f1afc9b1f0acb6d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
e8ac0cf7f89d9f746da699de1d3f0d1eff1241dc)
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
import org.opendaylight.restconf.common.schema.SchemaExportContext;
+import org.opendaylight.yangtools.yang.common.YangConstants;
import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
@Provider
-@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE })
+@Produces({ YangConstants.RFC6020_YANG_MEDIA_TYPE })
public class SchemaExportContentYangBodyWriter implements MessageBodyWriter<SchemaExportContext> {
@Override
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import org.opendaylight.restconf.common.schema.SchemaExportContext;
+import org.opendaylight.yangtools.yang.common.YangConstants;
/**
* Retrieval of the YANG modules which server supports.
@Beta
public interface SchemaRetrievalService {
- String YANG_MEDIA_TYPE = "application/yang";
String YIN_MEDIA_TYPE = "application/yin+xml";
@GET
- @Produces({YIN_MEDIA_TYPE,YANG_MEDIA_TYPE})
+ @Produces({YIN_MEDIA_TYPE, YangConstants.RFC6020_YANG_MEDIA_TYPE})
@Path("/modules/module/{identifier:.+}/schema")
SchemaExportContext getSchema(@PathParam("identifier") String mountAndModuleId);
}
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";
- public static final String YANG = "application/yang";
}
/**
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
import org.opendaylight.restconf.common.schema.SchemaExportContext;
-import org.opendaylight.restconf.nb.rfc8040.Rfc8040;
+import org.opendaylight.yangtools.yang.common.YangConstants;
import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
@Provider
-@Produces({ Rfc8040.MediaTypes.YANG })
+@Produces({ YangConstants.RFC6020_YANG_MEDIA_TYPE })
public class SchemaExportContentYangBodyWriter implements MessageBodyWriter<SchemaExportContext> {
@Override
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;
/**
* Retrieval of the YANG modules which server supports.
* @return {@link SchemaExportContext}
*/
@GET
- @Produces({ Rfc8040.MediaTypes.YIN + RestconfConstants.XML, Rfc8040.MediaTypes.YANG })
+ @Produces({ Rfc8040.MediaTypes.YIN + RestconfConstants.XML, YangConstants.RFC6020_YANG_MEDIA_TYPE })
@Path("modules/{identifier:.+}")
SchemaExportContext getSchema(@PathParam("identifier") String identifier);
}