use of com.hortonworks.registries.schemaregistry.SerDesInfo in project registry by hortonworks.
the class SchemaRegistryResource method getSerializers.
@GET
@Path("/schemas/{name}/serdes")
@ApiOperation(value = "Get list of Serializers registered for the given schema name", response = SerDesInfo.class, responseContainer = "List", tags = OPERATION_GROUP_SERDE)
@Timed
@UnitOfWork
public Response getSerializers(@ApiParam(value = "Schema name", required = true) @PathParam("name") String schemaName) {
Response response;
try {
SchemaMetadataInfo schemaMetadataInfoStorable = schemaRegistry.getSchemaMetadataInfo(schemaName);
if (schemaMetadataInfoStorable != null) {
Collection<SerDesInfo> schemaSerializers = schemaRegistry.getSerDes(schemaMetadataInfoStorable.getSchemaMetadata().getName());
response = WSUtils.respondEntities(schemaSerializers, Response.Status.OK);
} else {
LOG.info("No schemas found with schemakey: [{}]", schemaName);
response = WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, schemaName);
}
} catch (Exception ex) {
LOG.error("Encountered error while getting serializers for schemaKey [{}]", schemaName, ex);
response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage());
}
return response;
}
Aggregations