|
23 | 23 | import org.odpi.openmetadata.frameworks.openmetadata.properties.assets.processes.actions.ActionProperties; |
24 | 24 | import org.odpi.openmetadata.frameworks.openmetadata.properties.assets.processes.actions.ActionRequesterProperties; |
25 | 25 | import org.odpi.openmetadata.frameworks.openmetadata.properties.assets.processes.actions.ActionTargetProperties; |
| 26 | +import org.odpi.openmetadata.frameworks.openmetadata.properties.assets.processes.connectors.CatalogTargetProperties; |
26 | 27 | import org.odpi.openmetadata.frameworks.openmetadata.properties.lineage.LineageRelationshipProperties; |
27 | 28 | import org.odpi.openmetadata.frameworks.openmetadata.refdata.AssignmentType; |
28 | 29 | import org.odpi.openmetadata.frameworks.openmetadata.search.*; |
@@ -555,6 +556,189 @@ public void detachDataSetContent(String userId, |
555 | 556 | } |
556 | 557 |
|
557 | 558 |
|
| 559 | + /** |
| 560 | + * Add an element to an integration connector's workload. |
| 561 | + * |
| 562 | + * @param userId userId of user making request. |
| 563 | + * @param integrationConnectorGUID unique identifier of the integration connector. |
| 564 | + * @param metadataSourceOptions options to control access to open metadata |
| 565 | + * @param catalogTargetProperties properties describing the relationship characteristics. |
| 566 | + * @param elementGUID unique identifier of the target element. |
| 567 | + * @return relationship GUID |
| 568 | + * @throws InvalidParameterException one of the parameters is invalid. |
| 569 | + * @throws PropertyServerException there is a problem updating information in the property server(s). |
| 570 | + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. |
| 571 | + */ |
| 572 | + public String addCatalogTarget(String userId, |
| 573 | + String integrationConnectorGUID, |
| 574 | + String elementGUID, |
| 575 | + MetadataSourceOptions metadataSourceOptions, |
| 576 | + CatalogTargetProperties catalogTargetProperties) throws InvalidParameterException, |
| 577 | + PropertyServerException, |
| 578 | + UserNotAuthorizedException |
| 579 | + { |
| 580 | + final String methodName = "addCatalogTarget"; |
| 581 | + final String assetGUIDParameterName = "integrationConnectorGUID"; |
| 582 | + final String elementGUIDParameterName = "elementGUID"; |
| 583 | + |
| 584 | + propertyHelper.validateUserId(userId, methodName); |
| 585 | + propertyHelper.validateGUID(integrationConnectorGUID, assetGUIDParameterName, methodName); |
| 586 | + propertyHelper.validateGUID(elementGUID, elementGUIDParameterName, methodName); |
| 587 | + |
| 588 | + return openMetadataClient.createRelatedElementsInStore(userId, |
| 589 | + OpenMetadataType.CATALOG_TARGET_RELATIONSHIP.typeName, |
| 590 | + integrationConnectorGUID, |
| 591 | + elementGUID, |
| 592 | + metadataSourceOptions, |
| 593 | + relationshipBuilder.getNewElementProperties(catalogTargetProperties)); |
| 594 | + } |
| 595 | + |
| 596 | + |
| 597 | + /** |
| 598 | + * Update the properties of a catalog target relationship. |
| 599 | + * |
| 600 | + * @param userId calling user |
| 601 | + * @param relationshipGUID unique identifier of the relationship |
| 602 | + * @param updateOptions provides a structure for the additional options when updating a relationship. |
| 603 | + * @param catalogTargetProperties properties describing the catalog target processing characteristics. |
| 604 | + */ |
| 605 | + public void updateCatalogTarget(String userId, |
| 606 | + String relationshipGUID, |
| 607 | + UpdateOptions updateOptions, |
| 608 | + CatalogTargetProperties catalogTargetProperties) throws InvalidParameterException, |
| 609 | + PropertyServerException, |
| 610 | + UserNotAuthorizedException |
| 611 | + { |
| 612 | + openMetadataClient.updateRelationshipInStore(userId, |
| 613 | + relationshipGUID, |
| 614 | + updateOptions, |
| 615 | + relationshipBuilder.getElementProperties(catalogTargetProperties)); |
| 616 | + } |
| 617 | + |
| 618 | + |
| 619 | + /** |
| 620 | + * Retrieve a specific catalog target associated with an integration connector. |
| 621 | + * |
| 622 | + * @param userId identifier of calling user. |
| 623 | + * @param relationshipGUID unique identifier of the relationship. |
| 624 | + * @param getOptions options to control the retrieve |
| 625 | + * |
| 626 | + * @return details of the integration connector and the elements it is to catalog |
| 627 | + * @throws InvalidParameterException one of the parameters is null or invalid. |
| 628 | + * @throws UserNotAuthorizedException user not authorized to issue this request. |
| 629 | + * @throws PropertyServerException problem retrieving the integration connector definition. |
| 630 | + */ |
| 631 | + public OpenMetadataRelationship getCatalogTarget(String userId, |
| 632 | + String relationshipGUID, |
| 633 | + GetOptions getOptions) throws InvalidParameterException, |
| 634 | + UserNotAuthorizedException, |
| 635 | + PropertyServerException |
| 636 | + { |
| 637 | + final String methodName = "getCatalogTarget"; |
| 638 | + final String integrationConnectorGUIDParameter = "relationshipGUID"; |
| 639 | + |
| 640 | + propertyHelper.validateUserId(userId, methodName); |
| 641 | + propertyHelper.validateGUID(relationshipGUID, integrationConnectorGUIDParameter, methodName); |
| 642 | + |
| 643 | + return openMetadataClient.getRelationshipByGUID(userId, relationshipGUID, getOptions); |
| 644 | + } |
| 645 | + |
| 646 | + |
| 647 | + /** |
| 648 | + * Return a list of elements that are target elements for an integration connector. |
| 649 | + * |
| 650 | + * @param userId userId of user making request. |
| 651 | + * @param integrationConnectorGUID unique identifier of the integration connector. |
| 652 | + * @param queryOptions options for query |
| 653 | + * @return list of member details |
| 654 | + * @throws InvalidParameterException one of the parameters is invalid. |
| 655 | + * @throws PropertyServerException there is a problem retrieving information from the property server(s). |
| 656 | + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. |
| 657 | + */ |
| 658 | + public List<OpenMetadataRootElement> getCatalogTargets(String userId, |
| 659 | + String integrationConnectorGUID, |
| 660 | + QueryOptions queryOptions) throws InvalidParameterException, |
| 661 | + PropertyServerException, |
| 662 | + UserNotAuthorizedException |
| 663 | + { |
| 664 | + final String methodName = "getCatalogTargets"; |
| 665 | + final String assetGUIDParameterName = "integrationConnectorGUID"; |
| 666 | + |
| 667 | + propertyHelper.validateUserId(userId, methodName); |
| 668 | + propertyHelper.validateGUID(integrationConnectorGUID, assetGUIDParameterName, methodName); |
| 669 | + propertyHelper.validatePaging(queryOptions, openMetadataClient.getMaxPagingSize(), methodName); |
| 670 | + |
| 671 | + return super.getRelatedRootElements(userId, |
| 672 | + integrationConnectorGUID, |
| 673 | + assetGUIDParameterName, |
| 674 | + 1, |
| 675 | + OpenMetadataType.CATALOG_TARGET_RELATIONSHIP.typeName, |
| 676 | + queryOptions, |
| 677 | + methodName); |
| 678 | + } |
| 679 | + |
| 680 | + |
| 681 | + |
| 682 | + /** |
| 683 | + * Remove an element from an integration connector's workload. |
| 684 | + * |
| 685 | + * @param userId userId of user making request. |
| 686 | + * @param integrationConnectorGUID unique identifier of the integration connector. |
| 687 | + * @param elementGUID unique identifier of the element. |
| 688 | + * @param deleteOptions options to control access to open metadata |
| 689 | + * @throws InvalidParameterException one of the parameters is invalid. |
| 690 | + * @throws PropertyServerException there is a problem updating information in the property server(s). |
| 691 | + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. |
| 692 | + */ |
| 693 | + public void removeCatalogTarget(String userId, |
| 694 | + String integrationConnectorGUID, |
| 695 | + String elementGUID, |
| 696 | + DeleteOptions deleteOptions) throws InvalidParameterException, |
| 697 | + PropertyServerException, |
| 698 | + UserNotAuthorizedException |
| 699 | + { |
| 700 | + final String methodName = "removeCatalogTarget"; |
| 701 | + final String assetGUIDParameterName = "integrationConnectorGUID"; |
| 702 | + final String elementGUIDParameterName = "elementGUID"; |
| 703 | + |
| 704 | + propertyHelper.validateUserId(userId, methodName); |
| 705 | + propertyHelper.validateGUID(integrationConnectorGUID, assetGUIDParameterName, methodName); |
| 706 | + propertyHelper.validateGUID(elementGUID, elementGUIDParameterName, methodName); |
| 707 | + |
| 708 | + openMetadataClient.detachRelatedElementsInStore(userId, |
| 709 | + OpenMetadataType.CATALOG_TARGET_RELATIONSHIP.typeName, |
| 710 | + integrationConnectorGUID, |
| 711 | + elementGUID, |
| 712 | + deleteOptions); |
| 713 | + } |
| 714 | + |
| 715 | + |
| 716 | + /** |
| 717 | + * Remove an element from an integration connector's workload. |
| 718 | + * |
| 719 | + * @param userId userId of user making request. |
| 720 | + * @param relationshipGUID unique identifier of the relationship. |
| 721 | + * @param deleteOptions options to control access to open metadata |
| 722 | + * @throws InvalidParameterException one of the parameters is invalid. |
| 723 | + * @throws PropertyServerException there is a problem updating information in the property server(s). |
| 724 | + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. |
| 725 | + */ |
| 726 | + public void removeCatalogTarget(String userId, |
| 727 | + String relationshipGUID, |
| 728 | + DeleteOptions deleteOptions) throws InvalidParameterException, |
| 729 | + PropertyServerException, |
| 730 | + UserNotAuthorizedException |
| 731 | + { |
| 732 | + final String methodName = "removeCatalogTarget"; |
| 733 | + final String relationshipGUIDParameterName = "relationshipGUID"; |
| 734 | + |
| 735 | + propertyHelper.validateUserId(userId, methodName); |
| 736 | + propertyHelper.validateGUID(relationshipGUID, relationshipGUIDParameterName, methodName); |
| 737 | + |
| 738 | + openMetadataClient.deleteRelationshipInStore(userId, relationshipGUID, deleteOptions); |
| 739 | + } |
| 740 | + |
| 741 | + |
558 | 742 | /** |
559 | 743 | * Attach an API to an endpoint |
560 | 744 | * |
|
0 commit comments