Class CollectionManagerRESTServices

java.lang.Object
org.odpi.openmetadata.tokencontroller.TokenController
org.odpi.openmetadata.viewservices.collectionmanager.server.CollectionManagerRESTServices

public class CollectionManagerRESTServices extends TokenController
The CollectionManagerRESTServices provides the implementation of the Collection Manager Open Metadata View Service (OMVS).
  • Constructor Details

    • CollectionManagerRESTServices

      public CollectionManagerRESTServices()
      Default constructor
  • Method Details

    • getLinkedCollections

      public CollectionListResponse getLinkedCollections(String serverName, String parentGUID, int startFrom, int pageSize, FilterRequestBody requestBody)
      Returns the list of collections that are linked off of the supplied element.
      Parameters:
      serverName - name of called server
      parentGUID - unique identifier of referenceable object (typically a personal profile, project or community) that the collections hang off of
      startFrom - index of the list to start from (0 for start)
      pageSize - maximum number of elements to return
      requestBody - filter response by collection type - if null, any value will do
      Returns:
      a list of collections InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • getClassifiedCollections

      public CollectionListResponse getClassifiedCollections(String serverName, int startFrom, int pageSize, FilterRequestBody requestBody)
      Returns the list of collections with a particular classification.
      Parameters:
      serverName - name of called server
      requestBody - name of the classification - if null, all collections are returned
      startFrom - index of the list to start from (0 for start)
      pageSize - maximum number of elements to return
      Returns:
      a list of collections InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • findCollections

      public CollectionListResponse findCollections(String serverName, boolean startsWith, boolean endsWith, boolean ignoreCase, int startFrom, int pageSize, FilterRequestBody requestBody)
      Returns the list of collections matching the search string - this is coded as a regular expression.
      Parameters:
      serverName - name of the service to route the request to
      startsWith - does the value start with the supplied string?
      endsWith - does the value end with the supplied string?
      ignoreCase - should the search ignore case?
      startFrom - paging start point
      pageSize - maximum results that can be returned
      requestBody - string to find in the properties
      Returns:
      a list of collections InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • getCollectionsByName

      public CollectionListResponse getCollectionsByName(String serverName, int startFrom, int pageSize, FilterRequestBody requestBody)
      Returns the list of collections with a particular name.
      Parameters:
      serverName - name of called server
      requestBody - name of the collections to return - match is full text match in qualifiedName or name
      startFrom - index of the list to start from (0 for start)
      pageSize - maximum number of elements to return
      Returns:
      a list of collections InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • getCollectionsByType

      public CollectionListResponse getCollectionsByType(String serverName, int startFrom, int pageSize, FilterRequestBody requestBody)
      Returns the list of collections with a particular collectionType. This is an optional text field in the collection element.
      Parameters:
      serverName - name of called server
      requestBody - the collection type value to match on. If it is null, all collections with a null collectionType are returned
      startFrom - index of the list to start from (0 for start)
      pageSize - maximum number of elements to return
      Returns:
      a list of collections InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • getCollection

      public CollectionResponse getCollection(String serverName, String collectionGUID)
      Return the properties of a specific collection.
      Parameters:
      serverName - name of called server
      collectionGUID - unique identifier of the required collection
      Returns:
      collection properties InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • createCollection

      public GUIDResponse createCollection(String serverName, String optionalClassificationName, NewCollectionRequestBody requestBody)
      Create a new generic collection.
      Parameters:
      serverName - name of called server.
      optionalClassificationName - name of collection classification
      requestBody - properties for the collection.
      Returns:
      unique identifier of the newly created Collection InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • createRootCollection

      public GUIDResponse createRootCollection(String serverName, NewCollectionRequestBody requestBody)
      Create a new collection with the RootCollection classification. Used to identify the top of a collection hierarchy.
      Parameters:
      serverName - name of called server.
      requestBody - properties for the collection.
      Returns:
      unique identifier of the newly created Collection InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • createDataSpecCollection

      public GUIDResponse createDataSpecCollection(String serverName, NewCollectionRequestBody requestBody)
      Create a new collection with the DataSpecCollection classification. Used to identify the top of a collection hierarchy.
      Parameters:
      serverName - name of called server.
      requestBody - properties for the collection.
      Returns:
      unique identifier of the newly created Collection InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • createFolderCollection

      public GUIDResponse createFolderCollection(String serverName, NewCollectionRequestBody requestBody)
      Create a new collection with the Folder classification. This is used to identify the organizing collections in a collection hierarchy.
      Parameters:
      serverName - name of called server.
      requestBody - properties for the collection.
      Returns:
      unique identifier of the newly created Collection InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • createCollectionFromTemplate

      public GUIDResponse createCollectionFromTemplate(String serverName, TemplateRequestBody requestBody)
      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.
      Parameters:
      serverName - calling user
      requestBody - properties that override the template
      Returns:
      unique identifier of the new metadata element 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)
    • createDigitalProduct

      public GUIDResponse createDigitalProduct(String serverName, NewDigitalProductRequestBody requestBody)
      Create a new collection that represents a digital product.
      Parameters:
      serverName - name of called server.
      requestBody - properties for the collection and attached DigitalProduct classification
      Returns:
      unique identifier of the newly created Collection InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • updateCollection

      public VoidResponse updateCollection(String serverName, String collectionGUID, boolean replaceAllProperties, CollectionProperties requestBody)
      Update the properties of a collection.
      Parameters:
      serverName - name of called server.
      collectionGUID - unique identifier of the collection (returned from create)
      replaceAllProperties - flag to indicate whether to completely replace the existing properties with the new properties, or just update the individual properties specified on the request.
      requestBody - properties for the collection.
      Returns:
      void or InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • updateDigitalProduct

      public VoidResponse updateDigitalProduct(String serverName, String collectionGUID, boolean replaceAllProperties, DigitalProductProperties requestBody)
      Update the properties of the DigitalProduct classification attached to a collection.
      Parameters:
      serverName - name of called server.
      collectionGUID - unique identifier of the collection (returned from create)
      replaceAllProperties - flag to indicate whether to completely replace the existing properties with the new properties, or just update the individual properties specified on the request.
      requestBody - properties for the DigitalProduct classification.
      Returns:
      void or InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • attachCollection

      public VoidResponse attachCollection(String serverName, String collectionGUID, String parentGUID, boolean makeAnchor, ResourceListProperties requestBody)
      Connect an existing collection to an element using the ResourceList relationship (0019).
      Parameters:
      serverName - name of called server
      collectionGUID - unique identifier of the collection
      parentGUID - unique identifier of referenceable object that the collection should be attached to
      requestBody - description of how the collection will be used.
      makeAnchor - like the lifecycle of the collection to that of the parent so that if the parent is deleted, so is the collection
      Returns:
      void or InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • detachCollection

      public VoidResponse detachCollection(String serverName, String collectionGUID, String parentGUID, NullRequestBody requestBody)
      Detach an existing collection from an element. If the collection is anchored to the element, it is deleted.
      Parameters:
      serverName - name of called server.
      collectionGUID - unique identifier of the collection.
      parentGUID - unique identifier of referenceable object that the collection should be attached to
      requestBody - null request body
      Returns:
      void or InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • deleteCollection

      public VoidResponse deleteCollection(String serverName, String collectionGUID, NullRequestBody requestBody)
      Delete a collection. It is detected from all parent elements. If members are anchored to the collection then they are also deleted.
      Parameters:
      serverName - name of called server.
      collectionGUID - unique identifier of the collection.
      requestBody - null request body
      Returns:
      void or InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • getCollectionMembers

      public CollectionMemberListResponse getCollectionMembers(String serverName, String collectionGUID, int startFrom, int pageSize)
      Return a list of elements that are a member of a collection.
      Parameters:
      serverName - name of called server.
      collectionGUID - unique identifier of the collection.
      startFrom - index of the list to start from (0 for start)
      pageSize - maximum number of elements to return.
      Returns:
      list of asset details InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • addToCollection

      public VoidResponse addToCollection(String serverName, String collectionGUID, String elementGUID, CollectionMembershipProperties requestBody)
      Add an element to a collection.
      Parameters:
      serverName - name of called server.
      collectionGUID - unique identifier of the collection.
      requestBody - properties describing the membership characteristics.
      elementGUID - unique identifier of the element.
      Returns:
      void or InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem updating information in the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • updateCollectionMembership

      public VoidResponse updateCollectionMembership(String serverName, String collectionGUID, String elementGUID, boolean replaceAllProperties, CollectionMembershipProperties requestBody)
      Update an element's membership to a collection.
      Parameters:
      serverName - name of called server.
      collectionGUID - unique identifier of the collection.
      replaceAllProperties - flag to indicate whether to completely replace the existing properties with the new properties, or just update the individual properties specified on the request.
      requestBody - properties describing the membership characteristics.
      elementGUID - unique identifier of the element.
      Returns:
      void or InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem updating information in the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
    • removeFromCollection

      public VoidResponse removeFromCollection(String serverName, String collectionGUID, String elementGUID, NullRequestBody requestBody)
      Remove an element from a collection.
      Parameters:
      serverName - name of called server.
      collectionGUID - unique identifier of the collection.
      elementGUID - unique identifier of the element.
      requestBody - null request body
      Returns:
      void or InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem updating information in the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.