@RestController @RequestMapping(path="${spring.cloud.stream.schema.server.path:}") public class ServerController extends Object
Constructor and Description |
---|
ServerController(SchemaRepository repository,
Map<String,SchemaValidator> validators,
SchemaServerProperties schemaServerProperties) |
Modifier and Type | Method and Description |
---|---|
void |
delete(Integer id) |
void |
delete(String subject) |
void |
delete(String subject,
String format,
Integer version) |
org.springframework.http.ResponseEntity<List<Schema>> |
findBySubjectAndVersion(String subject,
String format) |
org.springframework.http.ResponseEntity<Schema> |
findOne(Integer id) |
org.springframework.http.ResponseEntity<Schema> |
findOne(String subject,
String format,
Integer version) |
void |
invalidSchema(InvalidSchemaException ex) |
org.springframework.http.ResponseEntity<Schema> |
register(Schema schema,
org.springframework.web.util.UriComponentsBuilder builder) |
void |
schemaDeletionNotPermitted(SchemaDeletionNotAllowedException ex) |
void |
schemaNotFound(SchemaNotFoundException ex) |
void |
unsupportedFormat(UnsupportedFormatException ex) |
public ServerController(SchemaRepository repository, Map<String,SchemaValidator> validators, SchemaServerProperties schemaServerProperties)
@RequestMapping(method=POST, path="/", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Schema> register(@RequestBody Schema schema, org.springframework.web.util.UriComponentsBuilder builder)
@RequestMapping(method=GET, produces="application/json", path="/{subject}/{format}/v{version}") public org.springframework.http.ResponseEntity<Schema> findOne(@PathVariable(value="subject") String subject, @PathVariable(value="format") String format, @PathVariable(value="version") Integer version)
@RequestMapping(method=GET, produces="application/json", path="/schemas/{id}") public org.springframework.http.ResponseEntity<Schema> findOne(@PathVariable(value="id") Integer id)
@RequestMapping(method=GET, produces="application/json", path="/{subject}/{format}") public org.springframework.http.ResponseEntity<List<Schema>> findBySubjectAndVersion(@PathVariable(value="subject") String subject, @PathVariable(value="format") String format)
@RequestMapping(value="/{subject}/{format}/v{version}", method=DELETE) public void delete(@PathVariable(value="subject") String subject, @PathVariable(value="format") String format, @PathVariable(value="version") Integer version)
@RequestMapping(value="/schemas/{id}", method=DELETE) public void delete(@PathVariable(value="id") Integer id)
@RequestMapping(value="/{subject}", method=DELETE) public void delete(@PathVariable(value="subject") String subject)
@ExceptionHandler(value=UnsupportedFormatException.class) @ResponseStatus(value=BAD_REQUEST, reason="Format not supported") public void unsupportedFormat(UnsupportedFormatException ex)
@ExceptionHandler(value=InvalidSchemaException.class) @ResponseStatus(value=BAD_REQUEST, reason="Invalid schema") public void invalidSchema(InvalidSchemaException ex)
@ExceptionHandler(value=SchemaNotFoundException.class) @ResponseStatus(value=NOT_FOUND, reason="Schema not found") public void schemaNotFound(SchemaNotFoundException ex)
@ExceptionHandler(value=SchemaDeletionNotAllowedException.class) @ResponseStatus(value=METHOD_NOT_ALLOWED, reason="Schema deletion is not permitted") public void schemaDeletionNotPermitted(SchemaDeletionNotAllowedException ex)
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.