Class MetadataExpertRESTServices

java.lang.Object
org.odpi.openmetadata.tokencontroller.TokenController
org.odpi.openmetadata.viewservices.metadataexpert.server.MetadataExpertRESTServices

public class MetadataExpertRESTServices extends TokenController
The MetadataExpertRESTServices provides the server-side implementation of the Metadata Expert Open Metadata View Service (OMVS). This interface provides access to a person's profile, roles and network.
  • Constructor Details

    • MetadataExpertRESTServices

      public MetadataExpertRESTServices()
      Default constructor
  • Method Details

    • createMetadataElementInStore

      public GUIDResponse createMetadataElementInStore(String serverName, String urlMarker, NewOpenMetadataElementRequestBody requestBody)
      Create a new metadata element in the metadata store. The type name comes from the open metadata types. The selected type also controls the names and types of the properties that are allowed. This version of the method allows access to advanced features such as multiple states and effectivity dates.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      requestBody - properties for the new element
      Returns:
      unique identifier of the new metadata element InvalidParameterException the type name, status or one of the properties is invalid UserNotAuthorizedException the governance action service is not authorized to create this type of element PropertyServerException a problem with the metadata store
    • createMetadataElementFromTemplate

      public GUIDResponse createMetadataElementFromTemplate(String serverName, String urlMarker, OpenMetadataTemplateRequestBody requestBody)
      Create a new metadata element in the metadata store using a template. The type name comes from the open metadata types. The selected type also controls the names and types of the properties that are allowed.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      requestBody - properties for the new element
      Returns:
      unique identifier of the new metadata element InvalidParameterException the type name, status or one of the properties is invalid UserNotAuthorizedException the governance action service is not authorized to create this type of element PropertyServerException a problem with the metadata store
    • updateMetadataElementInStore

      public BooleanResponse updateMetadataElementInStore(String serverName, String urlMarker, String metadataElementGUID, UpdatePropertiesRequestBody requestBody)
      Update the properties of a specific metadata element. The properties must match the type definition associated with the metadata element when it was created. However, it is possible to update a few properties, or replace all them by the value used in the replaceProperties flag.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      metadataElementGUID - unique identifier of the metadata element to update
      requestBody - new properties
      Returns:
      boolean or InvalidParameterException either the unique identifier or the properties are invalid in some way UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException a problem with the metadata store
    • publishMetadataElement

      public VoidResponse publishMetadataElement(String serverName, String urlMarker, String metadataElementGUID, MetadataSourceRequestBody requestBody)
      Update the zone membership to increase its visibility. The publishZones are defined in the user directory.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      metadataElementGUID - unique identifier of the metadata element to update
      requestBody - new status values - use null to leave as is
      Returns:
      void or InvalidParameterException either the unique identifier or the status are invalid in some way UserNotAuthorizedException the user is not authorized to update this element PropertyServerException a problem with the metadata store
    • withdrawMetadataElement

      public VoidResponse withdrawMetadataElement(String serverName, String urlMarker, String metadataElementGUID, MetadataSourceRequestBody requestBody)
      Update the zone membership to reduce its visibility. The defaultZones are defined in the user directory.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      metadataElementGUID - unique identifier of the metadata element to update
      requestBody - new status values - use null to leave as is
      Returns:
      void or InvalidParameterException either the unique identifier or the status are invalid in some way UserNotAuthorizedException the user is not authorized to update this element PropertyServerException a problem with the metadata store
    • updateMetadataElementEffectivityInStore

      public VoidResponse updateMetadataElementEffectivityInStore(String serverName, String urlMarker, String metadataElementGUID, UpdateEffectivityDatesRequestBody requestBody)
      Update the effectivity dates control the visibility of the element through specific APIs.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      metadataElementGUID - unique identifier of the metadata element to update
      requestBody - new status values - use null to leave as is
      Returns:
      void or InvalidParameterException either the unique identifier or the status are invalid in some way UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException a problem with the metadata store
    • deleteMetadataElementInStore

      public VoidResponse deleteMetadataElementInStore(String serverName, String urlMarker, String metadataElementGUID, OpenMetadataDeleteRequestBody requestBody)
      Delete a specific metadata element.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      metadataElementGUID - unique identifier of the metadata element to update
      requestBody - delete request body
      Returns:
      void or InvalidParameterException the unique identifier is null or invalid in some way UserNotAuthorizedException the governance action service is not authorized to delete this element PropertyServerException a problem with the metadata store
    • archiveMetadataElementInStore

      public VoidResponse archiveMetadataElementInStore(String serverName, String urlMarker, String metadataElementGUID, DeleteElementRequestBody requestBody)
      Archive a specific metadata element.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      metadataElementGUID - unique identifier of the metadata element to update
      requestBody - null request body
      Returns:
      void or InvalidParameterException the unique identifier is null or invalid in some way UserNotAuthorizedException the governance action service is not authorized to archive this element PropertyServerException a problem with the metadata store
    • classifyMetadataElementInStore

      public VoidResponse classifyMetadataElementInStore(String serverName, String urlMarker, String metadataElementGUID, String classificationName, NewOpenMetadataClassificationRequestBody requestBody)
      Add a new classification to the metadata element. Note that only one classification with the same name can be attached to a metadata element.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      metadataElementGUID - unique identifier of the metadata element to update
      classificationName - name of the classification to add (if the classification is already present then use reclassify)
      requestBody - properties to store in the new classification. These must conform to the valid properties associated with the classification name
      Returns:
      void or InvalidParameterException the unique identifier or classification name is null or invalid in some way; properties do not match the valid properties associated with the classification's type definition UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException a problem with the metadata store
    • reclassifyMetadataElementInStore

      public VoidResponse reclassifyMetadataElementInStore(String serverName, String urlMarker, String metadataElementGUID, String classificationName, UpdatePropertiesRequestBody requestBody)
      Update the properties of a classification that is currently attached to a specific metadata element.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      metadataElementGUID - unique identifier of the metadata element to update
      classificationName - unique name of the classification to update
      requestBody - new properties for the classification
      Returns:
      void or InvalidParameterException the unique identifier or classification name is null or invalid in some way; properties do not match the valid properties associated with the classification's type definition UserNotAuthorizedException the governance action service is not authorized to update this element/classification PropertyServerException a problem with the metadata store
    • updateClassificationEffectivityInStore

      public VoidResponse updateClassificationEffectivityInStore(String serverName, String urlMarker, String metadataElementGUID, String classificationName, UpdateEffectivityDatesRequestBody requestBody)
      Update the effectivity dates of a specific classification attached to a metadata element. The effectivity dates control the visibility of the classification through specific APIs.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      metadataElementGUID - unique identifier of the metadata element to update
      classificationName - unique name of the classification to update
      requestBody - the dates when this element is active / inactive - null for no restriction
      Returns:
      void or InvalidParameterException either the unique identifier or the status are invalid in some way UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException a problem with the metadata store
    • declassifyMetadataElementInStore

      public VoidResponse declassifyMetadataElementInStore(String serverName, String urlMarker, String metadataElementGUID, String classificationName, MetadataSourceRequestBody requestBody)
      Remove the named classification from a specific metadata element.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      metadataElementGUID - unique identifier of the metadata element to update
      classificationName - unique name of the classification to remove
      requestBody - null request body
      Returns:
      void or InvalidParameterException the unique identifier or classification name is null or invalid in some way UserNotAuthorizedException the governance action service is not authorized to remove this classification PropertyServerException a problem with the metadata store
    • createRelatedElementsInStore

      public GUIDResponse createRelatedElementsInStore(String serverName, String urlMarker, NewRelatedElementsRequestBody requestBody)
      Create a relationship between two metadata elements. It is important to put the right element at each end of the relationship according to the type definition since this will affect how the relationship is interpreted.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      requestBody - the properties of the relationship
      Returns:
      unique identifier of the new relationship or InvalidParameterException the unique identifier's of the metadata elements are null or invalid in some way; the properties are not valid for this type of relationship UserNotAuthorizedException the governance action service is not authorized to create this type of relationship PropertyServerException a problem with the metadata store
    • updateRelatedElementsInStore

      public VoidResponse updateRelatedElementsInStore(String serverName, String urlMarker, String relationshipGUID, UpdatePropertiesRequestBody requestBody)
      Update the properties associated with a relationship.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      relationshipGUID - unique identifier of the relationship to update
      requestBody - new properties for the relationship
      Returns:
      void or InvalidParameterException the unique identifier of the relationship is null or invalid in some way; the properties are not valid for this type of relationship UserNotAuthorizedException the governance action service is not authorized to update this relationship PropertyServerException a problem with the metadata store
    • updateRelatedElementsEffectivityInStore

      public VoidResponse updateRelatedElementsEffectivityInStore(String serverName, String urlMarker, String relationshipGUID, UpdateEffectivityDatesRequestBody requestBody)
      Update the effectivity dates of a specific relationship between metadata elements. The effectivity dates control the visibility of the classification through specific APIs.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      relationshipGUID - unique identifier of the relationship to update
      requestBody - the dates when this element is active / inactive - null for no restriction
      Returns:
      void or InvalidParameterException either the unique identifier or the status are invalid in some way UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException a problem with the metadata store
    • deleteRelatedElementsInStore

      public VoidResponse deleteRelatedElementsInStore(String serverName, String urlMarker, String relationshipGUID, OpenMetadataDeleteRequestBody requestBody)
      Delete a relationship between two metadata elements.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      relationshipGUID - unique identifier of the relationship to delete
      requestBody - options to control access to open metadata
      Returns:
      void or InvalidParameterException the unique identifier of the relationship is null or invalid in some way UserNotAuthorizedException the governance action service is not authorized to delete this relationship PropertyServerException a problem with the metadata store
    • detachRelatedElementsInStore

      public VoidResponse detachRelatedElementsInStore(String serverName, String urlMarker, String relationshipTypeName, String metadataElement1GUID, String metadataElement2GUID, OpenMetadataDeleteRequestBody requestBody)
      Delete all relationships of a particular type between two metadata elements.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      relationshipTypeName - name of the type of relationship to create. This will determine the types of metadata elements that can be related and the properties that can be associated with this relationship.
      metadataElement1GUID - unique identifier of the metadata element at end 1 of the relationship
      metadataElement2GUID - unique identifier of the metadata element at end 2 of the relationship
      requestBody - options to control access to open metadata
      Returns:
      void or InvalidParameterException the unique identifier of the relationship is null or invalid in some way UserNotAuthorizedException the governance action service is not authorized to delete this relationship PropertyServerException a problem with the metadata store
    • getMetadataElementByGUID

      public OpenMetadataElementResponse getMetadataElementByGUID(String serverName, String elementGUID, String urlMarker, GetRequestBody requestBody)
      Retrieve the metadata element using its unique identifier.
      Parameters:
      serverName - name of server instance to route request to
      elementGUID - unique identifier for the metadata element
      urlMarker - view service URL marker
      requestBody - only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
      Returns:
      metadata element properties or InvalidParameterException the unique identifier is null or not known. UserNotAuthorizedException the governance action service is not able to access the element PropertyServerException a problem accessing the metadata store
    • getMetadataElementByUniqueName

      public OpenMetadataElementResponse getMetadataElementByUniqueName(String serverName, String urlMarker, UniqueNameRequestBody requestBody)
      Retrieve the metadata element using its unique name (typically the qualified name).
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      requestBody - unique name for the metadata element
      Returns:
      metadata element properties or InvalidParameterException the unique identifier is null or not known. UserNotAuthorizedException the governance action service is not able to access the element PropertyServerException a problem accessing the metadata store
    • getMetadataElementGUIDByUniqueName

      public GUIDResponse getMetadataElementGUIDByUniqueName(String serverName, String urlMarker, UniqueNameRequestBody requestBody)
      Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name).
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      requestBody - unique name for the metadata element
      Returns:
      metadata element unique identifier (guid) or InvalidParameterException the unique identifier is null or not known or UserNotAuthorizedException the governance action service is not able to access the element or PropertyServerException a problem accessing the metadata store
    • getMetadataElementHistory

      public OpenMetadataElementsResponse getMetadataElementHistory(String serverName, String urlMarker, String elementGUID, HistoryRequestBody requestBody)
      Retrieve all the versions of an element.
      Parameters:
      serverName - name of server instance to route request to
      elementGUID - unique identifier for the metadata element
      urlMarker - view service URL marker
      requestBody - the time window required
      Returns:
      list of matching metadata elements (or null if no elements match the name) or InvalidParameterException the qualified name is null UserNotAuthorizedException the governance action service is not able to access the element PropertyServerException a problem accessing the metadata store
    • getClassificationHistory

      public AttachedClassificationsResponse getClassificationHistory(String serverName, String urlMarker, String elementGUID, String classificationName, HistoryRequestBody requestBody)
      Retrieve all the versions of an element's classification.
      Parameters:
      serverName - name of server instance to route request to
      elementGUID - unique identifier for the metadata element
      classificationName - name of the classification to retrieve
      urlMarker - view service URL marker
      requestBody - the time window required
      Returns:
      list of matching classifications (or null if no elements match the name) or InvalidParameterException the qualified name is null UserNotAuthorizedException the governance action service is not able to access the element PropertyServerException a problem accessing the metadata store
    • findMetadataElementsWithString

      public OpenMetadataElementsResponse findMetadataElementsWithString(String serverName, String urlMarker, SearchStringRequestBody requestBody)
      Retrieve the metadata elements that contain the requested string.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      requestBody - searchString to retrieve
      Returns:
      list of matching metadata elements (or null if no elements match the name) or InvalidParameterException the qualified name is null UserNotAuthorizedException the governance action service is not able to access the element PropertyServerException a problem accessing the metadata store
    • findElementsForAnchor

      public AnchorSearchMatchesResponse findElementsForAnchor(String serverName, String urlMarker, String anchorGUID, SearchStringRequestBody requestBody)
      Return a list of elements with the requested search string in their (display, resource)name, qualified name, title, text, summary, identifier or description. The search string is interpreted as a regular expression (RegEx). The breadth of the search is determined by the supplied anchorGUID.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      anchorGUID - unique identifier of anchor
      requestBody - searchString to retrieve
      Returns:
      list of matching metadata elements (or null if no elements match the name) or InvalidParameterException the qualified name is null UserNotAuthorizedException the governance action service is not able to access the element PropertyServerException a problem accessing the metadata store
    • findElementsInAnchorDomain

      public AnchorSearchMatchesListResponse findElementsInAnchorDomain(String serverName, String urlMarker, String anchorDomainName, SearchStringRequestBody requestBody)
      Return a list of elements with the requested search string in their (display, resource)name, qualified name, title, text, summary, identifier or description. The search string is interpreted as a regular expression (RegEx). The breadth of the search is determined by the supplied domain name. The results are organized by anchor element.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      anchorDomainName - name of open metadata type for the domain
      requestBody - searchString to retrieve
      Returns:
      list of matching metadata elements (or null if no elements match the name) or InvalidParameterException the qualified name is null UserNotAuthorizedException the governance action service is not able to access the element PropertyServerException a problem accessing the metadata store
    • findElementsInAnchorScope

      public AnchorSearchMatchesListResponse findElementsInAnchorScope(String serverName, String urlMarker, String anchorScopeGUID, SearchStringRequestBody requestBody)
      Return a list of elements with the requested search string in their (display, resource)name, qualified name, title, text, summary, identifier or description. The search string is interpreted as a regular expression (RegEx). The breadth of the search is determined by the supplied scope guid. The results are organized by anchor element.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      anchorScopeGUID - unique identifier of the scope to use
      requestBody - searchString to retrieve
      Returns:
      list of matching metadata elements (or null if no elements match the name) or InvalidParameterException the qualified name is null UserNotAuthorizedException the governance action service is not able to access the element PropertyServerException a problem accessing the metadata store
    • getRelatedMetadataElements

      public RelatedMetadataElementListResponse getRelatedMetadataElements(String serverName, String elementGUID, String relationshipTypeName, String urlMarker, int startingAtEnd, ResultsRequestBody requestBody)
      Retrieve the metadata elements connected to the supplied element.
      Parameters:
      serverName - name of server instance to route request to
      elementGUID - unique identifier for the starting metadata element
      relationshipTypeName - type name of relationships to follow (or null for all)
      urlMarker - view service URL marker
      startingAtEnd - indicates which end to retrieve from (0 is "either end"; 1 is end1; 2 is end 2)
      requestBody - only return an element if it is effective at this time. Null means anytime. Use "new Date()" for now.
      Returns:
      list of related elements InvalidParameterException the unique identifier is null or not known; the relationship type is invalid UserNotAuthorizedException the governance action service is not able to access the elements PropertyServerException a problem accessing the metadata store
    • getAnchoredElementsGraph

      public OpenMetadataGraphResponse getAnchoredElementsGraph(String serverName, String urlMarker, String elementGUID, ResultsRequestBody requestBody)
      Return all the elements that are anchored to an asset plus relationships between these elements and to other elements.
      Parameters:
      serverName - name of the server instances for this request
      urlMarker - the identifier of the view service
      elementGUID - unique identifier for the element
      requestBody - effective time and asOfTime
      Returns:
      graph of elements or InvalidParameterException - one of the parameters is null or invalid or PropertyServerException - a problem retrieving the connected asset properties from the property server or UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • getMetadataElementRelationships

      public OpenMetadataRelationshipListResponse getMetadataElementRelationships(String serverName, String metadataElementAtEnd1GUID, String relationshipTypeName, String metadataElementAtEnd2GUID, String urlMarker, ResultsRequestBody requestBody)
      Retrieve the relationships linking to the supplied elements.
      Parameters:
      serverName - name of server instance to route request to
      metadataElementAtEnd1GUID - unique identifier of the metadata element at end 1 of the relationship
      metadataElementAtEnd2GUID - unique identifier of the metadata element at end 2 of the relationship
      relationshipTypeName - type name of relationships to follow (or null for all)
      urlMarker - view service URL marker
      requestBody - only return an element if it is effective at this time. Null means anytime. Use "new Date()" for now.
      Returns:
      list of related elements InvalidParameterException the unique identifier is null or not known; the relationship type is invalid UserNotAuthorizedException the governance action service is not able to access the elements PropertyServerException a problem accessing the metadata store
    • findMetadataElements

      public OpenMetadataElementsResponse findMetadataElements(String serverName, String urlMarker, FindRequestBody requestBody)
      Return a list of metadata elements that match the supplied criteria. The results can be returned over many pages.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      requestBody - properties defining the search criteria
      Returns:
      a list of elements matching the supplied criteria; null means no matching elements in the metadata store. InvalidParameterException one of the search parameters are is invalid UserNotAuthorizedException the governance action service is not able to access the elements PropertyServerException a problem accessing the metadata store
    • findRelationshipsBetweenMetadataElements

      public OpenMetadataRelationshipListResponse findRelationshipsBetweenMetadataElements(String serverName, String urlMarker, FindRelationshipRequestBody requestBody)
      Return a list of relationships that match the requested conditions. The results can be received as a series of pages.
      Parameters:
      serverName - name of server instance to route request to
      urlMarker - view service URL marker
      requestBody - properties defining the search criteria
      Returns:
      a list of relationships - null means no matching relationships - or InvalidParameterException one of the search parameters are is invalid UserNotAuthorizedException the governance action service is not able to access the elements PropertyServerException a problem accessing the metadata store
    • getRelationshipByGUID

      public OpenMetadataRelationshipResponse getRelationshipByGUID(String serverName, String relationshipGUID, String urlMarker, GetRequestBody requestBody)
      Retrieve the relationship using its unique identifier.
      Parameters:
      serverName - name of server instance to route request to
      relationshipGUID - unique identifier for the relationship
      urlMarker - view service URL marker
      requestBody - only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
      Returns:
      metadata element properties or InvalidParameterException the unique identifier is null or not known. UserNotAuthorizedException the governance action service is not able to access the element PropertyServerException a problem accessing the metadata store
    • getRelationshipHistory

      public OpenMetadataRelationshipListResponse getRelationshipHistory(String serverName, String urlMarker, String relationshipGUID, HistoryRequestBody requestBody)
      Retrieve all the versions of an element.
      Parameters:
      serverName - name of server instance to route request to
      relationshipGUID - unique identifier for the metadata element
      urlMarker - view service URL marker
      requestBody - the time window required
      Returns:
      list of matching metadata elements (or null if no elements match the name) or InvalidParameterException the qualified name is null UserNotAuthorizedException the governance action service is not able to access the element PropertyServerException a problem accessing the metadata store