Package gov.niem.tools.api.db.namespace
Class NamespaceController
java.lang.Object
gov.niem.tools.api.db.namespace.NamespaceController
@Validated
@RestController
@RequestMapping("/stewards/{stewardKey}/models/{modelKey}/versions/{versionNumber}")
public class NamespaceController
extends Object
REST controller for namespaces.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNamespace
(String stewardKey, String modelKey, String versionNumber, String prefix) Get a namespace with the given fields.getNamespaceCmf
(String stewardKey, String modelKey, String versionNumber, String prefix, Config.AppMediaType mediaType) Get a namespace in CMF with the given fields.getNamespaceProperties
(String stewardKey, String modelKey, String versionNumber, String prefix) Gets all properties from a namespace.getNamespacePropertiesCmf
(String stewardKey, String modelKey, String versionNumber, String prefix, Config.AppMediaType mediaType) Gets all properties from a namespace in CMF.getNamespaceTypes
(String stewardKey, String modelKey, String versionNumber, String prefix) Gets all types from a namespace.getNamespaceTypesCmf
(String stewardKey, String modelKey, String versionNumber, String prefix, Config.AppMediaType mediaType) Gets all types in CMF from a namespace.getVersionNamespaces
(String stewardKey, String modelKey, String versionNumber) Get all namespaces from a version of a model.getVersionNamespacesCmf
(String stewardKey, String modelKey, String versionNumber, Config.AppMediaType mediaType) Get all namespaces as CMF from a version of a model.
-
Constructor Details
-
NamespaceController
public NamespaceController()
-
-
Method Details
-
getNamespace
@GetMapping("/namespaces/{prefix}") @ResponseStatus(code=OK) public Namespace getNamespace(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String prefix) throws Exception Get a namespace with the given fields.- Throws:
Exception
- Example:
- http://tools.niem.gov/api/v2/stewards/niem/models/model/versions/5.2/namespaces/nc
-
getNamespaceCmf
@GetMapping("/namespaces.cmf/{prefix}") @ResponseStatus(code=OK) public Object getNamespaceCmf(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String prefix, @RequestParam(required=false,defaultValue="json") Config.AppMediaType mediaType) throws Exception Get a namespace in CMF with the given fields.- Throws:
Exception
- Example:
- http://tools.niem.gov/api/v2/stewards/niem/models/model/versions/5.2/namespaces.cmf/nc
-
getVersionNamespaces
@GetMapping("/namespaces") @ResponseStatus(code=OK) public List<Namespace> getVersionNamespaces(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber) throws Exception Get all namespaces from a version of a model.- Throws:
Exception
- Example:
- http://tools.niem.gov/api/v2/stewards/niem/models/model/versions/5.2/namespaces
-
getVersionNamespacesCmf
@GetMapping("/namespaces.cmf") @ResponseStatus(code=OK) public Object getVersionNamespacesCmf(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @RequestParam(required=false,defaultValue="json") Config.AppMediaType mediaType) throws Exception Get all namespaces as CMF from a version of a model.- Throws:
Exception
- Example:
- http://tools.niem.gov/api/v2/stewards/niem/models/model/versions/5.2/namespaces.cmf
-
getNamespaceTypes
@GetMapping("/namespaces/{prefix}/types") @ResponseStatus(code=OK) public List<Type> getNamespaceTypes(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String prefix) throws Exception Gets all types from a namespace.- Throws:
Exception
-
getNamespaceTypesCmf
@GetMapping("/namespaces.cmf/{prefix}/types") @ResponseStatus(code=OK) public Object getNamespaceTypesCmf(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String prefix, @RequestParam(required=false,defaultValue="json") Config.AppMediaType mediaType) throws Exception Gets all types in CMF from a namespace.- Throws:
Exception
-
getNamespaceProperties
@GetMapping("/namespaces/{prefix}/properties") @ResponseStatus(code=OK) public List<Property> getNamespaceProperties(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String prefix) throws Exception Gets all properties from a namespace.- Throws:
Exception
-
getNamespacePropertiesCmf
@GetMapping("/namespaces.cmf/{prefix}/properties") @ResponseStatus(code=OK) public Object getNamespacePropertiesCmf(@PathVariable String stewardKey, @PathVariable String modelKey, @PathVariable String versionNumber, @PathVariable String prefix, @RequestParam(required=false,defaultValue="json") Config.AppMediaType mediaType) throws Exception Gets all properties from a namespace in CMF.- Throws:
Exception
-