java.lang.Object
org.odpi.openmetadata.accessservices.communityprofile.server.LocationRESTServices

public class LocationRESTServices extends Object
LocationRESTServices provides the API operations to create and maintain location information.
  • Constructor Details

    • LocationRESTServices

      public LocationRESTServices()
      Default constructor
  • Method Details

    • createLocation

      public GUIDResponse createLocation(String serverName, String userId, ReferenceableRequestBody requestBody)
      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 server
      userId - calling user
      requestBody - 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, TemplateRequestBody requestBody)
      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 server
      userId - calling user
      templateGUID - unique identifier of the metadata element to copy
      requestBody - 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, ReferenceableRequestBody requestBody)
      Update the metadata element representing a location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      isMergeUpdate - should the new properties be merged with existing properties (true) or completely replace them (false)?
      locationGUID - unique identifier of the metadata element to update
      requestBody - 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, ClassificationRequestBody requestBody)
      Classify the location to indicate that it represents a fixed physical location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - unique identifier of the metadata element to classify
      requestBody - 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, ExternalSourceRequestBody requestBody)
      Remove the fixed physical location designation from the location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - unique identifier of the metadata element to unclassify
      requestBody - 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, ClassificationRequestBody requestBody)
      Classify the location to indicate that it represents a secure location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - unique identifier of the metadata element to classify
      requestBody - 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, ExternalSourceRequestBody requestBody)
      Remove the secure location designation from the location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - unique identifier of the metadata element to unclassify
      requestBody - 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, ClassificationRequestBody requestBody)
      Classify the location to indicate that it represents a digital/cyber location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - unique identifier of the metadata element to classify
      requestBody - 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, ExternalSourceRequestBody requestBody)
      Remove the digital/cyber location designation from the location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - unique identifier of the metadata element to unclassify
      requestBody - 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, ExternalSourceRequestBody requestBody)
      Remove the metadata element representing a location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - unique identifier of the metadata element to remove
      requestBody - 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, RelationshipRequestBody requestBody)
      Create a parent-child relationship between two locations.
      Parameters:
      serverName - name of calling server
      userId - calling user
      parentLocationGUID - unique identifier of the location that is the broader location
      childLocationGUID - unique identifier of the location that is the smaller, nested location
      requestBody - 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, ExternalSourceRequestBody requestBody)
      Remove a parent-child relationship between two locations.
      Parameters:
      serverName - name of calling server
      userId - calling user
      parentLocationGUID - unique identifier of the location that is the broader location
      childLocationGUID - unique identifier of the location that is the smaller, nested location
      requestBody - 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, RelationshipRequestBody requestBody)
      Create a peer-to-peer relationship between two locations.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationOneGUID - unique identifier of the first location
      locationTwoGUID - unique identifier of the second location
      requestBody - 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, ExternalSourceRequestBody requestBody)
      Remove a peer-to-peer relationship between two locations.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationOneGUID - unique identifier of the first location
      locationTwoGUID - unique identifier of the second location
      requestBody - 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

      public VoidResponse setupProfileLocation(String serverName, String userId, String actorProfileGUID, String locationGUID, RelationshipRequestBody requestBody)
      Create a profile location relationship between an actor profile and a location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      actorProfileGUID - unique identifier of the actor profile
      locationGUID - unique identifier of the location
      requestBody - 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

      public VoidResponse clearProfileLocation(String serverName, String userId, String actorProfileGUID, String locationGUID, ExternalSourceRequestBody requestBody)
      Remove a profile location relationship between an actor profile and a location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      actorProfileGUID - unique identifier of the actor profile
      locationGUID - unique identifier of the location
      requestBody - 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

      public VoidResponse setupAssetLocation(String serverName, String userId, String assetGUID, String locationGUID, RelationshipRequestBody requestBody)
      Create an asset location relationship between an asset and a location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      assetGUID - unique identifier of the asset
      locationGUID - unique identifier of the location
      requestBody - 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

      public VoidResponse clearAssetLocation(String serverName, String userId, String assetGUID, String locationGUID, ExternalSourceRequestBody requestBody)
      Remove an asset location relationship between an asset and a location.
      Parameters:
      serverName - name of calling server
      userId - calling user
      assetGUID - unique identifier of the actor profile
      locationGUID - unique identifier of the location
      requestBody - 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 server
      userId - calling user
      requestBody - string to find in the properties
      startFrom - paging start point
      pageSize - 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 name, identifier or display name. There are no wildcards supported on this request.
      Parameters:
      serverName - name of calling server
      userId - calling user
      requestBody - name to search for
      startFrom - paging start point
      pageSize - 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

      public LocationsResponse getAdjacentLocations(String serverName, String userId, String locationGUID, int startFrom, int pageSize)
      Retrieve the list of adjacent location metadata elements linked to locationGUID.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - locationGUID to search for
      startFrom - paging start point
      pageSize - 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

      public LocationsResponse getNestedLocations(String serverName, String userId, String locationGUID, int startFrom, int pageSize)
      Retrieve the list of nested location metadata elements linked to locationGUID.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - locationGUID to search for
      startFrom - paging start point
      pageSize - 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

      public LocationsResponse 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.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - locationGUID to search for
      startFrom - paging start point
      pageSize - 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

      public LocationsResponse getLocationsByProfile(String serverName, String userId, String actorProfileGUID, int startFrom, int pageSize)
      Retrieve the list of location metadata elements linked to the requested profile.
      Parameters:
      serverName - name of calling server
      userId - calling user
      actorProfileGUID - profile to search for
      startFrom - paging start point
      pageSize - 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

      public LocationsResponse getKnownLocationsForAsset(String serverName, String userId, String assetGUID, int startFrom, int pageSize)
      Retrieve the list of location metadata elements linked to assetGUID.
      Parameters:
      serverName - name of calling server
      userId - calling user
      assetGUID - asset to search for
      startFrom - paging start point
      pageSize - 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

      public LocationsResponse getLocations(String serverName, String userId, int startFrom, int pageSize)
      Retrieve the list of location metadata.
      Parameters:
      serverName - name of calling server
      userId - calling user
      startFrom - paging start point
      pageSize - 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

      public LocationResponse getLocationByGUID(String serverName, String userId, String locationGUID)
      Retrieve the location metadata element with the supplied unique identifier.
      Parameters:
      serverName - name of calling server
      userId - calling user
      locationGUID - 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.