@Controller public class ProjectMetadataController extends AbstractMetadataController
Controller that exposes metadata and service configuration.| Modifier and Type | Field and Description |
|---|---|
static org.springframework.http.MediaType |
HAL_JSON_CONTENT_TYPE
HAL JSON content type.
|
metadataProvider| Constructor and Description |
|---|
ProjectMetadataController(InitializrMetadataProvider metadataProvider,
DependencyMetadataProvider dependencyMetadataProvider) |
| Modifier and Type | Method and Description |
|---|---|
InitializrMetadata |
config() |
org.springframework.http.ResponseEntity<String> |
dependenciesV21(String bootVersion) |
org.springframework.http.ResponseEntity<String> |
dependenciesV22(String bootVersion) |
protected org.springframework.http.CacheControl |
determineCacheControlFor(InitializrMetadata metadata)
Return the
CacheControl response headers to use for the specified
metadata. |
void |
invalidMetadataRequest(HttpServletResponse response,
InvalidInitializrMetadataException ex) |
void |
invalidProjectRequest(HttpServletResponse response,
InvalidProjectRequestException ex) |
org.springframework.http.ResponseEntity<String> |
serviceCapabilitiesHal() |
org.springframework.http.ResponseEntity<String> |
serviceCapabilitiesV2() |
org.springframework.http.ResponseEntity<String> |
serviceCapabilitiesV21() |
org.springframework.http.ResponseEntity<String> |
serviceCapabilitiesV22() |
createUniqueId, generateAppUrlpublic static final org.springframework.http.MediaType HAL_JSON_CONTENT_TYPE
public ProjectMetadataController(InitializrMetadataProvider metadataProvider, DependencyMetadataProvider dependencyMetadataProvider)
@RequestMapping(path="/metadata/config",
produces="application/json")
@ResponseBody
public InitializrMetadata config()
@RequestMapping(path={"/","/metadata/client"},
produces="application/hal+json")
public org.springframework.http.ResponseEntity<String> serviceCapabilitiesHal()
@RequestMapping(path={"/","/metadata/client"},
produces="application/vnd.initializr.v2.2+json")
public org.springframework.http.ResponseEntity<String> serviceCapabilitiesV22()
@RequestMapping(path={"/","/metadata/client"},
produces={"application/vnd.initializr.v2.1+json","application/json"})
public org.springframework.http.ResponseEntity<String> serviceCapabilitiesV21()
@RequestMapping(path={"/","/metadata/client"},
produces="application/vnd.initializr.v2+json")
public org.springframework.http.ResponseEntity<String> serviceCapabilitiesV2()
@RequestMapping(path="/dependencies",
produces="application/vnd.initializr.v2.2+json")
public org.springframework.http.ResponseEntity<String> dependenciesV22(@RequestParam(required=false)
String bootVersion)
@RequestMapping(path="/dependencies",
produces={"application/vnd.initializr.v2.1+json","application/json"})
public org.springframework.http.ResponseEntity<String> dependenciesV21(@RequestParam(required=false)
String bootVersion)
@ExceptionHandler public void invalidMetadataRequest(HttpServletResponse response, InvalidInitializrMetadataException ex) throws IOException
IOException@ExceptionHandler public void invalidProjectRequest(HttpServletResponse response, InvalidProjectRequestException ex) throws IOException
IOExceptionprotected org.springframework.http.CacheControl determineCacheControlFor(InitializrMetadata metadata)
CacheControl response headers to use for the specified
metadata. If no cache should be applied
CacheControl.empty() can be used.metadata - the metadata about to be exposedCache-Control headers to useCopyright © 2020 Pivotal Software, Inc.. All rights reserved.