Class LocationManagementResource
java.lang.Object
org.odpi.openmetadata.accessservices.communityprofile.server.spring.LocationManagementResource
@RestController
@RequestMapping("/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}")
public class LocationManagementResource
extends Object
LocationResource provides the API operations to create and maintain locations.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclearAdjacentLocation
(String serverName, String userId, String locationOneGUID, String locationTwoGUID, ExternalSourceRequestBody requestBody) Remove a peer-to-peer relationship between two locations.clearAssetLocation
(String serverName, String userId, String assetGUID, String locationGUID, ExternalSourceRequestBody requestBody) Remove an asset location relationship between an asset and a location.clearLocationAsDigital
(String serverName, String userId, String locationGUID, ExternalSourceRequestBody requestBody) Remove the digital/cyber location designation from the location.clearLocationAsFixedPhysical
(String serverName, String userId, String locationGUID, ExternalSourceRequestBody requestBody) Remove the fixed physical location designation from the location.clearLocationAsSecure
(String serverName, String userId, String locationGUID, ExternalSourceRequestBody requestBody) Remove the secure location designation from the location.clearNestedLocation
(String serverName, String userId, String parentLocationGUID, String childLocationGUID, ExternalSourceRequestBody requestBody) Remove a parent-child relationship between two locations.clearProfileLocation
(String serverName, String userId, String actorProfileGUID, String locationGUID, ExternalSourceRequestBody requestBody) Remove a profile location relationship between an actor profile and a location.createLocation
(String serverName, String userId, ReferenceableRequestBody locationProperties) Create a new metadata element to represent a location.createLocationFromTemplate
(String serverName, String userId, String templateGUID, TemplateRequestBody templateProperties) Create a new metadata element to represent a location using an existing metadata element as a template.findLocations
(String serverName, String userId, int startFrom, int pageSize, SearchStringRequestBody requestBody) Retrieve the list of location metadata elements that contain the search string.getAdjacentLocations
(String serverName, String userId, String locationGUID, int startFrom, int pageSize) Retrieve the list of adjacent location metadata elements linked to locationGUID.getGroupingLocations
(String serverName, String userId, String locationGUID, int startFrom, int pageSize) Retrieve the list of location metadata elements that has the location identifier with locationGUID nested inside it.getKnownLocationsForAsset
(String serverName, String userId, String assetGUID, int startFrom, int pageSize) Retrieve the list of location metadata elements linked to the requested asset.getLocationByGUID
(String serverName, String userId, String locationGUID) Retrieve the location metadata element with the supplied unique identifier.getLocations
(String serverName, String userId, int startFrom, int pageSize) Retrieve the list of location metadata elements.getLocationsByName
(String serverName, String userId, int startFrom, int pageSize, NameRequestBody requestBody) Retrieve the list of location metadata elements with a matching qualified name, identifier or display name.getLocationsByProfile
(String serverName, String userId, String actorProfileGUID, int startFrom, int pageSize) Retrieve the list of location metadata elements linked to the requested profile.getNestedLocations
(String serverName, String userId, String locationGUID, int startFrom, int pageSize) Retrieve the list of nested location metadata elements linked to locationGUID.removeLocation
(String serverName, String userId, String locationGUID, ExternalSourceRequestBody requestBody) Remove the metadata element representing a location.setLocationAsDigital
(String serverName, String userId, String locationGUID, ClassificationRequestBody requestBody) Classify the location to indicate that it represents a digital/cyber location.setLocationAsFixedPhysical
(String serverName, String userId, String locationGUID, ClassificationRequestBody requestBody) Classify the location to indicate that it represents a fixed physical location.setLocationAsSecure
(String serverName, String userId, String locationGUID, ClassificationRequestBody requestBody) Classify the location to indicate that it represents a secure location.setupAdjacentLocation
(String serverName, String userId, String locationOneGUID, String locationTwoGUID, RelationshipRequestBody requestBody) Create a peer-to-peer relationship between two locations.setupAssetLocation
(String serverName, String userId, String assetGUID, String locationGUID, RelationshipRequestBody requestBody) Create an asset location relationship between an asset and a location.setupNestedLocation
(String serverName, String userId, String parentLocationGUID, String childLocationGUID, RelationshipRequestBody requestBody) Create a parent-child relationship between two locations.setupProfileLocation
(String serverName, String userId, String actorProfileGUID, String locationGUID, RelationshipRequestBody requestBody) Create a profile location relationship between an actor profile and a location.updateLocation
(String serverName, String userId, String locationGUID, boolean isMergeUpdate, ReferenceableRequestBody locationProperties) Update the metadata element representing a location.
-
Constructor Details
-
LocationManagementResource
public LocationManagementResource()Default constructor
-
-
Method Details
-
createLocation
@PostMapping(path="/locations") public GUIDResponse createLocation(@PathVariable String serverName, @PathVariable String userId, @RequestBody ReferenceableRequestBody locationProperties) Create a new metadata element to represent a location. Classifications can be added later to define the type of location.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationProperties
- properties to store- Returns:
- unique identifier of the new metadata element InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
createLocationFromTemplate
@PostMapping(path="/locations/from-template/{templateGUID}") public GUIDResponse createLocationFromTemplate(@PathVariable String serverName, @PathVariable String userId, @PathVariable String templateGUID, @RequestBody TemplateRequestBody templateProperties) Create a new metadata element to represent a location using an existing metadata element as a template. The template defines additional classifications and relationships that should be added to the new location.- Parameters:
serverName
- name of calling serveruserId
- calling usertemplateGUID
- unique identifier of the metadata element to copytemplateProperties
- properties that override the template- Returns:
- unique identifier of the new metadata element InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
updateLocation
@PostMapping(path="/locations/{locationGUID}/update") public VoidResponse updateLocation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestParam boolean isMergeUpdate, @RequestBody ReferenceableRequestBody locationProperties) Update the metadata element representing a location.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- unique identifier of the metadata element to updateisMergeUpdate
- should the new properties be merged with existing properties (true) or completely replace them (false)?locationProperties
- new properties for this element- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
setLocationAsFixedPhysical
@PostMapping(path="/locations/{locationGUID}/classify-as-fixed-location") public VoidResponse setLocationAsFixedPhysical(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestBody ClassificationRequestBody requestBody) Classify the location to indicate that it represents a fixed physical location.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- unique identifier of the metadata element to classifyrequestBody
- properties of the location- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
clearLocationAsFixedPhysical
@PostMapping(path="/locations/{locationGUID}/classify-as-fixed-location/delete") public VoidResponse clearLocationAsFixedPhysical(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestBody(required=false) ExternalSourceRequestBody requestBody) Remove the fixed physical location designation from the location.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- unique identifier of the metadata element to unclassifyrequestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
setLocationAsSecure
@PostMapping(path="/locations/{locationGUID}/classify-as-secure-location") public VoidResponse setLocationAsSecure(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestBody ClassificationRequestBody requestBody) Classify the location to indicate that it represents a secure location.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- unique identifier of the metadata element to classifyrequestBody
- properties of the location- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
clearLocationAsSecure
@PostMapping(path="/locations/{locationGUID}/classify-as-secure-location/delete") public VoidResponse clearLocationAsSecure(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestBody(required=false) ExternalSourceRequestBody requestBody) Remove the secure location designation from the location.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- unique identifier of the metadata element to unclassifyrequestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
setLocationAsDigital
@PostMapping(path="/locations/{locationGUID}/classify-as-digital-location") public VoidResponse setLocationAsDigital(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestBody ClassificationRequestBody requestBody) Classify the location to indicate that it represents a digital/cyber location.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- unique identifier of the metadata element to classifyrequestBody
- position of the location- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
clearLocationAsDigital
@PostMapping(path="/locations/{locationGUID}/classify-as-digital-location/delete") public VoidResponse clearLocationAsDigital(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestBody(required=false) ExternalSourceRequestBody requestBody) Remove the digital/cyber location designation from the location.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- unique identifier of the metadata element to unclassifyrequestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
removeLocation
@PostMapping(path="/locations/{locationGUID}/delete") public VoidResponse removeLocation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestBody(required=false) ExternalSourceRequestBody requestBody) Remove the metadata element representing a location.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- unique identifier of the metadata element to removerequestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
setupNestedLocation
@PostMapping(path="/locations/{parentLocationGUID}/has-nested-location/{childLocationGUID}") public VoidResponse setupNestedLocation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String parentLocationGUID, @PathVariable String childLocationGUID, @RequestBody(required=false) RelationshipRequestBody requestBody) Create a parent-child relationship between two locations.- Parameters:
serverName
- name of calling serveruserId
- calling userparentLocationGUID
- unique identifier of the location that is the broader locationchildLocationGUID
- unique identifier of the location that is the smaller, nested locationrequestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
clearNestedLocation
@PostMapping(path="/locations/{parentLocationGUID}/has-nested-location/{childLocationGUID}/delete") public VoidResponse clearNestedLocation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String parentLocationGUID, @PathVariable String childLocationGUID, @RequestBody(required=false) ExternalSourceRequestBody requestBody) Remove a parent-child relationship between two locations.- Parameters:
serverName
- name of calling serveruserId
- calling userparentLocationGUID
- unique identifier of the location that is the broader locationchildLocationGUID
- unique identifier of the location that is the smaller, nested locationrequestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
setupAdjacentLocation
@PostMapping(path="/locations/{locationOneGUID}/linked-to-peer-location/{locationTwoGUID}") public VoidResponse setupAdjacentLocation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationOneGUID, @PathVariable String locationTwoGUID, @RequestBody(required=false) RelationshipRequestBody requestBody) Create a peer-to-peer relationship between two locations.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationOneGUID
- unique identifier of the first locationlocationTwoGUID
- unique identifier of the second locationrequestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
clearAdjacentLocation
@PostMapping(path="/locations/{locationOneGUID}/linked-to-peer-location/{locationTwoGUID}/delete") public VoidResponse clearAdjacentLocation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationOneGUID, @PathVariable String locationTwoGUID, @RequestBody(required=false) ExternalSourceRequestBody requestBody) Remove a peer-to-peer relationship between two locations.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationOneGUID
- unique identifier of the first locationlocationTwoGUID
- unique identifier of the second locationrequestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
setupProfileLocation
@PostMapping(path="/locations/{locationGUID}/linked-to-actor-profiles/{actorProfileGUID}") public VoidResponse setupProfileLocation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String actorProfileGUID, @PathVariable String locationGUID, @RequestBody RelationshipRequestBody requestBody) Create a profile location relationship between an actor profile and a location.- Parameters:
serverName
- name of calling serveruserId
- calling useractorProfileGUID
- unique identifier of the actor profilelocationGUID
- unique identifier of the locationrequestBody
- profile location request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
clearProfileLocation
@PostMapping(path="/locations/{locationGUID}/linked-to-actor-profiles/{actorProfileGUID}/delete") public VoidResponse clearProfileLocation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String actorProfileGUID, @PathVariable String locationGUID, @RequestBody(required=false) ExternalSourceRequestBody requestBody) Remove a profile location relationship between an actor profile and a location.- Parameters:
serverName
- name of calling serveruserId
- calling useractorProfileGUID
- unique identifier of the actor profilelocationGUID
- unique identifier of the locationrequestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
setupAssetLocation
@PostMapping(path="/locations/{locationGUID}/linked-to-assets/{assetGUID}") public VoidResponse setupAssetLocation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String assetGUID, @PathVariable String locationGUID, @RequestBody RelationshipRequestBody requestBody) Create an asset location relationship between an asset and a location.- Parameters:
serverName
- name of calling serveruserId
- calling userassetGUID
- unique identifier of the assetlocationGUID
- unique identifier of the locationrequestBody
- profile location request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
clearAssetLocation
@PostMapping(path="/locations/{locationGUID}/linked-to-assets/{assetGUID}/delete") public VoidResponse clearAssetLocation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String assetGUID, @PathVariable String locationGUID, @RequestBody(required=false) ExternalSourceRequestBody requestBody) Remove an asset location relationship between an asset and a location.- Parameters:
serverName
- name of calling serveruserId
- calling userassetGUID
- unique identifier of the assetlocationGUID
- unique identifier of the locationrequestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
findLocations
@PostMapping(path="/locations/by-search-string") public LocationsResponse findLocations(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startFrom, @RequestParam int pageSize, @RequestBody SearchStringRequestBody requestBody) Retrieve the list of location metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
serverName
- name of calling serveruserId
- calling userrequestBody
- string to find in the propertiesstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
getLocationsByName
@PostMapping(path="/locations/by-name") public LocationsResponse getLocationsByName(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startFrom, @RequestParam int pageSize, @RequestBody NameRequestBody requestBody) Retrieve the list of location metadata elements with a matching qualified name, identifier or display name. There are no wildcards supported on this request.- Parameters:
serverName
- name of calling serveruserId
- calling userrequestBody
- name to search forstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
getAdjacentLocations
@GetMapping(path="/locations/{locationGUID}/has-peer-locations") public LocationsResponse getAdjacentLocations(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestParam int startFrom, @RequestParam int pageSize) Retrieve the list of adjacent location metadata elements linked to locationGUID.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- location to start fromstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
getNestedLocations
@GetMapping(path="/locations/{locationGUID}/has-nested-locations") public LocationsResponse getNestedLocations(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestParam int startFrom, @RequestParam int pageSize) Retrieve the list of nested location metadata elements linked to locationGUID.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- location to start fromstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
getGroupingLocations
@GetMapping(path="/locations/{locationGUID}/has-grouping-locations") public LocationsResponse getGroupingLocations(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID, @RequestParam int startFrom, @RequestParam int pageSize) Retrieve the list of location metadata elements that has the location identifier with locationGUID nested inside it.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- location to start fromstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
getLocationsByProfile
@GetMapping(path="/locations/by-actor-profile/{actorProfileGUID}") public LocationsResponse getLocationsByProfile(@PathVariable String serverName, @PathVariable String userId, @PathVariable String actorProfileGUID, @RequestParam int startFrom, @RequestParam int pageSize) Retrieve the list of location metadata elements linked to the requested profile.- Parameters:
serverName
- name of calling serveruserId
- calling useractorProfileGUID
- name to search forstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
getKnownLocationsForAsset
@GetMapping(path="/locations/by-asset/{assetGUID}") public LocationsResponse getKnownLocationsForAsset(@PathVariable String serverName, @PathVariable String userId, @PathVariable String assetGUID, @RequestParam int startFrom, @RequestParam int pageSize) Retrieve the list of location metadata elements linked to the requested asset.- Parameters:
serverName
- name of calling serveruserId
- calling userassetGUID
- name to search forstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
getLocations
@GetMapping(path="/locations") public LocationsResponse getLocations(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startFrom, @RequestParam int pageSize) Retrieve the list of location metadata elements.- Parameters:
serverName
- name of calling serveruserId
- calling userstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-
getLocationByGUID
@GetMapping(path="/locations/{locationGUID}") public LocationResponse getLocationByGUID(@PathVariable String serverName, @PathVariable String userId, @PathVariable String locationGUID) Retrieve the location metadata element with the supplied unique identifier.- Parameters:
serverName
- name of calling serveruserId
- calling userlocationGUID
- unique identifier of the requested metadata element- Returns:
- matching metadata element or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to make this request or PropertyServerException the repository is not available or not working properly.
-