Class LocationHandler<B>


  • public class LocationHandler<B>
    extends ReferenceableHandler<B>
    LocationHandler manages Location objects. It runs server-side in the OMAG Server Platform and retrieves Location entities through the OMRSRepositoryConnector. It supports effectivity dates on entities and relationships but not on classifications (since these tent to be innate properties of the location) and all locations are local cohort.
    • Constructor Detail

      • LocationHandler

        public LocationHandler​(OpenMetadataAPIGenericConverter<B> converter,
                               Class<B> beanClass,
                               String serviceName,
                               String serverName,
                               InvalidParameterHandler invalidParameterHandler,
                               RepositoryHandler repositoryHandler,
                               OMRSRepositoryHelper repositoryHelper,
                               String localServerUserId,
                               OpenMetadataServerSecurityVerifier securityVerifier,
                               List<String> supportedZones,
                               List<String> defaultZones,
                               List<String> publishZones,
                               AuditLog auditLog)
        Construct the handler information needed to interact with the repository services
        Parameters:
        converter - specific converter for this bean class
        beanClass - name of bean class that is represented by the generic class B
        serviceName - name of this service
        serverName - name of the local server
        invalidParameterHandler - handler for managing parameter errors
        repositoryHandler - manages calls to the repository services
        repositoryHelper - provides utilities for manipulating the repository services objects
        localServerUserId - userId for this server
        securityVerifier - open metadata security services verifier
        supportedZones - list of zones that the access service is allowed to serve Asset instances from.
        defaultZones - list of zones that the access service should set in all new Asset instances.
        publishZones - list of zones that the access service sets up in published Asset instances.
        auditLog - destination for audit log events.
    • Method Detail

      • createLocation

        public String createLocation​(String userId,
                                     String qualifiedName,
                                     String displayName,
                                     String description,
                                     Map<String,​String> additionalProperties,
                                     String suppliedTypeName,
                                     Map<String,​Object> extendedProperties,
                                     Date effectiveFrom,
                                     Date effectiveTo,
                                     String methodName)
                              throws InvalidParameterException,
                                     UserNotAuthorizedException,
                                     PropertyServerException
        Create the location.
        Parameters:
        userId - calling user
        qualifiedName - unique name for the location - used in other configuration
        displayName - short display name for the location
        description - description of the governance location
        additionalProperties - additional properties for a location
        suppliedTypeName - type name from the caller (enables creation of subtypes)
        extendedProperties - properties for a governance location subtype
        effectiveFrom - starting time for this relationship (null for all time)
        effectiveTo - ending time for this relationship (null for all time)
        methodName - calling method
        Returns:
        unique identifier of the new location object
        Throws:
        InvalidParameterException - qualifiedName or userId is null
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • createLocationFromTemplate

        public String createLocationFromTemplate​(String userId,
                                                 String templateGUID,
                                                 String qualifiedName,
                                                 String displayName,
                                                 String description,
                                                 String methodName)
                                          throws InvalidParameterException,
                                                 UserNotAuthorizedException,
                                                 PropertyServerException
        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. All categories and terms are linked to a single location. They are owned by this location and if the location is deleted, any linked terms and categories are deleted as well.
        Parameters:
        userId - calling user
        templateGUID - unique identifier of the metadata element to copy
        qualifiedName - unique name for the location - used in other configuration
        displayName - short display name for the location
        description - description of the governance location
        methodName - calling method
        Returns:
        unique identifier of the new metadata element
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • updateLocation

        public void updateLocation​(String userId,
                                   String locationGUID,
                                   String locationGUIDParameterName,
                                   String qualifiedName,
                                   String displayName,
                                   String description,
                                   Map<String,​String> additionalProperties,
                                   String suppliedTypeName,
                                   Map<String,​Object> extendedProperties,
                                   boolean isMergeUpdate,
                                   Date effectiveFrom,
                                   Date effectiveTo,
                                   String methodName)
                            throws InvalidParameterException,
                                   UserNotAuthorizedException,
                                   PropertyServerException
        Update the location.
        Parameters:
        userId - calling user
        locationGUID - unique identifier of the location to update
        locationGUIDParameterName - parameter passing the locationGUID
        qualifiedName - unique name for the location - used in other configuration
        displayName - short display name for the location
        description - description of the governance location
        additionalProperties - additional properties for a governance location
        suppliedTypeName - type of location
        extendedProperties - properties for a governance location subtype
        effectiveFrom - starting time for this relationship (null for all time)
        effectiveTo - ending time for this relationship (null for all time)
        isMergeUpdate - should the new properties be merged with existing properties (true) or completely replace them (false)?
        methodName - calling method
        Throws:
        InvalidParameterException - qualifiedName or userId is null
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • setupNestedLocation

        public void setupNestedLocation​(String userId,
                                        String locationParentGUID,
                                        String locationParentGUIDParameterName,
                                        String locationChildGUID,
                                        String locationChildGUIDParameterName,
                                        Date effectiveFrom,
                                        Date effectiveTo,
                                        String methodName)
                                 throws InvalidParameterException,
                                        UserNotAuthorizedException,
                                        PropertyServerException
        Create a parent-child relationship between two locations.
        Parameters:
        userId - calling user
        locationParentGUID - unique identifier of the parent location
        locationParentGUIDParameterName - parameter supplying the parent
        locationChildGUID - unique identifier of the child location
        locationChildGUIDParameterName - parameter supplying the child
        effectiveFrom - starting time for this relationship (null for all time)
        effectiveTo - ending time for this relationship (null for all time)
        methodName - calling method
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • clearNestedLocation

        public void clearNestedLocation​(String userId,
                                        String locationParentGUID,
                                        String locationParentGUIDParameterName,
                                        String locationChildGUID,
                                        String locationChildGUIDParameterName,
                                        Date effectiveTime,
                                        String methodName)
                                 throws InvalidParameterException,
                                        UserNotAuthorizedException,
                                        PropertyServerException
        Remove a parent-child relationship between two locations.
        Parameters:
        userId - calling user
        locationParentGUID - unique identifier of the parent location
        locationParentGUIDParameterName - parameter supplying the parent
        locationChildGUID - unique identifier of the child location
        locationChildGUIDParameterName - parameter supplying the child
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • setupPeerLocations

        public void setupPeerLocations​(String userId,
                                       String locationOneGUID,
                                       String locationOneGUIDParameterName,
                                       String locationTwoGUID,
                                       String locationTwoGUIDParameterName,
                                       Date effectiveFrom,
                                       Date effectiveTo,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Create a peer relationship between two locations.
        Parameters:
        userId - calling user
        locationOneGUID - unique identifier of the first location
        locationOneGUIDParameterName - parameter supplying the first location
        locationTwoGUID - unique identifier of the second location
        locationTwoGUIDParameterName - parameter supplying the second location
        effectiveFrom - starting time for this relationship (null for all time)
        effectiveTo - ending time for this relationship (null for all time)
        methodName - calling method
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • clearPeerLocations

        public void clearPeerLocations​(String userId,
                                       String locationOneGUID,
                                       String locationOneGUIDParameterName,
                                       String locationTwoGUID,
                                       String locationTwoGUIDParameterName,
                                       Date effectiveTime,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Remove a peer relationship between two locations.
        Parameters:
        userId - calling user
        locationOneGUID - unique identifier of the first location
        locationOneGUIDParameterName - parameter supplying the first location
        locationTwoGUID - unique identifier of the second location
        locationTwoGUIDParameterName - parameter supplying the second location
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • setupAssetLocation

        public void setupAssetLocation​(String userId,
                                       String locationGUID,
                                       String locationGUIDParameterName,
                                       String assetGUID,
                                       String assetGUIDParameterName,
                                       Date effectiveFrom,
                                       Date effectiveTo,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Create a relationship between a location and an asset.
        Parameters:
        userId - calling user
        locationGUID - unique identifier of the location
        locationGUIDParameterName - parameter supplying the location
        assetGUID - unique identifier of the asset
        assetGUIDParameterName - parameter supplying the asset
        effectiveFrom - starting time for this relationship (null for all time)
        effectiveTo - ending time for this relationship (null for all time)
        methodName - calling method
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • getLocations

        public List<B> getLocations​(String userId,
                                    String elementGUID,
                                    String elementGUIDParameterName,
                                    String elementTypeName,
                                    int startingFrom,
                                    int pageSize,
                                    Date effectiveTime,
                                    String methodName)
                             throws InvalidParameterException,
                                    PropertyServerException,
                                    UserNotAuthorizedException
        Return the locations attached to an entity.
        Parameters:
        userId - calling user
        elementGUID - identifier for the entity that the feedback is attached to
        elementGUIDParameterName - name of parameter supplying the GUID
        elementTypeName - name of the type of object being attached to
        startingFrom - where to start from in the list
        pageSize - maximum number of results that can be returned
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Returns:
        list of retrieved objects or null if none found
        Throws:
        InvalidParameterException - the input properties are invalid
        UserNotAuthorizedException - user not authorized to issue this request
        PropertyServerException - problem accessing the property server
      • getLocations

        public List<B> getLocations​(String userId,
                                    String elementGUID,
                                    String elementGUIDParameterName,
                                    String elementTypeName,
                                    List<String> serviceSupportedZones,
                                    int startingFrom,
                                    int pageSize,
                                    Date effectiveTime,
                                    String methodName)
                             throws InvalidParameterException,
                                    PropertyServerException,
                                    UserNotAuthorizedException
        Return the locations attached to an entity.
        Parameters:
        userId - calling user
        elementGUID - identifier for the entity that the feedback is attached to
        elementGUIDParameterName - name of parameter supplying the GUID
        elementTypeName - name of the type of object being attached to
        serviceSupportedZones - supported zones for calling service
        startingFrom - where to start from in the list
        pageSize - maximum number of results that can be returned
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Returns:
        list of retrieved objects or null if none found
        Throws:
        InvalidParameterException - the input properties are invalid
        UserNotAuthorizedException - user not authorized to issue this request
        PropertyServerException - problem accessing the property server