Class SchemaExchangeRESTServices


  • public class SchemaExchangeRESTServices
    extends Object
    DataAssetExchangeRESTServices is the server-side implementation of the Asset Manager OMAS's support for relational databases. It matches the DataAssetExchangeClient.
    • Constructor Detail

      • SchemaExchangeRESTServices

        public SchemaExchangeRESTServices()
        Default constructor
    • Method Detail

      • createSchemaType

        public GUIDResponse createSchemaType​(String serverName,
                                             String userId,
                                             boolean assetManagerIsHome,
                                             SchemaTypeRequestBody requestBody)
        Create a new metadata element to represent a schema type.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        assetManagerIsHome - ensure that only the asset manager can update this schema element
        requestBody - properties about the schema type to store
        Returns:
        unique identifier of the new schema type 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)
      • createSchemaTypeFromTemplate

        public GUIDResponse createSchemaTypeFromTemplate​(String serverName,
                                                         String userId,
                                                         String templateGUID,
                                                         boolean assetManagerIsHome,
                                                         TemplateRequestBody requestBody)
        Create a new metadata element to represent a schema type using an existing metadata element as a template.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        assetManagerIsHome - ensure that only the asset manager can update this schema element
        templateGUID - unique identifier of the metadata element to copy
        requestBody - properties that override the template
        Returns:
        unique identifier of the new schema type 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)
      • updateSchemaType

        public VoidResponse updateSchemaType​(String serverName,
                                             String userId,
                                             String schemaTypeGUID,
                                             boolean isMergeUpdate,
                                             SchemaTypeRequestBody requestBody)
        Update the metadata element representing a schema type.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaTypeGUID - unique identifier of the metadata element to update
        isMergeUpdate - should the new properties be merged with existing properties (true) or completely replace them (false)?
        requestBody - new properties for the metadata element
        Returns:
        void or 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)
      • setupSchemaTypeParent

        public VoidResponse setupSchemaTypeParent​(String serverName,
                                                  String userId,
                                                  String parentElementGUID,
                                                  String parentElementTypeName,
                                                  String schemaTypeGUID,
                                                  boolean assetManagerIsHome,
                                                  AssetManagerIdentifiersRequestBody requestBody)
        Connect a schema type to a data asset, process or port.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaTypeGUID - unique identifier of the schema type to connect
        parentElementGUID - unique identifier of the open metadata element that this schema type is to be connected to
        parentElementTypeName - unique type name of the open metadata element that this schema type is to be connected to
        assetManagerIsHome - ensure that only the asset manager can update this relationship
        requestBody - unique identifier/name of software server capability representing the caller
        Returns:
        void or 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)
      • clearSchemaTypeParent

        public VoidResponse clearSchemaTypeParent​(String serverName,
                                                  String userId,
                                                  String parentElementGUID,
                                                  String parentElementTypeName,
                                                  String schemaTypeGUID,
                                                  AssetManagerIdentifiersRequestBody requestBody)
        Remove the relationship between a schema type and its parent data asset, process or port.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaTypeGUID - unique identifier of the schema type to connect
        parentElementGUID - unique identifier of the open metadata element that this schema type is to be connected to
        parentElementTypeName - unique type name of the open metadata element that this schema type is to be connected to
        requestBody - unique identifier/name of software server capability representing the caller
        Returns:
        void or 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)
      • removeSchemaType

        public VoidResponse removeSchemaType​(String serverName,
                                             String userId,
                                             String schemaTypeGUID,
                                             MetadataCorrelationProperties requestBody)
        Remove the metadata element representing a schema type.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaTypeGUID - unique identifier of the metadata element to remove
        requestBody - unique identifier/name of software server capability representing the caller and external identifier of element
        Returns:
        void or 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)
      • findSchemaType

        public SchemaTypeElementsResponse findSchemaType​(String serverName,
                                                         String userId,
                                                         int startFrom,
                                                         int pageSize,
                                                         SearchStringRequestBody requestBody)
        Retrieve the list of schema type metadata elements that contain the search string. The search string is treated as a regular expression.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        startFrom - paging start point
        pageSize - maximum results that can be returned
        requestBody - string to find in the properties plus external identifiers
        Returns:
        list of matching metadata elements or 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)
      • getSchemaTypeForElement

        public SchemaTypeElementResponse getSchemaTypeForElement​(String serverName,
                                                                 String userId,
                                                                 String parentElementGUID,
                                                                 String parentElementTypeName,
                                                                 AssetManagerIdentifiersRequestBody requestBody)
        Return the schema type associated with a specific open metadata element (data asset, process or port).
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        parentElementGUID - unique identifier of the open metadata element that this schema type is to be connected to
        parentElementTypeName - unique type name of the open metadata element that this schema type is to be connected to
        requestBody - unique identifier/name of software server capability representing the caller
        Returns:
        metadata element describing the schema type associated with the requested parent element or 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)
      • getSchemaTypeByName

        public SchemaTypeElementsResponse getSchemaTypeByName​(String serverName,
                                                              String userId,
                                                              int startFrom,
                                                              int pageSize,
                                                              NameRequestBody requestBody)
        Retrieve the list of schema type metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        startFrom - paging start point
        pageSize - maximum results that can be returned
        requestBody - name to search for plus identifiers
        Returns:
        list of matching metadata elements or 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)
      • getSchemaTypeByGUID

        public SchemaTypeElementResponse getSchemaTypeByGUID​(String serverName,
                                                             String userId,
                                                             String schemaTypeGUID,
                                                             AssetManagerIdentifiersRequestBody requestBody)
        Retrieve the schema type metadata element with the supplied unique identifier.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaTypeGUID - unique identifier of the requested metadata element
        requestBody - unique identifier/name of software server capability representing the caller
        Returns:
        requested metadata element or 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)
      • getSchemaTypeParent

        public ElementHeaderResponse getSchemaTypeParent​(String serverName,
                                                         String userId,
                                                         String schemaTypeGUID,
                                                         AssetManagerIdentifiersRequestBody requestBody)
        Retrieve the header of the metadata element connected to a schema type.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaTypeGUID - unique identifier of the requested metadata element
        requestBody - unique identifier/name of software server capability representing the caller
        Returns:
        header for parent element (data asset, process, port) or 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)
      • createSchemaAttribute

        public GUIDResponse createSchemaAttribute​(String serverName,
                                                  String userId,
                                                  String schemaElementGUID,
                                                  boolean assetManagerIsHome,
                                                  SchemaAttributeRequestBody requestBody)
        Create a new metadata element to represent a schema attribute.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        assetManagerIsHome - ensure that only the asset manager can update this schema attribute
        schemaElementGUID - unique identifier of the schemaType or Schema Attribute where the schema attribute is connected to
        requestBody - properties for the schema attribute
        Returns:
        unique identifier of the new metadata element for the schema attribute or 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)
      • createSchemaAttributeFromTemplate

        public GUIDResponse createSchemaAttributeFromTemplate​(String serverName,
                                                              String userId,
                                                              String schemaElementGUID,
                                                              String templateGUID,
                                                              boolean assetManagerIsHome,
                                                              TemplateRequestBody requestBody)
        Create a new metadata element to represent a schema attribute using an existing metadata element as a template.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaElementGUID - unique identifier of the schemaType or Schema Attribute where the schema attribute is connected to
        templateGUID - unique identifier of the metadata element to copy
        assetManagerIsHome - ensure that only the asset manager can update this schema attribute
        requestBody - properties that override the template
        Returns:
        unique identifier of the new metadata element for the schema attribute or 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)
      • updateSchemaAttribute

        public VoidResponse updateSchemaAttribute​(String serverName,
                                                  String userId,
                                                  String schemaAttributeGUID,
                                                  boolean isMergeUpdate,
                                                  SchemaAttributeRequestBody requestBody)
        Update the properties of the metadata element representing a schema attribute.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaAttributeGUID - unique identifier of the schema attribute to update
        isMergeUpdate - should the new properties be merged with existing properties (true) or completely replace them (false)?
        requestBody - new properties for the schema attribute
        Returns:
        void or 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)
      • setSchemaElementAsCalculatedValue

        public VoidResponse setSchemaElementAsCalculatedValue​(String serverName,
                                                              String userId,
                                                              String schemaElementGUID,
                                                              boolean assetManagerIsHome,
                                                              MetadataCorrelationProperties requestBody)
        Classify the schema type (or attribute if type is embedded) to indicate that it is a calculated value.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaElementGUID - unique identifier of the metadata element to update
        assetManagerIsHome - ensure that only the asset manager can update this classification
        requestBody - unique identifier/name of software server capability representing the caller and external identifier of element
        Returns:
        void or 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)
      • clearSchemaElementAsCalculatedValue

        public VoidResponse clearSchemaElementAsCalculatedValue​(String serverName,
                                                                String userId,
                                                                String schemaElementGUID,
                                                                MetadataCorrelationProperties requestBody)
        Remove the calculated value designation from the schema element.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaElementGUID - unique identifier of the metadata element to update
        requestBody - unique identifier/name of software server capability representing the caller and external identifier of element
        Returns:
        void or 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)
      • setupColumnAsPrimaryKey

        public VoidResponse setupColumnAsPrimaryKey​(String serverName,
                                                    String userId,
                                                    String schemaAttributeGUID,
                                                    boolean assetManagerIsHome,
                                                    PrimaryKeyClassificationRequestBody requestBody)
        Classify the column schema attribute to indicate that it describes a primary key.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        assetManagerIsHome - ensure that only the asset manager can update this classification
        schemaAttributeGUID - unique identifier of the metadata element to update
        requestBody - details of the primary key plus external identifiers
        Returns:
        null or 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)
      • clearColumnAsPrimaryKey

        public VoidResponse clearColumnAsPrimaryKey​(String serverName,
                                                    String userId,
                                                    String schemaAttributeGUID,
                                                    MetadataCorrelationProperties requestBody)
        Remove the primary key designation from the schema attribute.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaAttributeGUID - unique identifier of the metadata element to update
        requestBody - unique identifier/name of software server capability representing the caller and external identifier of element
        Returns:
        void or 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)
      • setupForeignKeyRelationship

        public VoidResponse setupForeignKeyRelationship​(String serverName,
                                                        String userId,
                                                        String primaryKeyGUID,
                                                        String foreignKeyGUID,
                                                        boolean assetManagerIsHome,
                                                        ForeignKeyRequestBody requestBody)
        Link two schema attributes together to show a foreign key relationship.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        primaryKeyGUID - unique identifier of the derived schema element
        foreignKeyGUID - unique identifier of the query target schema element
        assetManagerIsHome - ensure that only the asset manager can update this relationship
        requestBody - properties for the foreign key relationship
        Returns:
        void or 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)
      • updateForeignKeyRelationship

        public VoidResponse updateForeignKeyRelationship​(String serverName,
                                                         String userId,
                                                         String primaryKeyGUID,
                                                         String foreignKeyGUID,
                                                         ForeignKeyRequestBody requestBody)
        Update the relationship properties for the query target.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        primaryKeyGUID - unique identifier of the derived schema element
        foreignKeyGUID - unique identifier of the query target schema element
        requestBody - properties for the foreign key relationship plus external identifiers
        Returns:
        void or 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)
      • clearForeignKeyRelationship

        public VoidResponse clearForeignKeyRelationship​(String serverName,
                                                        String userId,
                                                        String primaryKeyGUID,
                                                        String foreignKeyGUID,
                                                        AssetManagerIdentifiersRequestBody requestBody)
        Remove the foreign key relationship between two schema elements.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        primaryKeyGUID - unique identifier of the derived schema element
        foreignKeyGUID - unique identifier of the query target schema element
        requestBody - unique identifier/name of software server capability representing the caller
        Returns:
        void or 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)
      • removeSchemaAttribute

        public VoidResponse removeSchemaAttribute​(String serverName,
                                                  String userId,
                                                  String schemaAttributeGUID,
                                                  MetadataCorrelationProperties requestBody)
        Remove the metadata element representing a schema attribute.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaAttributeGUID - unique identifier of the metadata element to remove
        requestBody - unique identifier/name of software server capability representing the caller and external identifier of element
        Returns:
        void or 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)
      • findSchemaAttributes

        public SchemaAttributeElementsResponse findSchemaAttributes​(String serverName,
                                                                    String userId,
                                                                    int startFrom,
                                                                    int pageSize,
                                                                    SearchStringRequestBody requestBody)
        Retrieve the list of schema attribute metadata elements that contain the search string. The search string is treated as a regular expression.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        startFrom - paging start point
        pageSize - maximum results that can be returned
        requestBody - string to find in the properties plus external identifiers
        Returns:
        list of matching metadata elements or 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)
      • getNestedAttributes

        public SchemaAttributeElementsResponse getNestedAttributes​(String serverName,
                                                                   String userId,
                                                                   String schemaTypeGUID,
                                                                   int startFrom,
                                                                   int pageSize,
                                                                   AssetManagerIdentifiersRequestBody requestBody)
        Retrieve the list of schema attributes associated with a schemaType.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaTypeGUID - unique identifier of the schemaType of interest
        startFrom - paging start point
        pageSize - maximum results that can be returned
        requestBody - unique identifier/name of software server capability representing the caller
        Returns:
        list of associated metadata elements or 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)
      • getSchemaAttributesByName

        public SchemaAttributeElementsResponse getSchemaAttributesByName​(String serverName,
                                                                         String userId,
                                                                         int startFrom,
                                                                         int pageSize,
                                                                         NameRequestBody requestBody)
        Retrieve the list of schema attribute metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        startFrom - paging start point
        pageSize - maximum results that can be returned
        requestBody - unique identifier/name of software server capability representing the caller
        Returns:
        list of matching metadata elements or 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)
      • getSchemaAttributeByGUID

        public SchemaAttributeElementResponse getSchemaAttributeByGUID​(String serverName,
                                                                       String userId,
                                                                       String schemaAttributeGUID,
                                                                       AssetManagerIdentifiersRequestBody requestBody)
        Retrieve the schema attribute metadata element with the supplied unique identifier.
        Parameters:
        serverName - name of the server to route the request to
        userId - calling user
        schemaAttributeGUID - unique identifier of the requested metadata element
        requestBody - unique identifier/name of software server capability representing the caller
        Returns:
        matching metadata element or 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)