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

    • getAttachedCollections

      public CollectionsResponse getAttachedCollections(String serverName, String urlMarker, 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
      urlMarker - view service URL marker
      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.
    • findCollections

      public CollectionsResponse findCollections(String serverName, String urlMarker, String classificationName, 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
      urlMarker - view service URL marker
      classificationName - option name of a collection classification
      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 CollectionsResponse getCollectionsByName(String serverName, String urlMarker, String classificationName, int startFrom, int pageSize, FilterRequestBody requestBody)
      Returns the list of collections with a particular name.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      requestBody - name of the collections to return - match is full text match in qualifiedName or name
      classificationName - option name of a collection classification
      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 CollectionsResponse getCollectionsByType(String serverName, String urlMarker, String classificationName, 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
      urlMarker - view service URL marker
      classificationName - option name of a collection classification
      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 urlMarker, String collectionGUID, AnyTimeRequestBody requestBody)
      Return the properties of a specific collection.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      collectionGUID - unique identifier of the required collection
      requestBody - time values for the query
      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 urlMarker, String optionalClassificationName, NewElementRequestBody requestBody)
      Create a new generic collection.
      Parameters:
      serverName - name of called server.
      urlMarker - view service URL marker
      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.
    • createCollectionFromTemplate

      public GUIDResponse createCollectionFromTemplate(String serverName, String urlMarker, 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
      urlMarker - view service URL marker
      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)
    • updateCollection

      public VoidResponse updateCollection(String serverName, String urlMarker, String collectionGUID, boolean replaceAllProperties, UpdateElementRequestBody requestBody)
      Update the properties of a collection.
      Parameters:
      serverName - name of called server.
      urlMarker - view service URL marker
      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.
    • updateDigitalProductStatus

      public VoidResponse updateDigitalProductStatus(String serverName, String urlMarker, String digitalProductGUID, DigitalProductStatusRequestBody requestBody)
      Update the status of a digital product.
      Parameters:
      serverName - name of called server.
      urlMarker - view service URL marker
      digitalProductGUID - unique identifier of the digital product (returned from create)
      requestBody - properties for the new element.
      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.
    • updateAgreementStatus

      public VoidResponse updateAgreementStatus(String serverName, String urlMarker, String agreementGUID, AgreementStatusRequestBody requestBody)
      Update the status of an agreement.
      Parameters:
      serverName - name of called server.
      urlMarker - view service URL marker
      agreementGUID - unique identifier of the agreement (returned from create)
      requestBody - properties for the new element.
      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 urlMarker, String collectionGUID, String parentGUID, boolean makeAnchor, RelationshipRequestBody requestBody)
      Connect an existing collection to an element using the ResourceList relationship (0019).
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      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 urlMarker, String collectionGUID, String parentGUID, MetadataSourceRequestBody 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.
      urlMarker - view service URL marker
      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.
    • linkDigitalProductDependency

      public VoidResponse linkDigitalProductDependency(String serverName, String urlMarker, String consumerDigitalProductGUID, String consumedDigitalProductGUID, RelationshipRequestBody requestBody)
      Link two dependent products.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      consumerDigitalProductGUID - unique identifier of the digital product that has the dependency.
      consumedDigitalProductGUID - unique identifier of the digital product that it is using.
      requestBody - description of the relationship.
      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.
    • detachDigitalProductDependency

      public VoidResponse detachDigitalProductDependency(String serverName, String urlMarker, String consumerDigitalProductGUID, String consumedDigitalProductGUID, MetadataSourceRequestBody requestBody)
      Unlink dependent products.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      consumerDigitalProductGUID - unique identifier of the digital product that has the dependency.
      consumedDigitalProductGUID - unique identifier of the digital product that it is using.
      requestBody - description of the relationship.
      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.
    • linkSubscriber

      public VoidResponse linkSubscriber(String serverName, String urlMarker, String digitalSubscriberGUID, String digitalSubscriptionGUID, RelationshipRequestBody requestBody)
      Attach a subscriber to a subscription.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      digitalSubscriberGUID - unique identifier of the subscriber (referenceable)
      digitalSubscriptionGUID - unique identifier of the digital subscription agreement
      requestBody - description of the relationship.
      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.
    • detachSubscriber

      public VoidResponse detachSubscriber(String serverName, String urlMarker, String digitalSubscriberGUID, String digitalSubscriptionGUID, MetadataSourceRequestBody requestBody)
      Detach a subscriber from a subscription.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      digitalSubscriberGUID - unique identifier of the subscriber (referenceable)
      digitalSubscriptionGUID - unique identifier of the digital subscription agreement
      requestBody - description of the relationship.
      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.
    • linkProductManager

      public VoidResponse linkProductManager(String serverName, String urlMarker, String digitalProductGUID, String digitalProductManagerGUID, RelationshipRequestBody requestBody)
      Attach a product manager to a digital product.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      digitalProductGUID - unique identifier of the digital product
      digitalProductManagerGUID - unique identifier of the product manager role
      requestBody - description of the relationship.
      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.
    • detachProductManager

      public VoidResponse detachProductManager(String serverName, String urlMarker, String digitalProductGUID, String digitalProductManagerGUID, MetadataSourceRequestBody requestBody)
      Detach a product manager from a digital product.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      digitalProductGUID - unique identifier of the digital product
      digitalProductManagerGUID - unique identifier of the product manager role
      requestBody - description of the relationship.
      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.
    • linkAgreementActor

      public GUIDResponse linkAgreementActor(String serverName, String urlMarker, String agreementGUID, String actorGUID, RelationshipRequestBody requestBody)
      Attach an actor to an agreement.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      agreementGUID - unique identifier of the agreement
      actorGUID - unique identifier of the actor
      requestBody - description of the relationship.
      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.
    • detachAgreementActor

      public VoidResponse detachAgreementActor(String serverName, String urlMarker, String agreementActorRelationshipGUID, MetadataSourceRequestBody requestBody)
      Detach an actor from an agreement.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      agreementActorRelationshipGUID - unique identifier of the element being described
      requestBody - description of the relationship.
      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.
    • linkAgreementItem

      public VoidResponse linkAgreementItem(String serverName, String urlMarker, String agreementGUID, String agreementItemGUID, RelationshipRequestBody requestBody)
      Attach an agreement to an element involved in its definition.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      agreementGUID - unique identifier of the agreement
      agreementItemGUID - unique identifier of the agreement item
      requestBody - description of the relationship.
      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.
    • detachAgreementItem

      public VoidResponse detachAgreementItem(String serverName, String urlMarker, String agreementGUID, String agreementItemGUID, MetadataSourceRequestBody requestBody)
      Detach an agreement from an element involved in its definition.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      agreementGUID - unique identifier of the agreement
      agreementItemGUID - unique identifier of the agreement item
      requestBody - description of the relationship.
      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.
    • linkContract

      public VoidResponse linkContract(String serverName, String urlMarker, String agreementGUID, String externalReferenceGUID, RelationshipRequestBody requestBody)
      Attach an agreement to an external reference element that describes the location of the contract documents.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      agreementGUID - unique identifier of the agreement
      externalReferenceGUID - unique identifier of the external reference describing the location of the contract
      requestBody - description of the relationship.
      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.
    • detachContract

      public VoidResponse detachContract(String serverName, String urlMarker, String agreementGUID, String externalReferenceGUID, MetadataSourceRequestBody requestBody)
      Detach an agreement from an external reference describing the location of the contract documents.
      Parameters:
      serverName - name of called server
      urlMarker - view service URL marker
      agreementGUID - unique identifier of the agreement
      externalReferenceGUID - unique identifier of the external reference describing the location of the contract
      requestBody - description of the relationship.
      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 urlMarker, String collectionGUID, boolean cascadedDelete, MetadataSourceRequestBody requestBody)
      Delete a collection. It is detached from all parent elements. If members are anchored to the collection then they are also deleted.
      Parameters:
      serverName - name of called server.
      urlMarker - view service URL marker
      collectionGUID - unique identifier of the collection
      cascadedDelete - should nested collections be deleted? If false, the delete fails if there are nested collections. If true, nested collections are delete - but not member elements unless they are anchored to 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 CollectionMembersResponse getCollectionMembers(String serverName, String urlMarker, String collectionGUID, int startFrom, int pageSize, ResultsRequestBody requestBody)
      Return a list of elements that are a member of a collection.
      Parameters:
      serverName - name of called server.
      urlMarker - view service URL marker
      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.
    • getCollectionGraph

      public CollectionGraphResponse getCollectionGraph(String serverName, String urlMarker, String collectionGUID, int startFrom, int pageSize, ResultsRequestBody requestBody)
      Return a graph of elements that are the nested members of a collection along with elements immediately connected to the starting collection. The result includes a mermaid graph of the returned elements.
      Parameters:
      serverName - name of called server.
      urlMarker - view service URL marker
      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 collection 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 urlMarker, String collectionGUID, String elementGUID, RelationshipRequestBody requestBody)
      Add an element to a collection.
      Parameters:
      serverName - name of called server.
      urlMarker - view service URL marker
      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 urlMarker, String collectionGUID, String elementGUID, boolean replaceAllProperties, RelationshipRequestBody requestBody)
      Update an element's membership to a collection.
      Parameters:
      serverName - name of called server.
      urlMarker - view service URL marker
      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 urlMarker, String collectionGUID, String elementGUID, MetadataSourceRequestBody requestBody)
      Remove an element from a collection.
      Parameters:
      serverName - name of called server.
      urlMarker - view service URL marker
      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.