Class LocationRESTServices
java.lang.Object
org.odpi.openmetadata.accessservices.digitalarchitecture.server.LocationRESTServices
LocationRESTServices provides the API operations to create and maintain location information.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclearAdjacentLocation
(String serverName, String userId, String locationOneGUID, String locationTwoGUID, NullRequestBody requestBody) Remove a peer-to-peer relationship between two locations.clearLocationAsDigital
(String serverName, String userId, String locationGUID, NullRequestBody requestBody) Remove the digital/cyber location designation from the location.clearLocationAsFixedPhysical
(String serverName, String userId, String locationGUID, NullRequestBody requestBody) Remove the fixed physical location designation from the location.clearLocationAsSecure
(String serverName, String userId, String locationGUID, NullRequestBody requestBody) Remove the secure location designation from the location.clearNestedLocation
(String serverName, String userId, String parentLocationGUID, String childLocationGUID, NullRequestBody requestBody) Remove a parent-child relationship between two locations.createLocation
(String serverName, String userId, LocationProperties locationProperties) Create a new metadata element to represent a location.createLocationFromTemplate
(String serverName, String userId, String templateGUID, TemplateProperties templateProperties) Create a new metadata element to represent a location using an existing metadata element as a template.findLocations
(String serverName, String userId, SearchStringRequestBody requestBody, int startFrom, int pageSize) Retrieve the list of location metadata elements that contain the search string.getLocationByGUID
(String serverName, String userId, String locationGUID) Retrieve the location metadata element with the supplied unique identifier.getLocationsByName
(String serverName, String userId, NameRequestBody requestBody, int startFrom, int pageSize) Retrieve the list of location metadata elements with a matching qualified or display name.removeLocation
(String serverName, String userId, String locationGUID, NullRequestBody requestBody) Remove the metadata element representing a location.setLocationAsDigital
(String serverName, String userId, String locationGUID, DigitalLocationRequestBody requestBody) Classify the location to indicate that it represents a digital/cyber location.setLocationAsFixedPhysical
(String serverName, String userId, String locationGUID, FixedLocationRequestBody requestBody) Classify the location to indicate that it represents a fixed physical location.setLocationAsSecure
(String serverName, String userId, String locationGUID, SecureLocationRequestBody requestBody) Classify the location to indicate that it represents a secure location.setupAdjacentLocation
(String serverName, String userId, String locationOneGUID, String locationTwoGUID, NullRequestBody requestBody) Create a peer-to-peer relationship between two locations.setupNestedLocation
(String serverName, String userId, String parentLocationGUID, String childLocationGUID, NullRequestBody requestBody) Create a parent-child relationship between two locations.updateLocation
(String serverName, String userId, String locationGUID, boolean isMergeUpdate, LocationProperties locationProperties) Update the metadata element representing a location.
-
Constructor Details
-
LocationRESTServices
public LocationRESTServices()Default constructor
-
-
Method Details
-
createLocation
public GUIDResponse createLocation(String serverName, String userId, LocationProperties 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
public GUIDResponse createLocationFromTemplate(String serverName, String userId, String templateGUID, TemplateProperties 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
public VoidResponse updateLocation(String serverName, String userId, String locationGUID, boolean isMergeUpdate, LocationProperties locationProperties) Update the metadata element representing a location.- Parameters:
serverName
- name of calling serveruserId
- calling userisMergeUpdate
- should the new properties be merged with existing properties (true) or completely replace them (false)?locationGUID
- unique identifier of the metadata element to updatelocationProperties
- 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
public VoidResponse setLocationAsFixedPhysical(String serverName, String userId, String locationGUID, FixedLocationRequestBody 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
public VoidResponse clearLocationAsFixedPhysical(String serverName, String userId, String locationGUID, NullRequestBody 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
public VoidResponse setLocationAsSecure(String serverName, String userId, String locationGUID, SecureLocationRequestBody 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
public VoidResponse clearLocationAsSecure(String serverName, String userId, String locationGUID, NullRequestBody 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
public VoidResponse setLocationAsDigital(String serverName, String userId, String locationGUID, DigitalLocationRequestBody 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
public VoidResponse clearLocationAsDigital(String serverName, String userId, String locationGUID, NullRequestBody 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
public VoidResponse removeLocation(String serverName, String userId, String locationGUID, NullRequestBody 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
public VoidResponse setupNestedLocation(String serverName, String userId, String parentLocationGUID, String childLocationGUID, NullRequestBody 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
public VoidResponse clearNestedLocation(String serverName, String userId, String parentLocationGUID, String childLocationGUID, NullRequestBody 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
public VoidResponse setupAdjacentLocation(String serverName, String userId, String locationOneGUID, String locationTwoGUID, NullRequestBody 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
public VoidResponse clearAdjacentLocation(String serverName, String userId, String locationOneGUID, String locationTwoGUID, NullRequestBody 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.
-
findLocations
public LocationsResponse findLocations(String serverName, String userId, SearchStringRequestBody requestBody, int startFrom, int pageSize) 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
public LocationsResponse getLocationsByName(String serverName, String userId, NameRequestBody requestBody, int startFrom, int pageSize) Retrieve the list of location metadata elements with a matching qualified 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.
-
getLocationByGUID
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.
-