@Override public SchemaVersionInfo getLatestSchemaVersionInfo(String schemaBranchName, String schemaName) throws SchemaNotFoundException, SchemaBranchNotFoundException { return schemaRegistry.getLatestSchemaVersionInfo(schemaBranchName, schemaName); }
@Override public SchemaVersionInfo getLatestSchemaVersionInfo(String schemaName) throws SchemaNotFoundException { return schemaRegistry.getLatestSchemaVersionInfo(schemaName); }
@GET @Path("/schemas/{name}/versions/latest") @ApiOperation(value = "Get the latest version of the schema for the given schema name", response = SchemaVersionInfo.class, tags = OPERATION_GROUP_SCHEMA) @Timed @UnitOfWork public Response getLatestSchemaVersion(@ApiParam(value = "Schema name", required = true) @PathParam("name") String schemaName, @QueryParam("branch") @DefaultValue(MASTER_BRANCH) String schemaBranchName) { Response response; try { SchemaVersionInfo schemaVersionInfo = schemaRegistry.getLatestSchemaVersionInfo(schemaBranchName, schemaName); if (schemaVersionInfo != null) { response = WSUtils.respondEntity(schemaVersionInfo, 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 (SchemaBranchNotFoundException e) { return WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, e.getMessage()); } catch (Exception ex) { LOG.error("Encountered error while getting latest schema version for schemakey [{}]", schemaName, ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }
@GET @Path("/schemas/{name}/versions/latest") @ApiOperation(value = "Get the latest version of the schema for the given schema name", response = SchemaVersionInfo.class, tags = OPERATION_GROUP_SCHEMA) @Timed @UnitOfWork public Response getLatestSchemaVersion(@ApiParam(value = "Schema name", required = true) @PathParam("name") String schemaName, @QueryParam("branch") @DefaultValue(MASTER_BRANCH) String schemaBranchName) { Response response; try { SchemaVersionInfo schemaVersionInfo = schemaRegistry.getLatestSchemaVersionInfo(schemaBranchName, schemaName); if (schemaVersionInfo != null) { response = WSUtils.respondEntity(schemaVersionInfo, 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 (SchemaBranchNotFoundException e) { return WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, e.getMessage()); } catch (Exception ex) { LOG.error("Encountered error while getting latest schema version for schemakey [{}]", schemaName, ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }
schemaVersionInfo = schemaRegistry.getLatestSchemaVersionInfo(subject); } else { SchemaMetadataInfo schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(subject);
schemaVersionInfo = schemaRegistry.getLatestSchemaVersionInfo(subject); } else { SchemaMetadataInfo schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(subject);