Class CollectionHandler<B>

  • Type Parameters:
    B - class that represents the collection

    public class CollectionHandler<B>
    extends ReferenceableHandler<B>
    CollectionHandler provides the exchange of metadata about collections between the repository and the OMAS.
    • Constructor Detail

      • CollectionHandler

        public CollectionHandler​(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 with information needed to work with B objects.
        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 B instances from
        defaultZones - list of zones that the access service should set in all new B instances
        publishZones - list of zones that the access service sets up in published B instances
        auditLog - destination for audit log events
    • Method Detail

      • createCollection

        public String createCollection​(String userId,
                                       String externalSourceGUID,
                                       String externalSourceName,
                                       String qualifiedName,
                                       String displayName,
                                       String description,
                                       Map<String,​String> additionalProperties,
                                       String suppliedTypeName,
                                       Map<String,​Object> extendedProperties,
                                       String classificationName,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Create the collection object.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of the software server capability that owns this collection
        externalSourceName - unique name of the software server capability that owns this collection
        qualifiedName - unique name for the collection - used in other configuration
        displayName - short display name for the collection
        description - description of the governance collection
        additionalProperties - additional properties for a collection
        suppliedTypeName - type name from the caller (enables creation of subtypes)
        extendedProperties - properties for a governance collection subtype
        classificationName - name of classification to add to the collection (assume no properties)
        methodName - calling method
        Returns:
        unique identifier of the new collection object
        Throws:
        InvalidParameterException - qualifiedName or userId is null
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • createFolder

        public String createFolder​(String userId,
                                   String externalSourceGUID,
                                   String externalSourceName,
                                   String qualifiedName,
                                   String displayName,
                                   String description,
                                   Map<String,​String> additionalProperties,
                                   String suppliedTypeName,
                                   Map<String,​Object> extendedProperties,
                                   int orderBy,
                                   String orderPropertyName,
                                   String methodName)
                            throws InvalidParameterException,
                                   UserNotAuthorizedException,
                                   PropertyServerException
        Create the folder object. This is collection with a Folder classification attached
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of the software server capability that owns this collection
        externalSourceName - unique name of the software server capability that owns this collection
        qualifiedName - unique name for the collection - used in other configuration
        displayName - short display name for the collection
        description - description of the governance collection
        additionalProperties - additional properties for a collection
        suppliedTypeName - type name from the caller (enables creation of subtypes)
        extendedProperties - properties for a governance collection subtype
        orderBy - the factor used to organize the members
        orderPropertyName - name of property of OrderBy is 99 (OTHER)
        methodName - calling method
        Returns:
        unique identifier of the new collection object
        Throws:
        InvalidParameterException - qualifiedName or userId is null
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • createCollectionFromTemplate

        public String createCollectionFromTemplate​(String userId,
                                                   String externalSourceGUID,
                                                   String externalSourceName,
                                                   String templateGUID,
                                                   String qualifiedName,
                                                   String displayName,
                                                   String description,
                                                   String methodName)
                                            throws InvalidParameterException,
                                                   UserNotAuthorizedException,
                                                   PropertyServerException
        Create a new metadata element to represent a collection using an existing metadata element as a template. The template defines additional classifications and relationships that should be added to the new collection. All categories and terms are linked to a single collection. They are owned by this collection and if the collection is deleted, any linked terms and categories are deleted as well.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of the software server capability that owns this collection
        externalSourceName - unique name of the software server capability that owns this collection
        templateGUID - unique identifier of the metadata element to copy
        qualifiedName - unique name for the collection - used in other configuration
        displayName - short display name for the collection
        description - description of the governance collection
        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)
      • updateCollection

        public void updateCollection​(String userId,
                                     String externalSourceGUID,
                                     String externalSourceName,
                                     String collectionGUID,
                                     String collectionGUIDParameterName,
                                     String qualifiedName,
                                     String displayName,
                                     String description,
                                     Map<String,​String> additionalProperties,
                                     String suppliedTypeName,
                                     Map<String,​Object> extendedProperties,
                                     String methodName)
                              throws InvalidParameterException,
                                     UserNotAuthorizedException,
                                     PropertyServerException
        Update the anchor object that all elements in a collection (terms and categories) are linked to.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of the software server capability that owns this collection
        externalSourceName - unique name of the software server capability that owns this collection
        collectionGUID - unique identifier of the collection to update
        collectionGUIDParameterName - parameter passing the collectionGUID
        qualifiedName - unique name for the collection - used in other configuration
        displayName - short display name for the collection
        description - description of the governance collection
        additionalProperties - additional properties for a governance collection
        suppliedTypeName - type of collection
        extendedProperties - properties for a governance collection subtype
        methodName - calling method
        Throws:
        InvalidParameterException - qualifiedName or userId is null
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • addMemberToCollection

        public void addMemberToCollection​(String userId,
                                          String externalSourceGUID,
                                          String externalSourceName,
                                          String collectionGUID,
                                          String collectionGUIDParameterName,
                                          String memberGUID,
                                          String memberGUIDParameterName,
                                          String membershipRationale,
                                          String methodName)
                                   throws InvalidParameterException,
                                          UserNotAuthorizedException,
                                          PropertyServerException
        Add a member (Referenceable) to collection.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of the software server capability that owns this collection
        externalSourceName - unique name of the software server capability that owns this collection
        collectionGUID - unique identifier of the collection
        collectionGUIDParameterName - parameter supplying the collectionGUID
        memberGUID - unique identifier of the element that is being added to the collection
        memberGUIDParameterName - parameter supplying the memberGUID
        membershipRationale - why is the element a member? (optional)
        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)
      • removeMemberFromCollection

        public void removeMemberFromCollection​(String userId,
                                               String externalSourceGUID,
                                               String externalSourceName,
                                               String collectionGUID,
                                               String collectionGUIDParameterName,
                                               String memberGUID,
                                               String memberGUIDParameterName,
                                               Date effectiveTime,
                                               String methodName)
                                        throws InvalidParameterException,
                                               UserNotAuthorizedException,
                                               PropertyServerException
        Remove a parent-child relationship between two categories.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of the software server capability that owns this collection
        externalSourceName - unique name of the software server capability that owns this collection
        collectionGUID - unique identifier of the collection
        collectionGUIDParameterName - parameter supplying the collectionGUID
        memberGUID - unique identifier of the element that is being added to the collection
        memberGUIDParameterName - parameter supplying the memberGUID
        effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
        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)
      • removeCollection

        public void removeCollection​(String userId,
                                     String externalSourceGUID,
                                     String externalSourceName,
                                     String collectionGUID,
                                     String collectionGUIDParameterName,
                                     String methodName)
                              throws InvalidParameterException,
                                     UserNotAuthorizedException,
                                     PropertyServerException
        Remove the metadata element representing a collection. This will delete the collection and all categories and terms because the Anchors classifications are set up in these elements.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of the software server capability that owns this collection
        externalSourceName - unique name of the software server capability that owns this collection
        collectionGUID - unique identifier of the metadata element to remove
        collectionGUIDParameterName - parameter supplying the collectionGUID
        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)
      • findCollections

        public List<B> findCollections​(String userId,
                                       String searchString,
                                       String searchStringParameterName,
                                       int startFrom,
                                       int pageSize,
                                       Date effectiveTime,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Retrieve the list of collection metadata elements that contain the search string. The search string is treated as a regular expression.
        Parameters:
        userId - calling user
        searchString - string to find in the properties
        searchStringParameterName - name of parameter supplying the search string
        startFrom - paging start point
        pageSize - maximum results that can be returned
        effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
        methodName - calling method
        Returns:
        list of matching metadata elements
        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)
      • getCollectionsByName

        public List<B> getCollectionsByName​(String userId,
                                            String name,
                                            String nameParameterName,
                                            int startFrom,
                                            int pageSize,
                                            Date effectiveTime,
                                            String methodName)
                                     throws InvalidParameterException,
                                            UserNotAuthorizedException,
                                            PropertyServerException
        Retrieve the list of collection metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
        Parameters:
        userId - calling user
        name - name to search for
        nameParameterName - parameter supplying name
        startFrom - paging start point
        pageSize - maximum results that can be returned
        effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
        methodName - calling method
        Returns:
        list of matching metadata elements
        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)