@Override public Collection<SchemaVersionInfo> getAllVersions(String schemaName) throws SchemaNotFoundException { return schemaRegistry.getAllVersions(schemaName); }
@Override public Collection<SchemaVersionInfo> getAllVersions(String schemaBranchName, String schemaName) throws SchemaNotFoundException, SchemaBranchNotFoundException { return schemaRegistry.getAllVersions(schemaBranchName, schemaName); }
@Override public Collection<SchemaVersionInfo> getAllVersions(String schemaBranchName, String schemaName, List<Byte> stateIds) throws SchemaNotFoundException, SchemaBranchNotFoundException { return schemaRegistry.getAllVersions(schemaBranchName, schemaName, stateIds); }
@GET @Path("/subjects/{subject}/versions") @ApiOperation(value = "Get all schema versions of given subject", response = Integer.class, responseContainer = "List", tags = OPERATION_GROUP_CONFLUENT_SR) @Timed @UnitOfWork public Response getAllVersions(@ApiParam(value = "subject", required = true) @PathParam("subject") String subject) { Response response; try { List<Integer> registeredSubjects = schemaRegistry.getAllVersions(subject) .stream() .map(SchemaVersionInfo::getVersion) .collect(Collectors.toList()); response = WSUtils.respondEntity(registeredSubjects, Response.Status.OK); } catch (SchemaNotFoundException ex) { LOG.error("No schema found with subject [{}]", subject, ex); response = subjectNotFoundError(); } catch (Exception ex) { LOG.error("Encountered error while retrieving all subjects", ex); response = serverError(); } return response; }
@GET @Path("/subjects/{subject}/versions") @ApiOperation(value = "Get all schema versions of given subject", response = Integer.class, responseContainer = "List", tags = OPERATION_GROUP_CONFLUENT_SR) @Timed @UnitOfWork public Response getAllVersions(@ApiParam(value = "subject", required = true) @PathParam("subject") String subject) { Response response; try { List<Integer> registeredSubjects = schemaRegistry.getAllVersions(subject) .stream() .map(SchemaVersionInfo::getVersion) .collect(Collectors.toList()); response = WSUtils.respondEntity(registeredSubjects, Response.Status.OK); } catch (SchemaNotFoundException ex) { LOG.error("No schema found with subject [{}]", subject, ex); response = subjectNotFoundError(); } catch (Exception ex) { LOG.error("Encountered error while retrieving all subjects", ex); response = serverError(); } return response; }
@GET @Path("/schemas/{name}/versions") @ApiOperation(value = "Get all the versions of the schema for the given schema name)", response = SchemaVersionInfo.class, responseContainer = "List", tags = OPERATION_GROUP_SCHEMA) @Timed @UnitOfWork public Response getAllSchemaVersions(@ApiParam(value = "Schema name", required = true) @PathParam("name") String schemaName, @QueryParam("branch") @DefaultValue(MASTER_BRANCH) String schemaBranchName, @QueryParam("states") List<Byte> stateIds) { Response response; try { Collection<SchemaVersionInfo> schemaVersionInfos = schemaRegistry.getAllVersions(schemaBranchName, schemaName, stateIds); if (schemaVersionInfos != null) { response = WSUtils.respondEntities(schemaVersionInfos, 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 all schema versions for schemakey [{}]", schemaName, ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }
@GET @Path("/schemas/{name}/versions") @ApiOperation(value = "Get all the versions of the schema for the given schema name)", response = SchemaVersionInfo.class, responseContainer = "List", tags = OPERATION_GROUP_SCHEMA) @Timed @UnitOfWork public Response getAllSchemaVersions(@ApiParam(value = "Schema name", required = true) @PathParam("name") String schemaName, @QueryParam("branch") @DefaultValue(MASTER_BRANCH) String schemaBranchName, @QueryParam("states") List<Byte> stateIds) { Response response; try { Collection<SchemaVersionInfo> schemaVersionInfos = schemaRegistry.getAllVersions(schemaBranchName, schemaName, stateIds); if (schemaVersionInfos != null) { response = WSUtils.respondEntities(schemaVersionInfos, 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 all schema versions for schemakey [{}]", schemaName, ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }