From c3aae61a14b731e3101368164d8087dc35e54e3a Mon Sep 17 00:00:00 2001 From: Mandy Chessell <mandy.e.chessell@gmail.com> Date: Wed, 7 Sep 2022 10:01:59 +0100 Subject: [PATCH 1/9] Improve ConnectedAssetClient and support #6630 Signed-off-by: Mandy Chessell <mandy.e.chessell@gmail.com> --- build.gradle | 13 +- .../assetconsumer/client/AssetConsumer.java | 204 +----- .../AssetConnectionManagementInterface.java | 12 +- .../assetowner/client/AssetOwner.java | 74 +-- .../communityprofile/api/package-info.java | 19 +- .../client/CommunityManagement.java | 58 +- .../client/ConnectedAssetClient.java | 51 ++ .../client/MyProfileManagement.java | 432 ------------- .../client/PersonalProfileManagement.java | 600 ----------------- .../communityprofile/client/package-info.java | 44 ++ .../client/DataManagerBaseClient.java | 8 +- .../client/MetadataSourceClient.java | 26 +- .../client/DiscoveryEngineClient.java | 27 +- .../client/ConnectedAssetClient.java | 273 +------- .../rest/GovernanceProgramRESTClient.java | 253 ++------ .../metadataelements/RelatedElement.java | 175 +++++ .../properties/ClassificationProperties.java | 189 ++++++ .../properties/RelationshipProperties.java | 188 ++++++ .../properties/TemplateProperties.java | 201 ++++++ .../rest/ClassificationRequestBody.java | 129 ++++ .../rest/ExternalSourceRequestBody.java | 145 +++++ .../rest/ReferenceableRequestBody.java | 129 ++++ .../rest/RelatedElementListResponse.java | 148 +++++ .../rest/RelationshipRequestBody.java | 129 ++++ .../rest/TemplateRequestBody.java | 165 +++++ .../client/MetadataSourceClient.java | 29 +- .../client/SecurityManagerBaseClient.java | 607 ++++++++++++++++++ .../rest/SecurityManagerRESTClient.java | 27 + .../OpenMetadataServerSecurityVerifier.java | 6 + .../api/ConnectorFactoryInterface.java} | 24 +- .../client/ConnectedAssetClientBase.java | 270 +++++++- .../APIIntegratorContextManager.java | 3 +- .../DatabaseIntegratorContextManager.java | 3 +- .../DisplayIntegratorContextManager.java | 3 +- .../FilesIntegratorContextManager.java | 3 +- .../SecurityIntegratorContextManager.java | 3 +- .../connector/TopicIntegratorContext.java | 454 ++++++++++++- .../TopicIntegratorContextManager.java | 11 +- .../ClientConstructorTest.java | 40 +- .../errorhandling/InvalidParameterTest.java | 234 +++++-- .../fvt/profiles/CreateProfileTest.java | 63 -- .../ClientConstructorTest.java | 2 +- .../fvt/connections/CreateConnectionTest.java | 8 +- .../fvt/databases/CreateDatabaseTest.java | 2 +- .../errorhandling/InvalidParameterTest.java | 2 +- .../fvt/events/CreateEventsTest.java | 2 +- 46 files changed, 3496 insertions(+), 1992 deletions(-) create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/ConnectedAssetClient.java delete mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MyProfileManagement.java delete mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/PersonalProfileManagement.java create mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/package-info.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/RelatedElement.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ClassificationProperties.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/RelationshipProperties.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/TemplateProperties.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ClassificationRequestBody.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ExternalSourceRequestBody.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ReferenceableRequestBody.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/RelatedElementListResponse.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/RelationshipRequestBody.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/TemplateRequestBody.java create mode 100644 open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerBaseClient.java rename open-metadata-implementation/{access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerConnectorFactoryInterface.java => common-services/ocf-metadata-management/ocf-metadata-api/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/api/ConnectorFactoryInterface.java} (86%) diff --git a/build.gradle b/build.gradle index 561ca129039..ca968a5e849 100644 --- a/build.gradle +++ b/build.gradle @@ -343,14 +343,18 @@ allprojects { task findDependency(type: DependencyInsightReportTask) {} // Whilst all modules have their own javadoc, we only build - // an aggregate for the client and API modules + // an aggregate for the client and API modules plus the REST calls javadoc { include ( "**/api/*.java" ) include ( "**/client/*.java" ) + include ( "**/clients/*.java" ) include ( "**/properties/*.java" ) include ( "**/metadataelements/*.java" ) include ( "**/metadataelement/*.java" ) include ( "**/events/*.java" ) + include ( "**/rest/*.java" ) + include ( "**/exceptions/*.java" ) + include ( "**/beans/*.java" ) include ( "**/ffdc/*.java" ) include ( "**/configuration/*.java" ) include ( "**/configuration/registration/*.java" ) @@ -360,6 +364,7 @@ allprojects { include ( "**/connector/*.java" ) include ( "**/frameworks/*.java" ) include ( "**/context/*.java" ) + include ( "**/contextmanager/*.java" ) include ( "**/graph/*.java" ) include ( "**/model/*.java" ) include ( "**/auditlog/*.java" ) @@ -371,10 +376,14 @@ allprojects { include ( "**/repositoryconnector/*.java" ) include ( "**/repositoryeventmapper/*.java" ) include ( "**/metadatacollectionstore/*.java" ) + include ( "**/metadatacollectionstore/instances/*.java" ) + include ( "**/metadatacollectionstore/typedefs/*.java" ) + include ( "**/metadatacollectionstore/search/*.java" ) include ( "**/metadatacollectionstore/utilities/*.java" ) include ( "**/archiveutilities/*.java" ) - include ( "**/clients/*.java" ) include ( "**/metadatasecurity/*.java" ) + include ( "**/spring/*.java" ) + include ( "**/frameworks/**/*.java" ) } } diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java index d43dd14a509..576af8101c2 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java @@ -12,11 +12,9 @@ import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; -import org.odpi.openmetadata.frameworks.connectors.Connector; import org.odpi.openmetadata.frameworks.connectors.ffdc.*; import org.odpi.openmetadata.frameworks.connectors.properties.AssetUniverse; import org.odpi.openmetadata.frameworks.connectors.properties.beans.Asset; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection; import java.util.ArrayList; import java.util.List; @@ -40,7 +38,6 @@ * about an asset. */ public class AssetConsumer extends ConnectedAssetClientBase implements AssetConsumerAssetInterface, - AssetConsumerConnectorFactoryInterface, AssetConsumerFeedbackInterface, AssetConsumerGlossaryInterface, AssetConsumerLoggingInterface, @@ -63,7 +60,7 @@ public AssetConsumer(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, auditLog); this.restClient = new AssetConsumerRESTClient(serverName, serverPlatformURLRoot, auditLog); } @@ -79,7 +76,7 @@ public AssetConsumer(String serverName, public AssetConsumer(String serverName, String serverPlatformURLRoot) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot); + super(serverName, serverPlatformURLRoot, serviceURLName); this.restClient = new AssetConsumerRESTClient(serverName, serverPlatformURLRoot); } @@ -102,7 +99,7 @@ public AssetConsumer(String serverName, String password, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, auditLog); this.restClient = new AssetConsumerRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); } @@ -123,7 +120,7 @@ public AssetConsumer(String serverName, String userId, String password) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot); + super(serverName, serverPlatformURLRoot, serviceURLName, userId, password); this.restClient = new AssetConsumerRESTClient(serverName, serverPlatformURLRoot, userId, password); } @@ -146,9 +143,7 @@ public AssetConsumer(String serverName, int maxPageSize, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); - - invalidParameterHandler.setMaxPagingSize(maxPageSize); + super(serverName, serverPlatformURLRoot, serviceURLName, maxPageSize, auditLog); this.restClient = restClient; } @@ -223,28 +218,6 @@ public String getAssetForConnectionName(String userId, } - /** - * Returns a comprehensive collection of properties about the requested asset. - * - * @param userId userId of user making request. - * @param assetGUID unique identifier for asset. - * - * @return a comprehensive collection of properties about the asset. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public AssetUniverse getAssetProperties(String userId, - String assetGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - return super.getAssetProperties(serviceURLName, userId, assetGUID); - } - - /** * Return a list of assets with the requested name. The name must match exactly. * @@ -273,6 +246,7 @@ private List<String> getAssetsByName(String userId, return retrieveAssets(userId, name, startFrom, pageSize, urlTemplate, methodName); } + /** * Return a list of assets with the requested search string in their name, qualified name * or description. The search string is interpreted as a regular expression (RegEx). @@ -406,7 +380,7 @@ public List<String> getAssetsByToken(String userId, try { - asset = this.getAssetSummary(restClient, serviceURLName, userId, assetToken, methodName); + asset = this.getAssetSummary(userId, assetToken, methodName); } catch (Exception error) { @@ -426,169 +400,25 @@ public List<String> getAssetsByToken(String userId, } - /* - * =============================================== - * AssetConsumerConnectorFactoryInterface - * =============================================== - */ - - - /** - * Returns the connector corresponding to the supplied connection name. - * - * @param userId userId of user making request. - * @param connectionName this may be the qualifiedName or displayName of the connection. - * - * @return connector instance - or null if there is no connection - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException there are errors in the initialization of the connector. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public Connector getConnectorByName(String userId, - String connectionName) throws InvalidParameterException, - ConnectionCheckedException, - ConnectorCheckedException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getConnectorByName"; - final String nameParameter = "connectionName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(connectionName, nameParameter, methodName); - - Connection connection = super.getConnectionByName(restClient, serviceURLName, userId, connectionName); - - if (connection != null) - { - return this.getConnectorForConnection(restClient, - serviceURLName, - userId, - connection, - methodName); - } - - return null; - } - - - /** - * Returns the connector corresponding to the supplied asset GUID. - * - * @param userId userId of user making request. - * @param assetGUID the unique id for the asset within the metadata repository. - * - * @return connector instance - or null if there is no connection - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException there are errors in the initialization of the connector. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public Connector getConnectorForAsset(String userId, - String assetGUID) throws InvalidParameterException, - ConnectionCheckedException, - ConnectorCheckedException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getConnectorForAsset"; - final String guidParameter = "assetGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); - - Connection connection = this.getConnectionForAsset(restClient, serviceURLName, userId, assetGUID); - - if (connection != null) - { - return this.getConnectorForConnection(restClient, - serviceURLName, - userId, - connection, - methodName); - } - - return null; - } - /** - * Returns the connector corresponding to the supplied connection GUID. + * Returns a comprehensive collection of properties about the requested asset. * - * @param userId userId of user making request. - * @param connectionGUID the unique id for the connection within the metadata repository. + * @param userId userId of user making request. + * @param assetGUID unique identifier for asset. * - * @return connector instance - or null if there is no connection + * @return a comprehensive collection of properties about the asset. * * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException there are errors in the initialization of the connector. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. */ - @Override - public Connector getConnectorByGUID(String userId, - String connectionGUID) throws InvalidParameterException, - ConnectionCheckedException, - ConnectorCheckedException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getConnectorByGUID"; - final String guidParameter = "connectionGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(connectionGUID, guidParameter, methodName); - - Connection connection = super.getConnectionByGUID(restClient, serviceURLName, userId, connectionGUID); - - if (connection != null) - { - return this.getConnectorForConnection(restClient, - serviceURLName, - userId, - connection, - methodName); - } - - return null; - } - - - /** - * Returns the connector corresponding to the supplied connection. - * - * @param userId userId of user making request. - * @param connection the connection object that contains the properties needed to create the connection. - * - * @return connector instance - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException there are errors in the initialization of the connector. - */ - @Override - public Connector getConnectorByConnection(String userId, - Connection connection) throws InvalidParameterException, - ConnectionCheckedException, - ConnectorCheckedException + public AssetUniverse getAssetProperties(String userId, + String assetGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException { - final String methodName = "getConnectorByConnection"; - - invalidParameterHandler.validateUserId(userId, methodName); - - return this.getConnectorForConnection(restClient, serviceURLName, userId, connection, methodName); + return super.getAssetProperties(serviceURLName, userId, assetGUID); } diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetConnectionManagementInterface.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetConnectionManagementInterface.java index 00a5edb1aeb..8d817c78123 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetConnectionManagementInterface.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-api/src/main/java/org/odpi/openmetadata/accessservices/assetowner/api/AssetConnectionManagementInterface.java @@ -48,7 +48,7 @@ public interface AssetConnectionManagementInterface * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - String createConnection(String userId, + String createConnection(String userId, ConnectionProperties connectionProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; @@ -68,8 +68,8 @@ String createConnection(String userId, * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - String createConnectionFromTemplate(String userId, - String templateGUID, + String createConnectionFromTemplate(String userId, + String templateGUID, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; @@ -87,9 +87,9 @@ String createConnectionFromTemplate(String userId, * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - void updateConnection(String userId, - String connectionGUID, - boolean isMergeUpdate, + void updateConnection(String userId, + String connectionGUID, + boolean isMergeUpdate, ConnectionProperties connectionProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException; diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java index b13f9492af0..159931551df 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java @@ -11,6 +11,7 @@ import org.odpi.openmetadata.accessservices.assetowner.rest.ConnectionResponse; import org.odpi.openmetadata.accessservices.assetowner.rest.ConnectorTypeResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.*; +import org.odpi.openmetadata.accessservices.assetowner.api.AssetKnowledgeInterface; import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.Connector; @@ -59,7 +60,7 @@ public AssetOwner(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, auditLog); this.restClient = new AssetOwnerRESTClient(serverName, serverPlatformURLRoot, auditLog); } @@ -76,7 +77,7 @@ public AssetOwner(String serverName, public AssetOwner(String serverName, String serverPlatformURLRoot) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot); + super(serverName, serverPlatformURLRoot, serviceURLName); this.restClient = new AssetOwnerRESTClient(serverName, serverPlatformURLRoot); } @@ -101,7 +102,7 @@ public AssetOwner(String serverName, String password, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, auditLog); this.restClient = new AssetOwnerRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); } @@ -123,7 +124,7 @@ public AssetOwner(String serverName, String userId, String password) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot); + super(serverName, serverPlatformURLRoot, serviceURLName, userId, password); this.restClient = new AssetOwnerRESTClient(serverName, serverPlatformURLRoot, userId, password); } @@ -146,7 +147,7 @@ public AssetOwner(String serverName, int maxPageSize, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, auditLog); invalidParameterHandler.setMaxPagingSize(maxPageSize); @@ -154,6 +155,27 @@ public AssetOwner(String serverName, } + /** + * Returns a comprehensive collection of properties about the requested asset. + * + * @param userId userId of user making request. + * @param assetGUID unique identifier for asset. + * + * @return a comprehensive collection of properties about the asset. + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + public AssetUniverse getAssetProperties(String userId, + String assetGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return super.getAssetProperties(serviceURLName, userId, assetGUID); + } + + /** * Return the asset subtype names. * @@ -481,7 +503,7 @@ public void attachSchemaTypeToAsset(String userId, /** - * Unlinks the schema from the asset but does not delete it. This means it can be be reattached to a different asset. + * Unlinks the schema from the asset but does not delete it. This means it can be reattached to a different asset. * * @param userId calling user * @param assetGUID unique identifier of the asset that the schema is to be attached to @@ -650,7 +672,7 @@ public String addSchemaAttribute(String serverName, * Adds a connection to an asset. Assets can have multiple connections attached. * * @param userId calling user - * @param assetGUID unique identifier of the attest to attach the connection to + * @param assetGUID unique identifier of the asset to attach the connection to * @param assetSummary summary of the asset that is stored in the relationship between the asset and the connection. * @param connection connection object. If the connection is already stored (matching guid) * then the existing connection is used. @@ -957,7 +979,7 @@ public void updateAssetZones(String userId, * @param userId calling user * @param assetGUID unique identifier for the asset to update * @param ownerId userId or profileGUID of the owner - or null to clear the field - * @param ownerType indicator of the type of Id provides above - or null to clear the field + * @param ownerType indicator of the type of identifier provided above - or null to clear the field * @throws InvalidParameterException userId is null * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem @@ -998,7 +1020,7 @@ public void updateAssetOwner(String userId, * @param userId calling user * @param assetGUID unique identifier for the asset to update * @param ownerId unique identifier/property of the owner - or null to clear the field - * @param ownerTypeName name of the type of Id provided above - or null to clear the field + * @param ownerTypeName name of the type of identifier provided above - or null to clear the field * @param ownerPropertyName name of the property that describes the ownerId * * @throws InvalidParameterException userId is null @@ -1856,7 +1878,7 @@ public ConnectionElement getConnectionByGUID(String userId, /** - * Create a new metadata element to represent a endpoint. Classifications can be added later to define the + * Create a new metadata element to represent an endpoint. Classifications can be added later to define the * type of endpoint. * * @param userId calling user @@ -1893,7 +1915,7 @@ public String createEndpoint(String userId, /** - * Create a new metadata element to represent a endpoint using an existing metadata element as a template. + * Create a new metadata element to represent an endpoint using an existing metadata element as a template. * The template defines additional classifications and relationships that should be added to the new endpoint. * * @param userId calling user @@ -2277,6 +2299,8 @@ public ConnectorTypeElement getConnectorTypeByGUID(String userId, connectorTypeGUID); return restResult.getElement(); } + + /* * ============================================== * AssetReviewInterface @@ -2401,28 +2425,6 @@ public AssetElement getAssetSummary(String userId, } - /** - * Returns a comprehensive collection of properties about the requested asset. - * - * @param userId userId of user making request. - * @param assetGUID unique identifier for asset. - * - * @return a comprehensive collection of properties about the asset. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public AssetUniverse getAssetProperties(String userId, - String assetGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - return super.getAssetProperties(serviceURLName, userId, assetGUID); - } - - /** * Return a connector for the asset to enable the calling user to access the content. * @@ -2472,7 +2474,7 @@ public Connector getConnectorToAsset(String userId, * @param userId calling user * @param assetGUID unique identifier of the asset * @param startingFrom position in the list (used when there are so many reports that paging is needed - * @param maximumResults maximum number of elements to return an this call + * @param maximumResults maximum number of elements to return on this call * @return list of discovery analysis reports * @throws InvalidParameterException one of the parameters is null or invalid. * @throws UserNotAuthorizedException user not authorized to issue this request. @@ -2673,10 +2675,10 @@ public List<Annotation> getExtendedAnnotations(String userId, * Deletes an asset and all of its associated elements such as schema, connections (unless they are linked to * another asset), discovery reports and associated feedback. * - * Given the depth of the delete performed by this call, it should be used with care. + * Given the depth of the delete request performed by this call, it should be used with care. * * @param userId calling user - * @param assetGUID unique identifier of the attest to attach the connection to + * @param assetGUID unique identifier of the asset to remove * @throws InvalidParameterException full path or userId is null * @throws PropertyServerException problem accessing property server * @throws UserNotAuthorizedException security access problem diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/package-info.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/package-info.java index 88dc4799e81..4c7a55adae9 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/package-info.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/package-info.java @@ -3,22 +3,9 @@ /** * The Community Profile Open Metadata Access Service (OMAS) is used by tools and administrators to - * maintain information associated with individuals and communities. The client interfaces are targeted - * at different use cases. They are as follows: + * maintain information associated with individuals and communities. The client interfaces are each targeted + * at different use cases. * - * <ul> - * <li>MyProfileManagement covers the management of a personal profile by the userId - * associated with the profile.</li> - * - * <li>MyNotificationsInterface covers the management of personal notifications that derive from changes - * to the metadata.</li> - * - * <li>PersonalProfileManagementInterface covers the setting up and removal of personal profiles by an administrator.</li> - * - * <li>CollectionManagement covers the management of collections of resources that can be attached to - * personal profiles, projects or communities.</li> - * - * <li>CommunityManagementInterface covers the administrator's role in setting up and shutting down communities.</li> - * </ul> + * Not all client interfaces are implemented. The interface that begin "MyXXX" are expected to move to a new View service called My Profile OMVS. */ package org.odpi.openmetadata.accessservices.communityprofile.api; diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java index d386bf2d03c..06a92038e93 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java @@ -23,10 +23,16 @@ /** * CommunityManagerClient supports the APIs to maintain communities and their related objects. + * + * It issues REST API calls to the Open Metadata Server running Community Profile OMAS that have a URL that begins: + * + * <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId} + * */ public class CommunityManagement extends CommunityProfileBaseClient implements CommunityManagementInterface { - private static final String communityURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/communities"; + private static final String baseURLTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}"; + private static final String communityURLTemplatePrefix = baseURLTemplatePrefix + "/communities"; /** @@ -130,10 +136,14 @@ public CommunityManagement(String serverName, /** * Create a new metadata element to represent a community. * + * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities. + * The request body is of type <i>ReferenceableRequestBody</i>. This holds the external source identifiers and the referenceableProperties are set to the supplied <i>communityProperties</i>. + * The HTTP response is of type <i>GUIDResponse</i>. + * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller - * @param communityProperties properties about the community to store + * @param communityProperties properties about the community to store. The qualifiedName property must be supplied and must be unique. * * @return unique identifier of the new community * @@ -160,6 +170,10 @@ public String createCommunity(String userId, /** * Create a new metadata element to represent a community using an existing metadata element as a template. * + * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/from-template/{templateGUID}. + * The request body is of type <i>TemplateRequestBody</i>. This holds the external source identifiers and the supplied <i>templateProperties</i>. + * The HTTP response is of type <i>GUIDResponse</i>. + * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller @@ -189,8 +203,11 @@ public String createCommunityFromTemplate(String userId, /** - * Update the metadata element representing a community. It is possible to use the subtype property classes or - * set up specialized properties in extended properties. + * Update the metadata element representing a community. + * + * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/{communityGUID}?isMergeUpdate={isMergeUpdate}. + * The request body is of type <i>ReferenceableRequestBody</i>. This holds the external source identifiers and the referenceableProperties are set to the supplied <i>communityProperties</i>. + * The HTTP response is of type <i>VoidResponse</i>. * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller @@ -225,6 +242,10 @@ public void updateCommunity(String userId, /** * Create a membership relationship between a community and a person role to show that anyone appointed to the role is a member of the community. * + * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/{communityGUID}/community-roles/{personRoleGUID}. + * The request body is of type <i>RelationshipRequestBody</i>. This holds the external source identifiers and the relationshipProperties are set to the supplied <i>membershipProperties</i>. + * The HTTP response is of type <i>VoidResponse</i>. + * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller @@ -259,6 +280,10 @@ public void setupCommunityRole(String userId, /** * Remove a membership relationship between a community and a person role. * + * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/{communityGUID}/community-roles/{personRoleGUID}/delete. + * The request body is of type <i>ExternalSourceRequestBody</i>. This holds the external source identifiers. + * The HTTP response is of type <i>VoidResponse</i>. + * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller @@ -298,6 +323,10 @@ public void clearCommunityRole(String userId, /** * Remove the metadata element representing a community. * + * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/{communityGUID}/delete. + * The request body is of type <i>ExternalSourceRequestBody</i>. This holds the external source identifiers. + * The HTTP response is of type <i>VoidResponse</i>. + * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller @@ -327,6 +356,10 @@ public void removeCommunity(String userId, * Retrieve the list of metadata elements that contain the search string. * The search string is treated as a regular expression. * + * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/by-search-string?startFrom={startFrom}&pageSize={pageSize}. + * The request body is of type <i>SearchStringRequestBody</i>. This holds the search string. + * The HTTP response is of type <i>CommunityListResponse</i>. + * * @param userId calling user * @param searchString string to find in the properties * @param startFrom paging start point @@ -376,6 +409,10 @@ public List<CommunityElement> findCommunities(String userId, * Retrieve the list of metadata elements with a matching qualified or display name. * There are no wildcards supported on this request. * + * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/by-name?startFrom={startFrom}&pageSize={pageSize}. + * The request body is of type <i>NameRequestBody</i>. This holds the name to search for. + * The HTTP response is of type <i>CommunityListResponse</i>. + * * @param userId calling user * @param name name to search for * @param startFrom paging start point @@ -422,7 +459,10 @@ public List<CommunityElement> getCommunitiesByName(String userId, /** - * Retrieve the list of communities. + * Retrieve the list of all communities defined in open metadata. + * + * This method issues an HTTP GET command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities?startFrom={startFrom}&pageSize={pageSize}. + * The HTTP response is of type <i>CommunityListResponse</i>. * * @param userId calling user * @param startFrom paging start point @@ -463,6 +503,9 @@ public List<CommunityElement> getCommunities(String userId, /** * Return information about the person roles linked to a community. * + * This method issues an HTTP GET command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/person-roles/by-community/{communityGUID}?startFrom={startFrom}&pageSize={pageSize}. + * The HTTP response is of type <i>PersonRoleListResponse</i>. + * * @param userId calling user * @param communityGUID unique identifier for the community * @param startFrom index of the list to start from (0 for start) @@ -488,7 +531,7 @@ public List<PersonRoleElement> getRolesForCommunity(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(communityGUID, guidPropertyName, methodName); - final String urlTemplate = serverPlatformURLRoot + communityURLTemplatePrefix + "/person-roles/by-community/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + baseURLTemplatePrefix + "/person-roles/by-community/{2}?startFrom={3}&pageSize={4}"; PersonRoleListResponse restResult = restClient.callPersonRoleListGetRESTCall(methodName, urlTemplate, @@ -505,6 +548,9 @@ public List<PersonRoleElement> getRolesForCommunity(String userId, /** * Retrieve the metadata element with the supplied unique identifier. * + * This method issues an HTTP GET command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/{communityGUID}?startFrom={startFrom}&pageSize={pageSize}. + * The HTTP response is of type <i>CommunityResponse</i>. + * * @param userId calling user * @param communityGUID unique identifier of the requested metadata element * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/ConnectedAssetClient.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/ConnectedAssetClient.java new file mode 100644 index 00000000000..2724884cbad --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/ConnectedAssetClient.java @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.communityprofile.client; + +import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; + +/** + * ConnectedAssetClient manages the retrieval of connections, and the creation of resource connectors used to access the + * content of data sources and services. + */ +public class ConnectedAssetClient extends ConnectedAssetClientBase +{ + private final static String serviceURLMarker = "community-profile"; + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ConnectedAssetClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + super(serviceURLMarker, serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param serverUserId caller's userId embedded in all HTTP requests + * @param serverPassword caller's userId embedded in all HTTP requests + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ConnectedAssetClient(String serverName, + String serverPlatformURLRoot, + String serverUserId, + String serverPassword) throws InvalidParameterException + { + super(serviceURLMarker, serverName, serverPlatformURLRoot, serverUserId, serverPassword); + } +} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MyProfileManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MyProfileManagement.java deleted file mode 100644 index 7699d097eff..00000000000 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/MyProfileManagement.java +++ /dev/null @@ -1,432 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.communityprofile.client; - -import org.odpi.openmetadata.accessservices.communityprofile.api.MyPersonalProfileInterface; -import org.odpi.openmetadata.accessservices.communityprofile.client.rest.CommunityProfileRESTClient; -import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ContactMethodElement; -import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.PersonalProfileUniverse; -import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.AssetCollectionMember; -import org.odpi.openmetadata.accessservices.communityprofile.properties.ContactMethodType; -import org.odpi.openmetadata.accessservices.communityprofile.rest.*; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; -import org.odpi.openmetadata.commonservices.ffdc.rest.CountResponse; -import org.odpi.openmetadata.frameworks.auditlog.AuditLog; -import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; -import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; -import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; - -import java.util.List; -import java.util.Map; - -/** - * This client covers the management of a user's personal profile. - */ -public class MyProfileManagement implements MyPersonalProfileInterface -{ - private final String serverName; /* Initialized in constructor */ - private final String serverPlatformURLRoot; /* Initialized in constructor */ - private final CommunityProfileRESTClient restClient; /* Initialized in constructor */ - - private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - - /** - * Create a new client with no authentication embedded in the HTTP request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * - * @throws InvalidParameterException bad input parameters - */ - public MyProfileManagement(String serverName, - String serverPlatformURLRoot) throws InvalidParameterException - { - final String methodName = "Constructor (no security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot); - } - - - /** - * Create a new client with no authentication embedded in the HTTP request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * @param auditLog logging destination - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public MyProfileManagement(String serverName, - String serverPlatformURLRoot, - AuditLog auditLog) throws InvalidParameterException - { - final String methodName = "Constructor (no security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, auditLog); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * @param userId caller's userId embedded in all HTTP requests - * @param password caller's userId embedded in all HTTP requests - * - * @throws InvalidParameterException bad input parameters - */ - public MyProfileManagement(String serverName, - String serverPlatformURLRoot, - String userId, - String password) throws InvalidParameterException - { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, userId, password); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * @param userId caller's userId embedded in all HTTP requests - * @param password caller's userId embedded in all HTTP requests - * @param auditLog logging destination - * - * @throws InvalidParameterException bad input parameters - */ - public MyProfileManagement(String serverName, - String serverPlatformURLRoot, - String userId, - String password, - AuditLog auditLog) throws InvalidParameterException - { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * @param restClient pre-initialized REST client - * @param maxPageSize pre-initialized parameter limit - * @throws InvalidParameterException there is a problem with the information about the remote OMAS - */ - public MyProfileManagement(String serverName, - String serverPlatformURLRoot, - CommunityProfileRESTClient restClient, - int maxPageSize) throws InvalidParameterException - { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.setMaxPagingSize(maxPageSize); - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = restClient; - } - - - /** - * Return the profile for this user. - * - * @param userId userId of the user making the request. - * - * @return profile object - * - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public PersonalProfileUniverse getMyProfile(String userId) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getMyProfile"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/my-profile"; - - invalidParameterHandler.validateUserId(userId, methodName); - - PersonalProfileResponse restResult = restClient.callPersonalProfileGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - userId); - - return restResult.getPersonalProfile(); - } - - - /** - * Return the total karma points for this user. - * - * @param userId userId of the user making the request. - * - * @return int - * - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public long getMyKarmaPoints(String userId) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getMyKarmaPoints"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/my-profile/karma-points"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.validateUserId(userId, methodName); - - CountResponse restResult = restClient.callCountGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - userId); - - return restResult.getCount(); - } - - - /** - * Create or update the profile for the requesting user. - * - * @param userId calling user - * @param qualifiedName personnel/serial/unique employee number of the individual. - * @param fullName full name of the person. - * @param knownName known name or nickname of the individual. - * @param jobTitle job title of the individual. - * @param jobRoleDescription job description of the individual. - * @param additionalProperties additional properties about the individual. - * - * @throws InvalidParameterException one of the parameters is invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void setUpMyProfile(String userId, - String qualifiedName, - String fullName, - String knownName, - String jobTitle, - String jobRoleDescription, - Map<String, String> additionalProperties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "setUpMyProfile"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/my-profile"; - - final String qualifiedNameParameterName = "qualifiedName"; - final String knownNameParameterName = "knownName"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); - invalidParameterHandler.validateName(knownName, knownNameParameterName, methodName); - - MyProfileRequestBody requestBody = new MyProfileRequestBody(); - requestBody.setQualifiedName(qualifiedName); - requestBody.setFullName(fullName); - requestBody.setKnownName(knownName); - requestBody.setJobTitle(jobTitle); - requestBody.setJobRoleDescription(jobRoleDescription); - requestBody.setAdditionalProperties(additionalProperties); - - - restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId); - } - - - /** - * Delete the profile for the requesting user. - * - * @param userId the name of the calling user. - * - * @throws InvalidParameterException one of the parameters is invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void deleteMyProfile(String userId, - String qualifiedName) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "deleteMyProfile"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/my-profile/delete"; - - final String qualifiedNameParameterName = "qualifiedName"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); - - PersonalProfileValidatorRequestBody requestBody = new PersonalProfileValidatorRequestBody(); - - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId); - } - - - - /** - * Return the list of contact methods for this user. - * - * @param UserId userId of the user making the request. - * - * @return list of contact methods - * - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public List<ContactMethodElement> getMyContactDetails(String UserId) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - return null; - } - - - /** - * Add a new contact method to the requesting user's profile. - * - * @param userId the name of the calling user. - * @param type type of contact method. - * @param service service for the contact method. - * @param value account name for the service. - * - * @return unique identifier (guid) for the new contact method. - * - * @throws InvalidParameterException the userId is null or invalid. Another property is invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public String addMyContactMethod(String userId, - ContactMethodType type, - String service, - String value) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - return null; - } - - - /** - * Remove an obsolete contact method from the requesting user's profile. - * - * @param userId the name of the calling user. - * @param contactMethodGUID unique identifier (guid) for the obsolete contact method. - * @param type type of contact method. This is used to confirm that the GUID is the right one. - * - * @throws InvalidParameterException the userId is null or invalid. Another property is invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public void deleteMyContactMethod(String userId, - String contactMethodGUID, - ContactMethodType type) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - } - - - /** - * Return a list of assets that the specified user has added to their favorites list. - * - * @param userId userId of user making request. - * @param startFrom index of the list to start from (0 for start) - * @param pageSize maximum number of elements to return. - * - * @return list of asset details - * - * @throws InvalidParameterException one of the parameters is invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - public List<AssetCollectionMember> getMyAssets(String userId, - int startFrom, - int pageSize) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - return null; - } - - - /** - * Add an asset to the identified user's list of favorite assets. - * - * @param userId userId of user making request. - * @param assetGUID unique identifier of the asset. - * - * @throws InvalidParameterException one of the parameters is invalid. - * @throws PropertyServerException there is a problem updating information in the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - public void addToMyAssets(String userId, - String assetGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - - } - - - /** - * Remove an asset from identified user's list of favorite assets. - * - * @param userId userId of user making request. - * @param assetGUID unique identifier of the asset. - * - * @throws InvalidParameterException one of the parameters is invalid. - * @throws PropertyServerException there is a problem updating information in the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - public void removeFromMyAssets(String userId, - String assetGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - - } -} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/PersonalProfileManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/PersonalProfileManagement.java deleted file mode 100644 index 07abfd147ad..00000000000 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/PersonalProfileManagement.java +++ /dev/null @@ -1,600 +0,0 @@ -/* SPDX-License-Identifier: Apache-2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.communityprofile.client; - - -import org.odpi.openmetadata.accessservices.communityprofile.api.PersonalProfileManagementInterface; -import org.odpi.openmetadata.accessservices.communityprofile.client.rest.CommunityProfileRESTClient; -import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.PersonalProfileUniverse; -import org.odpi.openmetadata.accessservices.communityprofile.properties.ContactMethodProperties; -import org.odpi.openmetadata.accessservices.communityprofile.properties.ContactMethodType; -import org.odpi.openmetadata.accessservices.communityprofile.rest.*; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; -import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; -import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; -import org.odpi.openmetadata.frameworks.auditlog.AuditLog; -import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; -import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; -import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; - -import java.util.List; -import java.util.Map; - -/** - * CommunityProfileLeadership provides the client-side interface for the Governance Program Open Metadata Access Service (OMAS). - * This client, manages all the interaction with an open metadata repository. It is initialized with the URL - * of the server that is running the Open Metadata Access Services. This server is responsible for locating and - * managing the governance program definitions exchanged with this client. - */ -public class PersonalProfileManagement implements PersonalProfileManagementInterface -{ - private final String serverName; /* Initialized in constructor */ - private final String serverPlatformURLRoot; /* Initialized in constructor */ - private final CommunityProfileRESTClient restClient; /* Initialized in constructor */ - - private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - - - /** - * Create a new client with no authentication embedded in the HTTP request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * - * @throws InvalidParameterException bad input parameters - */ - public PersonalProfileManagement(String serverName, - String serverPlatformURLRoot) throws InvalidParameterException - { - final String methodName = "Constructor (no security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot); - } - - - /** - * Create a new client with no authentication embedded in the HTTP request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * @param auditLog logging destination - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public PersonalProfileManagement(String serverName, - String serverPlatformURLRoot, - AuditLog auditLog) throws InvalidParameterException - { - final String methodName = "Constructor (no security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, auditLog); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * @param userId caller's userId embedded in all HTTP requests - * @param password caller's userId embedded in all HTTP requests - * - * @throws InvalidParameterException bad input parameters - */ - public PersonalProfileManagement(String serverName, - String serverPlatformURLRoot, - String userId, - String password) throws InvalidParameterException - { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, userId, password); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * @param userId caller's userId embedded in all HTTP requests - * @param password caller's userId embedded in all HTTP requests - * @param auditLog logging destination - * - * @throws InvalidParameterException bad input parameters - */ - public PersonalProfileManagement(String serverName, - String serverPlatformURLRoot, - String userId, - String password, - AuditLog auditLog) throws InvalidParameterException - { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); - } - - - /** - * Create a new client that passes userId and password in each HTTP request. This is the - * userId/password of the calling server. The end user's userId is sent on each request. - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * @param restClient pre-initialized REST client - * @param maxPageSize pre-initialized parameter limit - * @throws InvalidParameterException there is a problem with the information about the remote OMAS - */ - public PersonalProfileManagement(String serverName, - String serverPlatformURLRoot, - CommunityProfileRESTClient restClient, - int maxPageSize) throws InvalidParameterException - { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.setMaxPagingSize(maxPageSize); - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = restClient; - } - - - /** - * Create a personal profile for an individual who is to be appointed to a governance role but does not - * have a profile in open metadata. - * - * @param userId the name of the calling user. - * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local - * @param externalSourceName name of the software server capability entity that represented the external source - * @param profileUserId userId of the individual whose profile this is. - * @param qualifiedName personnel/serial/unique employee number of the individual. - * @param fullName full name of the person. - * @param knownName known name or nickname of the individual. - * @param jobTitle job title of the individual. - * @param jobRoleDescription job description of the individual. - * @param additionalProperties additional properties about the individual. - * - * @return Unique identifier for the personal profile. - * - * @throws InvalidParameterException the employee number or full name is null. - * @throws PropertyServerException the server is not available. - * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. - */ - @Override - public String createPersonalProfile(String userId, - String externalSourceGUID, - String externalSourceName, - String profileUserId, - String qualifiedName, - String fullName, - String knownName, - String jobTitle, - String jobRoleDescription, - Map<String, String> additionalProperties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "createPersonalProfile"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/personal-profiles"; - - final String profileUserIdParameterName = "profileUserId"; - final String qualifiedParameterName = "qualifiedName"; - final String knownNameParameterName = "knownName"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(profileUserId, profileUserIdParameterName, methodName); - invalidParameterHandler.validateName(qualifiedName, qualifiedParameterName, methodName); - invalidParameterHandler.validateName(knownName, knownNameParameterName, methodName); - - PersonalProfileRequestBody requestBody = new PersonalProfileRequestBody(); - requestBody.setOriginatingSystemGUID(externalSourceGUID); - requestBody.setOriginatingSystemName(externalSourceName); - requestBody.setProfileUserId(profileUserId); - requestBody.setQualifiedName(qualifiedName); - requestBody.setFullName(fullName); - requestBody.setKnownName(knownName); - requestBody.setJobTitle(jobTitle); - requestBody.setJobRoleDescription(jobRoleDescription); - requestBody.setAdditionalProperties(additionalProperties); - - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId); - - return restResult.getGUID(); - } - - - /** - * Update properties for the personal properties. Null values result in empty fields in the profile. - * - * @param userId the name of the calling user. - * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local - * @param externalSourceName name of the software server capability entity that represented the external source - * @param profileGUID unique identifier for the profile. - * @param qualifiedName personnel/serial/unique employee number of the individual. Used to verify the profileGUID. - * @param fullName full name of the person. - * @param knownName known name or nickname of the individual. - * @param jobTitle job title of the individual. - * @param jobRoleDescription job description of the individual. - * @param profileProperties properties about the individual for a new type that is the subclass of Person. - * @param additionalProperties additional properties about the individual. - * - * @throws InvalidParameterException the known name is null or the qualifiedName does not match the profileGUID. - * @throws PropertyServerException the server is not available. - * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. - */ - @Override - public void updatePersonalProfile(String userId, - String externalSourceGUID, - String externalSourceName, - String profileGUID, - String qualifiedName, - String fullName, - String knownName, - String jobTitle, - String jobRoleDescription, - Map<String, Object> profileProperties, - Map<String, String> additionalProperties) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "updatePersonalProfile"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/personal-profiles/{2}"; - - final String guidParameterName = "profileGUID"; - final String qualifiedNameParameterName = "qualifiedName"; - final String knownNameParameterName = "knownName"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(profileGUID, guidParameterName, methodName); - invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); - invalidParameterHandler.validateName(knownName, knownNameParameterName, methodName); - - PersonalProfileRequestBody requestBody = new PersonalProfileRequestBody(); - requestBody.setOriginatingSystemGUID(externalSourceGUID); - requestBody.setOriginatingSystemName(externalSourceName); - requestBody.setQualifiedName(qualifiedName); - requestBody.setFullName(fullName); - requestBody.setKnownName(knownName); - requestBody.setJobTitle(jobTitle); - requestBody.setJobRoleDescription(jobRoleDescription); - requestBody.setProfileProperties(profileProperties); - requestBody.setAdditionalProperties(additionalProperties); - - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - profileGUID); - - } - - - /** - * Delete the personal profile. - * - * @param userId the name of the calling user. - * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local - * @param externalSourceName name of the software server capability entity that represented the external source - * @param profileGUID unique identifier for the profile. - * @param qualifiedName personnel/serial/unique employee number of the individual. - * @throws InvalidParameterException the qualifiedName or guid is null. - * @throws PropertyServerException the server is not available. - * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. - */ - @Override - public void deletePersonalProfile(String userId, - String externalSourceGUID, - String externalSourceName, - String profileGUID, - String qualifiedName) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "deletePersonalProfile"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/personal-profiles/{2}/delete"; - - final String guidParameterName = "profileGUID"; - final String employeeNumberParameterName = "employeeNumber"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(profileGUID, guidParameterName, methodName); - invalidParameterHandler.validateName(qualifiedName, employeeNumberParameterName, methodName); - - PersonalProfileValidatorRequestBody requestBody = new PersonalProfileValidatorRequestBody(); - requestBody.setOriginatingSystemGUID(externalSourceGUID); - requestBody.setOriginatingSystemName(externalSourceName); - - restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - profileGUID); - } - - - /** - * Return the total karma points for this user. - * - * @param userId userId of the user making the request. - * @param profileUserId userId of the profile to update. - * - * @return int count of karma points - * - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public long getKarmaPoints(String userId, - String profileUserId) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - return 0; - } - - - /** - * Return the list of contact methods for this user. - * - * @param userId userId of the user making the request. - * @param profileUserId userId of the profile to update. - * - * @return list of contact methods - * - * @throws InvalidParameterException the userId is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public List<ContactMethodProperties> getContactMethods(String userId, - String profileUserId) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - return null; - } - - - /** - * Add a new contact method to the requesting user's profile. - * - * @param userId the name of the calling user. - * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local - * @param externalSourceName name of the software server capability entity that represented the external source - * @param profileUserId userId of the profile to update. - * @param type type of contact method. - * @param service service for the contact method. - * @param value account name for the service. - * - * @return unique identifier (guid) for the new contact method. - * - * @throws InvalidParameterException the userId is null or invalid. Another property is invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - @Override - public String addContactMethod(String userId, - String externalSourceGUID, - String externalSourceName, - String profileUserId, - ContactMethodType type, - String service, - String value) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - return null; - } - - - /** - * Remove an obsolete contact method from the requesting user's profile. - * - * @param userId the name of the calling user. - * @param externalSourceGUID guid of the software server capability entity that represented the external source - null for local - * @param externalSourceName name of the software server capability entity that represented the external source - * @param profileUserId userId of the profile to update. - * @param contactMethodGUID unique identifier (guid) for the obsolete contact method. - * @param type type of contact method. This is used to confirm that the GUID is the right one. - * - * @throws InvalidParameterException the userId is null or invalid. Another property is invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - public void deleteContactMethod(String userId, - String externalSourceGUID, - String externalSourceName, - String profileUserId, - String contactMethodGUID, - ContactMethodType type) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - } - - - /** - * Retrieve a personal profile by guid. - * - * @param userId the name of the calling user. - * @param profileGUID unique identifier for the profile. - * @return personal profile object. - * - * @throws InvalidParameterException one of the parameters is invalid. - * @throws PropertyServerException the server is not available. - * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. - */ - @Override - public PersonalProfileUniverse getPersonalProfileByGUID(String userId, - String profileGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getPersonalProfileByGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/personal-profiles/{2}"; - - final String guidParameterName = "profileGUID"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(profileGUID, guidParameterName, methodName); - - PersonalProfileResponse restResult = restClient.callPersonalProfileGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - profileGUID); - - return restResult.getPersonalProfile(); - } - - - /** - * Retrieve a personal profile by userId. - * - * @param userId the name of the calling user. - * @param profileUserId userId associated with the profile. - * - * @return personal profile object. - * - * @throws InvalidParameterException one of the parameters is invalid. - * @throws PropertyServerException the server is not available. - * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. - */ - @Override - public PersonalProfileUniverse getPersonalProfileForUser(String userId, - String profileUserId) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getPersonalProfileForUser"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/personal-profiles/by-user/{2}"; - - final String profileUserIdParameterName = "profileUserId"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(profileUserId, profileUserIdParameterName, methodName); - - PersonalProfileResponse restResult = restClient.callPersonalProfileGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - profileUserId); - - return restResult.getPersonalProfile(); - } - - - /** - * Retrieve a personal profile by personnel/serial/unique employee number of the individual. - * - * @param userId the name of the calling user. - * @param qualifiedName personnel/serial/unique employee number of the individual. - * - * @return personal profile object. - * - * @throws InvalidParameterException the employee number. - * @throws PropertyServerException the server is not available, or there is a problem retrieving the profile. - * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. - */ - @Override - public PersonalProfileUniverse getPersonalProfileByQualifiedName(String userId, - String qualifiedName) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getPersonalProfileByQualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/personal-profiles/by-qualified-name"; - - final String qualifiedNameParameterName = "qualifiedName"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); - - NameRequestBody requestBody = new NameRequestBody(); - requestBody.setName(qualifiedName); - - PersonalProfileResponse restResult = restClient.callPersonalProfilePostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - qualifiedName); - - return restResult.getPersonalProfile(); - } - - - /** - * Return a list of candidate personal profiles for an individual. It matches on full name and known name. - * The name may include wild card parameters. - * - * @param userId the name of the calling user. - * @param name name of individual. - * - * @return list of personal profile objects. - * - * @throws InvalidParameterException the name is null. - * @throws PropertyServerException the server is not available. - * @throws UserNotAuthorizedException the calling user is not authorized to issue the call. - */ - @Override - public List<PersonalProfileUniverse> getPersonalProfilesByName(String userId, - String name) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getPersonalProfilesByName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/personal-profiles/by-name"; - - final String nameParameterName = "name"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(name, nameParameterName, methodName); - - NameRequestBody requestBody = new NameRequestBody(); - requestBody.setName(name); - - PersonalProfileListResponse restResult = restClient.callPersonalProfileListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - name); - - return restResult.getPersonalProfiles(); - } -} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/package-info.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/package-info.java new file mode 100644 index 00000000000..7b7fe00c981 --- /dev/null +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/package-info.java @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +/** + * The Community Profile OMAS's clients provide access to metadata about people, communities, organizations, teams, roles, profiles and user identities. + * + * Most clients issue REST API calls to an Open Metadata Server. There is a shared base class (CommunityProfileBaseClient) that issues + * the rest calls that create, update and deleted metadata. + * + * The REST API clients are: + * + * <ul> + * <li> + * OrganizationManagement - maintaining information about profiles, roles, contact details, contribution records. + * </li> + * <li> + * CommunityManagement - supporting communities of people collaborating across an organization. + * </li> + * <li> + * LocationManagement - maintaining information about the locations used by an organization. + * </li> + * <li> + * UserIdentityManagement - maintaining information about user identities. + * </li> + * <li> + * SecurityGroupManagement - maintaining information about security groups. + * </li> + * <li> + * ValidValueManagement - maintaining valid value sets and definitions. + * </li> + * <li> + * MetadataSourceClient - maintains information about external sources of information about the organization. The identifiers of these systems are passed on the externalSourceGUID and externalSourceName parameters of methods that are populating metadata from an external source. + * </li> + * <li> + * ConnectedAssetClient - manages the retrieval of connections, and the creation of resource connectors used to access the content of data sources and services. + * </li> + * <li> + * OpenMetadataStoreClient - common metadata support for all access services that provide both generally useful services along with fine-grained, generic access to the metadata in the metadata store. + * </li> + * </ul> + * + * CommunityProfileEventClient allows you to register a listener to receive Community Profile OMAS Out Topic events. + */ +package org.odpi.openmetadata.accessservices.communityprofile.client; \ No newline at end of file diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java index e1ade470e07..d3c6d1ee350 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java @@ -124,10 +124,10 @@ public DataManagerBaseClient(String serverName, * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ - public DataManagerBaseClient(String serverName, - String serverPlatformURLRoot, - String userId, - String password, + public DataManagerBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, AuditLog auditLog) throws InvalidParameterException { final String methodName = "Client Constructor"; diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/MetadataSourceClient.java b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/MetadataSourceClient.java index 2cfdf293963..7ffe2578ef3 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/MetadataSourceClient.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/MetadataSourceClient.java @@ -19,11 +19,9 @@ /** * MetadataSourceClient is the client for setting up the SoftwareServerCapabilities that represent metadata sources. */ -public class MetadataSourceClient extends ConnectedAssetClientBase implements MetadataSourceInterface +public class MetadataSourceClient extends DataManagerBaseClient implements MetadataSourceInterface { - private DataManagerRESTClient restClient; /* Initialized in constructor */ - - private final String urlTemplatePrefix = "/servers/{0}/open-metadata/access-services/data-manager/users/{1}/metadata-sources"; + private final String urlTemplatePrefix = "/servers/{0}/open-metadata/access-services/data-manager/users/{1}/metadata-sources"; /** @@ -40,8 +38,6 @@ public MetadataSourceClient(String serverName, AuditLog auditLog) throws InvalidParameterException { super(serverName, serverPlatformURLRoot, auditLog); - - this.restClient = new DataManagerRESTClient(serverName, serverPlatformURLRoot, auditLog); } @@ -57,8 +53,6 @@ public MetadataSourceClient(String serverName, String serverPlatformURLRoot) throws InvalidParameterException { super(serverName, serverPlatformURLRoot); - - this.restClient = new DataManagerRESTClient(serverName, serverPlatformURLRoot); } @@ -81,9 +75,7 @@ public MetadataSourceClient(String serverName, String password, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); - - this.restClient = new DataManagerRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + super(serverName, serverPlatformURLRoot, userId, password, auditLog); } @@ -103,9 +95,7 @@ public MetadataSourceClient(String serverName, String userId, String password) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot); - - this.restClient = new DataManagerRESTClient(serverName, serverPlatformURLRoot, userId, password); + super(serverName, serverPlatformURLRoot, userId, password); } @@ -116,18 +106,14 @@ public MetadataSourceClient(String serverName, * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers * @param restClient pre-initialized REST client * @param maxPageSize pre-initialized parameter limit - * @param auditLog logging destination * @throws InvalidParameterException there is a problem with the information about the remote OMAS */ public MetadataSourceClient(String serverName, String serverPlatformURLRoot, DataManagerRESTClient restClient, - int maxPageSize, - AuditLog auditLog) throws InvalidParameterException + int maxPageSize) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, maxPageSize, auditLog); - - this.restClient = restClient; + super(serverName, serverPlatformURLRoot, restClient, maxPageSize); } diff --git a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/client/DiscoveryEngineClient.java b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/client/DiscoveryEngineClient.java index 6c3ac345f11..7304bac8496 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/client/DiscoveryEngineClient.java +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/client/DiscoveryEngineClient.java @@ -25,7 +25,7 @@ */ public class DiscoveryEngineClient extends ConnectedAssetClientBase { - private ODFRESTClient restClient; /* Initialized in constructor */ + private final ODFRESTClient restClient; /* Initialized in constructor */ private static final String serviceURLName = "discovery-engine"; @@ -44,7 +44,7 @@ public DiscoveryEngineClient(String serverName, ODFRESTClient restClient, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, auditLog); this.restClient = restClient; } @@ -63,7 +63,7 @@ public DiscoveryEngineClient(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, auditLog); this.restClient = new ODFRESTClient(serverName, serverPlatformURLRoot, auditLog); } @@ -79,7 +79,7 @@ public DiscoveryEngineClient(String serverName, public DiscoveryEngineClient(String serverName, String serverPlatformURLRoot) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot); + super(serverName, serverPlatformURLRoot, serviceURLName); this.restClient = new ODFRESTClient(serverName, serverPlatformURLRoot); } @@ -102,7 +102,7 @@ public DiscoveryEngineClient(String serverName, String password, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, auditLog); this.restClient = new ODFRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); } @@ -123,7 +123,7 @@ public DiscoveryEngineClient(String serverName, String userId, String password) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot); + super(serverName, serverPlatformURLRoot, serviceURLName); this.restClient = new ODFRESTClient(serverName, serverPlatformURLRoot, userId, password); } @@ -145,7 +145,7 @@ public DiscoveryEngineClient(String serverName, int maxPageSize, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, maxPageSize, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, maxPageSize, auditLog); this.restClient = restClient; } @@ -369,7 +369,7 @@ Connection getConnectionForAsset(String userId, * @param userId userId of user making request. * @param connection the connection object that contains the properties needed to create the connection. * - * @return Connector connector instance + * @return connector instance * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing @@ -402,10 +402,10 @@ public Connector getConnectorForConnection(String userId, * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. */ - AssetUniverse getAssetProperties(String userId, - String assetGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + public AssetUniverse getAssetProperties(String userId, + String assetGUID) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException { return super.getAssetProperties(serviceURLName, userId, assetGUID); } @@ -527,7 +527,7 @@ public String createDiscoveryAnalysisReport(String userId, * Update the properties of the discovery analysis report. * * @param userId calling user. - * @param updatedReport updated report - this will replace what was previous stored. + * @param updatedReport updated report - this will replace the current stored values. * @throws InvalidParameterException one of the parameters is null or invalid. * @throws UserNotAuthorizedException user not authorized to issue this request. * @throws PropertyServerException there was a problem that occurred within the property server. @@ -1303,7 +1303,6 @@ String addAnnotationToDataField(String userId, * @param userId identifier of calling user * @param dataField new properties * - * @return fully filled out data field * @throws InvalidParameterException one of the parameters is invalid * @throws UserNotAuthorizedException the user id not authorized to issue this request * @throws PropertyServerException there was a problem updating the data field in the annotation store. diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ConnectedAssetClient.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ConnectedAssetClient.java index 1c05085ae1c..4dc1bcb0b44 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ConnectedAssetClient.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ConnectedAssetClient.java @@ -2,43 +2,24 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.governanceprogram.client; -import org.odpi.openmetadata.accessservices.governanceprogram.client.rest.GovernanceProgramRESTClient; import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; -import org.odpi.openmetadata.frameworks.connectors.Connector; -import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectionCheckedException; -import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; -import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; -import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; -import org.odpi.openmetadata.frameworks.connectors.properties.AssetUniverse; -import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection; /** - * The Asset Consumer Open Metadata Access Service (OMAS) is used by applications and tools as a factory for Open + * ConnectedAssetClient is used by applications and tools as a factory for Open * Connector Framework (OCF) connectors. The configuration for the connectors is managed as open metadata in - * a Connection definition. The caller to the Asset Consumer OMAS passes either the name, GUID or URL for the - * connection to the appropriate method to retrieve a connector. The Asset Consumer OMAS retrieves the connection + * a Connection definition. The caller to the ConnectedAssetClient passes either the name, GUID or URL for the + * connection to the appropriate method to retrieve a connector. The ConnectedAssetClient retrieves the connection * from the metadata repository and creates an appropriate connector as described the connection and * returns it to the caller. * - * The Asset Consumer OMAS supports access to the asset properties either through the connector, or by a direct - * call to Asset Consumer API. It is also possible to look up the definitions of terms associated with the assets. - * - * It supports the ability to add and remove feedback for an asset. - * This feedback may be in the form of reviews, likes and comments. - * Asset Consumer OMAS also supports the maintenance of informal tags and their attachments to assets. - * - * Finally, Asset Consumer OMAS supports the ability to add audit log records to the local server's audit log - * about an asset. + * The ConnectedAssetClient supports access to the asset properties through the connector. */ public class ConnectedAssetClient extends ConnectedAssetClientBase { - private final GovernanceProgramRESTClient restClient; /* Initialized in constructor */ - private static final String serviceURLName = "governance-program"; - /** * Create a new client with no authentication embedded in the HTTP request. * @@ -52,9 +33,7 @@ public ConnectedAssetClient(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); - - this.restClient = new GovernanceProgramRESTClient(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, auditLog); } @@ -68,9 +47,7 @@ public ConnectedAssetClient(String serverName, public ConnectedAssetClient(String serverName, String serverPlatformURLRoot) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot); - - this.restClient = new GovernanceProgramRESTClient(serverName, serverPlatformURLRoot); + super(serverName, serverPlatformURLRoot, serviceURLName); } @@ -91,9 +68,7 @@ public ConnectedAssetClient(String serverName, String password, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); - - this.restClient = new GovernanceProgramRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + super(serverName, serverPlatformURLRoot, serviceURLName, userId, password, auditLog); } @@ -112,238 +87,6 @@ public ConnectedAssetClient(String serverName, String userId, String password) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot); - - this.restClient = new GovernanceProgramRESTClient(serverName, serverPlatformURLRoot, userId, password); - } - - - /** - * Create a new client that is going to be used in an OMAG Server (view service or integration service typically). - * - * @param serverName name of the server to connect to - * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers - * @param restClient client that issues the REST API calls - * @param maxPageSize maximum number of results supported by this server - * @param auditLog logging destination - * @throws InvalidParameterException there is a problem creating the client-side components to issue any - * REST API calls. - */ - public ConnectedAssetClient(String serverName, - String serverPlatformURLRoot, - GovernanceProgramRESTClient restClient, - int maxPageSize, - AuditLog auditLog) throws InvalidParameterException - { - super(serverName, serverPlatformURLRoot, auditLog); - - invalidParameterHandler.setMaxPagingSize(maxPageSize); - - this.restClient = restClient; - } - - - /** - * Returns the unique identifier for the asset connected to the requested connection. - * - * @param userId the userId of the requesting user. - * @param connectionGUID unique identifier for the connection. - * - * @return unique identifier of asset. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem retrieving information from the property server. - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - public String getAssetForConnection(String userId, - String connectionGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getAssetForConnection"; - final String guidParameter = "connectionGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(connectionGUID, guidParameter, methodName); - - return super.getAssetForConnection(restClient, serviceURLName, userId, connectionGUID); - } - - - - /** - * Returns a comprehensive collection of properties about the requested asset. - * - * @param userId userId of user making request. - * @param assetGUID unique identifier for asset. - * - * @return a comprehensive collection of properties about the asset. - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - public AssetUniverse getAssetProperties(String userId, - String assetGUID) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - return super.getAssetProperties(serviceURLName, userId, assetGUID); - } - - - - /** - * Returns the connector corresponding to the supplied connection name. - * - * @param userId userId of user making request. - * @param connectionName this may be the qualifiedName or displayName of the connection. - * - * @return connector instance - or null if there is no connection - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException there are errors in the initialization of the connector. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - public Connector getConnectorByName(String userId, - String connectionName) throws InvalidParameterException, - ConnectionCheckedException, - ConnectorCheckedException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getConnectorByName"; - final String nameParameter = "connectionName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateName(connectionName, nameParameter, methodName); - - Connection connection = super.getConnectionByName(restClient, serviceURLName, userId, connectionName); - - if (connection != null) - { - return super.getConnectorForConnection(restClient, - serviceURLName, - userId, - connection, - methodName); - } - - return null; - } - - - /** - * Returns the connector corresponding to the supplied asset GUID. - * - * @param userId userId of user making request. - * @param assetGUID the unique id for the asset within the metadata repository. - * - * @return connector instance - or null if there is no connection - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException there are errors in the initialization of the connector. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - public Connector getConnectorForAsset(String userId, - String assetGUID) throws InvalidParameterException, - ConnectionCheckedException, - ConnectorCheckedException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getConnectorForAsset"; - final String guidParameter = "assetGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); - - Connection connection = super.getConnectionForAsset(restClient, serviceURLName, userId, assetGUID); - - if (connection != null) - { - return super.getConnectorForConnection(restClient, - serviceURLName, - userId, - connection, - methodName); - } - - return null; - } - - - /** - * Returns the connector corresponding to the supplied connection GUID. - * - * @param userId userId of user making request. - * @param connectionGUID the unique id for the connection within the metadata repository. - * - * @return connector instance - or null if there is no connection - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException there are errors in the initialization of the connector. - * @throws PropertyServerException there is a problem retrieving information from the property server(s). - * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. - */ - public Connector getConnectorByGUID(String userId, - String connectionGUID) throws InvalidParameterException, - ConnectionCheckedException, - ConnectorCheckedException, - PropertyServerException, - UserNotAuthorizedException - { - final String methodName = "getConnectorByGUID"; - final String guidParameter = "connectionGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(connectionGUID, guidParameter, methodName); - - Connection connection = super.getConnectionByGUID(restClient, serviceURLName, userId, connectionGUID); - - if (connection != null) - { - return super.getConnectorForConnection(restClient, - serviceURLName, - userId, - connection, - methodName); - } - - return null; - } - - - /** - * Returns the connector corresponding to the supplied connection. - * - * @param userId userId of user making request. - * @param connection the connection object that contains the properties needed to create the connection. - * - * @return connector instance - * - * @throws InvalidParameterException one of the parameters is null or invalid. - * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing - * the creation of a connector. - * @throws ConnectorCheckedException there are errors in the initialization of the connector. - */ - public Connector getConnectorByConnection(String userId, - Connection connection) throws InvalidParameterException, - ConnectionCheckedException, - ConnectorCheckedException - { - final String methodName = "getConnectorByConnection"; - - invalidParameterHandler.validateUserId(userId, methodName); - - return super.getConnectorForConnection(restClient, serviceURLName, userId, connection, methodName); + super(serverName, serverPlatformURLRoot, serviceURLName, userId, password); } } \ No newline at end of file diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/rest/GovernanceProgramRESTClient.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/rest/GovernanceProgramRESTClient.java index dd9faac9b22..ae734f990e7 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/rest/GovernanceProgramRESTClient.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/rest/GovernanceProgramRESTClient.java @@ -4,7 +4,6 @@ import org.odpi.openmetadata.accessservices.governanceprogram.rest.*; import org.odpi.openmetadata.commonservices.ffdc.rest.FFDCRESTClient; -import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.OCFRESTClient; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; @@ -13,7 +12,7 @@ /** * RESTClient is responsible for issuing calls to the Governance Program OMAS REST APIs. */ -public class GovernanceProgramRESTClient extends OCFRESTClient +public class GovernanceProgramRESTClient extends FFDCRESTClient { /** * Constructor for no authentication with audit log. @@ -25,8 +24,8 @@ public class GovernanceProgramRESTClient extends OCFRESTClient * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ - public GovernanceProgramRESTClient(String serverName, - String serverPlatformURLRoot, + public GovernanceProgramRESTClient(String serverName, + String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException { super(serverName, serverPlatformURLRoot, auditLog); @@ -92,7 +91,7 @@ public GovernanceProgramRESTClient(String serverName, * Issue a GET REST call that returns a CertificationTypeResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return CertificationTypeResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -117,7 +116,7 @@ public CertificationTypeResponse callCertificationTypeGetRESTCall(String meth * Issue a GET REST call that returns a list of CertificationTypeElement objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return CertificationTypeListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -138,36 +137,11 @@ public CertificationTypeListResponse callCertificationTypeListGetRESTCall(String } - /** - * Issue a GET REST call that returns a list of CertificationElement objects. - * - * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters - * @param params a list of parameters that are slotted into the url template - * @return CertificationListResponse - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public CertificationListResponse callCertificationListGetRESTCall(String methodName, - String urlTemplate, - Object... params) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - CertificationListResponse restResult = this.callGetRESTCall(methodName, CertificationListResponse.class, urlTemplate, params); - - exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); - - return restResult; - } - - /** * Issue a POST REST call that returns a list of CertificationTypeElement objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param requestBody request body for the REST call - contains most of the parameters * @param params a list of parameters that are slotted into the url template * @return CertificationTypeListResponse @@ -194,7 +168,7 @@ public CertificationTypeListResponse callCertificationTypeListPostRESTCall(Strin * Issue a GET REST call that returns a ElementStubListResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return ElementStubListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -219,7 +193,7 @@ public ElementStubListResponse callElementStubListGetRESTCall(String methodNa * Issue a GET REST call that returns a ExternalReferenceResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return ExternalReferenceResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -244,7 +218,7 @@ public ExternalReferenceResponse callExternalReferenceGetRESTCall(String meth * Issue a GET REST call that returns a list of ExternalReferenceElement objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return ExternalReferenceListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -269,7 +243,7 @@ public ExternalReferenceListResponse callExternalReferenceListGetRESTCall(String * Issue a POST REST call that returns a list of ExternalReferenceElement objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param requestBody request body for the REST call - contains most of the parameters * @param params a list of parameters that are slotted into the url template * @return ExternalReferenceListResponse @@ -296,7 +270,7 @@ public ExternalReferenceListResponse callExternalReferenceListPostRESTCall(Strin * Issue a POST REST call that returns a list of GovernanceDefinitionListResponse objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param requestBody request body for the REST call - contains most of the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDefinitionListResponse @@ -323,7 +297,7 @@ public GovernanceDefinitionListResponse callGovernanceDefinitionListPostRESTCall * Issue a GET REST call that returns a GovernanceDefinitionListResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDefinitionListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -348,7 +322,7 @@ public GovernanceDefinitionListResponse callGovernanceDefinitionListGetRESTCall( * Issue a GET REST call that returns a GovernanceDefinitionResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDefinitionResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -373,7 +347,7 @@ public GovernanceDefinitionResponse callGovernanceDefinitionGetRESTCall(String * Issue a GET REST call that returns a GovernanceDefinitionGraphResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDefinitionGraphResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -398,7 +372,7 @@ public GovernanceDefinitionGraphResponse callGovernanceDefinitionGraphGetRESTCal * Issue a GET REST call that returns a GovernanceMetricImplementationListResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDefinitionGraphResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -423,7 +397,7 @@ public GovernanceMetricImplementationListResponse callGovernanceMetricsImplement * Issue a POST REST call that returns a list of GovernanceDomainSetListResponse objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param requestBody request body for the REST call - contains most of the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDomainSetListResponse @@ -450,7 +424,7 @@ public GovernanceDomainSetListResponse callGovernanceDomainSetListPostRESTCall(S * Issue a GET REST call that returns a GovernanceDomainSetListResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDomainSetResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -476,7 +450,7 @@ public GovernanceDomainSetListResponse callGovernanceDomainSetListGetRESTCall(St * Issue a GET REST call that returns a GovernanceDomainSetResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDomainSetResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -501,7 +475,7 @@ public GovernanceDomainSetResponse callGovernanceDomainSetGetRESTCall(String * Issue a POST REST call that returns a list of GovernanceDomainListResponse objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param requestBody request body for the REST call - contains most of the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDomainListResponse @@ -528,7 +502,7 @@ public GovernanceDomainListResponse callGovernanceDomainListPostRESTCall(String * Issue a GET REST call that returns a list of GovernanceDomainListResponse objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDomainListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -553,7 +527,7 @@ public GovernanceDomainListResponse callGovernanceDomainListGetRESTCall(String * Issue a GET REST call that returns a GovernanceDomainResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceDomainResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -578,7 +552,7 @@ public GovernanceDomainResponse callGovernanceDomainGetRESTCall(String method * Issue a GET REST call that returns a GovernanceMetricResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceMetricResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -599,36 +573,11 @@ public GovernanceMetricResponse callGovernanceMetricGetRESTCall(String method } - /** - * Issue a GET REST call that returns a list of GovernanceMetricElement objects. - * - * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters - * @param params a list of parameters that are slotted into the url template - * @return GovernanceMetricListResponse - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public GovernanceMetricListResponse callGovernanceMetricListGetRESTCall(String methodName, - String urlTemplate, - Object... params) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException - { - GovernanceMetricListResponse restResult = this.callGetRESTCall(methodName, GovernanceMetricListResponse.class, urlTemplate, params); - - exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); - - return restResult; - } - - /** * Issue a POST REST call that returns a list ofGovernanceMetricElement objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param requestBody request body for the REST call - contains most of the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceMetricListResponse @@ -655,7 +604,7 @@ public GovernanceMetricListResponse callGovernanceMetricListPostRESTCall(String * Issue a GET REST call that returns a LicenseTypeResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return LicenseTypeResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -680,7 +629,7 @@ public LicenseTypeResponse callLicenseTypeGetRESTCall(String methodName, * Issue a GET REST call that returns a list of LicenseTypeElement objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return LicenseTypeListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -706,7 +655,7 @@ public LicenseTypeListResponse callLicenseTypeListGetRESTCall(String methodNa * Issue a GET REST call that returns a list of LicenseElement objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return LicenseListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -731,7 +680,7 @@ public LicenseListResponse callLicenseListGetRESTCall(String methodName, * Issue a POST REST call that returns a list of LicenseTypeElement objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param requestBody request body for the REST call - contains most of the parameters * @param params a list of parameters that are slotted into the url template * @return LicenseTypeListResponse @@ -758,7 +707,7 @@ public LicenseTypeListResponse callLicenseTypeListPostRESTCall(String methodN * Issue a GET REST call that returns a GovernanceStatusIdentifierResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceStatusIdentifierResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -784,7 +733,7 @@ public GovernanceStatusIdentifierResponse callStatusIdentifierGetRESTCall(String * Issue a GET REST call that returns a GovernanceLevelIdentifierResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceLevelIdentifierResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -810,7 +759,7 @@ public GovernanceLevelIdentifierResponse callLevelIdentifierGetRESTCall(String * Issue a GET REST call that returns a GovernanceStatusIdentifierSetResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceStatusIdentifierSetResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -837,7 +786,7 @@ public GovernanceStatusIdentifierSetResponse callStatusIdentifierSetGetRESTCall( * Issue a GET REST call that returns a GovernanceStatusIdentifierSetListResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceStatusIdentifierSetListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -862,7 +811,7 @@ public GovernanceStatusIdentifierSetListResponse callStatusIdentifierSetListGetR * Issue a GET REST call that returns a list of GovernanceLevelIdentifierResponse objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceLevelIdentifierResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -887,7 +836,7 @@ public GovernanceLevelIdentifierResponse callLevelIdentifierListGetRESTCall(Stri * Issue a POST REST call that returns a list of GovernanceLevelIdentifierListResponse objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param requestBody request body for the REST call - contains most of the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceLevelIdentifierListResponse @@ -914,7 +863,7 @@ public GovernanceLevelIdentifierListResponse callLevelIdentifierListPostRESTCall * Issue a GET REST call that returns a GovernanceLevelIdentifierSetResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceLevelIdentifierSetResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -939,7 +888,7 @@ public GovernanceLevelIdentifierSetResponse callLevelIdentifierSetGetRESTCall(St * Issue a GET REST call that returns a list of GovernanceLevelIdentifierSetListResponse objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceLevelIdentifierSetListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -964,7 +913,7 @@ public GovernanceLevelIdentifierSetListResponse callLevelIdentifierSetListGetRES * Issue a POST REST call that returns a list of GovernanceLevelIdentifierSetResponse objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param requestBody request body for the REST call - contains most of the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceLevelIdentifierSetResponse @@ -991,7 +940,7 @@ public GovernanceLevelIdentifierSetResponse callLevelIdentifierSetListPostRESTCa * Issue a GET REST call that returns a GovernanceRoleResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceRoleResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -1016,7 +965,7 @@ public GovernanceRoleResponse callGovernanceRoleGetRESTCall(String methodName * Issue a GET REST call that returns a GovernanceRoleHistoryResponse object. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceRoleHistoryResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -1041,7 +990,7 @@ public GovernanceRoleHistoryResponse callGovernanceRoleHistoryGetRESTCall(String * Issue a GET REST call that returns a list of GovernanceRoleElement objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceRoleListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -1067,7 +1016,7 @@ public GovernanceRoleListResponse callGovernanceRoleListGetRESTCall(String me * Issue a POST REST call that returns a list of GovernanceRoleElement objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param requestBody request body for the REST call - contains most of the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceRoleListResponse @@ -1094,7 +1043,7 @@ public GovernanceRoleListResponse callGovernanceRoleListPostRESTCall(String m * Issue a GET REST call that returns a list of GovernanceRoleAppointee objects. * * @param methodName name of the method being called - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters + * @param urlTemplate template of the URL with place-holders for the parameters * @param params a list of parameters that are slotted into the url template * @return GovernanceRoleAppointeeListResponse * @throws InvalidParameterException one of the parameters is invalid. @@ -1120,7 +1069,7 @@ public GovernanceRoleAppointeeListResponse callGovernanceRoleAppointeeListGetRES * Issue a GET REST call that returns a GovernanceZoneResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate template of the URL with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return GovernanceZoneResponse @@ -1146,7 +1095,7 @@ public GovernanceZoneResponse callGovernanceZoneGetRESTCall(String methodName * Issue a GET REST call that returns a GovernanceZoneListResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate template of the URL with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return GovernanceZoneListResponse @@ -1172,7 +1121,7 @@ public GovernanceZoneListResponse callGovernanceZoneListGetRESTCall(String me * Issue a GET REST call that returns a GovernanceZoneDefinitionResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate template of the URL with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return GovernanceZoneDefinitionResponse @@ -1198,39 +1147,12 @@ public GovernanceZoneDefinitionResponse callGovernanceZoneDefinitionGetRESTCall( - /** - * Issue a POST REST call that returns a GovernanceZoneResponse object. - * - * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. - * @param requestBody request body for the REST call - contains most of the parameters - * @param params a list of parameters that are slotted into the url template. - * - * @return GovernanceZoneResponse - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public GovernanceZoneResponse callGovernanceZonePostRESTCall(String methodName, - String urlTemplate, - Object requestBody, - Object... params) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - GovernanceZoneResponse restResult = this.callPostRESTCall(methodName, GovernanceZoneResponse.class, urlTemplate, requestBody, params); - - exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); - - return restResult; - } - /** * Issue a GET REST call that returns a SubjectAreaResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate template of the URL with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return SubjectAreaResponse @@ -1256,7 +1178,7 @@ public SubjectAreaResponse callSubjectAreaGetRESTCall(String methodName, * Issue a GET REST call that returns a SubjectAreaDefinitionResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate template of the URL with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return SubjectAreaDefinitionResponse @@ -1283,7 +1205,7 @@ public SubjectAreaDefinitionResponse callSubjectAreaDefinitionGetRESTCall(String * Issue a GET REST call that returns a SubjectAreaListResponse object. * * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. + * @param urlTemplate template of the URL with place-holders for the parameters. * @param params a list of parameters that are slotted into the url template. * * @return SubjectAreaListResponse @@ -1305,87 +1227,6 @@ public SubjectAreaListResponse callSubjectAreaListGetRESTCall(String methodNa } - /** - * Issue a POST REST call that returns a SubjectAreaListResponse object. - * - * @param methodName name of the method being called. - * @param urlTemplate template of the URL for the REST API call with place-holders for the parameters. - * @param requestBody request body for the REST call - contains most of the parameters - * @param params a list of parameters that are slotted into the url template. - * - * @return SubjectAreaListResponse - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException the repository is not available or not working properly. - */ - public SubjectAreaListResponse callSubjectAreaListPostRESTCall(String methodName, - String urlTemplate, - Object requestBody, - Object... params) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - SubjectAreaListResponse restResult = this.callPostRESTCall(methodName, SubjectAreaListResponse.class, urlTemplate, requestBody, params); - - exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); - - return restResult; - } - - - /** - * Issue a GET REST call that returns a PersonRoleElement in a response object. - * - * @param methodName name of the method being called. - * @param urlTemplate REST API call URL template with place-holders for the parameters. - * @param params a list of parameters that are slotted into the url template. - * - * @return response object - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException something went wrong with the REST call stack. - */ - public PersonRoleResponse callPersonRoleGetRESTCall(String methodName, - String urlTemplate, - Object... params) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - PersonRoleResponse restResult = this.callGetRESTCall(methodName, PersonRoleResponse.class, urlTemplate, params); - - exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); - - return restResult; - } - - - - /** - * Issue a GET REST call that returns a list of PersonRoleElements in a response object. - * - * @param methodName name of the method being called - * @param urlTemplate REST API call URL template with place-holders for the parameters - * @param params a list of parameters that are slotted into the url template - * @return response object - * @throws InvalidParameterException one of the parameters is invalid. - * @throws UserNotAuthorizedException the user is not authorized to make this request. - * @throws PropertyServerException something went wrong with the REST call stack. - */ - public PersonRoleListResponse callPersonRoleListGetRESTCall(String methodName, - String urlTemplate, - Object... params) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException - { - PersonRoleListResponse restResult = this.callGetRESTCall(methodName, PersonRoleListResponse.class, urlTemplate, params); - - exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); - - return restResult; - } - - - /** * Issue a GET REST call that returns a RelatedElementListResponse object. * diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/RelatedElement.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/RelatedElement.java new file mode 100644 index 00000000000..db8502a5c0a --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/metadataelements/RelatedElement.java @@ -0,0 +1,175 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.securitymanager.metadataelements; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.securitymanager.properties.RelationshipProperties; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; +import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelatedElement contains the properties and header for a relationship retrieved from the metadata repository along with the stub + * of the related element. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelatedElement implements Serializable +{ + private static final long serialVersionUID = 1L; + + private ElementHeader relationshipHeader = null; + private RelationshipProperties relationshipProperties = null; + private ElementStub relatedElement = null; + + /** + * Default constructor + */ + public RelatedElement() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElement(RelatedElement template) + { + if (template != null) + { + relationshipHeader = template.getRelationshipHeader(); + relationshipProperties = template.getRelationshipProperties(); + relatedElement = template.getRelatedElement(); + } + } + + + /** + * Return the element header associated with the relationship. + * + * @return element header object + */ + public ElementHeader getRelationshipHeader() + { + return relationshipHeader; + } + + + /** + * Set up the element header associated with the relationship. + * + * @param relationshipHeader element header object + */ + public void setRelationshipHeader(ElementHeader relationshipHeader) + { + this.relationshipHeader = relationshipHeader; + } + + + /** + * Return details of the relationship + * + * @return relationship properties + */ + public RelationshipProperties getRelationshipProperties() + { + return relationshipProperties; + } + + + /** + * Set up relationship properties + * + * @param relationshipProperties relationship properties + */ + public void setRelationshipProperties(RelationshipProperties relationshipProperties) + { + this.relationshipProperties = relationshipProperties; + } + + + /** + * Return the element header associated with end 1 of the relationship. + * + * @return element stub object + */ + public ElementStub getRelatedElement() + { + return relatedElement; + } + + + /** + * Set up the element header associated with end 1 of the relationship. + * + * @param relatedElement element stub object + */ + public void setRelatedElement(ElementStub relatedElement) + { + this.relatedElement = relatedElement; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelatedElement{" + + "relationshipHeader=" + relationshipHeader + + ", relationshipProperties=" + relationshipProperties + + ", relatedElement=" + relatedElement + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelatedElement that = (RelatedElement) objectToCompare; + return Objects.equals(getRelationshipHeader(), that.getRelationshipHeader()) && + Objects.equals(getRelationshipProperties(), that.getRelationshipProperties()) && + Objects.equals(getRelatedElement(), that.getRelatedElement()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), relationshipHeader, relationshipProperties, relatedElement); + } +} diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ClassificationProperties.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ClassificationProperties.java new file mode 100644 index 00000000000..aabf3975e53 --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/ClassificationProperties.java @@ -0,0 +1,189 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.securitymanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipProperties provides the base class for relationships items. This provides extended properties with the ability to + * set effectivity dates. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) + +public class ClassificationProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map<String, Object> extendedProperties = null; + + + /** + * Default constructor + */ + public ClassificationProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public ClassificationProperties(ClassificationProperties template) + { + if (template != null) + { + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map<String, Object> getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map<String, Object> extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RelationshipProperties{" + + "effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ClassificationProperties that = (ClassificationProperties) objectToCompare; + return Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(effectiveFrom, effectiveTo); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/RelationshipProperties.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/RelationshipProperties.java new file mode 100644 index 00000000000..0891952c9ac --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/RelationshipProperties.java @@ -0,0 +1,188 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.securitymanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelationshipProperties provides the base class for relationships items. This provides extended properties with the ability to + * set effectivity dates. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private Date effectiveFrom = null; + private Date effectiveTo = null; + + private Map<String, Object> extendedProperties = null; + + + /** + * Default constructor + */ + public RelationshipProperties() + { + super(); + } + + + /** + * Copy/clone constructor. Retrieve values from the supplied template + * + * @param template element to copy + */ + public RelationshipProperties(RelationshipProperties template) + { + if (template != null) + { + effectiveFrom = template.getEffectiveFrom(); + effectiveTo = template.getEffectiveTo(); + extendedProperties = template.getExtendedProperties(); + } + } + + + /** + * Return the date/time that this element is effective from (null means effective from the epoch). + * + * @return date object + */ + public Date getEffectiveFrom() + { + return effectiveFrom; + } + + + /** + * Set up the date/time that this element is effective from (null means effective from the epoch). + * + * @param effectiveFrom date object + */ + public void setEffectiveFrom(Date effectiveFrom) + { + this.effectiveFrom = effectiveFrom; + } + + + /** + * Return the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @return date object + */ + public Date getEffectiveTo() + { + return effectiveTo; + } + + + /** + * Set the date/time that element is effective to (null means that it is effective indefinitely into the future). + * + * @param effectiveTo date object + */ + public void setEffectiveTo(Date effectiveTo) + { + this.effectiveTo = effectiveTo; + } + + + /** + * Return the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @return property map + */ + public Map<String, Object> getExtendedProperties() + { + if (extendedProperties == null) + { + return null; + } + else if (extendedProperties.isEmpty()) + { + return null; + } + else + { + return new HashMap<>(extendedProperties); + } + } + + + /** + * Set up the properties that have been defined for a subtype of this object that are not supported explicitly + * by this bean. + * + * @param extendedProperties property map + */ + public void setExtendedProperties(Map<String, Object> extendedProperties) + { + this.extendedProperties = extendedProperties; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "RelationshipProperties{" + + "effectiveFrom=" + effectiveFrom + + ", effectiveTo=" + effectiveTo + + ", extendedProperties=" + extendedProperties + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + RelationshipProperties that = (RelationshipProperties) objectToCompare; + return Objects.equals(effectiveFrom, that.effectiveFrom) && + Objects.equals(effectiveTo, that.effectiveTo); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(effectiveFrom, effectiveTo); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/TemplateProperties.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/TemplateProperties.java new file mode 100644 index 00000000000..61c95e449d3 --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/properties/TemplateProperties.java @@ -0,0 +1,201 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.securitymanager.properties; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * TemplateProperties defined the properties that can be overridden from the template object + * when creating an object from a template. + */ +@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +public class TemplateProperties implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String qualifiedName = null; + private String displayName = null; + private String description = null; + private String networkAddress = null; + + /** + * Default constructor + */ + public TemplateProperties() + { + super(); + } + + + /** + * Copy/clone constructor for the template properties. + * + * @param template template object to copy. + */ + public TemplateProperties(TemplateProperties template) + { + if (template != null) + { + qualifiedName = template.getQualifiedName(); + displayName = template.getDisplayName(); + description = template.getDescription(); + networkAddress = template.getNetworkAddress(); + } + } + + + /** + * Returns the stored qualified name property for the metadata entity. + * If no qualified name is available then the empty string is returned. + * + * @return qualifiedName + */ + public String getQualifiedName() + { + return qualifiedName; + } + + + /** + * Set up the fully qualified name. + * + * @param qualifiedName String name + */ + public void setQualifiedName(String qualifiedName) + { + this.qualifiedName = qualifiedName; + } + + + /** + * Returns the stored display name property for the metadata entity. + * If no display name is available then null is returned. + * + * @return String name + */ + public String getDisplayName() + { + return displayName; + } + + + /** + * Set up the stored display name property for the metadata entity. + * + * @param displayName String name + */ + public void setDisplayName(String displayName) + { + this.displayName = displayName; + } + + + /** + * Returns the stored description property for the metadata entity. + * If no description is provided then null is returned. + * + * @return description String text + */ + public String getDescription() + { + return description; + } + + + /** + * Set up the stored description property associated with the metadata entity. + * + * @param description String text + */ + public void setDescription(String description) + { + this.description = description; + } + + + /** + * Return the physical network address of this metadata element (if this makes sense). + * + * @return string name + */ + public String getNetworkAddress() + { + return networkAddress; + } + + + /** + * Set up the physical network address of this metadata element (if this makes sense). + * + * @param networkAddress string name + */ + public void setNetworkAddress(String networkAddress) + { + this.networkAddress = networkAddress; + } + + + /** + * Standard toString method. + * + * @return print out of variables in a JSON-style + */ + @Override + public String toString() + { + return "TemplateProperties{" + + "qualifiedName='" + qualifiedName + '\'' + + ", displayName='" + displayName + '\'' + + ", description='" + description + '\'' + + ", networkAddress='" + networkAddress + '\'' + + '}'; + } + + + /** + * Compare the values of the supplied object with those stored in the current object. + * + * @param objectToCompare supplied object + * @return boolean result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + TemplateProperties that = (TemplateProperties) objectToCompare; + return Objects.equals(qualifiedName, that.qualifiedName) && + Objects.equals(displayName, that.displayName) && + Objects.equals(description, that.description) && + Objects.equals(networkAddress, that.networkAddress); + } + + + /** + * Return has code based on properties. + * + * @return int + */ + @Override + public int hashCode() + { + return Objects.hash(qualifiedName, displayName, description, networkAddress); + } +} diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ClassificationRequestBody.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ClassificationRequestBody.java new file mode 100644 index 00000000000..7e73aa95c73 --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ClassificationRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.securitymanager.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.securitymanager.properties.ClassificationProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * ClassificationRequestBody describes the request body used when attaching classification to elements. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ClassificationRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private ClassificationProperties properties = null; + + + /** + * Default constructor + */ + public ClassificationRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public ClassificationRequestBody(ClassificationRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the classification. + * + * @return properties object + */ + public ClassificationProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the classification. + * + * @param properties properties object + */ + public void setProperties(ClassificationProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ClassificationRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ClassificationRequestBody that = (ClassificationRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ExternalSourceRequestBody.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ExternalSourceRequestBody.java new file mode 100644 index 00000000000..a0c2e35bb1a --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ExternalSourceRequestBody.java @@ -0,0 +1,145 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.securitymanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * ExternalSourceRequestBody carries the parameters for marking an asset or schema as external. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ExternalSourceRequestBody extends SecurityManagerOMASAPIRequestBody +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + + + /** + * Default constructor + */ + public ExternalSourceRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public ExternalSourceRequestBody(ExternalSourceRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + } + } + + + /** + * Return the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @return string guid + */ + public String getExternalSourceGUID() + { + return externalSourceGUID; + } + + + /** + * Set up the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @param externalSourceGUID string guid + */ + public void setExternalSourceGUID(String externalSourceGUID) + { + this.externalSourceGUID = externalSourceGUID; + } + + + /** + * Return the unique name of the software server capability entity that represented the external source. + * + * @return string name + */ + public String getExternalSourceName() + { + return externalSourceName; + } + + + /** + * Set up the unique name of the software server capability entity that represented the external source. + * + * @param externalSourceName string name + */ + public void setExternalSourceName(String externalSourceName) + { + this.externalSourceName = externalSourceName; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ExternalSourceRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + '}'; + } + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + ExternalSourceRequestBody that = (ExternalSourceRequestBody) objectToCompare; + return Objects.equals(externalSourceGUID, that.externalSourceGUID) && + Objects.equals(externalSourceName, that.externalSourceName); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), externalSourceGUID, externalSourceName); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ReferenceableRequestBody.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ReferenceableRequestBody.java new file mode 100644 index 00000000000..35e51b6a9bd --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/ReferenceableRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.securitymanager.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.securitymanager.properties.ReferenceableProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipRequestBody describes the request body used when linking elements together. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class ReferenceableRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private ReferenceableProperties properties = null; + + + /** + * Default constructor + */ + public ReferenceableRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public ReferenceableRequestBody(ReferenceableRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the relationship. + * + * @return properties object + */ + public ReferenceableProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the relationship. + * + * @param properties properties object + */ + public void setProperties(ReferenceableProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "ReferenceableRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + ReferenceableRequestBody that = (ReferenceableRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/RelatedElementListResponse.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/RelatedElementListResponse.java new file mode 100644 index 00000000000..632ab11c6f8 --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/RelatedElementListResponse.java @@ -0,0 +1,148 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ + +package org.odpi.openmetadata.accessservices.securitymanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.securitymanager.metadataelements.RelatedElement; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * RelatedElementListResponse is a response object for passing back a list of relatedElement objects. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelatedElementListResponse extends SecurityManagerOMASAPIResponse +{ + private static final long serialVersionUID = 1L; + + private List<RelatedElement> elementList = null; + + + /** + * Default constructor + */ + public RelatedElementListResponse() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public RelatedElementListResponse(RelatedElementListResponse template) + { + super(template); + + if (template != null) + { + elementList = template.getElementList(); + } + } + + + /** + * Return the list of metadata elements. + * + * @return result object + */ + public List<RelatedElement> getElementList() + { + if (elementList == null) + { + return null; + } + else if (elementList.isEmpty()) + { + return null; + } + else + { + return elementList; + } + } + + + /** + * Set up the list of metadata elements to return. + * + * @param elements result object + */ + public void setElementList(List<RelatedElement> elements) + { + this.elementList = elements; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelatedElementListResponse{" + + "element=" + elementList + + ", exceptionClassName='" + getExceptionClassName() + '\'' + + ", exceptionCausedBy='" + getExceptionCausedBy() + '\'' + + ", actionDescription='" + getActionDescription() + '\'' + + ", relatedHTTPCode=" + getRelatedHTTPCode() + + ", exceptionErrorMessage='" + getExceptionErrorMessage() + '\'' + + ", exceptionErrorMessageId='" + getExceptionErrorMessageId() + '\'' + + ", exceptionErrorMessageParameters=" + Arrays.toString(getExceptionErrorMessageParameters()) + + ", exceptionSystemAction='" + getExceptionSystemAction() + '\'' + + ", exceptionUserAction='" + getExceptionUserAction() + '\'' + + ", exceptionProperties=" + getExceptionProperties() + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelatedElementListResponse that = (RelatedElementListResponse) objectToCompare; + return Objects.equals(elementList, that.elementList); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), elementList); + } +} diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/RelationshipRequestBody.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/RelationshipRequestBody.java new file mode 100644 index 00000000000..cd3838f9b37 --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/RelationshipRequestBody.java @@ -0,0 +1,129 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.securitymanager.rest; + + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.securitymanager.properties.RelationshipProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + + +/** + * RelationshipRequestBody describes the request body used when linking elements together. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class RelationshipRequestBody extends ExternalSourceRequestBody +{ + private static final long serialVersionUID = 1L; + + private RelationshipProperties properties = null; + + + /** + * Default constructor + */ + public RelationshipRequestBody() + { + super(); + } + + + /** + * Copy/clone constructor. + * + * @param template object to copy + */ + public RelationshipRequestBody(RelationshipRequestBody template) + { + super(template); + + if (template != null) + { + properties = template.getProperties(); + } + } + + + /** + * Return the properties for the relationship. + * + * @return properties object + */ + public RelationshipProperties getProperties() + { + return properties; + } + + + /** + * Set up the properties for the relationship. + * + * @param properties properties object + */ + public void setProperties(RelationshipProperties properties) + { + this.properties = properties; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "RelationshipRequestBody{" + + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", properties=" + properties + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + RelationshipRequestBody that = (RelationshipRequestBody) objectToCompare; + return Objects.equals(getProperties(), that.getProperties()); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), properties); + } +} diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/TemplateRequestBody.java b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/TemplateRequestBody.java new file mode 100644 index 00000000000..a52e5ccd875 --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-api/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/rest/TemplateRequestBody.java @@ -0,0 +1,165 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.securitymanager.rest; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import org.odpi.openmetadata.accessservices.securitymanager.properties.TemplateProperties; + +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * TemplateRequestBody carries the parameters for creating a new asset using a template. + * The external source identifiers indicate whether the new asset should be created as an external element or not. + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown=true) +public class TemplateRequestBody extends TemplateProperties +{ + private static final long serialVersionUID = 1L; + + private String externalSourceGUID = null; + private String externalSourceName = null; + + + /** + * Default constructor + */ + public TemplateRequestBody() + { + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public TemplateRequestBody(TemplateRequestBody template) + { + super(template); + + if (template != null) + { + externalSourceGUID = template.getExternalSourceGUID(); + externalSourceName = template.getExternalSourceName(); + } + } + + + /** + * Copy/clone constructor + * + * @param template object to copy + */ + public TemplateRequestBody(TemplateProperties template) + { + super(template); + } + + + /** + * Return the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @return string guid + */ + public String getExternalSourceGUID() + { + return externalSourceGUID; + } + + + /** + * Set up the unique identifier of the software server capability entity that represented the external source - null for local. + * + * @param externalSourceGUID string guid + */ + public void setExternalSourceGUID(String externalSourceGUID) + { + this.externalSourceGUID = externalSourceGUID; + } + + + /** + * Return the unique name of the software server capability entity that represented the external source. + * + * @return string name + */ + public String getExternalSourceName() + { + return externalSourceName; + } + + + /** + * Set up the unique name of the software server capability entity that represented the external source. + * + * @param externalSourceName string name + */ + public void setExternalSourceName(String externalSourceName) + { + this.externalSourceName = externalSourceName; + } + + + /** + * JSON-style toString + * + * @return return string containing the property names and values + */ + @Override + public String toString() + { + return "TemplateRequestBody{" + + "externalSourceGUID='" + externalSourceGUID + '\'' + + ", externalSourceName='" + externalSourceName + '\'' + + ", qualifiedName='" + getQualifiedName() + '\'' + + ", displayName='" + getDisplayName() + '\'' + + ", description='" + getDescription() + '\'' + + '}'; + } + + + /** + * Return comparison result based on the content of the properties. + * + * @param objectToCompare test object + * @return result of comparison + */ + @Override + public boolean equals(Object objectToCompare) + { + if (this == objectToCompare) + { + return true; + } + if (objectToCompare == null || getClass() != objectToCompare.getClass()) + { + return false; + } + if (!super.equals(objectToCompare)) + { + return false; + } + TemplateRequestBody that = (TemplateRequestBody) objectToCompare; + return Objects.equals(externalSourceGUID, that.externalSourceGUID) && + Objects.equals(externalSourceName, that.externalSourceName); + } + + + /** + * Return hash code for this object + * + * @return int hash code + */ + @Override + public int hashCode() + { + return Objects.hash(super.hashCode(), externalSourceGUID, externalSourceName); + } +} \ No newline at end of file diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/MetadataSourceClient.java b/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/MetadataSourceClient.java index 050fca57e6c..8c56da344c9 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/MetadataSourceClient.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/MetadataSourceClient.java @@ -8,7 +8,6 @@ import org.odpi.openmetadata.accessservices.securitymanager.properties.*; import org.odpi.openmetadata.accessservices.securitymanager.rest.SecurityManagerRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; -import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; @@ -18,10 +17,8 @@ /** * MetadataSourceClient is the client for setting up the SoftwareServerCapabilities that represent metadata sources. */ -public class MetadataSourceClient extends ConnectedAssetClientBase implements MetadataSourceInterface +public class MetadataSourceClient extends SecurityManagerBaseClient implements MetadataSourceInterface { - private SecurityManagerRESTClient restClient; /* Initialized in constructor */ - private final String urlTemplatePrefix = "/servers/{0}/open-metadata/access-services/security-manager/users/{1}/metadata-sources"; @@ -39,8 +36,6 @@ public MetadataSourceClient(String serverName, AuditLog auditLog) throws InvalidParameterException { super(serverName, serverPlatformURLRoot, auditLog); - - this.restClient = new SecurityManagerRESTClient(serverName, serverPlatformURLRoot, auditLog); } @@ -56,8 +51,6 @@ public MetadataSourceClient(String serverName, String serverPlatformURLRoot) throws InvalidParameterException { super(serverName, serverPlatformURLRoot); - - this.restClient = new SecurityManagerRESTClient(serverName, serverPlatformURLRoot); } @@ -80,9 +73,7 @@ public MetadataSourceClient(String serverName, String password, AuditLog auditLog) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, auditLog); - - this.restClient = new SecurityManagerRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + super(serverName, serverPlatformURLRoot, userId, password, auditLog); } @@ -102,9 +93,7 @@ public MetadataSourceClient(String serverName, String userId, String password) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot); - - this.restClient = new SecurityManagerRESTClient(serverName, serverPlatformURLRoot, userId, password); + super(serverName, serverPlatformURLRoot, userId, password); } @@ -115,18 +104,14 @@ public MetadataSourceClient(String serverName, * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers * @param restClient pre-initialized REST client * @param maxPageSize pre-initialized parameter limit - * @param auditLog logging destination * @throws InvalidParameterException there is a problem with the information about the remote OMAS */ - public MetadataSourceClient(String serverName, - String serverPlatformURLRoot, + public MetadataSourceClient(String serverName, + String serverPlatformURLRoot, SecurityManagerRESTClient restClient, - int maxPageSize, - AuditLog auditLog) throws InvalidParameterException + int maxPageSize) throws InvalidParameterException { - super(serverName, serverPlatformURLRoot, maxPageSize, auditLog); - - this.restClient = restClient; + super(serverName, serverPlatformURLRoot, restClient, maxPageSize); } diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerBaseClient.java b/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerBaseClient.java new file mode 100644 index 00000000000..999728a21c1 --- /dev/null +++ b/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerBaseClient.java @@ -0,0 +1,607 @@ +/* SPDX-License-Identifier: Apache 2.0 */ +/* Copyright Contributors to the ODPi Egeria project. */ +package org.odpi.openmetadata.accessservices.securitymanager.client; + +import org.odpi.openmetadata.accessservices.securitymanager.client.rest.SecurityManagerRESTClient; +import org.odpi.openmetadata.accessservices.securitymanager.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.securitymanager.properties.ClassificationProperties; +import org.odpi.openmetadata.accessservices.securitymanager.properties.ReferenceableProperties; +import org.odpi.openmetadata.accessservices.securitymanager.properties.RelationshipProperties; +import org.odpi.openmetadata.accessservices.securitymanager.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.securitymanager.rest.ClassificationRequestBody; +import org.odpi.openmetadata.accessservices.securitymanager.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.securitymanager.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.securitymanager.rest.RelatedElementListResponse; +import org.odpi.openmetadata.accessservices.securitymanager.rest.RelationshipRequestBody; +import org.odpi.openmetadata.accessservices.securitymanager.rest.TemplateRequestBody; +import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; +import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.frameworks.auditlog.AuditLog; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; + +import java.util.List; + +/** + * SecurityManagerBaseClient supports the common properties and functions for the Data Manager OMAS. + */ +public class SecurityManagerBaseClient +{ + final String serverName; /* Initialized in constructor */ + final String serverPlatformURLRoot; /* Initialized in constructor */ + + final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + final SecurityManagerRESTClient restClient; /* Initialized in constructor */ + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public SecurityManagerBaseClient(String serverName, + String serverPlatformURLRoot, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new SecurityManagerRESTClient(serverName, serverPlatformURLRoot, auditLog); + } + + + /** + * Create a new client with no authentication embedded in the HTTP request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public SecurityManagerBaseClient(String serverName, + String serverPlatformURLRoot) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new SecurityManagerRESTClient(serverName, serverPlatformURLRoot); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public SecurityManagerBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new SecurityManagerRESTClient(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog logging destination + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public SecurityManagerBaseClient(String serverName, + String serverPlatformURLRoot, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + this.restClient = new SecurityManagerRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + } + + + /** + * Create a new client that is going to be used in an OMAG Server. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param restClient client that issues the REST API calls + * @param maxPageSize maximum number of results supported by this server + * + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public SecurityManagerBaseClient(String serverName, + String serverPlatformURLRoot, + SecurityManagerRESTClient restClient, + int maxPageSize) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + + invalidParameterHandler.setMaxPagingSize(maxPageSize); + + this.restClient = restClient; + } + + + /* ===================================================================================================================== + * Basic client methods + */ + + + /** + * Create a new metadata element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param properties properties about the element to store + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @return unique identifier of the new element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId); + + return restResult.getGUID(); + } + + + /** + * Create a new metadata element to represent a community using an existing metadata element as a template. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param templateGUID unique identifier of the metadata element to copy + * @param templateProperties properties that override the template + * @param urlTemplate URL to call (with placeholders) + * @param methodName calling method + * + * @return unique identifier of the new community + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createReferenceableFromTemplate(String userId, + String externalSourceGUID, + String externalSourceName, + String templateGUID, + TemplateProperties templateProperties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String templateGUIDParameterName = "templateGUID"; + final String propertiesParameterName = "templateProperties"; + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); + invalidParameterHandler.validateObject(templateProperties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); + + TemplateRequestBody requestBody = new TemplateRequestBody(templateProperties); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + templateGUID); + + return restResult.getGUID(); + } + + + /** + * Update the metadata element. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to update + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param properties new properties for the metadata element + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void updateReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + boolean isMergeUpdate, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + + if (! isMergeUpdate) + { + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + } + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID, + isMergeUpdate); + } + + + /** + * Add or update classification on referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param properties properties of security at the site + * @param urlTemplate URL to call with placeholder for guid + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setReferenceableClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameter, + ClassificationProperties properties, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ClassificationRequestBody requestBody = new ClassificationRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Remove classification from the referenceable. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to classify + * @param elementGUIDParameter parameter name for elementGUID + * @param urlTemplate URL to call with placeholder for guid + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void removeReferenceableClassification(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameter, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } + + + /** + * Create a relationship between a primary element and a secondary element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param properties describes the properties for the relationship + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void setupRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + RelationshipProperties properties, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + RelationshipRequestBody requestBody = new RelationshipRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID); + } + + + /** + * Remove a relationship. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + void clearRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + primaryElementGUID, + secondaryElementGUID); + } + + + /** + * Retrieve a relationship. + * + * @param userId calling user + * @param startingElementGUID unique identifier of the primary element + * @param startingElementGUIDParameterName name of parameter passing the startingElementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * @param methodName calling method + * + * @return list of related elements + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + List<RelatedElement> getRelatedElements(String userId, + String startingElementGUID, + String startingElementGUIDParameterName, + String urlTemplate, + int startFrom, + int pageSize, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(startingElementGUID, startingElementGUIDParameterName, methodName); + + RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, + urlTemplate, + serverName, + userId, + startingElementGUID, + Integer.toString(startFrom), + Integer.toString(pageSize)); + + return restResult.getElementList(); + } + + + /** + * Remove the metadata element. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param elementGUID unique identifier of the metadata element to remove + * @param elementGUIDParameterName name of parameter passing the elementGUID + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeReferenceable(String userId, + String externalSourceGUID, + String externalSourceName, + String elementGUID, + String elementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); + + ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + + restClient.callVoidPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId, + elementGUID); + } +} diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/rest/SecurityManagerRESTClient.java b/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/rest/SecurityManagerRESTClient.java index 0b1f864ad95..c075af35c91 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/rest/SecurityManagerRESTClient.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/rest/SecurityManagerRESTClient.java @@ -115,6 +115,33 @@ public ElementStubsResponse callElementStubsGetRESTCall(String methodName, } + + /** + * Issue a GET REST call that returns a RelatedElementListResponse object. + * + * @param methodName name of the method being called. + * @param urlTemplate REST API call URL template with place-holders for the parameters. + * @param params a list of parameters that are slotted into the url template. + * + * @return response object + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public RelatedElementListResponse callRelatedElementListGetRESTCall(String methodName, + String urlTemplate, + Object... params) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + RelatedElementListResponse restResult = this.callGetRESTCall(methodName, RelatedElementListResponse.class, urlTemplate, params); + + exceptionHandler.detectAndThrowStandardExceptions(methodName, restResult); + + return restResult; + } + + /** * Issue a GET REST call that returns a SecurityGroupResponse object. * diff --git a/open-metadata-implementation/common-services/metadata-security/metadata-security-server/src/main/java/org/odpi/openmetadata/metadatasecurity/server/OpenMetadataServerSecurityVerifier.java b/open-metadata-implementation/common-services/metadata-security/metadata-security-server/src/main/java/org/odpi/openmetadata/metadatasecurity/server/OpenMetadataServerSecurityVerifier.java index a537af9c64d..c374bb1e63f 100644 --- a/open-metadata-implementation/common-services/metadata-security/metadata-security-server/src/main/java/org/odpi/openmetadata/metadatasecurity/server/OpenMetadataServerSecurityVerifier.java +++ b/open-metadata-implementation/common-services/metadata-security/metadata-security-server/src/main/java/org/odpi/openmetadata/metadatasecurity/server/OpenMetadataServerSecurityVerifier.java @@ -273,6 +273,7 @@ private List<String> getSupportedZones(String userId, * * @param defaultZones setting of the default zones for the service * @param supportedZones setting of the supported zones for the service + * @param publishZones setting of the zones that are set when an asset is published for the service * @param originalAsset original values for the asset * @param updatedAsset updated values for the asset * @@ -945,6 +946,7 @@ public void validateUserForConnection(String userId, * @param serviceName calling service * @param methodName calling method * @return single connection entity, or null + * @throws UserNotAuthorizedException the user is not able to use any of the connections * @throws PropertyServerException unable to reduce the number of connections to */ public EntityDetail selectConnection(String userId, @@ -1161,6 +1163,10 @@ public void validateUserForConnection(String userId, * @param newProperties properties for new entity * @param classifications classifications for new entity * @param instanceStatus status for new entity + * @param defaultZones initial setting of the asset's zone membership + * @param repositoryHelper manipulates repository service objects + * @param serviceName calling service + * @param methodName calling method * @throws UserNotAuthorizedException the user is not authorized to access this zone * @throws InvalidParameterException Something wrong with the supplied parameters * @throws PropertyServerException logic error because classification type not recognized diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerConnectorFactoryInterface.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-api/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/api/ConnectorFactoryInterface.java similarity index 86% rename from open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerConnectorFactoryInterface.java rename to open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-api/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/api/ConnectorFactoryInterface.java index 6949824d403..d795586f314 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-api/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/api/AssetConsumerConnectorFactoryInterface.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-api/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/api/ConnectorFactoryInterface.java @@ -1,21 +1,25 @@ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.assetconsumer.api; +package org.odpi.openmetadata.commonservices.ocf.metadatamanagement.api; import org.odpi.openmetadata.frameworks.connectors.Connector; -import org.odpi.openmetadata.frameworks.connectors.ffdc.*; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectionCheckedException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection; /** - * AssetConsumerConnectorFactoryInterface is used by applications and tools as a factory for Open + * ConnectorFactoryInterface is used by applications and tools as a factory for Open * Connector Framework (OCF) connectors. The configuration for the connectors is managed as open metadata in - * a Connection definition. The caller to the Asset Consumer OMAS passes either the name, GUID or URL for the - * connection to the appropriate method to retrieve a connector. The Asset Consumer OMAS retrieves the connection + * a Connection definition. The caller to the interface passes either the name, GUID or URL for the + * connection to the appropriate method to retrieve a connector. The service retrieves the connection * from the metadata repository and creates an appropriate connector as described the connection and * returns it to the caller. */ -public interface AssetConsumerConnectorFactoryInterface +public interface ConnectorFactoryInterface { /** * Returns the connector corresponding to the supplied connection name. @@ -23,7 +27,7 @@ public interface AssetConsumerConnectorFactoryInterface * @param userId userId of user making request. * @param connectionName this may be the qualifiedName or displayName of the connection. * - * @return Connector connector instance. + * @return connector instance. * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing @@ -46,7 +50,7 @@ Connector getConnectorByName(String userId, * @param userId userId of user making request. * @param connectionGUID the unique id for the connection within the metadata repository. * - * @return Connector connector instance. + * @return connector instance. * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing @@ -68,7 +72,7 @@ Connector getConnectorByGUID(String userId, * @param userId userId of user making request. * @param assetGUID the unique id for the asset within the metadata repository. * - * @return Connector connector instance. + * @return connector instance. * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing @@ -91,7 +95,7 @@ Connector getConnectorForAsset(String userId, * @param userId userId of user making request. * @param connection the connection object that contains the properties needed to create the connection. * - * @return Connector connector instance + * @return connector instance * * @throws InvalidParameterException one of the parameters is null or invalid. * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing diff --git a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetClientBase.java b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetClientBase.java index 7e17061832f..de18ada61ee 100644 --- a/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetClientBase.java +++ b/open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedAssetClientBase.java @@ -5,6 +5,7 @@ import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; +import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.api.ConnectorFactoryInterface; import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.ffdc.OMAGOCFErrorCode; import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.rest.AssetResponse; import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.rest.ConnectionResponse; @@ -16,11 +17,12 @@ import org.odpi.openmetadata.frameworks.connectors.properties.beans.Asset; import org.odpi.openmetadata.frameworks.connectors.properties.beans.Connection; + /** * ConnectedAssetClientBase provides a base calls for clients that support an OCF interface. * In particular, it manages the retrieval of connections for assets, and the creation of connectors. */ -public class ConnectedAssetClientBase +public class ConnectedAssetClientBase implements ConnectorFactoryInterface { protected String serverName; /* Initialized in constructor */ protected String serverPlatformURLRoot; /* Initialized in constructor */ @@ -30,18 +32,22 @@ public class ConnectedAssetClientBase protected static NullRequestBody nullRequestBody = new NullRequestBody(); + private final String serviceURLMarker; + private final OCFRESTClient ocfrestClient; /** * Create a new client with no authentication embedded in the HTTP request. * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param serviceURLMarker indicator of the OMAS that this client is supporting * @param auditLog destination for log messages * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ public ConnectedAssetClientBase(String serverName, String serverPlatformURLRoot, + String serviceURLMarker, AuditLog auditLog) throws InvalidParameterException { final String methodName = "Client Constructor"; @@ -50,7 +56,11 @@ public ConnectedAssetClientBase(String serverName, this.serverName = serverName; this.serverPlatformURLRoot = serverPlatformURLRoot; + this.serviceURLMarker = serviceURLMarker; this.auditLog = auditLog; + + this.ocfrestClient = new OCFRESTClient(serverName, serverPlatformURLRoot, auditLog); + } @@ -60,12 +70,14 @@ public ConnectedAssetClientBase(String serverName, * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers * @param maxPageSize maximum page size for this process + * @param serviceURLMarker indicator of the OMAS that this client is supporting * @param auditLog destination for log messages * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ public ConnectedAssetClientBase(String serverName, String serverPlatformURLRoot, + String serviceURLMarker, int maxPageSize, AuditLog auditLog) throws InvalidParameterException { @@ -76,7 +88,10 @@ public ConnectedAssetClientBase(String serverName, this.serverName = serverName; this.serverPlatformURLRoot = serverPlatformURLRoot; + this.serviceURLMarker = serviceURLMarker; this.auditLog = auditLog; + + this.ocfrestClient = new OCFRESTClient(serverName, serverPlatformURLRoot, auditLog); } @@ -85,21 +100,84 @@ public ConnectedAssetClientBase(String serverName, * * @param serverName name of the server to connect to * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param serviceURLMarker indicator of the OMAS that this client is supporting * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ public ConnectedAssetClientBase(String serverName, - String serverPlatformURLRoot) throws InvalidParameterException + String serverPlatformURLRoot, + String serviceURLMarker) throws InvalidParameterException { - this(serverName, serverPlatformURLRoot, null); + this(serverName, serverPlatformURLRoot, serviceURLMarker, null); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param serviceURLMarker indicator of the OMAS that this client is supporting + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @param auditLog destination for log messages + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ConnectedAssetClientBase(String serverName, + String serverPlatformURLRoot, + String serviceURLMarker, + String userId, + String password, + AuditLog auditLog) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + this.serviceURLMarker = serviceURLMarker; + this.auditLog = auditLog; + + this.ocfrestClient = new OCFRESTClient(serverName, serverPlatformURLRoot, userId, password); + } + + + /** + * Create a new client that passes userId and password in each HTTP request. This is the + * userId/password of the calling server. The end user's userId is sent on each request. + * + * @param serverName name of the server to connect to + * @param serverPlatformURLRoot the network address of the server running the OMAS REST servers + * @param serviceURLMarker indicator of the OMAS that this client is supporting + * @param userId caller's userId embedded in all HTTP requests + * @param password caller's userId embedded in all HTTP requests + * @throws InvalidParameterException there is a problem creating the client-side components to issue any + * REST API calls. + */ + public ConnectedAssetClientBase(String serverName, + String serverPlatformURLRoot, + String serviceURLMarker, + String userId, + String password) throws InvalidParameterException + { + final String methodName = "Client Constructor"; + + invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); + + this.serverName = serverName; + this.serverPlatformURLRoot = serverPlatformURLRoot; + this.serviceURLMarker = serviceURLMarker; + + this.ocfrestClient = new OCFRESTClient(serverName, serverPlatformURLRoot, userId, password); } /** * Return the basic properties of an asset. * - * @param restClient client that calls REST APIs - * @param serviceName name of the calling service * @param userId calling user * @param guid unique identifier of asset * @param methodName calling method @@ -110,9 +188,7 @@ public ConnectedAssetClientBase(String serverName, * @throws PropertyServerException there is a problem access in the property server * @throws UserNotAuthorizedException the user does not have access to the properties */ - protected Asset getAssetSummary(OCFRESTClient restClient, - String serviceName, - String userId, + protected Asset getAssetSummary(String userId, String guid, String methodName) throws InvalidParameterException, PropertyServerException, @@ -120,12 +196,12 @@ protected Asset getAssetSummary(OCFRESTClient restClient, { final String urlTemplate = "/servers/{0}/open-metadata/common-services/{1}/connected-asset/users/{2}/assets/{3}"; - AssetResponse restResult = restClient.callOCFAssetGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - serviceName, - userId, - guid); + AssetResponse restResult = ocfrestClient.callOCFAssetGetRESTCall(methodName, + serverPlatformURLRoot + urlTemplate, + serverName, + serviceURLMarker, + userId, + guid); return restResult.getAsset(); } @@ -405,4 +481,170 @@ protected String getAssetForConnection(OCFRESTClient restClient, return restResult.getGUID(); } + + + /* + * =============================================== + * ConnectorFactoryInterface + * =============================================== + */ + + + /** + * Returns the connector corresponding to the supplied connection name. + * + * @param userId userId of user making request. + * @param connectionName this may be the qualifiedName or displayName of the connection. + * + * @return connector instance - or null if there is no connection + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing + * the creation of a connector. + * @throws ConnectorCheckedException there are errors in the initialization of the connector. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public Connector getConnectorByName(String userId, + String connectionName) throws InvalidParameterException, + ConnectionCheckedException, + ConnectorCheckedException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "getConnectorByName"; + final String nameParameter = "connectionName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateName(connectionName, nameParameter, methodName); + + Connection connection = this.getConnectionByName(ocfrestClient, serviceURLMarker, userId, connectionName); + + if (connection != null) + { + return this.getConnectorForConnection(ocfrestClient, + serviceURLMarker, + userId, + connection, + methodName); + } + + return null; + } + + + /** + * Returns the connector corresponding to the supplied asset GUID. + * + * @param userId userId of user making request. + * @param assetGUID the unique id for the asset within the metadata repository. + * + * @return connector instance - or null if there is no connection + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing + * the creation of a connector. + * @throws ConnectorCheckedException there are errors in the initialization of the connector. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public Connector getConnectorForAsset(String userId, + String assetGUID) throws InvalidParameterException, + ConnectionCheckedException, + ConnectorCheckedException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "getConnectorForAsset"; + final String guidParameter = "assetGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); + + Connection connection = this.getConnectionForAsset(ocfrestClient, serviceURLMarker, userId, assetGUID); + + if (connection != null) + { + return this.getConnectorForConnection(ocfrestClient, + serviceURLMarker, + userId, + connection, + methodName); + } + + return null; + } + + + /** + * Returns the connector corresponding to the supplied connection GUID. + * + * @param userId userId of user making request. + * @param connectionGUID the unique id for the connection within the metadata repository. + * + * @return connector instance - or null if there is no connection + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing + * the creation of a connector. + * @throws ConnectorCheckedException there are errors in the initialization of the connector. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public Connector getConnectorByGUID(String userId, + String connectionGUID) throws InvalidParameterException, + ConnectionCheckedException, + ConnectorCheckedException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "getConnectorByGUID"; + final String guidParameter = "connectionGUID"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(connectionGUID, guidParameter, methodName); + + Connection connection = this.getConnectionByGUID(ocfrestClient, serviceURLMarker, userId, connectionGUID); + + if (connection != null) + { + return this.getConnectorForConnection(ocfrestClient, + serviceURLMarker, + userId, + connection, + methodName); + } + + return null; + } + + + /** + * Returns the connector corresponding to the supplied connection. + * + * @param userId userId of user making request. + * @param connection the connection object that contains the properties needed to create the connection. + * + * @return connector instance + * + * @throws InvalidParameterException one of the parameters is null or invalid. + * @throws ConnectionCheckedException there are errors in the configuration of the connection which is preventing + * the creation of a connector. + * @throws ConnectorCheckedException there are errors in the initialization of the connector. + */ + @Override + public Connector getConnectorByConnection(String userId, + Connection connection) throws InvalidParameterException, + ConnectionCheckedException, + ConnectorCheckedException + { + final String methodName = "getConnectorByConnection"; + + invalidParameterHandler.validateUserId(userId, methodName); + + return this.getConnectorForConnection(ocfrestClient, serviceURLMarker, userId, connection, methodName); + } } diff --git a/open-metadata-implementation/integration-services/api-integrator/api-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/api/contextmanager/APIIntegratorContextManager.java b/open-metadata-implementation/integration-services/api-integrator/api-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/api/contextmanager/APIIntegratorContextManager.java index 0e40f685210..089f3983269 100644 --- a/open-metadata-implementation/integration-services/api-integrator/api-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/api/contextmanager/APIIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/api-integrator/api-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/api/contextmanager/APIIntegratorContextManager.java @@ -111,8 +111,7 @@ public void createClients() throws InvalidParameterException metadataSourceClient = new MetadataSourceClient(partnerOMASServerName, partnerOMASPlatformRootURL, restClient, - maxPageSize, - auditLog); + maxPageSize); } diff --git a/open-metadata-implementation/integration-services/database-integrator/database-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/database/contextmanager/DatabaseIntegratorContextManager.java b/open-metadata-implementation/integration-services/database-integrator/database-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/database/contextmanager/DatabaseIntegratorContextManager.java index 2546e79d71c..10585b4ca6b 100644 --- a/open-metadata-implementation/integration-services/database-integrator/database-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/database/contextmanager/DatabaseIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/database-integrator/database-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/database/contextmanager/DatabaseIntegratorContextManager.java @@ -111,8 +111,7 @@ public void createClients() throws InvalidParameterException metadataSourceClient = new MetadataSourceClient(partnerOMASServerName, partnerOMASPlatformRootURL, restClient, - maxPageSize, - auditLog); + maxPageSize); } diff --git a/open-metadata-implementation/integration-services/display-integrator/display-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/display/contextmanager/DisplayIntegratorContextManager.java b/open-metadata-implementation/integration-services/display-integrator/display-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/display/contextmanager/DisplayIntegratorContextManager.java index 4100cae994d..e656aec93f4 100644 --- a/open-metadata-implementation/integration-services/display-integrator/display-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/display/contextmanager/DisplayIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/display-integrator/display-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/display/contextmanager/DisplayIntegratorContextManager.java @@ -103,8 +103,7 @@ public void createClients() throws InvalidParameterException metadataSourceClient = new MetadataSourceClient(partnerOMASServerName, partnerOMASPlatformRootURL, restClient, - maxPageSize, - auditLog); + maxPageSize); } diff --git a/open-metadata-implementation/integration-services/files-integrator/files-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/files/contextmanager/FilesIntegratorContextManager.java b/open-metadata-implementation/integration-services/files-integrator/files-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/files/contextmanager/FilesIntegratorContextManager.java index 07fd3bcb803..abf9816890c 100644 --- a/open-metadata-implementation/integration-services/files-integrator/files-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/files/contextmanager/FilesIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/files-integrator/files-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/files/contextmanager/FilesIntegratorContextManager.java @@ -110,8 +110,7 @@ public void createClients() throws InvalidParameterException metadataSourceClient = new MetadataSourceClient(partnerOMASServerName, partnerOMASPlatformRootURL, restClient, - maxPageSize, - auditLog); + maxPageSize); } diff --git a/open-metadata-implementation/integration-services/security-integrator/security-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/security/contextmanager/SecurityIntegratorContextManager.java b/open-metadata-implementation/integration-services/security-integrator/security-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/security/contextmanager/SecurityIntegratorContextManager.java index e03b5a342a5..31f67850a74 100644 --- a/open-metadata-implementation/integration-services/security-integrator/security-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/security/contextmanager/SecurityIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/security-integrator/security-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/security/contextmanager/SecurityIntegratorContextManager.java @@ -98,8 +98,7 @@ public void createClients() throws InvalidParameterException metadataSourceClient = new MetadataSourceClient(partnerOMASServerName, partnerOMASPlatformRootURL, restClient, - maxPageSize, - auditLog); + maxPageSize); securityManagerClient = new SecurityManagerClient(partnerOMASServerName, partnerOMASPlatformRootURL, diff --git a/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/topic/connector/TopicIntegratorContext.java b/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/topic/connector/TopicIntegratorContext.java index de4036e42f9..3159301e168 100644 --- a/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/topic/connector/TopicIntegratorContext.java +++ b/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/topic/connector/TopicIntegratorContext.java @@ -5,11 +5,41 @@ import org.odpi.openmetadata.accessservices.datamanager.api.DataManagerEventListener; import org.odpi.openmetadata.accessservices.datamanager.client.ConnectionManagerClient; -import org.odpi.openmetadata.accessservices.datamanager.client.EventBrokerClient; import org.odpi.openmetadata.accessservices.datamanager.client.DataManagerEventClient; -import org.odpi.openmetadata.accessservices.datamanager.metadataelements.*; -import org.odpi.openmetadata.accessservices.datamanager.properties.*; -import org.odpi.openmetadata.frameworks.connectors.ffdc.*; +import org.odpi.openmetadata.accessservices.datamanager.client.EventBrokerClient; +import org.odpi.openmetadata.accessservices.datamanager.client.ValidValueManagement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ConnectionElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ConnectorTypeElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.EndpointElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.EventTypeElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.RelatedElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.SchemaAttributeElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.SchemaTypeElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.TopicElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ValidValueElement; +import org.odpi.openmetadata.accessservices.datamanager.metadataelements.ValidValueSetElement; +import org.odpi.openmetadata.accessservices.datamanager.properties.ConnectionProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.EndpointProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.EnumSchemaTypeProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.EventTypeProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.LiteralSchemaTypeProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.MapSchemaTypeProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.PrimitiveSchemaTypeProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ReferenceValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.SchemaAttributeProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.SchemaTypeChoiceProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.SchemaTypeProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.StructSchemaTypeProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.TemplateProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.TopicProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueAssignmentProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueMembershipProperties; +import org.odpi.openmetadata.accessservices.datamanager.properties.ValidValueProperties; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectionCheckedException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.ConnectorCheckedException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException; +import org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException; import org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader; import java.util.List; @@ -22,6 +52,7 @@ public class TopicIntegratorContext { private final ConnectionManagerClient connectionManagerClient; + private final ValidValueManagement validValueManagement; private final EventBrokerClient eventBrokerClient; private final DataManagerEventClient eventClient; private final String userId; @@ -35,6 +66,7 @@ public class TopicIntegratorContext * * @param eventBrokerClient client to map request to * @param connectionManagerClient client for managing connections + * @param validValueManagement client for managing valid value sets and definitions * @param eventClient client to register for events * @param userId integration daemon's userId * @param eventBrokerGUID unique identifier of the software server capability for the event broker @@ -42,6 +74,7 @@ public class TopicIntegratorContext */ public TopicIntegratorContext(EventBrokerClient eventBrokerClient, ConnectionManagerClient connectionManagerClient, + ValidValueManagement validValueManagement, DataManagerEventClient eventClient, String userId, String eventBrokerGUID, @@ -49,6 +82,7 @@ public TopicIntegratorContext(EventBrokerClient eventBrokerClient, { this.eventBrokerClient = eventBrokerClient; this.connectionManagerClient = connectionManagerClient; + this.validValueManagement = validValueManagement; this.eventClient = eventClient; this.userId = userId; this.eventBrokerGUID = eventBrokerGUID; @@ -361,7 +395,7 @@ public String createEventType(String topicGUID, /** - * Create a new metadata element to represent a event type using an existing metadata element as a template. + * Create a new metadata element to represent an event type using an existing metadata element as a template. * * @param templateGUID unique identifier of the metadata element to copy * @param topicGUID unique identifier of the topic where the event type is located @@ -391,7 +425,7 @@ public String createEventTypeFromTemplate(String templateGUID, /** - * Update the metadata element representing a event type. + * Update the metadata element representing an event type. * * @param eventTypeGUID unique identifier of the metadata element to update * @param isMergeUpdate are unspecified properties unchanged (true) or removed? @@ -412,7 +446,7 @@ public void updateEventType(String eventTypeGUID, /** - * Remove the metadata element representing a event type. + * Remove the metadata element representing an event type. * * @param eventTypeGUID unique identifier of the metadata element to remove * @param qualifiedName unique name of the metadata element to remove @@ -1533,7 +1567,7 @@ public String createEndpointFromTemplate(String networkAddress, /** - * Update the metadata element representing a endpoint. It is possible to use the subtype property classes or + * Update the metadata element representing an endpoint. It is possible to use the subtype property classes or * set up specialized properties in extended properties. * * @param endpointGUID unique identifier of the metadata element to update @@ -1705,4 +1739,408 @@ public ConnectorTypeElement getConnectorTypeByGUID(String connectorTypeGUID) thr { return connectionManagerClient.getConnectorTypeByGUID(userId, connectorTypeGUID); } + + + + + /* ===================================================================================================================== + * A ValidValue is the top level object for working with connectors + */ + + /** + * Create a new metadata element to represent a valid value. + * + * @param validValueProperties properties about the valid value to store + * + * @return unique identifier of the new valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public String createValidValue(ValidValueProperties validValueProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.createValidValue(userId, eventBrokerGUID, eventBrokerName, validValueProperties); + } + + + /** + * Update the metadata element representing a valid value. It is possible to use the subtype property classes or + * set up specialized properties in extended properties. + * + * @param validValueGUID unique identifier of the metadata element to update + * @param isMergeUpdate should the new properties be merged with existing properties (true) or completely replace them (false)? + * @param validValueProperties new properties for the metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void updateValidValue(String validValueGUID, + boolean isMergeUpdate, + ValidValueProperties validValueProperties) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + validValueManagement.updateValidValue(userId, eventBrokerGUID, eventBrokerName, validValueGUID, isMergeUpdate, validValueProperties); + } + + + /** + * Create a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param validValueSetGUID unique identifier of the valid value set + * @param properties describes the properties of the membership + * @param validValueMemberGUID unique identifier of the member + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void setupValidValueMember(String validValueSetGUID, + ValidValueMembershipProperties properties, + String validValueMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + validValueManagement.setupValidValueMember(userId, eventBrokerGUID, eventBrokerName, validValueSetGUID, properties, validValueMemberGUID); + } + + + /** + * Remove a membership relationship between a validValue and a validValueSet that it belongs to. + * + * @param validValueSetGUID unique identifier of the valid value set + * @param validValueMemberGUID unique identifier of the member + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void clearValidValueMember(String validValueSetGUID, + String validValueMemberGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + validValueManagement.clearValidValueMember(userId, eventBrokerGUID, eventBrokerName, validValueSetGUID, validValueMemberGUID); + } + + + /** + * Create a valid value assignment relationship between an element and a valid value (typically, a valid value set) to show that + * the valid value defines the values that can be stored in the data item that the element represents. + * + * @param elementGUID unique identifier of the element + * @param properties describes the permissions that the role has in the validValue + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void setupValidValues(String elementGUID, + ValidValueAssignmentProperties properties, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + validValueManagement.setupValidValues(userId, eventBrokerGUID, eventBrokerName, elementGUID, properties, validValueGUID); + } + + + /** + * Remove a valid value assignment relationship between an element and a valid value. + * + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void clearValidValues(String elementGUID, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + validValueManagement.clearValidValues(userId, eventBrokerGUID, eventBrokerName, elementGUID, validValueGUID); + } + + + /** + * Create a reference value assignment relationship between an element and a valid value to show that + * the valid value is a semiformal tag/classification. + * + * @param elementGUID unique identifier of the element + * @param properties describes the quality of the assignment + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void setupReferenceValueTag(String elementGUID, + ReferenceValueAssignmentProperties properties, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + validValueManagement.setupReferenceValueTag(userId, eventBrokerGUID, eventBrokerName, elementGUID, properties, validValueGUID); + } + + + /** + * Remove a reference value assignment relationship between an element and a valid value. + * + * @param elementGUID unique identifier of the element + * @param validValueGUID unique identifier of the valid value + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void clearReferenceValueTag(String elementGUID, + String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + validValueManagement.clearReferenceValueTag(userId, eventBrokerGUID, eventBrokerName, elementGUID, validValueGUID); + } + + + /** + * Remove the metadata element representing a valid value. + * + * @param validValueGUID unique identifier of the metadata element to remove + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public void removeValidValue(String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + validValueManagement.removeValidValue(userId, eventBrokerGUID, eventBrokerName, validValueGUID); + } + + + /** + * Retrieve the list of metadata elements that contain the search string. + * The search string is treated as a regular expression. + * + * @param searchString string to find in the properties + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List<ValidValueElement> findValidValues(String searchString, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.findValidValues(userId, searchString, startFrom, pageSize); + } + + + /** + * Retrieve the list of metadata elements with a matching qualified or display name. + * There are no wildcards supported on this request. + * + * @param name name to search for + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List<ValidValueElement> getValidValuesByName(String name, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.getValidValuesByName(userId, name, startFrom, pageSize); + } + + + /** + * Retrieve the list of valid values. + * + * @param startFrom paging start point + * @param pageSize maximum results that can be returned + * + * @return list of matching metadata elements + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public List<ValidValueElement> getAllValidValues(int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.getAllValidValues(userId, startFrom, pageSize); + } + + + /** + * Page through the members of a valid value set. + * + * @param validValueSetGUID unique identifier of the valid value set + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public List<ValidValueElement> getValidValueSetMembers(String validValueSetGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.getValidValueSetMembers(userId, validValueSetGUID, startFrom, pageSize); + } + + + /** + * Page through the list of valid value sets that a valid value definition/set belongs to. + * + * @param validValueGUID unique identifier of valid value to query + * @param startFrom paging starting point + * @param pageSize maximum number of return values. + * @return list of valid value beans + * @throws InvalidParameterException one of the parameters is invalid. + * @throws UserNotAuthorizedException the user is not authorized to make this request. + * @throws PropertyServerException the repository is not available or not working properly. + */ + public List<ValidValueElement> getSetsForValidValue(String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.getSetsForValidValue(userId, validValueGUID, startFrom, pageSize); + } + + + /** + * Return information about the valid value set linked to an element as its set of valid values. + * + * @param elementGUID unique identifier for the element using the valid value set + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException guid is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public ValidValueElement getValidValuesForConsumer(String elementGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.getValidValuesForConsumer(userId, elementGUID); + } + + + /** + * Return information about the consumers linked to a validValue. + * + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException guid is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public List<RelatedElement> getConsumersOfValidValue(String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.getConsumersOfValidValue(userId, validValueGUID, startFrom, pageSize); + } + + + /** + * Return information about the valid values linked as reference value tags to an element. + * + * @param elementGUID unique identifier for the element + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of valid values + * + * @throws InvalidParameterException guid is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public List<ValidValueElement> getReferenceValues(String elementGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.getReferenceValues(userId, elementGUID, startFrom, pageSize); + } + + + /** + * Return information about the person roles linked to a validValue. + * + * @param validValueGUID unique identifier for the validValue + * @param startFrom index of the list to start from (0 for start) + * @param pageSize maximum number of elements to return. + * + * @return list of matching actor profiles (hopefully only one) + * + * @throws InvalidParameterException guid is null + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public List<RelatedElement> getAssigneesOfReferenceValue(String validValueGUID, + int startFrom, + int pageSize) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.getAssigneesOfReferenceValue(userId, validValueGUID, startFrom, pageSize); + } + + + /** + * Retrieve the metadata element with the supplied unique identifier. + * + * @param validValueGUID unique identifier of the requested metadata element + * + * @return requested metadata element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + public ValidValueElement getValidValueByGUID(String validValueGUID) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + return validValueManagement.getValidValueByGUID(userId, validValueGUID); + } } diff --git a/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/topic/contextmanager/TopicIntegratorContextManager.java b/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/topic/contextmanager/TopicIntegratorContextManager.java index 19bdc1b6bb4..627c5a67339 100644 --- a/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/topic/contextmanager/TopicIntegratorContextManager.java +++ b/open-metadata-implementation/integration-services/topic-integrator/topic-integrator-server/src/main/java/org/odpi/openmetadata/integrationservices/topic/contextmanager/TopicIntegratorContextManager.java @@ -7,6 +7,7 @@ import org.odpi.openmetadata.accessservices.datamanager.client.EventBrokerClient; import org.odpi.openmetadata.accessservices.datamanager.client.DataManagerEventClient; import org.odpi.openmetadata.accessservices.datamanager.client.MetadataSourceClient; +import org.odpi.openmetadata.accessservices.datamanager.client.ValidValueManagement; import org.odpi.openmetadata.accessservices.datamanager.client.rest.DataManagerRESTClient; import org.odpi.openmetadata.accessservices.datamanager.properties.EventBrokerProperties; import org.odpi.openmetadata.adminservices.configuration.properties.PermittedSynchronization; @@ -35,6 +36,7 @@ public class TopicIntegratorContextManager extends IntegrationContextManager private EventBrokerClient eventBrokerClient = null; private ConnectionManagerClient connectionManagerClient = null; private MetadataSourceClient metadataSourceClient = null; + private ValidValueManagement validValueManagement = null; private DataManagerRESTClient restClient = null; /** @@ -108,11 +110,15 @@ public void createClients() throws InvalidParameterException maxPageSize, auditLog); + validValueManagement = new ValidValueManagement(partnerOMASServerName, + partnerOMASPlatformRootURL, + restClient, + maxPageSize); + metadataSourceClient = new MetadataSourceClient(partnerOMASServerName, partnerOMASPlatformRootURL, restClient, - maxPageSize, - auditLog); + maxPageSize); } @@ -214,6 +220,7 @@ public void setContext(String connectorId, serviceSpecificConnector.setContext(new TopicIntegratorContext(eventBrokerClient, connectionManagerClient, + validValueManagement, dataManagerEventClient, localServerUserId, metadataSourceGUID, diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/clientconstructors/ClientConstructorTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/clientconstructors/ClientConstructorTest.java index 1bfce691463..bb48e3eff27 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/clientconstructors/ClientConstructorTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/clientconstructors/ClientConstructorTest.java @@ -3,9 +3,9 @@ package org.odpi.openmetadata.accessservices.communityprofile.fvt.clientconstructors; +import org.odpi.openmetadata.accessservices.communityprofile.client.CommunityManagement; import org.odpi.openmetadata.accessservices.communityprofile.client.MetadataSourceClient; -import org.odpi.openmetadata.accessservices.communityprofile.client.MyProfileManagement; -import org.odpi.openmetadata.accessservices.communityprofile.client.PersonalProfileManagement; +import org.odpi.openmetadata.accessservices.communityprofile.client.OrganizationManagement; import org.odpi.openmetadata.accessservices.communityprofile.client.UserIdentityManagement; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; @@ -78,8 +78,8 @@ private static void runIt(String serverPlatformRootURL, thisTest.testMetadataSourceClient(serverName, serverPlatformRootURL, auditLog); thisTest.testUserIdentityManagement(serverName, serverPlatformRootURL, auditLog); - thisTest.testMyProfileManagement(serverName, serverPlatformRootURL, auditLog); - thisTest.testPersonalProfileManagement(serverName, serverPlatformRootURL, auditLog); + thisTest.testOrganizationManagement(serverName, serverPlatformRootURL, auditLog); + thisTest.testCommunityManagement(serverName, serverPlatformRootURL, auditLog); } @@ -143,18 +143,18 @@ private void testUserIdentityManagement(String serverName, * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ - private void testMyProfileManagement(String serverName, - String serverPlatformRootURL, - AuditLog auditLog) throws InvalidParameterException + private void testOrganizationManagement(String serverName, + String serverPlatformRootURL, + AuditLog auditLog) throws InvalidParameterException { - new MyProfileManagement(serverName, serverPlatformRootURL, auditLog); - new MyProfileManagement(serverName, serverPlatformRootURL); - new MyProfileManagement(serverName, serverPlatformRootURL, serverUserId, serverPassword, auditLog); - new MyProfileManagement(serverName, serverPlatformRootURL, serverUserId, serverPassword); + new OrganizationManagement(serverName, serverPlatformRootURL, auditLog); + new OrganizationManagement(serverName, serverPlatformRootURL); + new OrganizationManagement(serverName, serverPlatformRootURL, serverUserId, serverPassword, auditLog); + new OrganizationManagement(serverName, serverPlatformRootURL, serverUserId, serverPassword); CommunityProfileRESTClient restClient = new CommunityProfileRESTClient(serverName, serverPlatformRootURL); - new MyProfileManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); + new OrganizationManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); } @@ -167,17 +167,17 @@ private void testMyProfileManagement(String serverName, * @throws InvalidParameterException there is a problem creating the client-side components to issue any * REST API calls. */ - private void testPersonalProfileManagement(String serverName, - String serverPlatformRootURL, - AuditLog auditLog) throws InvalidParameterException + private void testCommunityManagement(String serverName, + String serverPlatformRootURL, + AuditLog auditLog) throws InvalidParameterException { - new PersonalProfileManagement(serverName, serverPlatformRootURL, auditLog); - new PersonalProfileManagement(serverName, serverPlatformRootURL); - new PersonalProfileManagement(serverName, serverPlatformRootURL, serverUserId, serverPassword, auditLog); - new PersonalProfileManagement(serverName, serverPlatformRootURL, serverUserId, serverPassword); + new CommunityManagement(serverName, serverPlatformRootURL, auditLog); + new CommunityManagement(serverName, serverPlatformRootURL); + new CommunityManagement(serverName, serverPlatformRootURL, serverUserId, serverPassword, auditLog); + new CommunityManagement(serverName, serverPlatformRootURL, serverUserId, serverPassword); CommunityProfileRESTClient restClient = new CommunityProfileRESTClient(serverName, serverPlatformRootURL); - new PersonalProfileManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); + new CommunityManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); } } diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/errorhandling/InvalidParameterTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/errorhandling/InvalidParameterTest.java index 25cd2ee3dfd..a8e3b4b036a 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/errorhandling/InvalidParameterTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/errorhandling/InvalidParameterTest.java @@ -3,9 +3,12 @@ package org.odpi.openmetadata.accessservices.communityprofile.fvt.errorhandling; -import org.odpi.openmetadata.accessservices.communityprofile.client.MyProfileManagement; +import org.odpi.openmetadata.accessservices.communityprofile.client.CommunityManagement; +import org.odpi.openmetadata.accessservices.communityprofile.client.OrganizationManagement; import org.odpi.openmetadata.accessservices.communityprofile.client.rest.CommunityProfileRESTClient; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ActorProfileProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.CommunityProperties; import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; @@ -13,8 +16,6 @@ import org.odpi.openmetadata.fvt.utilities.auditlog.FVTAuditLogDestination; import org.odpi.openmetadata.fvt.utilities.exceptions.FVTUnexpectedCondition; -import java.util.HashMap; - /** * InvalidParameterTest calls each non-constructor method with a series of null or invalid parameters. * It ensures that InvalidParameterException is thrown. @@ -56,7 +57,7 @@ public static FVTResults performFVT(String serverName, /** - * Run all of the tests in this class. + * Run all the tests in this class. * * @param serverPlatformRootURL root url of the server * @param serverName name of the server @@ -78,11 +79,11 @@ private static void runIt(String serverPlatformRootURL, AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceDescription(), AccessServiceDescription.COMMUNITY_PROFILE_OMAS.getAccessServiceWiki()); - thisTest.testMyProfileClient(serverName, serverPlatformRootURL, userId, auditLog); + thisTest.testOrganizationClient(serverName, serverPlatformRootURL, userId, auditLog); + thisTest.testCommunityClient(serverName, serverPlatformRootURL, userId, auditLog); } - - - + + /** * Create a client using each of its constructors. * @@ -92,21 +93,171 @@ private static void runIt(String serverPlatformRootURL, * @param auditLog logging destination * @throws FVTUnexpectedCondition the test case failed */ - private void testMyProfileClient(String serverName, + private void testCommunityClient(String serverName, String serverPlatformRootURL, String userId, AuditLog auditLog) throws FVTUnexpectedCondition { - final String activityName = "testMyProfileClient"; + final String activityName = "testCommunityClient"; try { CommunityProfileRESTClient restClient = new CommunityProfileRESTClient(serverName, serverPlatformRootURL, auditLog); - MyProfileManagement client = new MyProfileManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); + CommunityManagement client = new CommunityManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); + + testSetUpCommunity(client, userId); + } + catch (FVTUnexpectedCondition testCaseError) + { + throw testCaseError; + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + + /** + * Test null userId passed to createCommunity. + * + * @param client client to call + * @throws FVTUnexpectedCondition the test case failed + */ + private void testSetUpCommunityNoUserId(CommunityManagement client) throws FVTUnexpectedCondition + { + final String activityName = "testSetUpCommunityNoUserId"; + + try + { + CommunityProperties properties = new CommunityProperties(); + properties.setQualifiedName("TestQualifiedName"); + client.createCommunity(null, null, null, properties); + + throw new FVTUnexpectedCondition(testCaseName, activityName); + } + catch (InvalidParameterException expectedException) + { + // ignore + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Test null properties passed to createCommunity. + * + * @param client client to call + * @param userId calling user + * @throws FVTUnexpectedCondition the test case failed + */ + private void testSetUpCommunityNoProperties(CommunityManagement client, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "testSetUpCommunityNoProperties"; + + try + { + client.createCommunity(userId, null, null, null); + + throw new FVTUnexpectedCondition(testCaseName, activityName); + } + catch (InvalidParameterException expectedException) + { + // ignore + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Test null userId passed to createCommunity. + * + * @param client client to call + * @throws FVTUnexpectedCondition the test case failed + */ + private void testSetUpCommunityNoName(CommunityManagement client, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "testSetUpCommunityNoUserId"; + + try + { + client.createCommunity(userId, null, null, new CommunityProperties()); + + throw new FVTUnexpectedCondition(testCaseName, activityName); + } + catch (InvalidParameterException expectedException) + { + // ignore + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + + /** + * Test null qualifiedName passed to createCommunity. + * + * @param client client to call + * @param userId calling user + * @throws FVTUnexpectedCondition the test case failed + */ + private void testSetUpCommunity(CommunityManagement client, + String userId) throws FVTUnexpectedCondition + { + final String activityName = "testSetUpProfileNoName"; + + try + { + testSetUpCommunityNoUserId(client); + testSetUpCommunityNoProperties(client, userId); + testSetUpCommunityNoName(client, userId); + + } + catch (FVTUnexpectedCondition expectedException) + { + // ignore + } + catch (Exception unexpectedError) + { + throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); + } + } + + /** + * Create a client using each of its constructors. + * + * @param serverName name of the server to connect to + * @param serverPlatformRootURL the network address of the server running the OMAS REST servers + * @param userId calling user + * @param auditLog logging destination + * @throws FVTUnexpectedCondition the test case failed + */ + private void testOrganizationClient(String serverName, + String serverPlatformRootURL, + String userId, + AuditLog auditLog) throws FVTUnexpectedCondition + { + final String activityName = "testOrganizationClient"; + + try + { + CommunityProfileRESTClient restClient = new CommunityProfileRESTClient(serverName, serverPlatformRootURL, auditLog); + OrganizationManagement client = new OrganizationManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); testGetMyProfile(client); - testGetMyKarmaPoints(client); - testSetUpMyProfile(userId, client); + testGetProfileByUserId(client); + testSetUpProfile(userId, client); } catch (FVTUnexpectedCondition testCaseError) { @@ -125,7 +276,7 @@ private void testMyProfileClient(String serverName, * @param client client to call * @throws FVTUnexpectedCondition the test case failed */ - private void testGetMyProfile(MyProfileManagement client) throws FVTUnexpectedCondition + private void testGetMyProfile(OrganizationManagement client) throws FVTUnexpectedCondition { final String activityName = "testGetMyProfile"; @@ -146,13 +297,13 @@ private void testGetMyProfile(MyProfileManagement client) throws FVTUnexpectedCo * @param client client to call * @throws FVTUnexpectedCondition the test case failed */ - private void testGetMyProfileNoUserId(MyProfileManagement client) throws FVTUnexpectedCondition + private void testGetMyProfileNoUserId(OrganizationManagement client) throws FVTUnexpectedCondition { final String activityName = "testGetMyProfileNoUserId"; try { - client.getMyProfile(null); + client.getActorProfiles(null, 0, 0); throw new FVTUnexpectedCondition(testCaseName, activityName); } catch (InvalidParameterException expectedException) @@ -172,13 +323,13 @@ private void testGetMyProfileNoUserId(MyProfileManagement client) throws FVTUnex * @param client client to call * @throws FVTUnexpectedCondition the test case failed */ - private void testGetMyKarmaPoints(MyProfileManagement client) throws FVTUnexpectedCondition + private void testGetProfileByUserId(OrganizationManagement client) throws FVTUnexpectedCondition { final String activityName = "testGetMyKarmaPoints"; try { - testGetMyKarmaPointsNoUserId(client); + testGetProfileByUserIdNoUserId(client); } catch (Exception unexpectedError) { @@ -193,13 +344,13 @@ private void testGetMyKarmaPoints(MyProfileManagement client) throws FVTUnexpect * @param client client to call * @throws FVTUnexpectedCondition the test case failed */ - private void testGetMyKarmaPointsNoUserId(MyProfileManagement client) throws FVTUnexpectedCondition + private void testGetProfileByUserIdNoUserId(OrganizationManagement client) throws FVTUnexpectedCondition { - final String activityName = "testGetMyKarmaPointsNoUserId"; + final String activityName = "testGetProfileByUserIdNoUserId"; try { - client.getMyKarmaPoints(null); + client.getActorProfileByUserId(null, "testProfileUserId"); throw new FVTUnexpectedCondition(testCaseName, activityName); } catch (InvalidParameterException expectedException) @@ -220,16 +371,16 @@ private void testGetMyKarmaPointsNoUserId(MyProfileManagement client) throws FVT * @param client client to call * @throws FVTUnexpectedCondition the test case failed */ - private void testSetUpMyProfile(String userId, - MyProfileManagement client) throws FVTUnexpectedCondition + private void testSetUpProfile(String userId, + OrganizationManagement client) throws FVTUnexpectedCondition { - final String activityName = "testSetUpMyProfileNoUserId"; + final String activityName = "testSetUpProfile"; try { - testSetUpMyProfileNoUserId(client); - testSetUpMyProfileNoQualifiedName(client, userId); - testSetUpMyProfileNoKnownName(client, userId); + testSetUpProfileNoUserId(client); + testSetUpProfileNoProperties(client, userId); + testSetUpProfileNoName(client, userId); } catch (Exception unexpectedError) { @@ -239,18 +390,21 @@ private void testSetUpMyProfile(String userId, /** - * Test null userId passed to getMyKarmaPoints. + * Test null userId passed to createActorProfile. * * @param client client to call * @throws FVTUnexpectedCondition the test case failed */ - private void testSetUpMyProfileNoUserId(MyProfileManagement client) throws FVTUnexpectedCondition + private void testSetUpProfileNoUserId(OrganizationManagement client) throws FVTUnexpectedCondition { final String activityName = "testSetUpMyProfileNoUserId"; try { - client.setUpMyProfile(null, "qualifiedName", "fullName", "knownName", "jobTitle", "jobRoleDescription", new HashMap<>()); + ActorProfileProperties properties = new ActorProfileProperties(); + properties.setQualifiedName("TestQualifiedName"); + client.createActorProfile(null, null, null, properties, null); + throw new FVTUnexpectedCondition(testCaseName, activityName); } catch (InvalidParameterException expectedException) @@ -265,20 +419,20 @@ private void testSetUpMyProfileNoUserId(MyProfileManagement client) throws FVTUn /** - * Test null qualifiedName passed to createFileSystem. + * Test null properties passed to createActorProfile. * * @param client client to call * @param userId calling user * @throws FVTUnexpectedCondition the test case failed */ - private void testSetUpMyProfileNoQualifiedName(MyProfileManagement client, - String userId) throws FVTUnexpectedCondition + private void testSetUpProfileNoProperties(OrganizationManagement client, + String userId) throws FVTUnexpectedCondition { - final String activityName = "testSetUpMyProfileNoQualifiedName"; + final String activityName = "testSetUpProfileNoProperties"; try { - client.setUpMyProfile(userId, null, "fullName", "knownName", "jobTitle", "jobRoleDescription", new HashMap<>()); + client.createActorProfile(userId, null, null, null, null); throw new FVTUnexpectedCondition(testCaseName, activityName); } @@ -294,20 +448,20 @@ private void testSetUpMyProfileNoQualifiedName(MyProfileManagement client, /** - * Test null knownName passed to createFileSystem. + * Test null qualifiedName passed to createActorProfile. * * @param client client to call * @param userId calling user * @throws FVTUnexpectedCondition the test case failed */ - private void testSetUpMyProfileNoKnownName(MyProfileManagement client, - String userId) throws FVTUnexpectedCondition + private void testSetUpProfileNoName(OrganizationManagement client, + String userId) throws FVTUnexpectedCondition { - final String activityName = "testSetUpMyProfileNoKnownName"; + final String activityName = "testSetUpProfileNoName"; try { - client.setUpMyProfile(userId, "qualifiedName", "fullName", null, "jobTitle", "jobRoleDescription", new HashMap<>()); + client.createActorProfile(userId, null, null, new ActorProfileProperties(), null); throw new FVTUnexpectedCondition(testCaseName, activityName); } diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/profiles/CreateProfileTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/profiles/CreateProfileTest.java index d96f1100053..e61d3039c4d 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/profiles/CreateProfileTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/community-profile-fvt/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/fvt/profiles/CreateProfileTest.java @@ -4,9 +4,7 @@ package org.odpi.openmetadata.accessservices.communityprofile.fvt.profiles; -import org.odpi.openmetadata.accessservices.communityprofile.client.MyProfileManagement; import org.odpi.openmetadata.accessservices.communityprofile.client.OrganizationManagement; -import org.odpi.openmetadata.accessservices.communityprofile.client.PersonalProfileManagement; import org.odpi.openmetadata.accessservices.communityprofile.client.rest.CommunityProfileRESTClient; import org.odpi.openmetadata.accessservices.communityprofile.properties.ActorProfileProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.AppointmentProperties; @@ -18,7 +16,6 @@ import org.odpi.openmetadata.fvt.utilities.auditlog.FVTAuditLogDestination; import org.odpi.openmetadata.fvt.utilities.exceptions.FVTUnexpectedCondition; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -228,36 +225,6 @@ private void runOrganizationTest(OrganizationManagement client, } - - /** - * Create and return a personal profile manager client. - * - * @param serverName name of the server to connect to - * @param serverPlatformRootURL the network address of the server running the OMAS REST servers - * @param auditLog logging destination - * @return client - * @throws FVTUnexpectedCondition the test case failed - */ - private PersonalProfileManagement getProfileManagerClient(String serverName, - String serverPlatformRootURL, - AuditLog auditLog) throws FVTUnexpectedCondition - { - final String activityName = "getProfileManagerClient"; - - try - { - CommunityProfileRESTClient restClient = new CommunityProfileRESTClient(serverName, serverPlatformRootURL, auditLog); - - return new PersonalProfileManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); - } - catch (Exception unexpectedError) - { - throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); - } - } - - - /** * Create and return a personal profile manager client. * @@ -285,34 +252,4 @@ private OrganizationManagement getOrganizationClient(String serverName, } } - - /** - * Create and return a my profile manager client. - * - * @param serverName name of the server to connect to - * @param serverPlatformRootURL the network address of the server running the OMAS REST servers - * @param auditLog logging destination - * @return client - * @throws FVTUnexpectedCondition the test case failed - */ - private MyProfileManagement getMyProfileManagerClient(String serverName, - String serverPlatformRootURL, - AuditLog auditLog) throws FVTUnexpectedCondition - { - final String activityName = "getMyProfileManagerClient"; - - try - { - CommunityProfileRESTClient restClient = new CommunityProfileRESTClient(serverName, serverPlatformRootURL, auditLog); - - return new MyProfileManagement(serverName, serverPlatformRootURL, restClient, maxPageSize); - } - catch (Exception unexpectedError) - { - throw new FVTUnexpectedCondition(testCaseName, activityName, unexpectedError); - } - } - - - } diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/clientconstructors/ClientConstructorTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/clientconstructors/ClientConstructorTest.java index 1e8e5d6005f..d5fd93edd54 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/clientconstructors/ClientConstructorTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/clientconstructors/ClientConstructorTest.java @@ -104,7 +104,7 @@ private void testMetadataSourceClient(String serverName, DataManagerRESTClient restClient = new DataManagerRESTClient(serverName, serverPlatformRootURL); - new MetadataSourceClient(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); + new MetadataSourceClient(serverName, serverPlatformRootURL, restClient, maxPageSize); } diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/connections/CreateConnectionTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/connections/CreateConnectionTest.java index ca1bd2e5ae6..5608ddc4fca 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/connections/CreateConnectionTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/connections/CreateConnectionTest.java @@ -113,7 +113,7 @@ private static void runIt(String serverPlatformRootURL, ConnectionManagerClient client = thisTest.getConnectionClient(serverName, serverPlatformRootURL, auditLog); - String databaseManagerGUID = thisTest.getDatabaseManager(serverName, serverPlatformRootURL, userId, auditLog); + String databaseManagerGUID = thisTest.getDatabaseManager(serverName, serverPlatformRootURL, userId); String connectionGUID = thisTest.getConnection(client, databaseManagerGUID, userId); String endpointGUID = thisTest.createEndpoint(client, databaseManagerGUID, connectionGUID, userId); thisTest.addConnectorType(client, databaseManagerGUID, connectionGUID, userId); @@ -180,21 +180,19 @@ private ConnectionManagerClient getConnectionClient(String serverName, * @param serverName name of the server to connect to * @param serverPlatformRootURL the network address of the server running the OMAS REST servers * @param userId calling user - * @param auditLog logging destination * @return unique identifier of the connection manager entity * @throws FVTUnexpectedCondition the test case failed */ private String getDatabaseManager(String serverName, String serverPlatformRootURL, - String userId, - AuditLog auditLog) throws FVTUnexpectedCondition + String userId) throws FVTUnexpectedCondition { final String activityName = "getDatabaseManager"; try { DataManagerRESTClient restClient = new DataManagerRESTClient(serverName, serverPlatformRootURL); - MetadataSourceClient client = new MetadataSourceClient(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); + MetadataSourceClient client = new MetadataSourceClient(serverName, serverPlatformRootURL, restClient, maxPageSize); DatabaseManagerProperties properties = new DatabaseManagerProperties(); properties.setQualifiedName(databaseManagerName); diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/databases/CreateDatabaseTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/databases/CreateDatabaseTest.java index e3413d39202..9bdf66bd2d8 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/databases/CreateDatabaseTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/databases/CreateDatabaseTest.java @@ -403,7 +403,7 @@ private String getDatabaseManager(String serverName, try { DataManagerRESTClient restClient = new DataManagerRESTClient(serverName, serverPlatformRootURL); - MetadataSourceClient client = new MetadataSourceClient(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); + MetadataSourceClient client = new MetadataSourceClient(serverName, serverPlatformRootURL, restClient, maxPageSize); DatabaseManagerProperties properties = new DatabaseManagerProperties(); properties.setQualifiedName(databaseManagerName); diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/errorhandling/InvalidParameterTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/errorhandling/InvalidParameterTest.java index d9b9c922d2f..81539d00cab 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/errorhandling/InvalidParameterTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/errorhandling/InvalidParameterTest.java @@ -111,7 +111,7 @@ private void testMetadataSourceClient(String serverName, try { DataManagerRESTClient restClient = new DataManagerRESTClient(serverName, serverPlatformRootURL, auditLog); - MetadataSourceClient client = new MetadataSourceClient(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); + MetadataSourceClient client = new MetadataSourceClient(serverName, serverPlatformRootURL, restClient, maxPageSize); testCreateFileSystem(userId, client); testCreateFileManager(userId, client); diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/events/CreateEventsTest.java b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/events/CreateEventsTest.java index fe8ffaf7e5c..1bea6545bde 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/events/CreateEventsTest.java +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/data-manager-fvt/src/main/java/org/odpi/openmetadata/accessservices/datamanager/fvt/events/CreateEventsTest.java @@ -257,7 +257,7 @@ private String getEventBroker(String serverName, try { DataManagerRESTClient restClient = new DataManagerRESTClient(serverName, serverPlatformRootURL); - MetadataSourceClient client = new MetadataSourceClient(serverName, serverPlatformRootURL, restClient, maxPageSize, auditLog); + MetadataSourceClient client = new MetadataSourceClient(serverName, serverPlatformRootURL, restClient, maxPageSize); EventBrokerProperties properties = new EventBrokerProperties(); properties.setQualifiedName(eventBrokerName); From 5aab007d2325ca450e08487a61a3c94242d501e7 Mon Sep 17 00:00:00 2001 From: Mandy Chessell <mandy.e.chessell@gmail.com> Date: Thu, 8 Sep 2022 17:42:12 +0100 Subject: [PATCH 2/9] Consistent url specification and bug fixes Signed-off-by: Mandy Chessell <mandy.e.chessell@gmail.com> --- .../eventclient/AssetCatalogEventClient.java | 4 +- .../assetconsumer/client/AssetConsumer.java | 106 ++-- .../client/AssetConsumerEventClient.java | 4 +- .../client/AssetManagerEventClient.java | 4 +- .../client/GovernanceExchangeClient.java | 44 +- .../assetowner/client/AssetOwner.java | 246 ++++---- .../client/AssetOwnerEventClient.java | 4 +- .../assetowner/client/AvroFileAssetOwner.java | 4 +- .../assetowner/client/CSVFileAssetOwner.java | 4 +- .../client/FileSystemAssetOwner.java | 80 +-- .../client/ValidValuesAssetOwner.java | 50 +- .../api/UserIdentityManagementInterface.java | 26 +- .../properties/ProfileIdentityProperties.java | 4 +- .../properties/RelationshipProperties.java | 1 + .../CommunityProfileOMASAPIRequestBody.java | 1 - .../rest/ProfileIdentityRequestBody.java | 125 ----- .../rest/ReferenceableRequestBody.java | 33 +- .../rest/UserIdentityRequestBody.java | 126 ----- .../client/CommunityManagement.java | 41 -- .../client/CommunityProfileBaseClient.java | 123 +++- .../client/CommunityProfileEventClient.java | 4 +- .../client/SecurityGroupManagement.java | 24 +- .../client/UserIdentityManagement.java | 185 ++---- .../server/UserIdentityRESTServices.java | 337 ++++++++--- .../server/spring/UserIdentityResource.java | 70 ++- .../client/DataManagerBaseClient.java | 4 +- .../client/DataManagerEventClient.java | 14 +- .../client/ConnectionManager.java | 116 ++-- .../DigitalArchitectureEventClient.java | 4 +- .../client/LocationManager.java | 88 +-- .../client/ReferenceDataManager.java | 125 ++--- .../client/DiscoveryEngineClient.java | 131 +++-- .../client/GovernanceActionProcessClient.java | 84 +-- .../client/GovernanceEngineClient.java | 152 +++-- .../GovernanceEngineConfigurationClient.java | 76 +-- .../client/GovernanceEngineEventClient.java | 4 +- .../rest/ReferenceableRequestBody.java | 1 + .../client/CertificationManager.java | 34 +- .../client/ExternalReferenceManager.java | 44 +- .../GovernanceClassificationLevelManager.java | 32 +- .../client/GovernanceDefinitionManager.java | 14 +- .../client/GovernanceDomainManager.java | 76 ++- .../client/GovernanceMetricsManager.java | 41 +- .../client/GovernanceProgramBaseClient.java | 96 ++-- .../GovernanceProgramReviewManager.java | 29 +- .../client/GovernanceRoleManager.java | 41 +- .../client/GovernanceStatusLevelManager.java | 29 +- .../client/GovernanceZoneManager.java | 26 +- .../client/RightsManager.java | 34 +- .../client/SubjectAreaManager.java | 33 +- .../client/EndpointManagerClient.java | 6 +- .../client/ITInfrastructureEventClient.java | 4 +- .../server/ITProfileRESTServices.java | 3 + .../server/spring/ITProfileResource.java | 8 +- .../client/ProjectManagementBaseClient.java | 4 +- .../client/SecurityManagerBaseClient.java | 4 +- .../client/SecurityManagerEventClient.java | 4 +- .../server/SecurityManagerRESTServices.java | 3 + .../spring/SecurityManagerOMASResource.java | 2 +- .../client/StewardshipAction.java | 44 +- .../client/StewardshipActionEventClient.java | 4 +- .../generichandlers/ActorProfileHandler.java | 6 +- .../OpenMetadataAPIGenericHandler.java | 31 +- .../generichandlers/UserIdentityHandler.java | 96 +++- .../OrganizationIntegratorContext.java | 21 + .../GovernanceLeadershipSample.java | 531 ++++++++++++------ .../CreateGovernanceZoneSample.java | 1 + 67 files changed, 2004 insertions(+), 1746 deletions(-) delete mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ProfileIdentityRequestBody.java delete mode 100644 open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityRequestBody.java diff --git a/open-metadata-implementation/access-services/asset-catalog/asset-catalog-client/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/eventclient/AssetCatalogEventClient.java b/open-metadata-implementation/access-services/asset-catalog/asset-catalog-client/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/eventclient/AssetCatalogEventClient.java index ec20383a312..de70b566055 100644 --- a/open-metadata-implementation/access-services/asset-catalog/asset-catalog-client/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/eventclient/AssetCatalogEventClient.java +++ b/open-metadata-implementation/access-services/asset-catalog/asset-catalog-client/src/main/java/org/odpi/openmetadata/accessservices/assetcatalog/eventclient/AssetCatalogEventClient.java @@ -149,13 +149,13 @@ public void registerListener(String userId, final String methodName = "registerListener"; final String nameParameter = "listener"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-catalog/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-catalog/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java index 576af8101c2..0068280fd80 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java @@ -203,13 +203,13 @@ public String getAssetForConnectionName(String userId, { final String methodName = "getAssetForConnectionName"; final String nameParameter = "connectionName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/by-connection-name/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/by-connection-name/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(connectionName, nameParameter, methodName); GUIDResponse restResult = restClient.callGUIDGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, connectionName); @@ -241,7 +241,7 @@ private List<String> getAssetsByName(String userId, PropertyServerException, UserNotAuthorizedException { - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/by-name?startFrom={2}&pageSize={3}"; return retrieveAssets(userId, name, startFrom, pageSize, urlTemplate, methodName); } @@ -271,7 +271,7 @@ public List<String> findAssets(String userId, UserNotAuthorizedException { final String methodName = "findAssets"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/by-search-string?startFrom={2}&pageSize={3}"; return retrieveAssets(userId, searchString, startFrom, pageSize, urlTemplate, methodName); } @@ -302,7 +302,7 @@ private List<String> retrieveAssets(String userId, UserNotAuthorizedException { GUIDListResponse restResult = restClient.callGUIDListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, searchString, serverName, userId, @@ -454,7 +454,7 @@ public void addRatingToAsset(String userId, final String methodName = "addRatingToAsset"; final String guidParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/ratings"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/ratings"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); @@ -465,7 +465,7 @@ public void addRatingToAsset(String userId, requestBody.setPublic(isPublic); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -492,13 +492,13 @@ public void removeRatingFromAsset(String userId, final String methodName = "removeRatingFromAsset"; final String guidParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/ratings/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/ratings/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -527,7 +527,7 @@ public void addLikeToAsset(String userId, final String methodName = "addLikeToAsset"; final String guidParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/likes"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/likes"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); @@ -535,7 +535,7 @@ public void addLikeToAsset(String userId, FeedbackRequestBody requestBody = new FeedbackRequestBody(); requestBody.setIsPublic(isPublic); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -562,13 +562,13 @@ public void removeLikeFromAsset(String userId, final String methodName = "removeLikeFromAsset"; final String guidParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/likes/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/likes/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -603,7 +603,7 @@ public String addCommentToAsset(String userId, final String methodName = "addCommentToAsset"; final String guidParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/comments"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/comments"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); @@ -614,7 +614,7 @@ public String addCommentToAsset(String userId, requestBody.setIsPublic(isPublic); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -652,7 +652,7 @@ public String addCommentReply(String userId, { final String methodName = "addCommentReply"; final String commentGUIDParameter = "commentGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/comments/{2}/replies"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/comments/{2}/replies"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(commentGUID, commentGUIDParameter, methodName); @@ -663,7 +663,7 @@ public String addCommentReply(String userId, requestBody.setIsPublic(isPublic); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -700,7 +700,7 @@ public void updateComment(String userId, final String methodName = "updateComment"; final String assetGUIDParameter = "assetGUID"; final String commentGUIDParameter = "commentGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/comments/{3}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/comments/{3}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); @@ -712,7 +712,7 @@ public void updateComment(String userId, requestBody.setIsPublic(isPublic); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -743,14 +743,14 @@ public void removeComment(String userId, final String assetGUIDParameter = "assetGUID"; final String commentGUIDParameter = "commentGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/comments/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/comments/{3}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); invalidParameterHandler.validateGUID(commentGUID, commentGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -785,14 +785,14 @@ public MeaningElement getMeaning(String userId, UserNotAuthorizedException { final String methodName = "getMeaning"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/meanings/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/meanings/{2}"; final String guidParameter = "guid"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(guid, guidParameter, methodName); GlossaryTermResponse restResult = restClient.callGlossaryTermGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, guid); @@ -823,7 +823,7 @@ public List<MeaningElement> getMeaningByName(String userId, UserNotAuthorizedException { final String methodName = "getMeaningByName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/meanings/by-name/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/meanings/by-name/{2}?startFrom={3}&pageSize={4}"; return retrieveMeanings(userId, term, startFrom, pageSize, urlTemplate, methodName); } @@ -851,7 +851,7 @@ public List<MeaningElement> findMeanings(String userId, UserNotAuthorizedException { final String methodName = "findMeanings"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/meanings/by-search-string/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/meanings/by-search-string/{2}?startFrom={3}&pageSize={4}"; return retrieveMeanings(userId, term, startFrom, pageSize, urlTemplate, methodName); } @@ -887,7 +887,7 @@ private List<MeaningElement> retrieveMeanings(String userId, invalidParameterHandler.validateName(term, nameParameter, methodName); GlossaryTermListResponse restResult = restClient.callGlossaryTermListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, term, serverName, userId, @@ -921,14 +921,14 @@ public List<String> getAssetsByMeaning(String userId, UserNotAuthorizedException { final String methodName = "getAssetsByMeaning"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/by-meaning/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/by-meaning/{2}?startFrom={3}&pageSize={4}"; final String termGUIDParameterName = "termGUID"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(termGUID, termGUIDParameterName, methodName); GUIDListResponse restResult = restClient.callGUIDListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, termGUID, @@ -975,7 +975,7 @@ public void addLogMessageToAsset(String userId, final String methodName = "addLogMessageToAsset"; final String guidParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/log-records"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/log-records"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); @@ -988,7 +988,7 @@ public void addLogMessageToAsset(String userId, requestBody.setMessage(message); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1026,7 +1026,7 @@ private String createTag(boolean isPublic, PropertyServerException, UserNotAuthorizedException { - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags"; invalidParameterHandler.validateUserId(userId, methodName); @@ -1036,7 +1036,7 @@ private String createTag(boolean isPublic, tagRequestBody.setDescription(tagDescription); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, tagRequestBody, serverName, userId); @@ -1121,7 +1121,7 @@ public void updateTagDescription(String userId, final String methodName = "updateTagDescription"; final String guidParameter = "tagGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/{2}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(tagGUID, guidParameter, methodName); @@ -1130,7 +1130,7 @@ public void updateTagDescription(String userId, tagRequestBody.setDescription(tagDescription); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, tagRequestBody, serverName, userId, @@ -1159,13 +1159,13 @@ public void deleteTag(String userId, final String methodName = "deleteTag"; final String guidParameter = "tagGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/{2}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(tagGUID, guidParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1191,14 +1191,14 @@ public InformalTagElement getTag(String userId, UserNotAuthorizedException { final String methodName = "getTag"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/{2}"; final String guidParameter = "guid"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(guid, guidParameter, methodName); TagResponse restResult = restClient.callInformalTagGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, guid); @@ -1229,7 +1229,7 @@ public List<InformalTagElement> getTagsByName(String userId, UserNotAuthorizedException { final String methodName = "getTagsByName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/by-name?startFrom={2}&pageSize={3}"; return retrieveTags(userId, tag, startFrom, pageSize, urlTemplate, methodName); } @@ -1257,7 +1257,7 @@ public List<InformalTagElement> getMyTagsByName(String userId, UserNotAuthorizedException { final String methodName = "getTagsByName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/private/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/private/by-name?startFrom={2}&pageSize={3}"; return retrieveTags(userId, tag, startFrom, pageSize, urlTemplate, methodName); } @@ -1285,7 +1285,7 @@ public List<InformalTagElement> findTags(String userId, UserNotAuthorizedException { final String methodName = "findTags"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/by-search-string?startFrom={2}&pageSize={3}"; return retrieveTags(userId, tag, startFrom, pageSize, urlTemplate, methodName); } @@ -1313,7 +1313,7 @@ public List<InformalTagElement> findMyTags(String userId, UserNotAuthorizedException { final String methodName = "findTags"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/private/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/tags/private/by-search-string?startFrom={2}&pageSize={3}"; return retrieveTags(userId, tag, startFrom, pageSize, urlTemplate, methodName); } @@ -1349,7 +1349,7 @@ private List<InformalTagElement> retrieveTags(String userId, invalidParameterHandler.validateName(tag, nameParameter, methodName); TagsResponse restResult = restClient.callInformalTagListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, tag, serverName, userId, @@ -1384,7 +1384,7 @@ public void addTagToAsset(String userId, final String assetGUIDParameterName = "assetGUID"; final String tagGUIDParameterName = "tagGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/tags/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/tags/{3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameterName, methodName); @@ -1393,7 +1393,7 @@ public void addTagToAsset(String userId, FeedbackRequestBody requestBody = new FeedbackRequestBody(); requestBody.setIsPublic(isPublic); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1426,7 +1426,7 @@ public void addTagToElement(String userId, final String elementGUIDParameterName = "elementGUID"; final String tagGUIDParameterName = "tagGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/elements/{2}/tags/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/elements/{2}/tags/{3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); @@ -1435,7 +1435,7 @@ public void addTagToElement(String userId, FeedbackRequestBody requestBody = new FeedbackRequestBody(); requestBody.setIsPublic(isPublic); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1467,14 +1467,14 @@ public void removeTagFromAsset(String userId, final String assetGUIDParameterName = "assetGUID"; final String tagGUIDParameterName = "tagGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/tags/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/{2}/tags/{3}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameterName, methodName); invalidParameterHandler.validateGUID(tagGUID, tagGUIDParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1505,14 +1505,14 @@ public void removeTagFromElement(String userId, final String elementGUIDParameterName = "elementGUID"; final String tagGUIDParameterName = "tagGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/elements/{2}/tags/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/elements/{2}/tags/{3}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); invalidParameterHandler.validateGUID(tagGUID, tagGUIDParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1545,14 +1545,14 @@ public List<String> getAssetsByTag(String userId, UserNotAuthorizedException { final String methodName = "getAssetsByTag"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/by-tag/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/assets/by-tag/{2}?startFrom={3}&pageSize={4}"; final String tagGUIDParameterName = "tagGUID"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(tagGUID, tagGUIDParameterName, methodName); GUIDListResponse restResult = restClient.callGUIDListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, tagGUID, diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumerEventClient.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumerEventClient.java index 27168c4d8ed..3e7a2469901 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumerEventClient.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumerEventClient.java @@ -115,7 +115,7 @@ public void registerListener(String userId, final String nameParameter = "listener"; final String callerIdParameter = "callerId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); @@ -128,7 +128,7 @@ public void registerListener(String userId, * event bus. */ ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerEventClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerEventClient.java index 6217dccc44f..b927b5fb278 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerEventClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/AssetManagerEventClient.java @@ -115,7 +115,7 @@ public void registerListener(String userId, final String nameParameter = "listener"; final String callerIdParameter = "callerId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); @@ -128,7 +128,7 @@ public void registerListener(String userId, * event bus. */ ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/GovernanceExchangeClient.java b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/GovernanceExchangeClient.java index 3328777470b..2ba53789dc6 100644 --- a/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/GovernanceExchangeClient.java +++ b/open-metadata-implementation/access-services/asset-manager/asset-manager-client/src/main/java/org/odpi/openmetadata/accessservices/assetmanager/client/GovernanceExchangeClient.java @@ -502,7 +502,7 @@ public List<GovernanceActionProcessElement> findGovernanceActionProcesses(String { final String methodName = "findGovernanceActionProcesses"; final String searchStringParameterName = "searchString"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-processes/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-processes/by-search-string?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); @@ -513,7 +513,7 @@ public List<GovernanceActionProcessElement> findGovernanceActionProcesses(String requestBody.setSearchStringParameterName(searchStringParameterName); GovernanceActionProcessElementsResponse restResult = restClient.callGovernanceActionProcessElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -550,7 +550,7 @@ public List<GovernanceActionProcessElement> getGovernanceActionProcessesByName(S { final String methodName = "getGovernanceActionProcessesByName"; final String nameParameterName = "name"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-processes/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-processes/by-name?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(name, nameParameterName, methodName); @@ -561,7 +561,7 @@ public List<GovernanceActionProcessElement> getGovernanceActionProcessesByName(S requestBody.setNameParameterName(nameParameterName); GovernanceActionProcessElementsResponse restResult = restClient.callGovernanceActionProcessElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -593,13 +593,13 @@ public GovernanceActionProcessElement getGovernanceActionProcessByGUID(String us { final String methodName = "getGovernanceActionProcessByGUID"; final String guidParameterName = "processGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-processes/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-processes/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(processGUID, guidParameterName, methodName); GovernanceActionProcessElementResponse restResult = restClient.callGovernanceActionProcessGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, processGUID); @@ -638,7 +638,7 @@ public List<GovernanceActionTypeElement> findGovernanceActionTypes(String userId { final String methodName = "findGovernanceActionTypes"; final String searchStringParameterName = "searchString"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-types/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-types/by-search-string?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); @@ -649,7 +649,7 @@ public List<GovernanceActionTypeElement> findGovernanceActionTypes(String userId requestBody.setSearchStringParameterName(searchStringParameterName); GovernanceActionTypeElementsResponse restResult = restClient.callGovernanceActionTypeElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -685,7 +685,7 @@ public List<GovernanceActionTypeElement> getGovernanceActionTypesByName(String u { final String methodName = "getGovernanceActionTypesByName"; final String nameParameterName = "name"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-types/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-types/by-name?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(name, nameParameterName, methodName); @@ -696,7 +696,7 @@ public List<GovernanceActionTypeElement> getGovernanceActionTypesByName(String u requestBody.setNameParameterName(nameParameterName); GovernanceActionTypeElementsResponse restResult = restClient.callGovernanceActionTypeElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -727,13 +727,13 @@ public GovernanceActionTypeElement getGovernanceActionTypeByGUID(String userId, { final String methodName = "getGovernanceActionTypeByGUID"; final String guidParameterName = "actionTypeGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-types/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-types/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(actionTypeGUID, guidParameterName, methodName); GovernanceActionTypeElementResponse restResult = restClient.callGovernanceActionTypeGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, actionTypeGUID); @@ -762,13 +762,13 @@ public GovernanceActionTypeElement getFirstActionType(String userId, { final String methodName = "getFirstActionType"; final String guidParameterName = "processGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-processes/{2}/first-action-type"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-processes/{2}/first-action-type"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(processGUID, guidParameterName, methodName); GovernanceActionTypeElementResponse restResult = restClient.callGovernanceActionTypeGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, processGUID); @@ -801,13 +801,13 @@ public List<NextGovernanceActionTypeElement> getNextGovernanceActionTypes(String { final String methodName = "getNextGovernanceActionTypes"; final String guidParameterName = "actionTypeGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-types/{2}/next-action-type?startFrom={4}&pageSize={5}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-action-types/{2}/next-action-type?startFrom={4}&pageSize={5}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(actionTypeGUID, guidParameterName, methodName); NextGovernanceActionTypeElementsResponse restResult = restClient.callNextGovernanceActionTypesGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, actionTypeGUID, @@ -838,13 +838,13 @@ public GovernanceActionElement getGovernanceAction(String userId, { final String methodName = "getGovernanceAction"; final String guidParameterName = "governanceActionGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-actions/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-actions/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceActionGUID, guidParameterName, methodName); GovernanceActionElementResponse restResult = restClient.callGovernanceActionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, governanceActionGUID); @@ -873,12 +873,12 @@ public List<GovernanceActionElement> getGovernanceActions(String userId, PropertyServerException { final String methodName = "getGovernanceActions"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-actions?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-actions?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); GovernanceActionElementsResponse restResult = restClient.callGovernanceActionsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, Integer.toString(startFrom), @@ -908,12 +908,12 @@ public List<GovernanceActionElement> getActiveGovernanceActions(String userId, PropertyServerException { final String methodName = "getActiveGovernanceActions"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-actions/active?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-manager/users/{1}/governance-actions/active?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); GovernanceActionElementsResponse restResult = restClient.callGovernanceActionsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, Integer.toString(startFrom), diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java index 159931551df..002d2afd6c6 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java @@ -191,12 +191,12 @@ public List<String> getTypesOfAsset(String userId) throws InvalidParameterExcep PropertyServerException { final String methodName = "getTypesOfAsset"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/sub-types"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/sub-types"; invalidParameterHandler.validateUserId(userId, methodName); NameListResponse restResult = restClient.callNameListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId); @@ -219,12 +219,12 @@ public Map<String, String> getTypesOfAssetWithDescriptions(String userId) throw PropertyServerException { final String methodName = "getTypesOfAssetWithDescriptions"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/sub-types/descriptions"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/sub-types/descriptions"; invalidParameterHandler.validateUserId(userId, methodName); StringMapResponse restResult = restClient.callStringMapGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId); @@ -305,7 +305,7 @@ public String addAssetToCatalog(String userId, final String methodName = "addAssetToCatalog"; final String assetPropertiesParameterName = "assetProperties"; final String qualifiedNameParameter = "assetProperties.getQualifiedName()"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(assetProperties, assetPropertiesParameterName, methodName); @@ -317,7 +317,7 @@ public String addAssetToCatalog(String userId, } GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, assetProperties, serverName, userId, @@ -351,7 +351,7 @@ public String addAssetToCatalogUsingTemplate(String userId, final String templateGUIDParameterName = "templateGUID"; final String propertiesParameterName = "templateProperties"; final String qualifiedNameParameterName = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/from-template/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/from-template/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(templateGUID, templateGUIDParameterName, methodName); @@ -359,7 +359,7 @@ public String addAssetToCatalogUsingTemplate(String userId, invalidParameterHandler.validateName(templateProperties.getQualifiedName(), qualifiedNameParameterName, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, templateProperties, serverName, userId, @@ -397,7 +397,7 @@ public String addCombinedSchemaToAsset(String userId, final String methodName = "addCombinedSchemaToAsset"; final String assetGUIDParameter = "assetGUID"; final String schemaTypeParameter = "schemaType"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/with-attributes"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/with-attributes"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); @@ -409,7 +409,7 @@ public String addCombinedSchemaToAsset(String userId, requestBody.setSchemaAttributes(schemaAttributes); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -444,14 +444,14 @@ public String addSchemaTypeToAsset(String userId, final String methodName = "addSchemaTypeToAsset"; final String assetGUIDParameter = "assetGUID"; final String schemaTypeParameter = "schemaType"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); invalidParameterHandler.validateObject(schemaType, schemaTypeParameter, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, schemaType, serverName, userId, @@ -485,7 +485,7 @@ public void attachSchemaTypeToAsset(String userId, final String assetGUIDParameter = "assetGUID"; final String schemaTypeParameter = "schemaTypeGUID"; final String urlTemplate - = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/{3}/attach"; + = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/{3}/attach"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); @@ -493,7 +493,7 @@ public void attachSchemaTypeToAsset(String userId, restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -522,13 +522,13 @@ public String detachSchemaTypeFromAsset(String userId, final String methodName = "detachSchemaTypeFromAsset"; final String assetGUIDParameter = "assetGUID"; final String urlTemplate - = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/detach"; + = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/detach"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -557,13 +557,13 @@ public void deleteAssetSchemaType(String userId, final String methodName = "deleteAssetSchemaType"; final String assetGUIDParameter = "assetGUID"; final String urlTemplate - = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/delete"; + = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -599,7 +599,7 @@ public void addSchemaAttributes(String serverName, final String parentGUIDParameter = "parentGUID"; final String schemaAttributesParameter = "schemaAttributes"; final String urlTemplate - = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/{3}/schema-attributes/list"; + = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/{3}/schema-attributes/list"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); @@ -607,7 +607,7 @@ public void addSchemaAttributes(String serverName, invalidParameterHandler.validateObject(schemaAttributes, schemaAttributesParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, schemaAttributes, serverName, userId, @@ -648,7 +648,7 @@ public String addSchemaAttribute(String serverName, final String schemaAttributeParameter = "schemaAttribute"; final String qualifiedNameParameter = "schemaAttribute.getQualifiedName()"; final String urlTemplate - = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/{3}/schema-attributes"; + = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/schemas/{3}/schema-attributes"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); @@ -657,7 +657,7 @@ public String addSchemaAttribute(String serverName, invalidParameterHandler.validateName(schemaAttribute.getQualifiedName(), qualifiedNameParameter, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, schemaAttribute, serverName, userId, @@ -692,7 +692,7 @@ public void addConnectionToAsset(String userId, final String methodName = "addConnectionToAsset"; final String assetGUIDParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/connection"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/connection"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); @@ -703,7 +703,7 @@ public void addConnectionToAsset(String userId, requestBody.setConnection(connection); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -827,7 +827,7 @@ public void addAssetOrigin(String userId, { final String methodName = "addAssetOrigin"; final String assetGUIDParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/origin"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/origin"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); @@ -837,7 +837,7 @@ public void addAssetOrigin(String userId, requestBody.setOrganizationGUID(organizationGUID); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -862,13 +862,13 @@ public void removeAssetOrigin(String userId, { final String methodName = "removeAssetOrigin"; final String assetGUIDParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/origin/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/origin/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -893,13 +893,13 @@ public void publishAsset(String userId, { final String methodName = "publishAsset"; final String assetGUIDParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/publish"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/publish"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -924,13 +924,13 @@ public void withdrawAsset(String userId, { final String methodName = "withdrawAsset"; final String assetGUIDParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/withdraw"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/withdraw"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -959,13 +959,13 @@ public void updateAssetZones(String userId, final String methodName = "updateAssetZones"; final String assetGUIDParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/governance-zones"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/governance-zones"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, assetZones, serverName, userId, @@ -996,7 +996,7 @@ public void updateAssetOwner(String userId, final String methodName = "updateAssetOwner"; final String assetGUIDParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/owner"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/owner"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); @@ -1006,7 +1006,7 @@ public void updateAssetOwner(String userId, requestBody.setOwnerType(ownerType); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1038,7 +1038,7 @@ public void updateAssetOwner(String userId, final String methodName = "updateAssetOwner"; final String assetGUIDParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/owner"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/owner"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); @@ -1049,7 +1049,7 @@ public void updateAssetOwner(String userId, requestBody.setOwnerPropertyName(ownerPropertyName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1081,8 +1081,8 @@ public void addSecurityTags(String userId, { final String methodName = "addSecurityTags"; final String assetGUIDParameter = "assetGUID"; - final String assetURLTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/security-tags"; - final String elementURLTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/attachments/{3}/security-tags"; + final String assetURLTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/security-tags"; + final String elementURLTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/attachments/{3}/security-tags"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); @@ -1093,11 +1093,11 @@ public void addSecurityTags(String userId, if (assetElementGUID == null) { - restClient.callVoidPostRESTCall(methodName, serverPlatformURLRoot + assetURLTemplate, requestBody, serverName, userId, assetGUID); + restClient.callVoidPostRESTCall(methodName, assetURLTemplate, requestBody, serverName, userId, assetGUID); } else { - restClient.callVoidPostRESTCall(methodName, serverPlatformURLRoot + elementURLTemplate, requestBody, serverName, userId, assetGUID, assetElementGUID); + restClient.callVoidPostRESTCall(methodName, elementURLTemplate, requestBody, serverName, userId, assetGUID, assetElementGUID); } } @@ -1126,16 +1126,16 @@ public void removeSecurityTags(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); - final String assetURLTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/security-tags/delete"; - final String elementURLTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/attachments/{3}/security-tags/delete"; + final String assetURLTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/security-tags/delete"; + final String elementURLTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/attachments/{3}/security-tags/delete"; if (assetElementGUID == null) { - restClient.callVoidPostRESTCall(methodName, serverPlatformURLRoot + assetURLTemplate, nullRequestBody, serverName, userId, assetGUID); + restClient.callVoidPostRESTCall(methodName, assetURLTemplate, nullRequestBody, serverName, userId, assetGUID); } else { - restClient.callVoidPostRESTCall(methodName, serverPlatformURLRoot + elementURLTemplate, nullRequestBody, serverName, userId, assetGUID, assetElementGUID); + restClient.callVoidPostRESTCall(methodName, elementURLTemplate, nullRequestBody, serverName, userId, assetGUID, assetElementGUID); } } @@ -1167,7 +1167,7 @@ public void addTemplateClassification(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/template-classification"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/template-classification"; TemplateClassificationRequestBody requestBody = new TemplateClassificationRequestBody(); @@ -1176,7 +1176,7 @@ public void addTemplateClassification(String userId, requestBody.setAdditionalProperties(additionalProperties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1205,10 +1205,10 @@ public void removeTemplateClassification(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/template-classification/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/template-classification/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1250,10 +1250,10 @@ public String createConnection(String userId, invalidParameterHandler.validateObject(connectionProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(connectionProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, connectionProperties, serverName, userId); @@ -1289,10 +1289,10 @@ public String createConnectionFromTemplate(String userId, invalidParameterHandler.validateObject(templateProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(templateProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/from-template/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/from-template/{2}"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, templateProperties, serverName, userId, @@ -1335,10 +1335,10 @@ public void updateConnection(String userId, invalidParameterHandler.validateName(connectionProperties.getQualifiedName(), qualifiedNameParameter, methodName); } - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/update?isMergeUpdate={3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, connectionProperties, serverName, userId, @@ -1373,10 +1373,10 @@ public void setupConnectorType(String userId, invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); invalidParameterHandler.validateGUID(connectorTypeGUID, connectorTypeGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/connector-types/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/connector-types/{3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1411,10 +1411,10 @@ public void clearConnectorType(String userId, invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); invalidParameterHandler.validateGUID(connectorTypeGUID, connectorTypeGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/connector-types/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/connector-types/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1449,10 +1449,10 @@ public void setupEndpoint(String userId, invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); invalidParameterHandler.validateGUID(endpointGUID, endpointGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/endpoints/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/endpoints/{3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1487,10 +1487,10 @@ public void clearEndpoint(String userId, invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); invalidParameterHandler.validateGUID(endpointGUID, endpointGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/endpoints/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/endpoints/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1537,10 +1537,10 @@ public void setupEmbeddedConnection(String userId, requestBody.setDisplayName(displayName); requestBody.setArguments(arguments); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/embedded-connections/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/embedded-connections/{3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1575,10 +1575,10 @@ public void clearEmbeddedConnection(String userId, invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); invalidParameterHandler.validateGUID(embeddedConnectionGUID, embeddedConnectionGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/embedded-connections/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/embedded-connections/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1615,14 +1615,14 @@ public void setupAssetConnection(String userId, invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/connections/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/connections/{3}"; StringRequestBody requestBody = new StringRequestBody(); requestBody.setString(assetSummary); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1657,10 +1657,10 @@ public void clearAssetConnection(String userId, invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/connections/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/connections/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1691,10 +1691,10 @@ public void removeConnection(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(connectionGUID, guidParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1733,7 +1733,7 @@ public List<ConnectionElement> findConnections(String userId, invalidParameterHandler.validateSearchString(searchString, parameterName, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/by-search-string" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/by-search-string" + "?startFrom={2}&pageSize={3}"; SearchStringRequestBody requestBody = new SearchStringRequestBody(); @@ -1742,7 +1742,7 @@ public List<ConnectionElement> findConnections(String userId, requestBody.setSearchStringParameterName(parameterName); ConnectionsResponse restResult = restClient.callConnectionsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1778,10 +1778,10 @@ public List<ConnectionElement> scanConnections(String userId, invalidParameterHandler.validateUserId(userId, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/scan?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/scan?startFrom={2}&pageSize={3}"; ConnectionsResponse restResult = restClient.callConnectionsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, startFrom, @@ -1821,7 +1821,7 @@ public List<ConnectionElement> getConnectionsByName(String userId, invalidParameterHandler.validateName(name, nameParameter, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/by-name?startFrom={2}&pageSize={3}"; NameRequestBody requestBody = new NameRequestBody(); @@ -1829,7 +1829,7 @@ public List<ConnectionElement> getConnectionsByName(String userId, requestBody.setNamePropertyName(nameParameter); ConnectionsResponse restResult = restClient.callConnectionsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1864,10 +1864,10 @@ public ConnectionElement getConnectionByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connections/{2}"; ConnectionResponse restResult = restClient.callMyConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, connectionGUID); @@ -1902,10 +1902,10 @@ public String createEndpoint(String userId, invalidParameterHandler.validateObject(endpointProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(endpointProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, endpointProperties, serverName, userId); @@ -1941,10 +1941,10 @@ public String createEndpointFromTemplate(String userId, invalidParameterHandler.validateObject(templateProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(templateProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/from-template/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/from-template/{2}"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, templateProperties, serverName, userId, @@ -1987,10 +1987,10 @@ public void updateEndpoint(String userId, invalidParameterHandler.validateGUID(endpointGUID, guidParameter, methodName); invalidParameterHandler.validateObject(endpointProperties, propertiesParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/{2}/update?isMergeUpdate={3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, endpointProperties, serverName, userId, @@ -2022,10 +2022,10 @@ public void removeEndpoint(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(endpointGUID, guidParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/{2}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -2063,7 +2063,7 @@ public List<EndpointElement> findEndpoints(String userId, invalidParameterHandler.validateSearchString(searchString, parameterName, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/by-search-string" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/by-search-string" + "?startFrom={2}&pageSize={3}"; SearchStringRequestBody requestBody = new SearchStringRequestBody(); @@ -2072,7 +2072,7 @@ public List<EndpointElement> findEndpoints(String userId, requestBody.setSearchStringParameterName(parameterName); EndpointsResponse restResult = restClient.callEndpointsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -2113,7 +2113,7 @@ public List<EndpointElement> getEndpointsByName(String userId, invalidParameterHandler.validateName(name, nameParameter, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/by-name?startFrom={2}&pageSize={3}"; NameRequestBody requestBody = new NameRequestBody(); @@ -2121,7 +2121,7 @@ public List<EndpointElement> getEndpointsByName(String userId, requestBody.setNamePropertyName(nameParameter); EndpointsResponse restResult = restClient.callEndpointsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -2156,10 +2156,10 @@ public EndpointElement getEndpointByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(endpointGUID, endpointGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/endpoints/{2}"; EndpointResponse restResult = restClient.callEndpointGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, endpointGUID); @@ -2197,7 +2197,7 @@ public List<ConnectorTypeElement> findConnectorTypes(String userId, invalidParameterHandler.validateSearchString(searchString, parameterName, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connector-types/by-search-string" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connector-types/by-search-string" + "?startFrom={2}&pageSize={3}"; SearchStringRequestBody requestBody = new SearchStringRequestBody(); @@ -2206,7 +2206,7 @@ public List<ConnectorTypeElement> findConnectorTypes(String userId, requestBody.setSearchStringParameterName(parameterName); ConnectorTypesResponse restResult = restClient.callConnectorTypesPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -2247,7 +2247,7 @@ public List<ConnectorTypeElement> getConnectorTypesByName(String userId, invalidParameterHandler.validateName(name, nameParameter, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connector-types/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connector-types/by-name?startFrom={2}&pageSize={3}"; NameRequestBody requestBody = new NameRequestBody(); @@ -2255,7 +2255,7 @@ public List<ConnectorTypeElement> getConnectorTypesByName(String userId, requestBody.setNamePropertyName(nameParameter); ConnectorTypesResponse restResult = restClient.callConnectorTypesPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -2290,10 +2290,10 @@ public ConnectorTypeElement getConnectorTypeByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(connectorTypeGUID, connectorTypeGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connector-types/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/connector-types/{2}"; ConnectorTypeResponse restResult = restClient.callMyConnectorTypeGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, connectorTypeGUID); @@ -2330,7 +2330,7 @@ public List<AssetElement> getAssetsByName(String userId, PropertyServerException, UserNotAuthorizedException { - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/by-name?startFrom={2}&pageSize={3}"; final String methodName = "getAssetsByName"; final String nameParameter = "name"; @@ -2338,7 +2338,7 @@ public List<AssetElement> getAssetsByName(String userId, invalidParameterHandler.validateName(name, nameParameter, methodName); AssetElementsResponse restResult = restClient.callAssetElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, name, serverName, userId, @@ -2372,7 +2372,7 @@ public List<AssetElement> findAssets(String userId, PropertyServerException, UserNotAuthorizedException { - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/by-search-string?startFrom={2}&pageSize={3}"; final String methodName = "findAssets"; final String searchParameter = "searchString"; @@ -2380,7 +2380,7 @@ public List<AssetElement> findAssets(String userId, invalidParameterHandler.validateSearchString(searchString, searchParameter, methodName); AssetElementsResponse restResult = restClient.callAssetElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, searchString, serverName, userId, @@ -2413,13 +2413,13 @@ public AssetElement getAssetSummary(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}"; AssetElementResponse restResult = restClient.callAssetElementGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - assetGUID); + urlTemplate, + serverName, + userId, + assetGUID); return restResult.getAsset(); } @@ -2491,14 +2491,14 @@ public List<DiscoveryAnalysisReport> getDiscoveryAnalysisReports(String userI final String methodName = "getDiscoveryAnalysisReports"; final String assetGUIDParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/discovery-analysis-reports?startingFrom={4}&maximumResults={5}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/discovery-analysis-reports?startingFrom={4}&maximumResults={5}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); invalidParameterHandler.validatePaging(startingFrom, maximumResults, methodName); DiscoveryAnalysisReportListResponse restResult = restClient.callDiscoveryAnalysisReportListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, assetGUID, @@ -2524,12 +2524,12 @@ public List<String> getTypesOfAnnotation(String userId) throws InvalidParameter PropertyServerException { final String methodName = "getTypesOfAnnotation"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/annotations/sub-types"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/annotations/sub-types"; invalidParameterHandler.validateUserId(userId, methodName); NameListResponse restResult = restClient.callNameListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId); @@ -2552,12 +2552,12 @@ public Map<String, String> getTypesOfAnnotationWithDescriptions(String userId) PropertyServerException { final String methodName = "getTypesOfAnnotationWithDescriptions"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/annotations/sub-types/descriptions"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/annotations/sub-types/descriptions"; invalidParameterHandler.validateUserId(userId, methodName); StringMapResponse restResult = restClient.callStringMapGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId); @@ -2592,7 +2592,7 @@ public List<Annotation> getDiscoveryReportAnnotations(String userId, final String methodName = "getDiscoveryReportAnnotations"; final String discoveryReportGUIDParameter = "discoveryReportGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/discovery-analysis-reports/{2}?startingFrom={3}&maxPageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/discovery-analysis-reports/{2}?startingFrom={3}&maxPageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(discoveryReportGUID, discoveryReportGUIDParameter, methodName); @@ -2603,7 +2603,7 @@ public List<Annotation> getDiscoveryReportAnnotations(String userId, requestBody.setAnnotationStatus(annotationStatus); AnnotationListResponse restResult = restClient.callAnnotationListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -2642,7 +2642,7 @@ public List<Annotation> getExtendedAnnotations(String userId, final String methodName = "getExtendedAnnotations"; final String annotationGUIDParameter = "annotationGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/annotations/{2}?startingFrom={3}&maxPageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/annotations/{2}?startingFrom={3}&maxPageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(annotationGUID, annotationGUIDParameter, methodName); @@ -2653,7 +2653,7 @@ public List<Annotation> getExtendedAnnotations(String userId, requestBody.setAnnotationStatus(annotationStatus); AnnotationListResponse restResult = restClient.callAnnotationListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -2692,13 +2692,13 @@ public void deleteAsset(String userId, final String methodName = "deleteAsset"; final String assetGUIDParameter = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/{2}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwnerEventClient.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwnerEventClient.java index 2d344df6097..d1070bdc7c9 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwnerEventClient.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwnerEventClient.java @@ -119,7 +119,7 @@ public void registerListener(String userId, final String nameParameter = "listener"; final String callerIdParameter = "callerId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); @@ -132,7 +132,7 @@ public void registerListener(String userId, * event bus. */ ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AvroFileAssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AvroFileAssetOwner.java index 5957b23ed08..b573365ae63 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AvroFileAssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AvroFileAssetOwner.java @@ -156,7 +156,7 @@ public List<String> addAvroFileToCatalog(String userId, { final String methodName = "addAvroFileToCatalog"; final String pathParameter = "fullPath"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/data-files/avro"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/data-files/avro"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(fullPath, pathParameter, methodName); @@ -167,7 +167,7 @@ public List<String> addAvroFileToCatalog(String userId, requestBody.setFullPath(fullPath); GUIDListResponse restResult = restClient.callGUIDListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/CSVFileAssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/CSVFileAssetOwner.java index 1837eac4233..1660c9f8983 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/CSVFileAssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/CSVFileAssetOwner.java @@ -181,7 +181,7 @@ public List<String> addCSVFileToCatalog(String userId, { final String methodName = "addCSVFileToCatalog"; final String pathParameter = "fullPath"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/data-files/csv"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/data-files/csv"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(fullPath, pathParameter, methodName); @@ -195,7 +195,7 @@ public List<String> addCSVFileToCatalog(String userId, requestBody.setQuoteCharacter(quoteCharacter); GUIDListResponse restResult = restClient.callGUIDListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/FileSystemAssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/FileSystemAssetOwner.java index 4e422d9af4f..e1dc94bb292 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/FileSystemAssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/FileSystemAssetOwner.java @@ -167,7 +167,7 @@ public String createFileSystemInCatalog(String userId, { final String methodName = "createFileSystemInCatalog"; final String pathParameter = "uniqueName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(uniqueName, pathParameter, methodName); @@ -184,7 +184,7 @@ public String createFileSystemInCatalog(String userId, requestBody.setEncryption(encryption); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -217,7 +217,7 @@ public List<String> createFolderStructureInCatalog(String userId, { final String methodName = "createFolderStructureInCatalog"; final String pathParameter = "pathName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(pathName, pathParameter, methodName); @@ -226,7 +226,7 @@ public List<String> createFolderStructureInCatalog(String userId, requestBody.setFullPath(pathName); GUIDListResponse restResult = restClient.callGUIDListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -258,7 +258,7 @@ public List<String> createFolderStructureInCatalog(String userId, { final String methodName = "createFolderStructureInCatalog"; final String pathParameter = "pathName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(pathName, pathParameter, methodName); @@ -267,7 +267,7 @@ public List<String> createFolderStructureInCatalog(String userId, requestBody.setFullPath(pathName); GUIDListResponse restResult = restClient.callGUIDListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -297,14 +297,14 @@ public void attachFolderToFileSystem(String userId, final String methodName = "attachFolderToFileSystem"; final String fileSystemGUIDParameter = "fileSystemGUID"; final String folderGUIDParameter = "folderGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems/{2}/folders/{3}/attach"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems/{2}/folders/{3}/attach"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(fileSystemGUID, fileSystemGUIDParameter, methodName); invalidParameterHandler.validateGUID(folderGUID, folderGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -334,14 +334,14 @@ public void detachFolderFromFileSystem(String userId, final String methodName = "detachFolderFromFileSystem"; final String fileSystemGUIDParameter = "fileSystemGUID"; final String folderGUIDParameter = "folderGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems/{2}/folders/{3}/detach"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems/{2}/folders/{3}/detach"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(fileSystemGUID, fileSystemGUIDParameter, methodName); invalidParameterHandler.validateGUID(folderGUID, folderGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -378,7 +378,7 @@ public List<String> addDataFileAssetToCatalog(String userId, { final String methodName = "addDataFileAssetToCatalog"; final String pathParameter = "pathName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/data-files"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/data-files"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(pathName, pathParameter, methodName); @@ -389,7 +389,7 @@ public List<String> addDataFileAssetToCatalog(String userId, requestBody.setFullPath(pathName); GUIDListResponse restResult = restClient.callGUIDListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -428,7 +428,7 @@ public List<String> addDataFolderAssetToCatalog(String userId, { final String methodName = "addDataFolderAssetToCatalog"; final String pathParameter = "pathName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/data-folders"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/assets/data-folders"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(pathName, pathParameter, methodName); @@ -439,7 +439,7 @@ public List<String> addDataFolderAssetToCatalog(String userId, requestBody.setFullPath(pathName); GUIDListResponse restResult = restClient.callGUIDListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -470,14 +470,14 @@ public void attachDataFileAssetToFolder(String userId, final String methodName = "attachDataFileAssetToFolder"; final String fileGUIDParameter = "fileGUID"; final String folderGUIDParameter = "folderGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}/assets/data-files/{3}/attach"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}/assets/data-files/{3}/attach"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(fileGUID, fileGUIDParameter, methodName); invalidParameterHandler.validateGUID(folderGUID, folderGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -509,14 +509,14 @@ public void detachDataFileAssetFromFolder(String userId, final String methodName = "detachDataFileAssetFromFolder"; final String fileGUIDParameter = "fileGUID"; final String folderGUIDParameter = "folderGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}/assets/data-files/{3}/detach"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}/assets/data-files/{3}/detach"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(fileGUID, fileGUIDParameter, methodName); invalidParameterHandler.validateGUID(folderGUID, folderGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -547,14 +547,14 @@ public void moveDataFileInCatalog(String userId, final String methodName = "moveDataFileInCatalog"; final String fileGUIDParameter = "fileGUID"; final String folderGUIDParameter = "folderGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}/assets/data-files/{3}/move-to"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}/assets/data-files/{3}/move-to"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(fileGUID, fileGUIDParameter, methodName); invalidParameterHandler.validateGUID(folderGUID, folderGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -585,14 +585,14 @@ public void moveDataFolderInCatalog(String userId, final String methodName = "moveDataFileInCatalog"; final String fileGUIDParameter = "fileGUID"; final String folderGUIDParameter = "folderGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}/assets/data-folders/{3}/move-to"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}/assets/data-folders/{3}/move-to"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(dataFolderGUID, fileGUIDParameter, methodName); invalidParameterHandler.validateGUID(folderGUID, folderGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -621,13 +621,13 @@ public FileSystemElement getFileSystemByGUID(String userId, { final String methodName = "getFileSystemByGUID"; final String fileSystemGUIDParameter = "fileSystemGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(fileSystemGUID, fileSystemGUIDParameter, methodName); FileSystemResponse restResult = restClient.callFileSystemGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, fileSystemGUID); @@ -656,13 +656,13 @@ public FileSystemElement getFileSystemByUniqueName(String userId, { final String methodName = "getFileSystemByUniqueName"; final String nameParameter = "uniqueName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems/by-name/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems/by-name/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(uniqueName, nameParameter, methodName); FileSystemResponse restResult = restClient.callFileSystemGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, uniqueName); @@ -692,16 +692,16 @@ public List<String> getFileSystems(String userId, PropertyServerException { final String methodName = "getFileSystems"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems?startingFrom={2}&maximumResults={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/file-systems?startingFrom={2}&maximumResults={3}"; invalidParameterHandler.validateUserId(userId, methodName); GUIDListResponse restResult = restClient.callGUIDListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - Integer.toString(startingFrom), - Integer.toString(maxPageSize)); + urlTemplate, + serverName, + userId, + Integer.toString(startingFrom), + Integer.toString(maxPageSize)); return restResult.getGUIDs(); } @@ -727,13 +727,13 @@ public FolderElement getFolderByGUID(String userId, { final String methodName = "getFileSystemByGUID"; final String folderGUIDParameter = "folderGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(folderGUID, folderGUIDParameter, methodName); FolderResponse restResult = restClient.callFolderGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, folderGUID); @@ -762,13 +762,13 @@ public FolderElement getFolderByPathName(String userId, { final String methodName = "getFileSystemByUniqueName"; final String nameParameter = "pathName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/by-path-name/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/by-path-name/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(pathName, nameParameter, methodName); FolderResponse restResult = restClient.callFolderGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, pathName); @@ -801,13 +801,13 @@ public List<String> getNestedFolders(String userId, { final String methodName = "getNestedFolders"; final String anchorGUIDParameter = "anchorGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/anchor/{2}/folders?startingFrom={3}&maximumResults={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/anchor/{2}/folders?startingFrom={3}&maximumResults={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(parentGUID, anchorGUIDParameter, methodName); GUIDListResponse restResult = restClient.callGUIDListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, parentGUID, @@ -842,13 +842,13 @@ public List<String> getFolderFiles(String userId, { final String methodName = "getFolderFiles"; final String anchorGUIDParameter = "folderGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}/assets/data-files?startingFrom={3}&maximumResults={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/folders/{2}/assets/data-files?startingFrom={3}&maximumResults={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(folderGUID, anchorGUIDParameter, methodName); GUIDListResponse restResult = restClient.callGUIDListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, folderGUID, diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/ValidValuesAssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/ValidValuesAssetOwner.java index f6911105763..cb062265f9e 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/ValidValuesAssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/ValidValuesAssetOwner.java @@ -165,7 +165,7 @@ public String createValidValueSet(String userId, { final String methodName = "createValidValueSet"; final String nameParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}//valid-values/new-set"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}//valid-values/new-set"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); @@ -180,7 +180,7 @@ public String createValidValueSet(String userId, requestBody.setExtendedProperties(extendedProperties); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -226,7 +226,7 @@ public String createValidValueDefinition(String userId, { final String methodName = "createValidValueDefinition"; final String nameParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/new-definition?isDefaultValue={2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/new-definition?isDefaultValue={2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); @@ -242,7 +242,7 @@ public String createValidValueDefinition(String userId, requestBody.setExtendedProperties(extendedProperties); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -292,7 +292,7 @@ public void updateValidValue(String userId, final String methodName = "updateValidValue"; final String guidParameter = "validValueGUID"; final String nameParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/{2}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(validValueGUID, guidParameter, methodName); @@ -310,7 +310,7 @@ public void updateValidValue(String userId, requestBody.setExtendedProperties(extendedProperties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -340,14 +340,14 @@ public void deleteValidValue(String userId, final String methodName = "deleteValidValue"; final String guidParameter = "validValueGUID"; final String nameParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/{2}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(validValueGUID, guidParameter, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, qualifiedName, serverName, userId, @@ -379,14 +379,14 @@ public void attachValidValueToSet(String userId, final String methodName = "attachValidValueToSet"; final String setGUIDParameter = "setGUID"; final String validValueGUIDParameter = "validValueGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/sets/{2}/members/{3}?isDefaultValue={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/sets/{2}/members/{3}?isDefaultValue={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(setGUID, setGUIDParameter, methodName); invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -417,14 +417,14 @@ public void detachValidValueFromSet(String userId, final String methodName = "detachValidValueFromSet"; final String setGUIDParameter = "setGUID"; final String validValueGUIDParameter = "validValueGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/sets/{2}/members/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/sets/{2}/members/{3}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(setGUID, setGUIDParameter, methodName); invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -453,16 +453,16 @@ public ValidValueElement getValidValueByGUID(String userId, { final String methodName = "getValidValueByGUID"; final String validValueGUIDParameter = "validValueGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); ValidValueResponse restResult = restClient.callValidValueGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - validValueGUID); + urlTemplate, + serverName, + userId, + validValueGUID); return restResult.getElement(); } @@ -492,13 +492,13 @@ public List<ValidValueElement> getValidValueByName(String userId, { final String methodName = "getValidValueByName"; final String validValueNameParameter = "validValueName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/by-name?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/by-name?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(validValueName, validValueNameParameter, methodName); ValidValuesResponse restResult = restClient.callValidValuesPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, validValueName, serverName, userId, @@ -534,14 +534,14 @@ public List<ValidValueElement> findValidValues(String userId, { final String methodName = "getValidValueByName"; final String parameterName = "searchString"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/by-search-string?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/by-search-string?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, parameterName, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); ValidValuesResponse restResult = restClient.callValidValuesPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, searchString, serverName, userId, @@ -576,14 +576,14 @@ public List<ValidValueElement> getValidValueSetMembers(String userId, { final String methodName = "getValidValueSetMembers"; final String validValueGUIDParameter = "validValueSetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/sets/{2}/members?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/sets/{2}/members?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(validValueSetGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); ValidValuesResponse restResult = restClient.callValidValuesGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, validValueSetGUID, @@ -617,14 +617,14 @@ public List<ValidValueElement> getSetsForValidValue(String userId, { final String methodName = "getSetsForValidValue"; final String validValueGUIDParameter = "validValueSetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/{2}/set-membership?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/asset-owner/users/{1}/valid-values/{2}/set-membership?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); ValidValuesResponse restResult = restClient.callValidValuesGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, validValueGUID, diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/UserIdentityManagementInterface.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/UserIdentityManagementInterface.java index 9e72b66edeb..8cb7d26bb77 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/UserIdentityManagementInterface.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/api/UserIdentityManagementInterface.java @@ -27,7 +27,7 @@ public interface UserIdentityManagementInterface * @param userId the name of the calling user. * @param externalSourceGUID unique identifier of software server capability representing the caller * @param externalSourceName unique name of software server capability representing the caller - * @param newIdentity properties for the new userIdentity. + * @param newIdentity properties for the new userIdentity * * @return unique identifier of the UserIdentity * @@ -43,6 +43,30 @@ String createUserIdentity(String userId, UserNotAuthorizedException; + /** + * Create a UserIdentity that is for the sole use of a specific actor profile. + * + * @param userId the name of the calling user. + * @param externalSourceGUID unique identifier of software server capability representing the caller + * @param externalSourceName unique name of software server capability representing the caller + * @param profileGUID unique identifier of the profile + * @param newIdentity properties for the new userIdentity + * + * @return unique identifier of the UserIdentity + * + * @throws InvalidParameterException one of the parameters is invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + String createUserIdentityForProfile(String userId, + String externalSourceGUID, + String externalSourceName, + String profileGUID, + UserIdentityProperties newIdentity) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException; + + /** * Update a UserIdentity. * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProfileIdentityProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProfileIdentityProperties.java index d2d24c2dbb8..7f59a179576 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProfileIdentityProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/ProfileIdentityProperties.java @@ -19,7 +19,7 @@ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) -public class ProfileIdentityProperties implements Serializable +public class ProfileIdentityProperties extends RelationshipProperties { private static final long serialVersionUID = 1L; @@ -44,6 +44,8 @@ public ProfileIdentityProperties() */ public ProfileIdentityProperties(ProfileIdentityProperties template) { + super(template); + if (template != null) { roleTypeName = template.getRoleTypeName(); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/RelationshipProperties.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/RelationshipProperties.java index c3e4ca18b25..5b2d99f6c6a 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/RelationshipProperties.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/properties/RelationshipProperties.java @@ -33,6 +33,7 @@ @JsonSubTypes.Type(value = AssignmentScopeProperties.class, name = "AssignmentScopeProperties"), @JsonSubTypes.Type(value = StakeholderProperties.class, name = "StakeholderProperties"), @JsonSubTypes.Type(value = ProfileLocationProperties.class, name = "ProfileLocationProperties"), + @JsonSubTypes.Type(value = ProfileIdentityProperties.class, name = "ProfileIdentityProperties"), @JsonSubTypes.Type(value = AssetLocationProperties.class, name = "AssetLocationProperties"), @JsonSubTypes.Type(value = CommunityMembershipProperties.class, name = "CommunityMembershipProperties"), @JsonSubTypes.Type(value = AdjacentLocationProperties.class, name = "AdjacentLocationProperties"), diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityProfileOMASAPIRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityProfileOMASAPIRequestBody.java index fdb46f9f22b..b4a618fa4f3 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityProfileOMASAPIRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/CommunityProfileOMASAPIRequestBody.java @@ -19,7 +19,6 @@ property = "class") @JsonSubTypes( { - @JsonSubTypes.Type(value = UserIdentityRequestBody.class, name = "UserIdentityRequestBody"), @JsonSubTypes.Type(value = MyProfileRequestBody.class, name = "MyProfileRequestBody"), @JsonSubTypes.Type(value = PersonalProfileRequestBody.class, name = "PersonalProfileRequestBody"), @JsonSubTypes.Type(value = PersonalProfileValidatorRequestBody.class, name = "PersonalProfileValidatorRequestBody") diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ProfileIdentityRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ProfileIdentityRequestBody.java deleted file mode 100644 index d1c719e13aa..00000000000 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ProfileIdentityRequestBody.java +++ /dev/null @@ -1,125 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.communityprofile.rest; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileIdentityProperties; - -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * ProfileIdentityRequestBody provides the request body payload for working on ProfileIdentity relationships. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class ProfileIdentityRequestBody extends ExternalSourceRequestBody -{ - private static final long serialVersionUID = 1L; - - private ProfileIdentityProperties properties = null; - - /** - * Default constructor - */ - public ProfileIdentityRequestBody() - { - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public ProfileIdentityRequestBody(ProfileIdentityRequestBody template) - { - super(template); - - if (template != null) - { - this.properties = template.getProperties(); - } - } - - - /** - * Return the properties for this profile identity. - * - * @return properties bean - */ - public ProfileIdentityProperties getProperties() - { - return properties; - } - - - /** - * Set up the properties for this profile identity. - * - * @param properties properties bean - */ - public void setProperties(ProfileIdentityProperties properties) - { - this.properties = properties; - } - - - /** - * JSON-style toString. - * - * @return list of properties and their values. - */ - @Override - public String toString() - { - return "ProfileIdentityRequestBody{" + - "properties=" + properties + - ", externalSourceGUID='" + getExternalSourceGUID() + '\'' + - ", externalSourceName='" + getExternalSourceName() + '\'' + - '}'; - } - - - /** - * Equals method that returns true if containing properties are the same. - * - * @param objectToCompare object to compare - * @return boolean result of comparison - */ - @Override - public boolean equals(Object objectToCompare) - { - if (this == objectToCompare) - { - return true; - } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) - { - return false; - } - if (!super.equals(objectToCompare)) - { - return false; - } - ProfileIdentityRequestBody that = (ProfileIdentityRequestBody) objectToCompare; - return Objects.equals(properties, that.properties); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), properties); - } -} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ReferenceableRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ReferenceableRequestBody.java index f85c5e48864..b3fc739a92b 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ReferenceableRequestBody.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/ReferenceableRequestBody.java @@ -24,6 +24,7 @@ public class ReferenceableRequestBody extends ExternalSourceRequestBody { private static final long serialVersionUID = 1L; + private String anchorGUID = null; private ReferenceableProperties properties = null; @@ -47,6 +48,7 @@ public ReferenceableRequestBody(ReferenceableRequestBody template) if (template != null) { + anchorGUID = template.getAnchorGUID(); properties = template.getProperties(); } } @@ -74,6 +76,28 @@ public void setProperties(ReferenceableProperties properties) } + /** + * Return an optional anchor GUID to attach the new element to. + * + * @return guid + */ + public String getAnchorGUID() + { + return anchorGUID; + } + + + /** + * Set up an optional anchor GUID to attach the new element to. + * + * @param anchorGUID guid + */ + public void setAnchorGUID(String anchorGUID) + { + this.anchorGUID = anchorGUID; + } + + /** * JSON-style toString * @@ -85,6 +109,7 @@ public String toString() return "ReferenceableRequestBody{" + "externalSourceGUID='" + getExternalSourceGUID() + '\'' + ", externalSourceName='" + getExternalSourceName() + '\'' + + ", anchorGUID='" + anchorGUID + '\'' + ", properties=" + properties + '}'; } @@ -103,16 +128,16 @@ public boolean equals(Object objectToCompare) { return true; } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) + if (! (objectToCompare instanceof ReferenceableRequestBody)) { return false; } - if (!super.equals(objectToCompare)) + if (! super.equals(objectToCompare)) { return false; } ReferenceableRequestBody that = (ReferenceableRequestBody) objectToCompare; - return Objects.equals(getProperties(), that.getProperties()); + return Objects.equals(anchorGUID, that.anchorGUID) && Objects.equals(properties, that.properties); } @@ -124,6 +149,6 @@ public boolean equals(Object objectToCompare) @Override public int hashCode() { - return Objects.hash(super.hashCode(), properties); + return Objects.hash(super.hashCode(), anchorGUID, properties); } } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityRequestBody.java b/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityRequestBody.java deleted file mode 100644 index 51158784f31..00000000000 --- a/open-metadata-implementation/access-services/community-profile/community-profile-api/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/rest/UserIdentityRequestBody.java +++ /dev/null @@ -1,126 +0,0 @@ -/* SPDX-License-Identifier: Apache 2.0 */ -/* Copyright Contributors to the ODPi Egeria project. */ -package org.odpi.openmetadata.accessservices.communityprofile.rest; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import org.odpi.openmetadata.accessservices.communityprofile.properties.UserIdentityProperties; - -import java.util.Objects; - -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; -import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; - -/** - * UserIdentityRequestBody provides the request body payload for working on UserIdentity entities and their - * link to profiles. - */ -@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown=true) -public class UserIdentityRequestBody extends ExternalSourceRequestBody -{ - private static final long serialVersionUID = 1L; - - private UserIdentityProperties properties = null; - - /** - * Default constructor - */ - public UserIdentityRequestBody() - { - } - - - /** - * Copy/clone constructor - * - * @param template object to copy - */ - public UserIdentityRequestBody(UserIdentityRequestBody template) - { - super(template); - - if (template != null) - { - this.properties = template.getProperties(); - } - } - - - /** - * Return the properties for this user identity. - * - * @return properties bean - */ - public UserIdentityProperties getProperties() - { - return properties; - } - - - /** - * Set up the properties for this user identity. - * - * @param properties properties bean - */ - public void setProperties(UserIdentityProperties properties) - { - this.properties = properties; - } - - - /** - * JSON-style toString. - * - * @return list of properties and their values. - */ - @Override - public String toString() - { - return "UserIdentityRequestBody{" + - "properties=" + properties + - ", externalSourceGUID='" + getExternalSourceGUID() + '\'' + - ", externalSourceName='" + getExternalSourceName() + '\'' + - '}'; - } - - - /** - * Equals method that returns true if containing properties are the same. - * - * @param objectToCompare object to compare - * @return boolean result of comparison - */ - @Override - public boolean equals(Object objectToCompare) - { - if (this == objectToCompare) - { - return true; - } - if (objectToCompare == null || getClass() != objectToCompare.getClass()) - { - return false; - } - if (!super.equals(objectToCompare)) - { - return false; - } - UserIdentityRequestBody that = (UserIdentityRequestBody) objectToCompare; - return Objects.equals(properties, that.properties); - } - - - /** - * Return hash code for this object - * - * @return int hash code - */ - @Override - public int hashCode() - { - return Objects.hash(super.hashCode(), properties); - } -} diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java index 06a92038e93..193c672e82c 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityManagement.java @@ -136,10 +136,6 @@ public CommunityManagement(String serverName, /** * Create a new metadata element to represent a community. * - * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities. - * The request body is of type <i>ReferenceableRequestBody</i>. This holds the external source identifiers and the referenceableProperties are set to the supplied <i>communityProperties</i>. - * The HTTP response is of type <i>GUIDResponse</i>. - * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller @@ -170,10 +166,6 @@ public String createCommunity(String userId, /** * Create a new metadata element to represent a community using an existing metadata element as a template. * - * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/from-template/{templateGUID}. - * The request body is of type <i>TemplateRequestBody</i>. This holds the external source identifiers and the supplied <i>templateProperties</i>. - * The HTTP response is of type <i>GUIDResponse</i>. - * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller @@ -205,10 +197,6 @@ public String createCommunityFromTemplate(String userId, /** * Update the metadata element representing a community. * - * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/{communityGUID}?isMergeUpdate={isMergeUpdate}. - * The request body is of type <i>ReferenceableRequestBody</i>. This holds the external source identifiers and the referenceableProperties are set to the supplied <i>communityProperties</i>. - * The HTTP response is of type <i>VoidResponse</i>. - * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller @@ -242,10 +230,6 @@ public void updateCommunity(String userId, /** * Create a membership relationship between a community and a person role to show that anyone appointed to the role is a member of the community. * - * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/{communityGUID}/community-roles/{personRoleGUID}. - * The request body is of type <i>RelationshipRequestBody</i>. This holds the external source identifiers and the relationshipProperties are set to the supplied <i>membershipProperties</i>. - * The HTTP response is of type <i>VoidResponse</i>. - * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller @@ -280,10 +264,6 @@ public void setupCommunityRole(String userId, /** * Remove a membership relationship between a community and a person role. * - * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/{communityGUID}/community-roles/{personRoleGUID}/delete. - * The request body is of type <i>ExternalSourceRequestBody</i>. This holds the external source identifiers. - * The HTTP response is of type <i>VoidResponse</i>. - * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller @@ -323,10 +303,6 @@ public void clearCommunityRole(String userId, /** * Remove the metadata element representing a community. * - * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/{communityGUID}/delete. - * The request body is of type <i>ExternalSourceRequestBody</i>. This holds the external source identifiers. - * The HTTP response is of type <i>VoidResponse</i>. - * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller * @param externalSourceName unique name of software capability representing the caller @@ -356,10 +332,6 @@ public void removeCommunity(String userId, * Retrieve the list of metadata elements that contain the search string. * The search string is treated as a regular expression. * - * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/by-search-string?startFrom={startFrom}&pageSize={pageSize}. - * The request body is of type <i>SearchStringRequestBody</i>. This holds the search string. - * The HTTP response is of type <i>CommunityListResponse</i>. - * * @param userId calling user * @param searchString string to find in the properties * @param startFrom paging start point @@ -409,10 +381,6 @@ public List<CommunityElement> findCommunities(String userId, * Retrieve the list of metadata elements with a matching qualified or display name. * There are no wildcards supported on this request. * - * This method issues an HTTP POST command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/by-name?startFrom={startFrom}&pageSize={pageSize}. - * The request body is of type <i>NameRequestBody</i>. This holds the name to search for. - * The HTTP response is of type <i>CommunityListResponse</i>. - * * @param userId calling user * @param name name to search for * @param startFrom paging start point @@ -461,9 +429,6 @@ public List<CommunityElement> getCommunitiesByName(String userId, /** * Retrieve the list of all communities defined in open metadata. * - * This method issues an HTTP GET command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities?startFrom={startFrom}&pageSize={pageSize}. - * The HTTP response is of type <i>CommunityListResponse</i>. - * * @param userId calling user * @param startFrom paging start point * @param pageSize maximum results that can be returned @@ -503,9 +468,6 @@ public List<CommunityElement> getCommunities(String userId, /** * Return information about the person roles linked to a community. * - * This method issues an HTTP GET command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/person-roles/by-community/{communityGUID}?startFrom={startFrom}&pageSize={pageSize}. - * The HTTP response is of type <i>PersonRoleListResponse</i>. - * * @param userId calling user * @param communityGUID unique identifier for the community * @param startFrom index of the list to start from (0 for start) @@ -548,9 +510,6 @@ public List<PersonRoleElement> getRolesForCommunity(String userId, /** * Retrieve the metadata element with the supplied unique identifier. * - * This method issues an HTTP GET command with a URL of <i>serverPlatformURLRoot</i>/servers/{serverName}/open-metadata/access-services/community-profile/users/{userId}/communities/{communityGUID}?startFrom={startFrom}&pageSize={pageSize}. - * The HTTP response is of type <i>CommunityResponse</i>. - * * @param userId calling user * @param communityGUID unique identifier of the requested metadata element * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java index c6e9fdb10c5..efe62b9ed67 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileBaseClient.java @@ -282,6 +282,58 @@ String createReferenceableFromTemplate(String userId, } + + /** + * Create a new metadata element. + * + * @param userId calling user + * @param properties properties about the element to store + * @param propertiesParameterName name of parameter passing the properties + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @return unique identifier of the new element + * + * @throws InvalidParameterException one of the parameters is invalid + * @throws UserNotAuthorizedException the user is not authorized to issue this request + * @throws PropertyServerException there is a problem reported in the open metadata server(s) + */ + String createReferenceableWithAnchor(String userId, + String externalSourceGUID, + String externalSourceName, + String anchorGUID, + String anchorGUIDParameterName, + ReferenceableProperties properties, + String propertiesParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String qualifiedNameParameterName = "qualifiedName"; + + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(anchorGUID, anchorGUIDParameterName, methodName); + invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); + invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); + + ReferenceableRequestBody requestBody = new ReferenceableRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setAnchorGUID(anchorGUID); + requestBody.setProperties(properties); + + GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, + urlTemplate, + requestBody, + serverName, + userId); + + return restResult.getGUID(); + } + + /** * Update the metadata element. It is possible to use the subtype property classes or * set up specialized properties in extended properties. @@ -448,18 +500,18 @@ void removeReferenceableClassification(String userId, * @throws UserNotAuthorizedException the user is not authorized to issue this request * @throws PropertyServerException there is a problem reported in the open metadata server(s) */ - void setupRelationship(String userId, - String externalSourceGUID, - String externalSourceName, - String primaryElementGUID, - String primaryElementGUIDParameterName, + void setupRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, RelationshipProperties properties, - String secondaryElementGUID, - String secondaryElementGUIDParameterName, - String urlTemplate, - String methodName) throws InvalidParameterException, - UserNotAuthorizedException, - PropertyServerException + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + String urlTemplate, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException { invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); @@ -481,6 +533,55 @@ void setupRelationship(String userId, } + + /** + * Update the properties of the relationship between two elements. + * + * @param userId the name of the calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param primaryElementGUID unique identifier of the primary element + * @param primaryElementGUIDParameterName name of parameter passing the primaryElementGUID + * @param properties describes the properties for the relationship + * @param secondaryElementGUID unique identifier of the element to connect it to + * @param secondaryElementGUIDParameterName name of parameter passing the secondaryElementGUID + * @param isMergeUpdate should the supplied properties be overlaid on the existing properties (true) or replace them (false + * @param urlTemplate URL to call (no expected placeholders) + * @param methodName calling method + * + * @throws InvalidParameterException one of the parameters is invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + public void updateRelationship(String userId, + String externalSourceGUID, + String externalSourceName, + String primaryElementGUID, + String primaryElementGUIDParameterName, + RelationshipProperties properties, + String secondaryElementGUID, + String secondaryElementGUIDParameterName, + boolean isMergeUpdate, + String urlTemplate, + String methodName) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + invalidParameterHandler.validateUserId(userId, methodName); + invalidParameterHandler.validateGUID(primaryElementGUID, primaryElementGUIDParameterName, methodName); + invalidParameterHandler.validateGUID(secondaryElementGUID, secondaryElementGUIDParameterName, methodName); + + RelationshipRequestBody requestBody = new RelationshipRequestBody(); + + requestBody.setExternalSourceGUID(externalSourceGUID); + requestBody.setExternalSourceName(externalSourceName); + requestBody.setProperties(properties); + + restClient.callVoidPostRESTCall(methodName, urlTemplate, requestBody, serverName, userId, primaryElementGUID, secondaryElementGUID, isMergeUpdate); + } + + + /** * Remove a relationship. * diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileEventClient.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileEventClient.java index 6465b998d5a..c0cffd21d8f 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileEventClient.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/CommunityProfileEventClient.java @@ -160,7 +160,7 @@ public void registerListener(String userId, final String methodName = "registerListener"; final String nameParameter = "listener"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/data-manager/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); @@ -172,7 +172,7 @@ public void registerListener(String userId, * event bus. */ ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/SecurityGroupManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/SecurityGroupManagement.java index da5ea3b7659..0bddc363d18 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/SecurityGroupManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/SecurityGroupManagement.java @@ -187,7 +187,7 @@ public String createSecurityGroup(String userId, PropertyServerException { final String methodName = "createSecurityGroup"; - final String urlTemplate = urlTemplatePrefix + "/security-groups"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/security-groups"; final String docIdParameterName = "documentIdentifier"; final String titleParameterName = "title"; @@ -199,7 +199,7 @@ public String createSecurityGroup(String userId, invalidParameterHandler.validateName(properties.getTitle(), titleParameterName, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, properties, serverName, userId); @@ -229,7 +229,7 @@ public void updateSecurityGroup(String userId, PropertyServerException { final String methodName = "updateSecurityGroup"; - final String urlTemplate = urlTemplatePrefix + "/security-groups/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/security-groups/{2}/update?isMergeUpdate={3}"; final String guidParameterName = "securityGroupGUID"; final String docIdParameterName = "documentIdentifier"; @@ -247,7 +247,7 @@ public void updateSecurityGroup(String userId, } restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, properties, serverName, userId, @@ -273,14 +273,14 @@ public void deleteSecurityGroup(String userId, PropertyServerException { final String methodName = "deleteSecurityGroup"; - final String urlTemplate = urlTemplatePrefix + "/security-groups/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/security-groups/{2}/delete"; final String guidParameterName = "securityGroupGUID"; invalidParameterHandler.validateGUID(securityGroupGUID, guidParameterName, methodName); invalidParameterHandler.validateUserId(userId, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -311,7 +311,7 @@ public List<SecurityGroupElement> getSecurityGroupsForDistinguishedName(String u PropertyServerException { final String methodName = "getSecurityGroupsForDistinguishedName"; - final String urlTemplate = urlTemplatePrefix + "/security-groups/for-distinguished-name/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/security-groups/for-distinguished-name/{2}?startFrom={3}&pageSize={4}"; final String parameterName = "distinguishedName"; invalidParameterHandler.validateUserId(userId, methodName); @@ -320,7 +320,7 @@ public List<SecurityGroupElement> getSecurityGroupsForDistinguishedName(String u int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); SecurityGroupsResponse restResult = restClient.callSecurityGroupsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, distinguishedName, @@ -354,7 +354,7 @@ public List<ElementStub> getElementsGovernedBySecurityGroup(String userId, PropertyServerException { final String methodName = "getElementsGovernedBySecurityGroup"; - final String urlTemplate = urlTemplatePrefix + "/security-groups/{2}/governed-by/elements?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/security-groups/{2}/governed-by/elements?startFrom={3}&pageSize={4}"; final String guidParameterName = "securityGroupGUID"; invalidParameterHandler.validateUserId(userId, methodName); @@ -363,7 +363,7 @@ public List<ElementStub> getElementsGovernedBySecurityGroup(String userId, int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); ElementStubsResponse restResult = restClient.callElementStubsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, securityGroupGUID, @@ -397,7 +397,7 @@ public List<SecurityGroupElement> findSecurityGroups(String userId, PropertyServerException { final String methodName = "findSecurityGroups"; - final String urlTemplate = urlTemplatePrefix + "/security-groups/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/security-groups/by-search-string?startFrom={2}&pageSize={3}"; final String searchStringParameterName = "searchString"; invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); @@ -411,7 +411,7 @@ public List<SecurityGroupElement> findSecurityGroups(String userId, requestBody.setSearchStringParameterName(searchStringParameterName); SecurityGroupsResponse restResult = restClient.callSecurityGroupsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/UserIdentityManagement.java b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/UserIdentityManagement.java index 8c6bd1aa3ab..7f3d78d9237 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/UserIdentityManagement.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-client/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/client/UserIdentityManagement.java @@ -10,8 +10,6 @@ import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileIdentityProperties; import org.odpi.openmetadata.accessservices.communityprofile.properties.UserIdentityProperties; import org.odpi.openmetadata.accessservices.communityprofile.rest.*; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; -import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; @@ -26,14 +24,8 @@ * UserIdentityManagement is the client for explicitly managing the user identity entities and associating them with * profiles. It is typically used when the relationship between user identities and profiles are many to one. */ -public class UserIdentityManagement implements UserIdentityManagementInterface +public class UserIdentityManagement extends CommunityProfileBaseClient implements UserIdentityManagementInterface { - private final String serverName; /* Initialized in constructor */ - private final String serverPlatformURLRoot; /* Initialized in constructor */ - private final CommunityProfileRESTClient restClient; /* Initialized in constructor */ - - private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); - private final String urlTemplatePrefix = "/servers/{0}/open-metadata/access-services/community-profile/users/{1}/user-identities"; /** @@ -47,13 +39,7 @@ public class UserIdentityManagement implements UserIdentityManagementInterface public UserIdentityManagement(String serverName, String serverPlatformURLRoot) throws InvalidParameterException { - final String methodName = "Constructor (no security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot); + super(serverName, serverPlatformURLRoot); } @@ -70,13 +56,7 @@ public UserIdentityManagement(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException { - final String methodName = "Constructor (no security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, auditLog); + super(serverName, serverPlatformURLRoot, auditLog); } @@ -96,13 +76,7 @@ public UserIdentityManagement(String serverName, String userId, String password) throws InvalidParameterException { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, userId, password); + super(serverName, serverPlatformURLRoot, userId, password); } @@ -124,13 +98,7 @@ public UserIdentityManagement(String serverName, String password, AuditLog auditLog) throws InvalidParameterException { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = new CommunityProfileRESTClient(serverName, serverPlatformURLRoot, userId, password, auditLog); + super(serverName, serverPlatformURLRoot, userId, password, auditLog); } @@ -149,14 +117,7 @@ public UserIdentityManagement(String serverName, CommunityProfileRESTClient restClient, int maxPageSize) throws InvalidParameterException { - final String methodName = "Constructor (with security)"; - - invalidParameterHandler.setMaxPagingSize(maxPageSize); - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); - - this.serverName = serverName; - this.serverPlatformURLRoot = serverPlatformURLRoot; - this.restClient = restClient; + super(serverName, serverPlatformURLRoot, restClient, maxPageSize); } @@ -186,25 +147,45 @@ public String createUserIdentity(String userId, PropertyServerException, UserNotAuthorizedException { - final String methodName = "createUserIdentity"; - final String propertiesParameterName = "newIdentity"; - final String qualifiedNameParameterName = "newIdentity.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateObject(newIdentity, propertiesParameterName, methodName); - invalidParameterHandler.validateName(newIdentity.getQualifiedName(), qualifiedNameParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix; + final String methodName = "createUserIdentity"; + final String propertiesParameterName = "newIdentity"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix; - UserIdentityRequestBody requestBody = new UserIdentityRequestBody(); + return super.createReferenceable(userId, externalSourceGUID, externalSourceName, newIdentity, propertiesParameterName, urlTemplate, methodName); + } - requestBody.setExternalSourceGUID(externalSourceGUID); - requestBody.setExternalSourceName(externalSourceName); - requestBody.setProperties(newIdentity); - GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, urlTemplate, requestBody, serverName, userId); + /** + * Create a UserIdentity that is for the sole use of a specific actor profile. When the profile is deleted, the user identity is + * deleted. + * + * @param userId the name of the calling user. + * @param externalSourceGUID unique identifier of software server capability representing the caller + * @param externalSourceName unique name of software server capability representing the caller + * @param profileGUID unique identifier of the profile + * @param newIdentity properties for the new userIdentity + * + * @return unique identifier of the UserIdentity + * + * @throws InvalidParameterException one of the parameters is invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + @Override + public String createUserIdentityForProfile(String userId, + String externalSourceGUID, + String externalSourceName, + String profileGUID, + UserIdentityProperties newIdentity) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + final String methodName = "createUserIdentityForProfile"; + final String guidParameterName = "profileGUID"; + final String propertiesParameterName = "newIdentity"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix; - return restResult.getGUID(); + return super.createReferenceableWithAnchor(userId, externalSourceGUID, externalSourceName, profileGUID, guidParameterName, newIdentity, propertiesParameterName, urlTemplate, methodName); } @@ -235,31 +216,14 @@ public void updateUserIdentity(String userId, final String methodName = "updateUserIdentity"; final String guidParameterName = "userIdentityGUID"; final String propertiesParameterName = "properties"; - final String qualifiedNameParameterName = "properties.qualifiedName"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(userIdentityGUID, guidParameterName, methodName); - invalidParameterHandler.validateObject(properties, propertiesParameterName, methodName); - if (! isMergeUpdate) - { - invalidParameterHandler.validateName(properties.getQualifiedName(), qualifiedNameParameterName, methodName); - } - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/{2}?isMergeUpdate={3}"; - UserIdentityRequestBody requestBody = new UserIdentityRequestBody(); - - requestBody.setExternalSourceGUID(externalSourceGUID); - requestBody.setExternalSourceName(externalSourceName); - requestBody.setProperties(properties); - - restClient.callVoidPostRESTCall(methodName, urlTemplate, requestBody, serverName, userId, userIdentityGUID, isMergeUpdate); + super.updateReferenceable(userId, externalSourceGUID, externalSourceName, userIdentityGUID, guidParameterName, isMergeUpdate, properties, propertiesParameterName, urlTemplate, methodName); } /** - * Remove a user identity object. This will fail if the profile would be left without an - * associated user identity. + * Remove a user identity object. * * @param userId the name of the calling user * @param externalSourceGUID unique identifier of software server capability representing the caller @@ -278,26 +242,16 @@ public void deleteUserIdentity(String userId, PropertyServerException, UserNotAuthorizedException { - final String methodName = "deleteUserIdentity"; - final String guidParameterName = "userIdentityGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(userIdentityGUID, guidParameterName, methodName); + final String methodName = "deleteUserIdentity"; + final String guidParameterName = "userIdentityGUID"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/{2}/delete"; - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/{2}/delete"; - - ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); - - requestBody.setExternalSourceGUID(externalSourceGUID); - requestBody.setExternalSourceName(externalSourceName); - - restClient.callVoidPostRESTCall(methodName, urlTemplate, requestBody, serverName, userId, userIdentityGUID); + super.removeReferenceable(userId, externalSourceGUID, externalSourceName, userIdentityGUID, guidParameterName, urlTemplate, methodName); } /** - * Link a user identity to a profile. This will fail if the user identity is already connected to - * a profile. + * Link a user identity to a profile. * * @param userId the name of the calling user. * @param externalSourceGUID unique identifier of software server capability representing the caller @@ -323,20 +277,9 @@ public void addIdentityToProfile(String userId, final String methodName = "addIdentityToProfile"; final String profileGUIDParameterName = "profileGUID"; final String userIdentityGUIDParameterName = "userIdentityGUID"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/{2}/profiles/{3}/link"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(profileGUID, profileGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(userIdentityGUID, userIdentityGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/{2}/profiles/{3}/link"; - - ProfileIdentityRequestBody requestBody = new ProfileIdentityRequestBody(); - - requestBody.setExternalSourceGUID(externalSourceGUID); - requestBody.setExternalSourceName(externalSourceName); - requestBody.setProperties(properties); - - restClient.callVoidPostRESTCall(methodName, urlTemplate, requestBody, serverName, userId, userIdentityGUID, profileGUID); + super.setupRelationship(userId, externalSourceGUID, externalSourceName, userIdentityGUID, userIdentityGUIDParameterName, properties, profileGUID, profileGUIDParameterName, urlTemplate, methodName); } @@ -369,21 +312,9 @@ public void updateProfileIdentity(String userId, final String methodName = "updateProfileIdentity"; final String profileGUIDParameterName = "profileGUID"; final String userIdentityGUIDParameterName = "userIdentityGUID"; + final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/{2}/profiles/{3}/link/update?isMergeUpdate={4}"; - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(profileGUID, profileGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(userIdentityGUID, userIdentityGUIDParameterName, methodName); - - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/{2}/profiles/{3}/link/update?isMergeUpdate={4}"; - - ProfileIdentityRequestBody requestBody = new ProfileIdentityRequestBody(); - - requestBody.setExternalSourceGUID(externalSourceGUID); - requestBody.setExternalSourceName(externalSourceName); - requestBody.setProperties(properties); - - restClient.callVoidPostRESTCall(methodName, urlTemplate, requestBody, serverName, userId, userIdentityGUID, profileGUID, isMergeUpdate); - + super.updateRelationship(userId, externalSourceGUID, externalSourceName, userIdentityGUID, userIdentityGUIDParameterName, properties, profileGUID, profileGUIDParameterName, isMergeUpdate, urlTemplate, methodName); } @@ -412,19 +343,9 @@ public void removeIdentityFromProfile(String userId, final String methodName = "removeIdentityFromProfile"; final String profileGUIDParameterName = "profileGUID"; final String userIdentityGUIDParameterName = "userIdentityGUID"; - - invalidParameterHandler.validateUserId(userId, methodName); - invalidParameterHandler.validateGUID(profileGUID, profileGUIDParameterName, methodName); - invalidParameterHandler.validateGUID(userIdentityGUID, userIdentityGUIDParameterName, methodName); - final String urlTemplate = serverPlatformURLRoot + urlTemplatePrefix + "/{2}/profiles/{3}/unlink"; - ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); - - requestBody.setExternalSourceGUID(externalSourceGUID); - requestBody.setExternalSourceName(externalSourceName); - - restClient.callVoidPostRESTCall(methodName, urlTemplate, requestBody, serverName, userId, userIdentityGUID, profileGUID); + super.clearRelationship(userId, externalSourceGUID, externalSourceName, userIdentityGUID, userIdentityGUIDParameterName, profileGUID, profileGUIDParameterName, urlTemplate, methodName); } diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/UserIdentityRESTServices.java b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/UserIdentityRESTServices.java index 4592812ccf4..393db140ea7 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/UserIdentityRESTServices.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-server/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/UserIdentityRESTServices.java @@ -3,9 +3,12 @@ package org.odpi.openmetadata.accessservices.communityprofile.server; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.UserIdentityElement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ProfileIdentityProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.UserIdentityProperties; import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityListResponse; -import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityResponse; import org.odpi.openmetadata.commonservices.ffdc.RESTCallLogger; import org.odpi.openmetadata.commonservices.ffdc.RESTCallToken; @@ -54,11 +57,12 @@ public UserIdentityRESTServices() * PropertyServerException - there is a problem retrieving information from the property server(s) or * UserNotAuthorizedException - the requesting user is not authorized to issue this request. */ - public GUIDResponse createUserIdentity(String serverName, - String userId, - UserIdentityRequestBody requestBody) + public GUIDResponse createUserIdentity(String serverName, + String userId, + ReferenceableRequestBody requestBody) { final String methodName = "createUserIdentity"; + final String profileGUIDParameterName = "profileGUID"; RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); @@ -67,28 +71,37 @@ public GUIDResponse createUserIdentity(String serverName, try { - if ((requestBody != null) && (requestBody.getProperties() != null)) + if (requestBody != null) { - UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); - - auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - String userIdentityGUID = handler.createUserIdentity(userId, - requestBody.getExternalSourceGUID(), - requestBody.getExternalSourceName(), - null, - null, - requestBody.getProperties().getQualifiedName(), - requestBody.getProperties().getUserId(), - requestBody.getProperties().getDistinguishedName(), - requestBody.getProperties().getAdditionalProperties(), - requestBody.getProperties().getTypeName(), - requestBody.getProperties().getExtendedProperties(), - false, - false, - new Date(), - methodName); - - response.setGUID(userIdentityGUID); + if (requestBody.getProperties() instanceof UserIdentityProperties) + { + UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); + + UserIdentityProperties userIdentityProperties = (UserIdentityProperties) requestBody.getProperties(); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + String userIdentityGUID = handler.createUserIdentity(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + requestBody.getAnchorGUID(), + profileGUIDParameterName, + userIdentityProperties.getQualifiedName(), + userIdentityProperties.getUserId(), + userIdentityProperties.getDistinguishedName(), + userIdentityProperties.getAdditionalProperties(), + userIdentityProperties.getTypeName(), + userIdentityProperties.getExtendedProperties(), + false, + false, + new Date(), + methodName); + + response.setGUID(userIdentityGUID); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(UserIdentityProperties.class.getName(), methodName); + } } else { @@ -119,11 +132,11 @@ public GUIDResponse createUserIdentity(String serverName, * PropertyServerException there is a problem retrieving information from the property server(s). * UserNotAuthorizedException the requesting user is not authorized to issue this request. */ - public VoidResponse updateUserIdentity(String serverName, - String userId, - String userIdentityGUID, - boolean isMergeUpdate, - UserIdentityRequestBody requestBody) + public VoidResponse updateUserIdentity(String serverName, + String userId, + String userIdentityGUID, + boolean isMergeUpdate, + ReferenceableRequestBody requestBody) { final String methodName = "updateUserIdentity"; final String guidParameterName = "userIdentityGUID"; @@ -135,29 +148,38 @@ public VoidResponse updateUserIdentity(String serverName, try { - if ((requestBody != null) && (requestBody.getProperties() != null)) + if (requestBody != null) { - UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); - - auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - handler.updateUserIdentity(userId, - requestBody.getExternalSourceGUID(), - requestBody.getExternalSourceName(), - userIdentityGUID, - guidParameterName, - requestBody.getProperties().getQualifiedName(), - requestBody.getProperties().getUserId(), - requestBody.getProperties().getDistinguishedName(), - requestBody.getProperties().getAdditionalProperties(), - requestBody.getProperties().getTypeName(), - requestBody.getProperties().getExtendedProperties(), - isMergeUpdate, - null, - null, - false, - false, - new Date(), - methodName); + if (requestBody.getProperties() instanceof UserIdentityProperties) + { + UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); + + UserIdentityProperties userIdentityProperties = (UserIdentityProperties) requestBody.getProperties(); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + handler.updateUserIdentity(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + userIdentityGUID, + guidParameterName, + userIdentityProperties.getQualifiedName(), + userIdentityProperties.getUserId(), + userIdentityProperties.getDistinguishedName(), + userIdentityProperties.getAdditionalProperties(), + userIdentityProperties.getTypeName(), + userIdentityProperties.getExtendedProperties(), + isMergeUpdate, + userIdentityProperties.getEffectiveFrom(), + userIdentityProperties.getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } } else { @@ -202,11 +224,12 @@ public VoidResponse deleteUserIdentity(String serverName, try { + UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + if (requestBody != null) { - UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); - - auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); handler.deleteUserIdentity(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), @@ -219,7 +242,15 @@ public VoidResponse deleteUserIdentity(String serverName, } else { - restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + handler.deleteUserIdentity(userId, + null, + null, + userIdentityGUID, + guidParameterName, + false, + false, + new Date(), + methodName); } } catch (Exception error) @@ -232,7 +263,6 @@ public VoidResponse deleteUserIdentity(String serverName, } - /** * Link a user identity to a profile. * @@ -247,11 +277,11 @@ public VoidResponse deleteUserIdentity(String serverName, * PropertyServerException - there is a problem retrieving information from the property server(s) or * UserNotAuthorizedException - the requesting user is not authorized to issue this request. */ - public VoidResponse addIdentityToProfile(String serverName, - String userId, - String userIdentityGUID, - String profileGUID, - ExternalSourceRequestBody requestBody) + public VoidResponse addIdentityToProfile(String serverName, + String userId, + String userIdentityGUID, + String profileGUID, + RelationshipRequestBody requestBody) { final String methodName = "addIdentityToProfile"; final String userIdentityGUIDParameterName = "userIdentityGUID"; @@ -264,24 +294,157 @@ public VoidResponse addIdentityToProfile(String serverName, try { + UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + if (requestBody != null) { - UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); + if (requestBody.getProperties() instanceof ProfileIdentityProperties) + { + ProfileIdentityProperties properties = (ProfileIdentityProperties)requestBody.getProperties(); + handler.addIdentityToProfile(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + userIdentityGUID, + userIdentityGUIDParameterName, + profileGUID, + profileGUIDParameterName, + properties.getRoleTypeName(), + properties.getRoleGUID(), + properties.getDescription(), + requestBody.getProperties().getEffectiveFrom(), + requestBody.getProperties().getEffectiveTo(), + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.addIdentityToProfile(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + userIdentityGUID, + userIdentityGUIDParameterName, + profileGUID, + profileGUIDParameterName, + null, + null, + null, + null, + null, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ProfileIdentityProperties.class.getName(), methodName); + } + } + else + { + restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); + } + } + catch (Exception error) + { + restExceptionHandler.captureExceptions(response, error, methodName, auditLog); + } - auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); - handler.addIdentityToProfile(userId, - requestBody.getExternalSourceGUID(), - requestBody.getExternalSourceName(), - userIdentityGUID, - userIdentityGUIDParameterName, - profileGUID, - profileGUIDParameterName, - null, - null, - false, - false, - new Date(), - methodName); + restCallLogger.logRESTCallReturn(token, response.toString()); + return response; + } + + + + + /** + * Link a user identity to a profile. + * + * @param serverName name of target server + * @param userId the name of the calling user. + * @param userIdentityGUID unique identifier of the UserIdentity + * @param profileGUID the profile to add the identity to. + * @param isMergeUpdate should the supplied properties be overlaid on the existing properties (true) or replace them (false + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException - one of the parameters is invalid or + * PropertyServerException - there is a problem retrieving information from the property server(s) or + * UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + public VoidResponse updateIdentityProfile(String serverName, + String userId, + String userIdentityGUID, + String profileGUID, + boolean isMergeUpdate, + RelationshipRequestBody requestBody) + { + final String methodName = "updateIdentityProfile"; + final String userIdentityGUIDParameterName = "userIdentityGUID"; + final String profileGUIDParameterName = "profileGUID"; + + RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName); + + VoidResponse response = new VoidResponse(); + AuditLog auditLog = null; + + try + { + UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + + if (requestBody != null) + { + if (requestBody.getProperties() instanceof ProfileIdentityProperties) + { + ProfileIdentityProperties properties = (ProfileIdentityProperties)requestBody.getProperties(); + handler.updateIdentityProfile(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + profileGUID, + profileGUIDParameterName, + userIdentityGUID, + userIdentityGUIDParameterName, + properties.getRoleTypeName(), + properties.getRoleGUID(), + properties.getDescription(), + requestBody.getProperties().getEffectiveFrom(), + requestBody.getProperties().getEffectiveTo(), + isMergeUpdate, + false, + false, + new Date(), + methodName); + } + else if (requestBody.getProperties() == null) + { + handler.updateIdentityProfile(userId, + requestBody.getExternalSourceGUID(), + requestBody.getExternalSourceName(), + profileGUID, + profileGUIDParameterName, + userIdentityGUID, + userIdentityGUIDParameterName, + null, + null, + null, + null, + null, + isMergeUpdate, + false, + false, + new Date(), + methodName); + } + else + { + restExceptionHandler.handleInvalidPropertiesObject(ProfileIdentityProperties.class.getName(), methodName); + } } else { @@ -329,11 +492,12 @@ public VoidResponse removeIdentityFromProfile(String serverNa try { + UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); + + auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); + if (requestBody != null) { - UserIdentityHandler<UserIdentityElement> handler = instanceHandler.getUserIdentityHandler(userId, serverName, methodName); - - auditLog = instanceHandler.getAuditLog(userId, serverName, methodName); handler.removeIdentifyFromProfile(userId, requestBody.getExternalSourceGUID(), requestBody.getExternalSourceName(), @@ -348,8 +512,17 @@ public VoidResponse removeIdentityFromProfile(String serverNa } else { - restExceptionHandler.handleNoRequestBody(userId, methodName, serverName); - } + handler.removeIdentifyFromProfile(userId, + null, + null, + userIdentityGUID, + userIdentityGUIDParameterName, + profileGUID, + profileGUIDParameterName, + false, + false, + new Date(), + methodName); } } catch (Exception error) { diff --git a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/UserIdentityResource.java b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/UserIdentityResource.java index a79b89da3f3..97f7641beef 100644 --- a/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/UserIdentityResource.java +++ b/open-metadata-implementation/access-services/community-profile/community-profile-spring/src/main/java/org/odpi/openmetadata/accessservices/communityprofile/server/spring/UserIdentityResource.java @@ -5,8 +5,9 @@ import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.tags.Tag; import org.odpi.openmetadata.accessservices.communityprofile.rest.ExternalSourceRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.ReferenceableRequestBody; +import org.odpi.openmetadata.accessservices.communityprofile.rest.RelationshipRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityListResponse; -import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityRequestBody; import org.odpi.openmetadata.accessservices.communityprofile.rest.UserIdentityResponse; import org.odpi.openmetadata.accessservices.communityprofile.server.UserIdentityRESTServices; import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; @@ -43,9 +44,9 @@ public class UserIdentityResource */ @PostMapping(path = "/user-identities") - public GUIDResponse createUserIdentity(@PathVariable String serverName, - @PathVariable String userId, - @RequestBody UserIdentityRequestBody requestBody) + public GUIDResponse createUserIdentity(@PathVariable String serverName, + @PathVariable String userId, + @RequestBody ReferenceableRequestBody requestBody) { return restAPI.createUserIdentity(serverName, userId, requestBody); } @@ -57,7 +58,7 @@ public GUIDResponse createUserIdentity(@PathVariable String ser * @param serverName name of target server * @param userId the name of the calling user * @param userIdentityGUID unique identifier of the UserIdentity - * @param isMergeUpdate should the supplied properties be overlaid on the existing properties (true) or replace them (false + * @param isMergeUpdate should the supplied properties be overlaid on the existing properties (true) or replace them (false) * @param requestBody updated properties for the new userIdentity * * @return void or @@ -67,11 +68,11 @@ public GUIDResponse createUserIdentity(@PathVariable String ser */ @PostMapping(path = "/user-identities/{userIdentityGUID}") - public VoidResponse updateUserIdentity(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String userIdentityGUID, - @RequestParam boolean isMergeUpdate, - @RequestBody UserIdentityRequestBody requestBody) + public VoidResponse updateUserIdentity(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String userIdentityGUID, + @RequestParam boolean isMergeUpdate, + @RequestBody ReferenceableRequestBody requestBody) { return restAPI.updateUserIdentity(serverName, userId, userIdentityGUID, isMergeUpdate, requestBody); } @@ -96,7 +97,8 @@ public VoidResponse updateUserIdentity(@PathVariable String ser public VoidResponse deleteUserIdentity(@PathVariable String serverName, @PathVariable String userId, @PathVariable String userIdentityGUID, - @RequestBody ExternalSourceRequestBody requestBody) + @RequestBody (required = false) + ExternalSourceRequestBody requestBody) { return restAPI.deleteUserIdentity(serverName, userId, userIdentityGUID, requestBody); } @@ -117,18 +119,49 @@ public VoidResponse deleteUserIdentity(@PathVariable String s * PropertyServerException - there is a problem retrieving information from the property server(s) or * UserNotAuthorizedException - the requesting user is not authorized to issue this request. */ - @PostMapping(path = "/user-identities/{userIdentityGUID}/personal-profiles/{profileGUID}/link") + @PostMapping(path = "/user-identities/{userIdentityGUID}/profiles/{profileGUID}/link") - public VoidResponse addIdentityToProfile(@PathVariable String serverName, - @PathVariable String userId, - @PathVariable String userIdentityGUID, - @PathVariable String profileGUID, - @RequestBody ExternalSourceRequestBody requestBody) + public VoidResponse addIdentityToProfile(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String userIdentityGUID, + @PathVariable String profileGUID, + @RequestBody (required = false) + RelationshipRequestBody requestBody) { return restAPI.addIdentityToProfile(serverName, userId, userIdentityGUID, profileGUID, requestBody); } + /** + * Link a user identity to a profile. This will fail if the user identity is already connected to + * a profile. + * + * @param serverName name of target server + * @param userId the name of the calling user. + * @param userIdentityGUID unique identifier of the UserIdentity + * @param profileGUID the profile to add the identity to. + * @param isMergeUpdate should the supplied properties be overlaid on the existing properties (true) or replace them (false) + * @param requestBody external source identifiers + * + * @return void or + * InvalidParameterException - one of the parameters is invalid or + * PropertyServerException - there is a problem retrieving information from the property server(s) or + * UserNotAuthorizedException - the requesting user is not authorized to issue this request. + */ + @PostMapping(path = "/user-identities/{userIdentityGUID}/profiles/{profileGUID}/link/update") + + public VoidResponse updateIdentityProfile(@PathVariable String serverName, + @PathVariable String userId, + @PathVariable String userIdentityGUID, + @PathVariable String profileGUID, + @RequestParam boolean isMergeUpdate, + @RequestBody (required = false) + RelationshipRequestBody requestBody) + { + return restAPI.updateIdentityProfile(serverName, userId, userIdentityGUID, profileGUID, isMergeUpdate, requestBody); + } + + /** * Remove a user identity object. This will fail if the profile would be left without an * associated user identity. @@ -150,7 +183,8 @@ public VoidResponse removeIdentityFromProfile(@PathVariable String @PathVariable String userId, @PathVariable String userIdentityGUID, @PathVariable String profileGUID, - @RequestBody ExternalSourceRequestBody requestBody) + @RequestBody (required = false) + ExternalSourceRequestBody requestBody) { return restAPI.removeIdentityFromProfile(serverName, userId, userIdentityGUID, profileGUID, requestBody); } diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java index d3c6d1ee350..ad2e85c9ec7 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerBaseClient.java @@ -373,7 +373,7 @@ void setReferenceableClassification(String userId, requestBody.setProperties(properties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -416,7 +416,7 @@ void removeReferenceableClassification(String userId, requestBody.setExternalSourceName(externalSourceName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerEventClient.java b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerEventClient.java index 1cd0533f3e6..6609d8ecf3d 100644 --- a/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerEventClient.java +++ b/open-metadata-implementation/access-services/data-manager/data-manager-client/src/main/java/org/odpi/openmetadata/accessservices/datamanager/client/DataManagerEventClient.java @@ -24,12 +24,12 @@ public class DataManagerEventClient implements DataManagerEventInterface { private static final String serviceName = "Data Manager OMAS"; - private String serverName; /* Initialized in constructor */ - private String serverPlatformURLRoot; /* Initialized in constructor */ - private String callerId; /* Initialized in constructor */ - private OCFRESTClient restClient; /* Initialized in constructor */ + private final String serverName; /* Initialized in constructor */ + private final String serverPlatformURLRoot; /* Initialized in constructor */ + private final String callerId; /* Initialized in constructor */ + private final OCFRESTClient restClient; /* Initialized in constructor */ - private InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); + private final InvalidParameterHandler invalidParameterHandler = new InvalidParameterHandler(); private DataManagerOutTopicClientConnector configurationEventTopicConnector = null; private AuditLog auditLog = null; @@ -156,7 +156,7 @@ public void registerListener(String userId, final String methodName = "registerListener"; final String nameParameter = "listener"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/data-manager/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/data-manager/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); @@ -168,7 +168,7 @@ public void registerListener(String userId, * event bus. */ ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ConnectionManager.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ConnectionManager.java index 4ac6aab99ce..00545cac9db 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ConnectionManager.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ConnectionManager.java @@ -164,10 +164,10 @@ public String createConnection(String userId, invalidParameterHandler.validateObject(connectionProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(connectionProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, connectionProperties, serverName, userId); @@ -203,10 +203,10 @@ public String createConnectionFromTemplate(String userId, invalidParameterHandler.validateObject(templateProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(templateProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/from-template/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/from-template/{2}"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, templateProperties, serverName, userId, @@ -249,10 +249,10 @@ public void updateConnection(String userId, invalidParameterHandler.validateName(connectionProperties.getQualifiedName(), qualifiedNameParameter, methodName); } - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/update?isMergeUpdate={3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, connectionProperties, serverName, userId, @@ -287,10 +287,10 @@ public void setupConnectorType(String userId, invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); invalidParameterHandler.validateGUID(connectorTypeGUID, connectorTypeGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/connector-types/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/connector-types/{3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -325,10 +325,10 @@ public void clearConnectorType(String userId, invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); invalidParameterHandler.validateGUID(connectorTypeGUID, connectorTypeGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/connector-types/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/connector-types/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -363,10 +363,10 @@ public void setupEndpoint(String userId, invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); invalidParameterHandler.validateGUID(endpointGUID, endpointGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/endpoints/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/endpoints/{3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -401,10 +401,10 @@ public void clearEndpoint(String userId, invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); invalidParameterHandler.validateGUID(endpointGUID, endpointGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/endpoints/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/endpoints/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -451,10 +451,10 @@ public void setupEmbeddedConnection(String userId, requestBody.setDisplayName(displayName); requestBody.setArguments(arguments); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/embedded-connections/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/embedded-connections/{3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -489,10 +489,10 @@ public void clearEmbeddedConnection(String userId, invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); invalidParameterHandler.validateGUID(embeddedConnectionGUID, embeddedConnectionGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/embedded-connections/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/embedded-connections/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -529,14 +529,14 @@ public void setupAssetConnection(String userId, invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/assets/{2}/connections/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/assets/{2}/connections/{3}"; StringRequestBody requestBody = new StringRequestBody(); requestBody.setString(assetSummary); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -571,10 +571,10 @@ public void clearAssetConnection(String userId, invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/assets/{2}/connections/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/assets/{2}/connections/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -605,10 +605,10 @@ public void removeConnection(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(connectionGUID, guidParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -647,7 +647,7 @@ public List<ConnectionElement> findConnections(String userId, invalidParameterHandler.validateSearchString(searchString, parameterName, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/by-search-string" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/by-search-string" + "?startFrom={2}&pageSize={3}"; SearchStringRequestBody requestBody = new SearchStringRequestBody(); @@ -656,7 +656,7 @@ public List<ConnectionElement> findConnections(String userId, requestBody.setSearchStringParameterName(parameterName); ConnectionsResponse restResult = restClient.callConnectionsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -697,7 +697,7 @@ public List<ConnectionElement> getConnectionsByName(String userId, invalidParameterHandler.validateName(name, nameParameter, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/by-name?startFrom={2}&pageSize={3}"; NameRequestBody requestBody = new NameRequestBody(); @@ -705,7 +705,7 @@ public List<ConnectionElement> getConnectionsByName(String userId, requestBody.setNamePropertyName(nameParameter); ConnectionsResponse restResult = restClient.callConnectionsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -740,10 +740,10 @@ public ConnectionElement getConnectionByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(connectionGUID, connectionGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connections/{2}"; ConnectionResponse restResult = restClient.callConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, connectionGUID); @@ -778,10 +778,10 @@ public String createEndpoint(String userId, invalidParameterHandler.validateObject(endpointProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(endpointProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, endpointProperties, serverName, userId); @@ -819,10 +819,10 @@ public String createEndpointFromTemplate(String userId, invalidParameterHandler.validateObject(templateProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(templateProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/network-address/{2}/from-template/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/network-address/{2}/from-template/{3}"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, templateProperties, serverName, userId, @@ -866,10 +866,10 @@ public void updateEndpoint(String userId, invalidParameterHandler.validateGUID(endpointGUID, guidParameter, methodName); invalidParameterHandler.validateObject(endpointProperties, propertiesParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/{2}/update?isMergeUpdate={3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, endpointProperties, serverName, userId, @@ -901,10 +901,10 @@ public void removeEndpoint(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(endpointGUID, guidParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/{2}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -942,7 +942,7 @@ public List<EndpointElement> findEndpoints(String userId, invalidParameterHandler.validateSearchString(searchString, parameterName, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/by-search-string" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/by-search-string" + "?startFrom={2}&pageSize={3}"; SearchStringRequestBody requestBody = new SearchStringRequestBody(); @@ -951,7 +951,7 @@ public List<EndpointElement> findEndpoints(String userId, requestBody.setSearchStringParameterName(parameterName); EndpointsResponse restResult = restClient.callEndpointsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -992,7 +992,7 @@ public List<EndpointElement> getEndpointsByName(String userId, invalidParameterHandler.validateName(name, nameParameter, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/by-name?startFrom={2}&pageSize={3}"; NameRequestBody requestBody = new NameRequestBody(); @@ -1000,7 +1000,7 @@ public List<EndpointElement> getEndpointsByName(String userId, requestBody.setNamePropertyName(nameParameter); EndpointsResponse restResult = restClient.callEndpointsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1035,10 +1035,10 @@ public EndpointElement getEndpointByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(endpointGUID, endpointGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/endpoints/{2}"; EndpointResponse restResult = restClient.callEndpointGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, endpointGUID); @@ -1071,10 +1071,10 @@ public String createConnectorType(String userId, invalidParameterHandler.validateObject(connectorTypeProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(connectorTypeProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, connectorTypeProperties, serverName, userId); @@ -1110,10 +1110,10 @@ public String createConnectorTypeFromTemplate(String userId, invalidParameterHandler.validateObject(templateProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(templateProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/from-template/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/from-template/{2}"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, templateProperties, serverName, userId, @@ -1156,10 +1156,10 @@ public void updateConnectorType(String userId, invalidParameterHandler.validateName(connectorTypeProperties.getQualifiedName(), qualifiedNameParameter, methodName); } - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/{2}/update?isMergeUpdate={3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, connectorTypeProperties, serverName, userId, @@ -1190,10 +1190,10 @@ public void removeConnectorType(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(connectorTypeGUID, guidParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/{2}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1231,7 +1231,7 @@ public List<ConnectorTypeElement> findConnectorTypes(String userId, invalidParameterHandler.validateSearchString(searchString, parameterName, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/by-search-string" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/by-search-string" + "?startFrom={2}&pageSize={3}"; SearchStringRequestBody requestBody = new SearchStringRequestBody(); @@ -1240,7 +1240,7 @@ public List<ConnectorTypeElement> findConnectorTypes(String userId, requestBody.setSearchStringParameterName(parameterName); ConnectorTypesResponse restResult = restClient.callConnectorTypesPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1281,7 +1281,7 @@ public List<ConnectorTypeElement> getConnectorTypesByName(String userId, invalidParameterHandler.validateName(name, nameParameter, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/by-name?startFrom={2}&pageSize={3}"; NameRequestBody requestBody = new NameRequestBody(); @@ -1289,7 +1289,7 @@ public List<ConnectorTypeElement> getConnectorTypesByName(String userId, requestBody.setNamePropertyName(nameParameter); ConnectorTypesResponse restResult = restClient.callConnectorTypesPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1324,10 +1324,10 @@ public ConnectorTypeElement getConnectorTypeByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(connectorTypeGUID, connectorTypeGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/connector-types/{2}"; ConnectorTypeResponse restResult = restClient.callMyConnectorTypeGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, connectorTypeGUID); diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/DigitalArchitectureEventClient.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/DigitalArchitectureEventClient.java index b7f0e9acfd3..29421a5ab54 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/DigitalArchitectureEventClient.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/DigitalArchitectureEventClient.java @@ -121,7 +121,7 @@ public void registerListener(String userId, final String nameParameter = "listener"; final String callerIdParameter = "callerId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); @@ -134,7 +134,7 @@ public void registerListener(String userId, * event bus. */ ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/LocationManager.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/LocationManager.java index a4d94ab223a..f82bb542f6d 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/LocationManager.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/LocationManager.java @@ -151,10 +151,10 @@ public String createLocation(String userId, invalidParameterHandler.validateObject(locationProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(locationProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, locationProperties, serverName, userId); @@ -190,10 +190,10 @@ public String createLocationFromTemplate(String userId, invalidParameterHandler.validateObject(templateProperties, propertiesParameter, methodName); invalidParameterHandler.validateName(templateProperties.getQualifiedName(), nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/from-template/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/from-template/{2}"; GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, templateProperties, serverName, userId, @@ -236,10 +236,10 @@ public void updateLocation(String userId, invalidParameterHandler.validateName(locationProperties.getQualifiedName(), qualifiedNameParameter, methodName); } - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/update?isMergeUpdate={3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, locationProperties, serverName, userId, @@ -277,7 +277,7 @@ public void setLocationAsFixedPhysical(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/classify-as-fixed-location"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/classify-as-fixed-location"; FixedLocationRequestBody requestBody = new FixedLocationRequestBody(); @@ -287,7 +287,7 @@ public void setLocationAsFixedPhysical(String userId, requestBody.setTimeZone(timeZone); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -316,10 +316,10 @@ public void clearLocationAsFixedPhysical(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/classify-as-fixed-location/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/classify-as-fixed-location/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -353,7 +353,7 @@ public void setLocationAsSecure(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/classify-as-secure-location"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/classify-as-secure-location"; SecureLocationRequestBody requestBody = new SecureLocationRequestBody(); @@ -361,7 +361,7 @@ public void setLocationAsSecure(String userId, requestBody.setLevel(level); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -391,10 +391,10 @@ public void clearLocationAsSecure(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/classify-as-secure-location/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/classify-as-secure-location/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -426,14 +426,14 @@ public void setLocationAsDigital(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/classify-as-digital-location"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/classify-as-digital-location"; DigitalLocationRequestBody requestBody = new DigitalLocationRequestBody(); requestBody.setNetworkAddress(networkAddress); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -463,10 +463,10 @@ public void clearLocationAsDigital(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/classify-as-digital-location/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/classify-as-digital-location/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -496,10 +496,10 @@ public void removeLocation(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(locationGUID, guidParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -533,10 +533,10 @@ public void setupNestedLocation(String userId, invalidParameterHandler.validateGUID(parentLocationGUID, parentLocationGUIDParameter, methodName); invalidParameterHandler.validateGUID(childLocationGUID, childLocationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/has-nested-location/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/has-nested-location/{3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -571,10 +571,10 @@ public void clearNestedLocation(String userId, invalidParameterHandler.validateGUID(parentLocationGUID, parentLocationGUIDParameter, methodName); invalidParameterHandler.validateGUID(childLocationGUID, childLocationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/has-nested-location/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/has-nested-location/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -609,10 +609,10 @@ public void setupAdjacentLocation(String userId, invalidParameterHandler.validateGUID(locationOneGUID, locationOneGUIDParameter, methodName); invalidParameterHandler.validateGUID(locationTwoGUID, locationTwoGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/linked-to-peer-location/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/linked-to-peer-location/{3}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -647,10 +647,10 @@ public void clearAdjacentLocation(String userId, invalidParameterHandler.validateGUID(locationOneGUID, locationOneGUIDParameter, methodName); invalidParameterHandler.validateGUID(locationTwoGUID, locationTwoGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/linked-to-peer-location/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}/linked-to-peer-location/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -690,7 +690,7 @@ public List<LocationElement> findLocations(String userId, invalidParameterHandler.validateSearchString(searchString, parameterName, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/by-search-string" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/by-search-string" + "?startFrom={2}&pageSize={3}"; SearchStringRequestBody requestBody = new SearchStringRequestBody(); @@ -699,12 +699,12 @@ public List<LocationElement> findLocations(String userId, requestBody.setSearchStringParameterName(parameterName); LocationsResponse restResult = restClient.callLocationsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - startFrom, - validatedPageSize); + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); return restResult.getElementList(); } @@ -740,7 +740,7 @@ public List<LocationElement> getLocationsByName(String userId, invalidParameterHandler.validateName(name, nameParameter, methodName); int validatedPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/by-name?startFrom={2}&pageSize={3}"; NameRequestBody requestBody = new NameRequestBody(); @@ -748,12 +748,12 @@ public List<LocationElement> getLocationsByName(String userId, requestBody.setNamePropertyName(nameParameter); LocationsResponse restResult = restClient.callLocationsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - requestBody, - serverName, - userId, - startFrom, - validatedPageSize); + urlTemplate, + requestBody, + serverName, + userId, + startFrom, + validatedPageSize); return restResult.getElementList(); } @@ -783,10 +783,10 @@ public LocationElement getLocationByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(locationGUID, locationGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/locations/{2}"; LocationResponse restResult = restClient.callLocationGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, locationGUID); diff --git a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java index c2a04980a92..32f4f2e50a6 100644 --- a/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java +++ b/open-metadata-implementation/access-services/digital-architecture/digital-architecture-client/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/client/ReferenceDataManager.java @@ -171,7 +171,7 @@ public String createValidValueSet(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets"; ValidValueProperties requestBody = new ValidValueProperties(); requestBody.setQualifiedName(qualifiedName); @@ -184,7 +184,7 @@ public String createValidValueSet(String userId, requestBody.setExtendedProperties(extendedProperties); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -236,7 +236,7 @@ public String createValidValueDefinition(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}?isDefaultValue={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}?isDefaultValue={3}"; ValidValueProperties requestBody = new ValidValueProperties(); requestBody.setQualifiedName(qualifiedName); @@ -250,7 +250,7 @@ public String createValidValueDefinition(String userId, requestBody.setExtendedProperties(extendedProperties); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -309,7 +309,7 @@ public void updateValidValue(String userId, invalidParameterHandler.validateGUID(validValueGUID, guidParameter, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/update?isMergeUpdate={3}"; ValidValueProperties requestBody = new ValidValueProperties(); requestBody.setQualifiedName(qualifiedName); @@ -323,7 +323,7 @@ public void updateValidValue(String userId, requestBody.setExtendedProperties(extendedProperties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -359,10 +359,10 @@ public void deleteValidValue(String userId, invalidParameterHandler.validateGUID(validValueGUID, guidParameter, methodName); invalidParameterHandler.validateName(qualifiedName, nameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, qualifiedName, serverName, userId, @@ -399,10 +399,10 @@ public void attachValidValueToSet(String userId, invalidParameterHandler.validateGUID(setGUID, setGUIDParameter, methodName); invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}/members/{3}?isDefaultValue={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}/members/{3}?isDefaultValue={4}"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -438,10 +438,10 @@ public void detachValidValueFromSet(String userId, invalidParameterHandler.validateGUID(setGUID, setGUIDParameter, methodName); invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}/members/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}/members/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -483,7 +483,7 @@ public void linkValidValueToImplementation(String userId, invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/implementations/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/implementations/{3}"; ValidValuesImplProperties requestBody = new ValidValuesImplProperties(); @@ -492,7 +492,7 @@ public void linkValidValueToImplementation(String userId, requestBody.setAdditionalValues(additionalValues); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -524,10 +524,10 @@ public void classifyAssetAsReferenceData(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/assets/classify-as-reference-data"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/assets/classify-as-reference-data"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -561,10 +561,10 @@ public void unlinkValidValueFromImplementation(String userId, invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/implementations/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/implementations/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -596,10 +596,10 @@ public void declassifyAssetAsReferenceData(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/assets/declassify-as-reference-data"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/assets/declassify-as-reference-data"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -636,13 +636,13 @@ public void assignValidValueToConsumer(String userId, invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validateGUID(consumerGUID, consumerGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/consumers/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/consumers/{3}"; ValidValueAssignmentProperties requestBody = new ValidValueAssignmentProperties(); requestBody.setStrictRequirement(strictRequirement); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -677,10 +677,10 @@ public void unassignValidValueFromConsumer(String userId, invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validateGUID(consumerGUID, consumerGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/consumers/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/consumers/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -722,7 +722,7 @@ public void assignReferenceValueToItem(String userId, invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validateGUID(referenceableGUID, referenceableGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/reference-values/{2}/items/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/reference-values/{2}/items/{3}"; ReferenceValueAssignmentProperties requestBody = new ReferenceValueAssignmentProperties(); requestBody.setConfidence(confidence); @@ -730,7 +730,7 @@ public void assignReferenceValueToItem(String userId, requestBody.setNotes(notes); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -765,11 +765,10 @@ public void unassignReferenceValueFromItem(String userId, invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validateGUID(referenceableGUID, referenceableGUIDParameter, methodName); - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/reference-values/{2}/items/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/reference-values/{2}/items/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -813,7 +812,7 @@ public void mapValidValues(String userId, invalidParameterHandler.validateGUID(validValue1GUID, validValue1GUIDParameter, methodName); invalidParameterHandler.validateGUID(validValue2GUID, validValue2GUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/map/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/map/{3}"; ValidValuesMappingProperties requestBody = new ValidValuesMappingProperties(); requestBody.setAssociationDescription(associationDescription); @@ -822,7 +821,7 @@ public void mapValidValues(String userId, requestBody.setNotes(notes); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -858,11 +857,10 @@ public void unmapValidValues(String userId, invalidParameterHandler.validateGUID(validValue1GUID, validValue1GUIDParameter, methodName); invalidParameterHandler.validateGUID(validValue2GUID, validValue2GUIDParameter, methodName); - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/map/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/map/{3}/delete"; restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -895,10 +893,10 @@ public ValidValueElement getValidValueByGUID(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}"; ValidValueResponse restResult = restClient.callValidValueGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, validValueGUID); @@ -935,7 +933,7 @@ public List<ValidValueElement> getValidValueByName(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(validValueName, validValueNameParameter, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/by-name?startFrom={2}&pageSize={3}"; NameRequestBody requestBody = new NameRequestBody(); @@ -943,7 +941,7 @@ public List<ValidValueElement> getValidValueByName(String userId, requestBody.setNamePropertyName(validValueNameParameter); ValidValuesResponse restResult = restClient.callValidValuesPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -984,7 +982,7 @@ public List<ValidValueElement> findValidValues(String userId, invalidParameterHandler.validateSearchString(searchString, parameterName, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/by-search-string" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/by-search-string" + "?startFrom={2}&pageSize={3}"; SearchStringRequestBody requestBody = new SearchStringRequestBody(); @@ -993,7 +991,7 @@ public List<ValidValueElement> findValidValues(String userId, requestBody.setSearchStringParameterName(parameterName); ValidValuesResponse restResult = restClient.callValidValuesPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1033,10 +1031,10 @@ public List<ValidValueElement> getValidValueSetMembers(String userId, invalidParameterHandler.validateGUID(validValueSetGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}/members?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/sets/{2}/members?startFrom={3}&pageSize={4}"; ValidValuesResponse restResult = restClient.callValidValuesGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, validValueSetGUID, @@ -1075,10 +1073,10 @@ public List<ValidValueElement> getSetsForValidValue(String userId, invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/set-membership?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/set-membership?startFrom={3}&pageSize={4}"; ValidValuesResponse restResult = restClient.callValidValuesGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, validValueGUID, @@ -1117,12 +1115,11 @@ public List<ValidValueAssignmentConsumerElement> getValidValuesAssignmentConsume invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/consumers?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/consumers?startFrom={3}&pageSize={4}"; ValidValueAssignmentConsumersResponse restResult = restClient.callValidValueAssignmentConsumersGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, validValueGUID, @@ -1161,11 +1158,11 @@ public List<ValidValueAssignmentDefinitionElement> getValidValuesAssignmentDefin invalidParameterHandler.validateGUID(referenceableGUID, referenceableGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/referenceables/{2}/valid-value-assignments?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/referenceables/{2}/valid-value-assignments?startFrom={3}&pageSize={4}"; ValidValueAssignmentDefinitionsResponse restResult = restClient.callValidValueAssignmentDefinitionsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, referenceableGUID, @@ -1204,12 +1201,11 @@ public List<ValidValueImplAssetElement> getValidValuesImplementationAssets(Strin invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/implementations" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/implementations" + "?startFrom={3}&pageSize={4}"; ValidValuesImplAssetsResponse restResult = restClient.callValidValuesImplAssetsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, validValueGUID, @@ -1249,12 +1245,11 @@ public List<ValidValueImplDefinitionElement> getValidValuesImplementationDefinit invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/implementations?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/implementations?startFrom={3}&pageSize={4}"; ValidValuesImplDefinitionsResponse restResult = restClient.callValidValuesImplDefinitionsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, assetGUID, @@ -1294,12 +1289,11 @@ public List<ValidValueMappingElement> getValidValueMappings(String userId, invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/mapped-values" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/mapped-values" + "?startFrom={3}&pageSize={4}"; ValidValueMappingsResponse restResult = restClient.callValidValueMappingsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, validValueGUID, @@ -1340,12 +1334,11 @@ public List<ValidValuesMappingElement> getValidValuesMappings(String userI invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/map-relationships" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/map-relationships" + "?startFrom={3}&pageSize={4}"; ValidValuesMappingsResponse restResult = restClient.callValidValuesMappingsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, validValueGUID, @@ -1384,13 +1377,12 @@ public List<ReferenceValueAssignmentItemElement> getReferenceValueAssignedItems( invalidParameterHandler.validateGUID(validValueGUID, validValueGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/reference-values/assigned-items" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/valid-values/{2}/reference-values/assigned-items" + "?startFrom={3}&pageSize={4}"; ReferenceValueAssignmentItemsResponse restResult = restClient.callReferenceValueAssignmentItemsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, validValueGUID, @@ -1429,13 +1421,12 @@ public List<ReferenceValueAssignmentDefinitionElement> getReferenceValueAssignme invalidParameterHandler.validateGUID(referenceableGUID, referenceableGUIDParameter, methodName); invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/referenceables/{2}/reference-value-assignments" + + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/digital-architecture/users/{1}/referenceables/{2}/reference-value-assignments" + "?startFrom={3}&pageSize={4}"; ReferenceValueAssignmentDefinitionsResponse restResult = restClient.callReferenceValueAssignmentDefinitionsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, referenceableGUID, diff --git a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/client/DiscoveryEngineClient.java b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/client/DiscoveryEngineClient.java index 7304bac8496..5e82867e22a 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/client/DiscoveryEngineClient.java +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/src/main/java/org/odpi/openmetadata/accessservices/discoveryengine/client/DiscoveryEngineClient.java @@ -168,17 +168,17 @@ public List<String> getAssets(String userId, UserNotAuthorizedException, PropertyServerException { - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets?startFrom={2}&pageSize={3}"; final String methodName = "getAssets"; invalidParameterHandler.validateUserId(userId, methodName); GUIDListResponse restResult = restClient.callGUIDListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - startFrom, - pageSize); + urlTemplate, + serverName, + userId, + startFrom, + pageSize); return restResult.getGUIDs(); } @@ -213,7 +213,7 @@ private List<String> retrieveAssetGUIDList(String userId, invalidParameterHandler.validateSearchString(searchParameter, searchParameterName, methodName); GUIDListResponse restResult = restClient.callGUIDListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, searchParameter, serverName, userId, @@ -244,7 +244,7 @@ public List<String> getAssetsByQualifiedName(String userId, UserNotAuthorizedException, PropertyServerException { - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/by-qualified-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/by-qualified-name?startFrom={2}&pageSize={3}"; final String methodName = "getAssetsByQualifiedName"; final String searchParameterName = "name"; @@ -272,7 +272,7 @@ public List<String> getAssetsByName(String userId, UserNotAuthorizedException, PropertyServerException { - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/by-name?startFrom={2}&pageSize={3}"; final String methodName = "getAssetsByName"; final String searchParameterName = "name"; @@ -302,7 +302,7 @@ public List<String> findAssets(String userId, PropertyServerException, UserNotAuthorizedException { - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/by-search-string?startFrom={2}&pageSize={3}"; final String methodName = "findAssets"; final String searchParameterName = "searchString"; @@ -329,7 +329,7 @@ public List<String> findAssetsByEndpoint(String userId, UserNotAuthorizedException, PropertyServerException { - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/by-endpoint-address?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/by-endpoint-address?startFrom={2}&pageSize={3}"; final String methodName = "findAssetsByEndpoint"; final String searchParameterName = "networkAddress"; @@ -434,14 +434,14 @@ public void logAssetAuditMessage(String userId, final String guidParameter = "assetGUID"; final String discoveryServiceParameter = "discoveryService"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/{2}/log-records/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/{2}/log-records/{3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, guidParameter, methodName); invalidParameterHandler.validateName(discoveryService, discoveryServiceParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, message, serverName, userId, @@ -491,7 +491,7 @@ public String createDiscoveryAnalysisReport(String userId, final String assetGUIDParameterName = "assetGUID"; final String discoveryEngineGUIDParameterName = "discoveryEngineGUID"; final String discoveryServiceGUIDParameterName = "discoveryServiceGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/{2}/discovery-analysis-reports"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/{2}/discovery-analysis-reports"; invalidParameterHandler.validateName(qualifiedName, nameParameterName, methodName); invalidParameterHandler.validateUserId(userId, methodName); @@ -513,7 +513,7 @@ public String createDiscoveryAnalysisReport(String userId, requestBody.setAdditionalProperties(additionalProperties); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -541,7 +541,7 @@ public void updateDiscoveryAnalysisReport(String userId, final String reportParameterName = "updatedReport"; final String reportHeaderParameterName = "updatedReport.getElementHeader"; final String reportGUIDParameterName = "updatedReport.getGUID()"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(updatedReport, reportParameterName, methodName); @@ -549,12 +549,11 @@ public void updateDiscoveryAnalysisReport(String userId, invalidParameterHandler.validateGUID(updatedReport.getElementHeader().getGUID(), reportGUIDParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, updatedReport, serverName, userId, updatedReport.getElementHeader().getGUID()); - } @@ -633,13 +632,13 @@ public DiscoveryAnalysisReport getDiscoveryAnalysisReport(String userId, { final String methodName = "getDiscoveryAnalysisReport"; final String reportGUIDParameterName = "discoveryReportGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(discoveryReportGUID, reportGUIDParameterName, methodName); DiscoveryAnalysisReportResponse restResult = restClient.callDiscoveryAnalysisReportGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, discoveryReportGUID); @@ -662,12 +661,12 @@ List<String> getTypesOfAnnotation(String userId) throws InvalidParameterExcepti PropertyServerException { final String methodName = "getTypesOfAnnotation"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/sub-types"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/sub-types"; invalidParameterHandler.validateUserId(userId, methodName); NameListResponse restResult = restClient.callNameListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId); @@ -689,12 +688,12 @@ Map<String, String> getTypesOfAnnotationWithDescriptions(String userId) throws PropertyServerException { final String methodName = "getTypesOfAnnotationWithDescriptions"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/sub-types/descriptions"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/sub-types/descriptions"; invalidParameterHandler.validateUserId(userId, methodName); StringMapResponse restResult = restClient.callStringMapGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId); @@ -727,7 +726,7 @@ List<Annotation> getAnnotationsForAssetByStatus(String userId, { final String methodName = "getAnnotationsForAssetByStatus"; final String assetGUIDParameterName = "assetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/{2}/annotations?startingFrom={3}&maximumResults={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/assets/{2}/annotations?startingFrom={3}&maximumResults={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, assetGUIDParameterName, methodName); @@ -738,7 +737,7 @@ List<Annotation> getAnnotationsForAssetByStatus(String userId, requestBody.setAnnotationStatus(status); AnnotationListResponse restResult = restClient.callAnnotationListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -801,14 +800,14 @@ List<Annotation> getDiscoveryReportAnnotations(String userId, PropertyServerException { final String reportGUIDParameterName = "discoveryReportGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}/annotations?startingFrom={3}&maximumResults={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}/annotations?startingFrom={3}&maximumResults={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(discoveryReportGUID, reportGUIDParameterName, methodName); invalidParameterHandler.validatePaging(startingFrom, maximumResults, methodName); AnnotationListResponse restResult = restClient.callAnnotationListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, discoveryReportGUID, @@ -842,14 +841,14 @@ public List<Annotation> getExtendedAnnotations(String userId, { final String methodName = "getExtendedAnnotations"; final String annotationGUIDParameterName = "annotationGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}/extended-annotations?startingFrom={3}&maximumResults={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}/extended-annotations?startingFrom={3}&maximumResults={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(annotationGUID, annotationGUIDParameterName, methodName); invalidParameterHandler.validatePaging(startingFrom, maximumResults, methodName); AnnotationListResponse restResult = restClient.callAnnotationListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, annotationGUID, @@ -880,13 +879,13 @@ public Annotation getAnnotation(String userId, { final String methodName = "getAnnotation"; final String annotationGUIDParameterName = "annotationGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(annotationGUID, annotationGUIDParameterName, methodName); AnnotationResponse restResult = restClient.callAnnotationGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, annotationGUID); @@ -915,14 +914,14 @@ String addAnnotationToDiscoveryReport(String userId, final String methodName = "addAnnotationToDiscoveryReport"; final String annotationParameterName = "annotation"; final String reportGUIDParameterName = "discoveryReportGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}/annotations"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}/annotations"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(discoveryReportGUID, reportGUIDParameterName, methodName); invalidParameterHandler.validateObject(annotation, annotationParameterName, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, annotation, serverName, userId, @@ -952,14 +951,14 @@ String addAnnotationToAnnotation(String userId, final String methodName = "addAnnotationToAnnotation"; final String annotationGUIDParameterName = "parentAnnotationGUID"; final String annotationParameterName = "annotation"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}/extended-annotations"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}/extended-annotations"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(parentAnnotationGUID, annotationGUIDParameterName, methodName); invalidParameterHandler.validateObject(annotation, annotationParameterName, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, annotation, serverName, userId, @@ -989,7 +988,7 @@ void updateAnnotation(String userId, final String headerParameterName = "annotation.getElementHeader()"; final String annotationGUIDParameterName = "annotation.getElementHeader().getGUID()"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(annotation, annotationParameterName, methodName); @@ -1000,7 +999,7 @@ void updateAnnotation(String userId, invalidParameterHandler.validateGUID(elementHeader.getGUID(), annotationGUIDParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, annotation, serverName, userId, @@ -1024,13 +1023,13 @@ void deleteAnnotation(String userId, { final String methodName = "deleteAnnotation"; final String annotationGUIDParameterName = "annotationGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(annotationGUID, annotationGUIDParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1059,19 +1058,19 @@ List<DataField> getPreviousDataFieldsForAsset(String userId, { final String methodName = "getPreviousDataFieldsForAsset"; final String discoveryReportGUIDParameterName = "discoveryReportGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}/data-fields/previous?startingFrom={3}&maximumResults={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}/data-fields/previous?startingFrom={3}&maximumResults={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(discoveryReportGUID, discoveryReportGUIDParameterName, methodName); invalidParameterHandler.validatePaging(startingFrom, maximumResults, methodName); DataFieldListResponse restResult = restClient.callDataFieldListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - discoveryReportGUID, - Integer.toString(startingFrom), - Integer.toString(maximumResults)); + urlTemplate, + serverName, + userId, + discoveryReportGUID, + Integer.toString(startingFrom), + Integer.toString(maximumResults)); return restResult.getDataFields(); } @@ -1096,14 +1095,14 @@ List<DataField> getNewDataFieldsForAsset(String userId, { final String methodName = "getNewDataFieldsForAsset"; final String discoveryReportGUIDParameterName = "discoveryReportGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}/data-fields?startingFrom={3}&maximumResults={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/discovery-analysis-reports/{2}/data-fields?startingFrom={3}&maximumResults={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(discoveryReportGUID, discoveryReportGUIDParameterName, methodName); invalidParameterHandler.validatePaging(startingFrom, maximumResults, methodName); DataFieldListResponse restResult = restClient.callDataFieldListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, discoveryReportGUID, @@ -1136,14 +1135,14 @@ List<DataField> getNestedDataFields(String userId, { final String methodName = "getNestedDataFields"; final String dataFieldGUIDParameterName = "parentDataFieldGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}/nested-data-fields?startingFrom={3}&maximumResults={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}/nested-data-fields?startingFrom={3}&maximumResults={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(parentDataFieldGUID, dataFieldGUIDParameterName, methodName); invalidParameterHandler.validatePaging(startingFrom, maximumResults, methodName); DataFieldListResponse restResult = restClient.callDataFieldListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, parentDataFieldGUID, @@ -1170,16 +1169,16 @@ DataField getDataField(String userId, { final String methodName = "getDataField"; final String dataFieldGUIDParameterName = "dataFieldGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(dataFieldGUID, dataFieldGUIDParameterName, methodName); DataFieldResponse restResult = restClient.callDataFieldGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - dataFieldGUID); + urlTemplate, + serverName, + userId, + dataFieldGUID); return restResult.getDataField(); } @@ -1206,14 +1205,14 @@ String addDataFieldToDiscoveryReport(String userId, final String methodName = "addDataFieldToDiscoveryReport"; final String annotationGUIDParameterName = "annotationGUID"; final String dataFieldParameterName = "dataField"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}/data-fields"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/annotations/{2}/data-fields"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(annotationGUID, annotationGUIDParameterName, methodName); invalidParameterHandler.validateObject(dataField, dataFieldParameterName, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, dataField, serverName, userId, @@ -1243,14 +1242,14 @@ String addDataFieldToDataField(String userId, final String methodName = "addDataFieldToDataField"; final String dataFieldGUIDParameterName = "parentDataFieldGUID"; final String dataFieldParameterName = "dataField"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}/nested-data-fields"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}/nested-data-fields"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(parentDataFieldGUID, dataFieldGUIDParameterName, methodName); invalidParameterHandler.validateObject(dataField, dataFieldParameterName, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, dataField, serverName, userId, @@ -1280,14 +1279,14 @@ String addAnnotationToDataField(String userId, final String methodName = "addAnnotationToDataField"; final String dataFieldGUIDParameterName = "parentDataFieldGUID"; final String annotationParameterName = "annotation"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}/annotations"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}/annotations"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(parentDataFieldGUID, dataFieldGUIDParameterName, methodName); invalidParameterHandler.validateObject(annotation, annotationParameterName, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, annotation, serverName, userId, @@ -1317,7 +1316,7 @@ void updateDataField(String userId, final String headerParameterName = "dataField.getElementHeader()"; final String annotationGUIDParameterName = "dataField.getElementHeader().getGUID()"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(dataField, dataFieldParameterName, methodName); @@ -1328,7 +1327,7 @@ void updateDataField(String userId, invalidParameterHandler.validateGUID(elementHeader.getGUID(), annotationGUIDParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, dataField, serverName, userId, @@ -1352,13 +1351,13 @@ void deleteDataField(String userId, { final String methodName = "deleteDataField"; final String dataFieldGUIDParameterName = "dataFieldGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/discovery-engine/users/{1}/data-fields/{2}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(dataFieldGUID, dataFieldGUIDParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceActionProcessClient.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceActionProcessClient.java index dff7443e9d6..d0ce00a00fa 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceActionProcessClient.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceActionProcessClient.java @@ -137,7 +137,7 @@ public String createGovernanceActionProcess(String us final String methodName = "createGovernanceActionProcess"; final String propertiesParameterName = "processProperties"; final String qualifiedNameParameterName = "processProperties.getQualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/new"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/new"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(processProperties, propertiesParameterName, methodName); @@ -149,7 +149,7 @@ public String createGovernanceActionProcess(String us requestBody.setProperties(processProperties); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -185,7 +185,7 @@ public void updateGovernanceActionProcess(String user final String guidParameterName = "processGUID"; final String propertiesParameterName = "processProperties"; final String qualifiedNameParameterName = "processProperties.getQualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(processGUID, guidParameterName, methodName); @@ -203,7 +203,7 @@ public void updateGovernanceActionProcess(String user requestBody.setProperties(processProperties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -231,13 +231,13 @@ public void publishGovernanceActionProcess(String userId, { final String methodName = "publishGovernanceActionProcess"; final String guidParameterName = "processGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/publish"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/publish"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(processGUID, guidParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -266,13 +266,13 @@ public void withdrawGovernanceActionProcess(String userId, { final String methodName = "withdrawGovernanceActionProcess"; final String guidParameterName = "processGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/withdraw"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/withdraw"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(processGUID, guidParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -299,13 +299,13 @@ public void removeGovernanceActionProcess(String userId, { final String methodName = "removeGovernanceActionProcess"; final String guidParameterName = "processGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/remove"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/remove"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(processGUID, guidParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -339,7 +339,7 @@ public List<GovernanceActionProcessElement> findGovernanceActionProcesses(String { final String methodName = "findGovernanceActionProcesses"; final String searchStringParameterName = "searchString"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/by-search-string?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); @@ -350,7 +350,7 @@ public List<GovernanceActionProcessElement> findGovernanceActionProcesses(String requestBody.setSearchStringParameterName(searchStringParameterName); GovernanceActionProcessElementsResponse restResult = restClient.callGovernanceActionProcessElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -387,7 +387,7 @@ public List<GovernanceActionProcessElement> getGovernanceActionProcessesByName(S { final String methodName = "getGovernanceActionProcessesByName"; final String nameParameterName = "name"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/by-name?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(name, nameParameterName, methodName); @@ -398,7 +398,7 @@ public List<GovernanceActionProcessElement> getGovernanceActionProcessesByName(S requestBody.setNameParameterName(nameParameterName); GovernanceActionProcessElementsResponse restResult = restClient.callGovernanceActionProcessElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -430,13 +430,13 @@ public GovernanceActionProcessElement getGovernanceActionProcessByGUID(String us { final String methodName = "getGovernanceActionProcessByGUID"; final String guidParameterName = "processGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(processGUID, guidParameterName, methodName); GovernanceActionProcessElementResponse restResult = restClient.callGovernanceActionProcessGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, processGUID); @@ -472,14 +472,14 @@ public String createGovernanceActionType(String userId, final String methodName = "createGovernanceActionType"; final String propertiesParameterName = "actionTypeProperties"; final String qualifiedNameParameterName = "actionTypeProperties.getQualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/new"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/new"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(actionTypeProperties, propertiesParameterName, methodName); invalidParameterHandler.validateName(actionTypeProperties.getQualifiedName(), qualifiedNameParameterName, methodName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, actionTypeProperties, serverName, userId); @@ -513,7 +513,7 @@ public void updateGovernanceActionType(String userId, final String guidParameterName = "actionTypeGUID"; final String propertiesParameterName = "actionTypeProperties"; final String qualifiedNameParameterName = "actionTypeProperties.getQualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/{2}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(actionTypeGUID, guidParameterName, methodName); @@ -530,7 +530,7 @@ public void updateGovernanceActionType(String userId, requestBody.setProperties(actionTypeProperties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -556,13 +556,13 @@ public void removeGovernanceActionType(String userId, { final String methodName = "removeGovernanceActionType"; final String guidParameterName = "actionTypeGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/{2}/remove"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/{2}/remove"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(actionTypeGUID, guidParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -595,7 +595,7 @@ public List<GovernanceActionTypeElement> findGovernanceActionTypes(String userId { final String methodName = "findGovernanceActionTypes"; final String searchStringParameterName = "searchString"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/by-search-string?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); @@ -606,7 +606,7 @@ public List<GovernanceActionTypeElement> findGovernanceActionTypes(String userId requestBody.setSearchStringParameterName(searchStringParameterName); GovernanceActionTypeElementsResponse restResult = restClient.callGovernanceActionTypeElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -642,7 +642,7 @@ public List<GovernanceActionTypeElement> getGovernanceActionTypesByName(String u { final String methodName = "getGovernanceActionTypesByName"; final String nameParameterName = "name"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/by-name?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(name, nameParameterName, methodName); @@ -653,7 +653,7 @@ public List<GovernanceActionTypeElement> getGovernanceActionTypesByName(String u requestBody.setNameParameterName(nameParameterName); GovernanceActionTypeElementsResponse restResult = restClient.callGovernanceActionTypeElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -684,13 +684,13 @@ public GovernanceActionTypeElement getGovernanceActionTypeByGUID(String userId, { final String methodName = "getGovernanceActionTypeByGUID"; final String guidParameterName = "actionTypeGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(actionTypeGUID, guidParameterName, methodName); GovernanceActionTypeElementResponse restResult = restClient.callGovernanceActionTypeGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, actionTypeGUID); @@ -724,14 +724,14 @@ public void setupFirstActionType(String userId, final String methodName = "setupFirstActionType"; final String processGUIDParameterName = "processGUID"; final String actionTypeGUIDParameterName = "actionTypeGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/first-action-type/{3}/new"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/first-action-type/{3}/new"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(processGUID, processGUIDParameterName, methodName); invalidParameterHandler.validateGUID(actionTypeGUID, actionTypeGUIDParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, guard, serverName, userId, @@ -760,13 +760,13 @@ public GovernanceActionTypeElement getFirstActionType(String userId, { final String methodName = "getFirstActionType"; final String guidParameterName = "processGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/first-action-type"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/first-action-type"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(processGUID, guidParameterName, methodName); GovernanceActionTypeElementResponse restResult = restClient.callGovernanceActionTypeGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, processGUID); @@ -793,13 +793,13 @@ public void removeFirstActionType(String userId, { final String methodName = "removeFirstActionType"; final String guidParameterName = "processGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/first-action-type/remove"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/{2}/first-action-type/remove"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(processGUID, guidParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -838,7 +838,7 @@ public String setupNextActionType(String userId, final String methodName = "setupNextActionType"; final String currentGUIDParameterName = "currentActionTypeGUID"; final String nextGUIDParameterName = "nextActionTypeGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/{2}/next-action-types/{3}/new"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/{2}/next-action-types/{3}/new"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(currentActionTypeGUID, currentGUIDParameterName, methodName); @@ -851,7 +851,7 @@ public String setupNextActionType(String userId, requestBody.setIgnoreMultipleTriggers(ignoreMultipleTriggers); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -887,7 +887,7 @@ public void updateNextActionType(String userId, { final String methodName = "updateNextActionType"; final String guidParameterName = "nextActionLinkGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/next-action-types/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/next-action-types/{2}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(nextActionLinkGUID, guidParameterName, methodName); @@ -899,7 +899,7 @@ public void updateNextActionType(String userId, requestBody.setIgnoreMultipleTriggers(ignoreMultipleTriggers); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -931,13 +931,13 @@ public List<NextGovernanceActionTypeElement> getNextGovernanceActionTypes(String { final String methodName = "getNextGovernanceActionTypes"; final String guidParameterName = "actionTypeGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/{2}/next-action-type?startFrom={4}&pageSize={5}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/{2}/next-action-type?startFrom={4}&pageSize={5}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(actionTypeGUID, guidParameterName, methodName); NextGovernanceActionTypeElementsResponse restResult = restClient.callNextGovernanceActionTypesGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, actionTypeGUID, @@ -966,13 +966,13 @@ public void removeNextActionType(String userId, { final String methodName = "removeFirstActionType"; final String guidParameterName = "processGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/next-action-type/{2}/remove"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-types/next-action-type/{2}/remove"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(actionLinkGUID, guidParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineClient.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineClient.java index 6d5fe04e197..80493182170 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineClient.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineClient.java @@ -156,14 +156,13 @@ public OpenMetadataElement getMetadataElementByGUID(String userId, { final String methodName = "getMetadataElementByGUID"; final String guidParameterName = "elementGUID"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}?forLineage={3}&forDuplicateProcessing={4}&effectiveTime={5}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}?forLineage={3}&forDuplicateProcessing={4}&effectiveTime={5}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, guidParameterName, methodName); OpenMetadataElementResponse restResult = restClient.callOpenMetadataElementGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, elementGUID, @@ -203,8 +202,7 @@ public OpenMetadataElement getMetadataElementByUniqueName(String userId, final String methodName = "getMetadataElementByUniqueName"; final String defaultPropertyName = "qualifiedName"; final String nameParameterName = "uniqueName"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/by-unique-name?forLineage={2}&forDuplicateProcessing={3}&effectiveTime={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/by-unique-name?forLineage={2}&forDuplicateProcessing={3}&effectiveTime={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(uniqueName, nameParameterName, methodName); @@ -223,7 +221,7 @@ public OpenMetadataElement getMetadataElementByUniqueName(String userId, } OpenMetadataElementResponse restResult = restClient.callOpenMetadataElementPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -264,8 +262,7 @@ public String getMetadataElementGUIDByUniqueName(String userId, final String methodName = "getMetadataElementGUIDByUniqueName"; final String defaultPropertyName = "qualifiedName"; final String nameParameterName = "uniqueName"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/guid-by-unique-name?forLineage={2}&forDuplicateProcessing={3}&effectiveTime={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/guid-by-unique-name?forLineage={2}&forDuplicateProcessing={3}&effectiveTime={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(uniqueName, nameParameterName, methodName); @@ -284,7 +281,7 @@ public String getMetadataElementGUIDByUniqueName(String userId, } GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -326,8 +323,7 @@ public List<OpenMetadataElement> findMetadataElementsWithString(String userId, { final String methodName = "findMetadataElementsWithString"; final String searchStringParameterName = "searchString"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/by-search-string?forLineage={2}&forDuplicateProcessing={3}&effectiveTime={4}&startFrom={5}&pageSize={6}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/by-search-string?forLineage={2}&forDuplicateProcessing={3}&effectiveTime={4}&startFrom={5}&pageSize={6}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); @@ -338,7 +334,7 @@ public List<OpenMetadataElement> findMetadataElementsWithString(String userId, requestBody.setSearchStringParameterName(searchStringParameterName); OpenMetadataElementsResponse restResult = restClient.callOpenMetadataElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -387,15 +383,14 @@ public List<RelatedMetadataElement> getRelatedMetadataElements(String userId, final String methodName = "getRelatedMetadataElements"; final String guidParameterName = "elementGUID"; final String typeNameParameterName = "relationshipTypeName"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/{2}/type/{3}?startingAtEnd={4}&forLineage={5}&forDuplicateProcessing={6}&effectiveTime={7}&startFrom={8}&pageSize={9}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/{2}/type/{3}?startingAtEnd={4}&forLineage={5}&forDuplicateProcessing={6}&effectiveTime={7}&startFrom={8}&pageSize={9}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, guidParameterName, methodName); invalidParameterHandler.validateName(relationshipTypeName, typeNameParameterName, methodName); RelatedMetadataElementListResponse restResult = restClient.callRelatedMetadataElementListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, elementGUID, @@ -456,8 +451,7 @@ public List<OpenMetadataElement> findMetadataElements(String user PropertyServerException { final String methodName = "findMetadataElements"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/by-search-specification?forLineage={2}&forDuplicateProcessing={3}&effectiveTime={4}&startFrom={5}&pageSize={6}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/by-search-specification?forLineage={2}&forDuplicateProcessing={3}&effectiveTime={4}&startFrom={5}&pageSize={6}"; invalidParameterHandler.validateUserId(userId, methodName); @@ -472,7 +466,7 @@ public List<OpenMetadataElement> findMetadataElements(String user requestBody.setSequencingOrder(sequencingOrder); OpenMetadataElementsResponse restResult = restClient.callOpenMetadataElementsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -523,8 +517,7 @@ public List<RelatedMetadataElements> findRelationshipsBetweenMetadataElements(St PropertyServerException { final String methodName = "findRelationshipsBetweenMetadataElements"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/by-search-specification?forLineage={2}&forDuplicateProcessing={3}&effectiveTime={4}&startFrom={5}&pageSize={6}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/by-search-specification?forLineage={2}&forDuplicateProcessing={3}&effectiveTime={4}&startFrom={5}&pageSize={6}"; invalidParameterHandler.validateUserId(userId, methodName); @@ -536,14 +529,13 @@ public List<RelatedMetadataElements> findRelationshipsBetweenMetadataElements(St requestBody.setSequencingOrder(sequencingOrder); RelatedMetadataElementsListResponse restResult = restClient.callRelatedMetadataElementsListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, forLineage, forDuplicateProcessing, - this.getEffectiveTimeAsLong( - effectiveTime), + this.getEffectiveTimeAsLong(effectiveTime), Integer.toString(startFrom), Integer.toString(pageSize)); @@ -585,8 +577,7 @@ public String createMetadataElementInStore(String userId, { final String methodName = "createMetadataElementInStore"; final String elementTypeParameterName = "metadataElementTypeName"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/new"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/new"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(metadataElementTypeName, elementTypeParameterName, methodName); @@ -601,7 +592,7 @@ public String createMetadataElementInStore(String userId, requestBody.setTemplateGUID(templateGUID); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -641,8 +632,7 @@ public void updateMetadataElementInStore(String userId, { final String methodName = "updateMetadataElementInStore"; final String guidParameterName = "metadataElementGUID"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/update-properties"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/update-properties"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(metadataElementGUID, guidParameterName, methodName); @@ -656,7 +646,7 @@ public void updateMetadataElementInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -692,8 +682,7 @@ public void updateMetadataElementStatusInStore(String userId, { final String methodName = "updateMetadataElementStatusInStore"; final String guidParameterName = "metadataElementGUID"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/update-status"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/update-status"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(metadataElementGUID, guidParameterName, methodName); @@ -706,7 +695,7 @@ public void updateMetadataElementStatusInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -744,8 +733,7 @@ public void updateMetadataElementEffectivityInStore(String userId, { final String methodName = "updateMetadataElementEffectivityInStore"; final String guidParameterName = "metadataElementGUID"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/update-effectivity"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/update-effectivity"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(metadataElementGUID, guidParameterName, methodName); @@ -759,7 +747,7 @@ public void updateMetadataElementEffectivityInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -791,8 +779,7 @@ public void deleteMetadataElementInStore(String userId, { final String methodName = "deleteMetadataElementInStore"; final String guidParameterName = "metadataElementGUID"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(metadataElementGUID, guidParameterName, methodName); @@ -804,7 +791,7 @@ public void deleteMetadataElementInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -848,8 +835,7 @@ public void classifyMetadataElementInStore(String userId, final String methodName = "classifyMetadataElementInStore"; final String guidParameterName = "metadataElementGUID"; final String classificationParameterName = "classificationName"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/classifications/{3}/new"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/classifications/{3}/new"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(metadataElementGUID, guidParameterName, methodName); @@ -865,7 +851,7 @@ public void classifyMetadataElementInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -907,8 +893,7 @@ public void reclassifyMetadataElementInStore(String userId, final String methodName = "reclassifyMetadataElementInStore"; final String guidParameterName = "metadataElementGUID"; final String classificationParameterName = "classificationName"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/classifications/{3}/update-properties"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/classifications/{3}/update-properties"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(metadataElementGUID, guidParameterName, methodName); @@ -923,7 +908,7 @@ public void reclassifyMetadataElementInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -964,8 +949,7 @@ public void updateClassificationEffectivityInStore(String userId, final String methodName = "updateClassificationEffectivityInStore"; final String guidParameterName = "metadataElementGUID"; final String classificationParameterName = "classificationName"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/classifications/{3}/update-effectivity"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/classifications/{3}/update-effectivity"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(metadataElementGUID, guidParameterName, methodName); @@ -980,7 +964,7 @@ public void updateClassificationEffectivityInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1016,8 +1000,7 @@ public void unclassifyMetadataElementInStore(String userId, final String methodName = "unclassifyMetadataElementInStore"; final String guidParameterName = "metadataElementGUID"; final String classificationParameterName = "classificationName"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/classifications/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/metadata-elements/{2}/classifications/{3}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(metadataElementGUID, guidParameterName, methodName); @@ -1030,7 +1013,7 @@ public void unclassifyMetadataElementInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1080,8 +1063,7 @@ public String createRelatedElementsInStore(String userId, final String elementTypeParameterName = "relationshipTypeName"; final String end1ParameterName = "metadataElement1GUID"; final String end2ParameterName = "metadataElement2GUID"; - final String urlTemplate = - "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/new"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/new"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(relationshipTypeName, elementTypeParameterName, methodName); @@ -1101,7 +1083,7 @@ public String createRelatedElementsInStore(String userId, requestBody.setEffectiveTime(effectiveTime); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -1140,7 +1122,7 @@ public void updateRelatedElementsInStore(String userId, { final String methodName = "updateRelatedElementsInStore"; final String guidParameterName = "relationshipGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/{2}/update-properties"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/{2}/update-properties"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(relationshipGUID, guidParameterName, methodName); @@ -1154,7 +1136,7 @@ public void updateRelatedElementsInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1191,7 +1173,7 @@ public void updateRelatedElementsEffectivityInStore(String userId, { final String methodName = "updateRelatedElementsEffectivityInStore"; final String guidParameterName = "relationshipGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/{2}/update-effectivity"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/{2}/update-effectivity"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(relationshipGUID, guidParameterName, methodName); @@ -1205,7 +1187,7 @@ public void updateRelatedElementsEffectivityInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1237,7 +1219,7 @@ public void deleteRelatedElementsInStore(String userId, { final String methodName = "deleteRelatedElementsInStore"; final String guidParameterName = "relationshipGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/{2}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(relationshipGUID, guidParameterName, methodName); @@ -1249,7 +1231,7 @@ public void deleteRelatedElementsInStore(String userId, requestBody.setEffectiveTime(effectiveTime); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1284,7 +1266,7 @@ public void updateActionTargetStatus(String userId, { final String methodName = "updateActionTargetStatus"; final String guidParameterName = "actionTargetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/action-targets/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/action-targets/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(actionTargetGUID, guidParameterName, methodName); @@ -1297,7 +1279,7 @@ public void updateActionTargetStatus(String userId, requestBody.setCompletionDate(completionDate); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -1325,7 +1307,7 @@ public void updateGovernanceActionStatus(String userId, final String methodName = "updateGovernanceActionStatus"; final String guidParameterName = "governanceActionGUID"; final String statusParameterName = "governanceActionStatus"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/{2}/status/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/{2}/status/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceActionGUID, guidParameterName, methodName); @@ -1336,7 +1318,7 @@ public void updateGovernanceActionStatus(String userId, requestBody.setStatus(governanceActionStatus); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1370,7 +1352,7 @@ public void recordCompletionStatus(String userId, { final String methodName = "recordCompletionStatus"; final String statusParameterName = "status"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/{2}/completion-status"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/{2}/completion-status"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateEnum(status, statusParameterName, methodName); @@ -1383,7 +1365,7 @@ public void recordCompletionStatus(String userId, requestBody.setNewActionTargets(newActionTargets); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1437,7 +1419,7 @@ public String initiateGovernanceAction(String userId, final String methodName = "initiateGovernanceAction"; final String qualifiedNameParameterName = "qualifiedName"; final String engineNameParameterName = "governanceEngineName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-actions/initiate"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-actions/initiate"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); @@ -1459,7 +1441,7 @@ public String initiateGovernanceAction(String userId, requestBody.setOriginatorEngineName(originatorEngineName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1500,7 +1482,7 @@ public String initiateGovernanceActionProcess(String userId, { final String methodName = "initiateGovernanceAction"; final String qualifiedNameParameterName = "processQualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/initiate"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-action-processes/initiate"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(processQualifiedName, qualifiedNameParameterName, methodName); @@ -1516,7 +1498,7 @@ public String initiateGovernanceActionProcess(String userId, requestBody.setOriginatorEngineName(originatorEngineName); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -1545,13 +1527,13 @@ public GovernanceActionElement getGovernanceAction(String userId, { final String methodName = "getGovernanceAction"; final String guidParameterName = "governanceActionGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceActionGUID, guidParameterName, methodName); GovernanceActionElementResponse restResult = restClient.callGovernanceActionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, governanceActionGUID); @@ -1578,13 +1560,13 @@ public void claimGovernanceAction(String userId, { final String methodName = "claimGovernanceAction"; final String guidParameterName = "governanceActionGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/{2}/claim"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/{2}/claim"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceActionGUID, guidParameterName, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -1614,12 +1596,12 @@ public List<GovernanceActionElement> getGovernanceActions(String userId, PropertyServerException { final String methodName = "getGovernanceActions"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); GovernanceActionElementsResponse restResult = restClient.callGovernanceActionsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, Integer.toString(startFrom), @@ -1651,12 +1633,12 @@ public List<GovernanceActionElement> getActiveGovernanceActions(String userId, PropertyServerException { final String methodName = "getActiveGovernanceActions"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/active?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-actions/active?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); GovernanceActionElementsResponse restResult = restClient.callGovernanceActionsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, Integer.toString(startFrom), @@ -1690,13 +1672,13 @@ public List<GovernanceActionElement> getActiveClaimedGovernanceActions(String u { final String methodName = "getActiveClaimedGovernanceActions"; final String guidParameterName = "governanceEngineGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/active-governance-actions?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/active-governance-actions?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceEngineGUID, guidParameterName, methodName); GovernanceActionElementsResponse restResult = restClient.callGovernanceActionsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, governanceEngineGUID, @@ -1741,7 +1723,7 @@ public String createIncidentReport(String userId, { final String methodName = "createIncidentReport"; final String qualifiedNameParameterName = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/incident-reports"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/incident-reports"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); @@ -1758,7 +1740,7 @@ public String createIncidentReport(String userId, requestBody.setOriginatorGUID(originatorGUID); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -1803,7 +1785,7 @@ public void linkElementsAsPeerDuplicates(String userId, final String methodName = "linkElementsAsPeerDuplicates"; final String end1ParameterName = "metadataElement1GUID"; final String end2ParameterName = "metadataElement2GUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/link-as-peer-duplicate"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/link-as-peer-duplicate"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(metadataElement1GUID, end1ParameterName, methodName); @@ -1822,7 +1804,7 @@ public void linkElementsAsPeerDuplicates(String userId, requestBody.setSetKnownDuplicate(setKnownDuplicate); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -1864,7 +1846,7 @@ public void linkConsolidatedDuplicate(String userId, final String methodName = "linkConsolidatedDuplicate"; final String consolidatedElementGUIDParameterName = "consolidatedElementGUID"; final String sourceElementGUIDsParameterName = "sourceElementGUIDs"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/link-as-consolidated-duplicate"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/open-metadata-store/related-elements/link-as-consolidated-duplicate"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(consolidatedElementGUID, consolidatedElementGUIDParameterName, methodName); @@ -1882,7 +1864,7 @@ public void linkConsolidatedDuplicate(String userId, requestBody.setSourceElementGUIDs(sourceElementGUIDs); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineConfigurationClient.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineConfigurationClient.java index eabc22d38c9..663d4a8bf46 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineConfigurationClient.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineConfigurationClient.java @@ -156,7 +156,7 @@ public String createGovernanceEngine(String userId, final String methodName = "createGovernanceEngine"; final String engineTypeParameterName = "governanceEngineType"; final String nameParameterName = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/new/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/new/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(governanceEngineType, engineTypeParameterName, methodName); @@ -168,7 +168,7 @@ public String createGovernanceEngine(String userId, requestBody.setDescription(description); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -196,13 +196,13 @@ public GovernanceEngineElement getGovernanceEngineByGUID(String userId, { final String methodName = "getGovernanceEngineByGUID"; final String guidParameterName = "guid"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(guid, guidParameterName, methodName); GovernanceEngineElementResponse restResult = restClient.callGovernanceEngineGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, guid); @@ -229,13 +229,13 @@ public GovernanceEngineElement getGovernanceEngineByName(String userId, { final String methodName = "getGovernanceEngineByName"; final String nameParameterName = "name"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/by-name/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/by-name/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(name, nameParameterName, methodName); GovernanceEngineElementResponse restResult = restClient.callGovernanceEngineGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, name); @@ -265,14 +265,14 @@ public List<GovernanceEngineElement> getAllGovernanceEngines(String userId, { final String methodName = "getAllGovernanceEngines"; final String engineTypeParameterName = "governanceEngineType"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}?startingFrom={3}&maximumResults={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}?startingFrom={3}&maximumResults={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(governanceEngineType, engineTypeParameterName, methodName); invalidParameterHandler.validatePaging(startingFrom, maximumResults, methodName); GovernanceEngineElementsResponse restResult = restClient.callGovernanceEnginesGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, governanceEngineType, @@ -321,7 +321,7 @@ public void updateGovernanceEngine(String userId, final String methodName = "updateGovernanceEngine"; final String guidParameterName = "guid"; final String nameParameterName = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(guid, guidParameterName, methodName); @@ -339,7 +339,7 @@ public void updateGovernanceEngine(String userId, requestBody.setExtendedProperties(extendedProperties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -368,7 +368,7 @@ public void deleteGovernanceEngine(String userId, final String methodName = "deleteGovernanceEngine"; final String guidParameterName = "guid"; final String nameParameterName = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(guid, guidParameterName, methodName); @@ -378,7 +378,7 @@ public void deleteGovernanceEngine(String userId, requestBody.setQualifiedName(qualifiedName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -416,7 +416,7 @@ public String createGovernanceService(String userId, final String serviceTypeParameterName = "governanceServiceType"; final String nameParameterName = "qualifiedName"; final String connectionParameterName = "connection"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/new/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/new/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(governanceServiceType, serviceTypeParameterName, methodName); @@ -430,7 +430,7 @@ public String createGovernanceService(String userId, requestBody.setConnection(connection); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -459,13 +459,13 @@ public GovernanceServiceElement getGovernanceServiceByGUID(String userId, { final String methodName = "getGovernanceServiceByGUID"; final String guidParameterName = "guid"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(guid, guidParameterName, methodName); GovernanceServiceElementResponse restResult = restClient.callGovernanceServiceGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, guid); @@ -493,13 +493,13 @@ public GovernanceServiceElement getGovernanceServiceByName(String userId, { final String methodName = "getGovernanceServiceByName"; final String nameParameterName = "name"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/by-name/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/by-name/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(name, nameParameterName, methodName); GovernanceServiceElementResponse restResult = restClient.callGovernanceServiceGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, name); @@ -528,13 +528,13 @@ public List<GovernanceServiceElement> getAllGovernanceServices(String userId, PropertyServerException { final String methodName = "getAllGovernanceServices"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services?startingFrom={2}&maximumResults={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services?startingFrom={2}&maximumResults={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validatePaging(startingFrom, maximumResults, methodName); GovernanceServiceElementsResponse restResult = restClient.callGovernanceServicesGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, Integer.toString(startingFrom), @@ -563,13 +563,13 @@ public List<String> getGovernanceServiceRegistrations(String userId, { final String methodName = "getGovernanceServiceRegistrations"; final String guidParameter = "governanceServiceGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/{2}/registrations"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/{2}/registrations"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceServiceGUID, guidParameter, methodName); GUIDListResponse restResult = restClient.callGUIDListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, governanceServiceGUID); @@ -611,7 +611,7 @@ public void updateGovernanceService(String userId, final String guidParameterName = "guid"; final String nameParameterName = "qualifiedName"; final String connectionParameterName = "connection"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/{2}/update"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(guid, guidParameterName, methodName); @@ -627,7 +627,7 @@ public void updateGovernanceService(String userId, requestBody.setExtendedProperties(extendedProperties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -657,7 +657,7 @@ public void deleteGovernanceService(String userId, final String methodName = "deleteGovernanceService"; final String guidParameterName = "guid"; final String nameParameterName = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-services/{2}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(guid, guidParameterName, methodName); @@ -667,7 +667,7 @@ public void deleteGovernanceService(String userId, requestBody.setQualifiedName(qualifiedName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -701,7 +701,7 @@ public void registerGovernanceServiceWithEngine(String userId, final String governanceEngineGUIDParameter = "governanceEngineGUID"; final String governanceServiceGUIDParameter = "governanceServiceGUID"; final String governanceRequestTypesParameter = "governanceRequestType"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-services"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-services"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceEngineGUID, governanceEngineGUIDParameter, methodName); @@ -714,7 +714,7 @@ public void registerGovernanceServiceWithEngine(String userId, requestBody.setRequestParameters(requestParameters); VoidResponse restResult = restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -748,18 +748,18 @@ public RegisteredGovernanceServiceElement getRegisteredGovernanceService(String final String methodName = "getRegisteredGovernanceService"; final String governanceEngineGUIDParameter = "governanceEngineGUID"; final String governanceServiceGUIDParameter = "governanceServiceGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-services/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-services/{3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceEngineGUID, governanceEngineGUIDParameter, methodName); invalidParameterHandler.validateGUID(governanceServiceGUID, governanceServiceGUIDParameter, methodName); RegisteredGovernanceServiceResponse restResult = restClient.callRegisteredGovernanceServiceGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - governanceEngineGUID, - governanceServiceGUID); + urlTemplate, + serverName, + userId, + governanceEngineGUID, + governanceServiceGUID); return restResult.getRegisteredGovernanceService(); } @@ -788,14 +788,14 @@ public List<String> getRegisteredGovernanceServices(String userId, { final String methodName = "getRegisteredGovernanceServices"; final String governanceEngineGUIDParameter = "governanceEngineGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-services?startingFrom={3}&maximumResults={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-services?startingFrom={3}&maximumResults={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceEngineGUID, governanceEngineGUIDParameter, methodName); invalidParameterHandler.validatePaging(startingFrom, maximumResults, methodName); GUIDListResponse restResult = restClient.callGUIDListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, governanceEngineGUID, @@ -826,14 +826,14 @@ public void unregisterGovernanceServiceFromEngine(String userId, final String methodName = "unregisterGovernanceServiceFromEngine"; final String governanceEngineGUIDParameter = "governanceEngineGUID"; final String governanceServiceGUIDParameter = "governanceServiceGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-services/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/governance-engines/{2}/governance-services/{3}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceEngineGUID, governanceEngineGUIDParameter, methodName); invalidParameterHandler.validateGUID(governanceServiceGUID, governanceServiceGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineEventClient.java b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineEventClient.java index db8f0604f71..1e1530099d0 100644 --- a/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineEventClient.java +++ b/open-metadata-implementation/access-services/governance-engine/governance-engine-client/src/main/java/org/odpi/openmetadata/accessservices/governanceengine/client/GovernanceEngineEventClient.java @@ -90,7 +90,7 @@ public void registerListener(String userId, final String methodName = "registerListener"; final String nameParameter = "listener"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-engine/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); @@ -102,7 +102,7 @@ public void registerListener(String userId, * event bus. */ ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/ReferenceableRequestBody.java b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/ReferenceableRequestBody.java index 95725eea9ca..fd2313561d4 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/ReferenceableRequestBody.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-api/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/rest/ReferenceableRequestBody.java @@ -48,6 +48,7 @@ public ReferenceableRequestBody(ReferenceableRequestBody template) if (template != null) { + anchorGUID = template.getAnchorGUID(); properties = template.getProperties(); } } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/CertificationManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/CertificationManager.java index 88a386cf270..78723583778 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/CertificationManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/CertificationManager.java @@ -148,7 +148,7 @@ public String createCertificationType(String userId, PropertyServerException { final String methodName = "createCertificationType"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types"; final String propertiesParameterName = "properties"; return super.createGovernanceDefinition(userId, properties, propertiesParameterName, initialStatus, urlTemplate, methodName); @@ -176,7 +176,7 @@ public void updateCertificationType(String userId, PropertyServerException { final String methodName = "updateCertificationType"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/{2}/update?isMergeUpdate={3}"; final String guidParameterName = "certificationTypeGUID"; final String propertiesParameterName = "properties"; @@ -208,7 +208,7 @@ public void deleteCertificationType(String userId, PropertyServerException { final String methodName = "deleteCertificationType"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/{2}/delete"; final String guidParameterName = "certificationTypeGUID"; super.removeReferenceable(userId, certificationTypeGUID, guidParameterName, urlTemplate, methodName); @@ -234,7 +234,7 @@ public CertificationTypeElement getCertificationTypeByGUID(String userId, PropertyServerException { final String methodName = "getCertificationTypeByGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/{2}"; final String guidParameterName = "certificationTypeGUID"; @@ -242,7 +242,7 @@ public CertificationTypeElement getCertificationTypeByGUID(String userId, invalidParameterHandler.validateGUID(certificationTypeGUID, guidParameterName, methodName); CertificationTypeResponse restResult = restClient.callCertificationTypeGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, certificationTypeGUID); @@ -270,7 +270,7 @@ public CertificationTypeElement getCertificationTypeByDocId(String userId, PropertyServerException { final String methodName = "getCertificationTypeByDocId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/by-document-id/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/by-document-id/{2}"; final String documentIdParameterName = "documentId"; @@ -278,7 +278,7 @@ public CertificationTypeElement getCertificationTypeByDocId(String userId, invalidParameterHandler.validateName(documentIdentifier, documentIdParameterName, methodName); CertificationTypeResponse restResult = restClient.callCertificationTypeGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, documentIdentifier); @@ -310,7 +310,7 @@ public List<CertificationTypeElement> getCertificationTypesByTitle(String userId PropertyServerException { final String methodName = "getCertificationTypesByTitle"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/by-title?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/by-title?startFrom={2}&pageSize={3}"; final String titleParameterName = "title"; invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); @@ -324,7 +324,7 @@ public List<CertificationTypeElement> getCertificationTypesByTitle(String userId requestBody.setSearchStringParameterName(titleParameterName); CertificationTypeListResponse restResult = restClient.callCertificationTypeListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -358,14 +358,14 @@ public List<CertificationTypeElement> getCertificationTypeByDomainId(String user PropertyServerException { final String methodName = "getCertificationTypeByDomainId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/by-domain/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certification-types/by-domain/{2}?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); invalidParameterHandler.validateUserId(userId, methodName); int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); CertificationTypeListResponse restResult = restClient.callCertificationTypeListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, domainIdentifier, @@ -402,7 +402,7 @@ public String certifyElement(String userId, PropertyServerException { final String methodName = "certifyElement"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/certification-types/{3}/certify"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/certification-types/{3}/certify"; final String elementGUIDParameterName = "elementGUID"; final String certificationTypeGUIDParameterName = "certificationTypeGUID"; @@ -440,7 +440,7 @@ public void updateCertification(String userId, PropertyServerException { final String methodName = "updateCertification"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certifications/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certifications/{2}/update?isMergeUpdate={3}"; final String certificationGUIDParameterName = "certificationGUID"; @@ -472,7 +472,7 @@ public void decertifyElement(String userId, PropertyServerException { final String methodName = "decertifyElement"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certifications/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/certifications/{2}/delete"; final String certificationGUIDParameterName = "certificationGUID"; @@ -510,7 +510,7 @@ public List<RelatedElement> getCertifiedElements(String userId, { final String methodName = "getCertifiedElements"; final String guidParameter = "certificationTypeGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/certifications/{2}?&startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/certifications/{2}?&startFrom={3}&pageSize={4}"; return super.getRelatedElements(userId, certificationTypeGUID, guidParameter, urlTemplate, startFrom, pageSize, methodName); } @@ -540,7 +540,7 @@ public List<RelatedElement> getCertifications(String userId, { final String methodName = "getLicences"; final String guidParameterName = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/certifications?&startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/certifications?&startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, guidParameterName, methodName); @@ -548,7 +548,7 @@ public List<RelatedElement> getCertifications(String userId, int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, elementGUID, diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ExternalReferenceManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ExternalReferenceManager.java index 957f7048569..439c2f1ce08 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ExternalReferenceManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/ExternalReferenceManager.java @@ -8,11 +8,9 @@ import org.odpi.openmetadata.accessservices.governanceprogram.metadataelements.RelatedElement; import org.odpi.openmetadata.accessservices.governanceprogram.properties.ExternalReferenceLinkProperties; import org.odpi.openmetadata.accessservices.governanceprogram.properties.ExternalReferenceProperties; -import org.odpi.openmetadata.accessservices.governanceprogram.rest.*; -import org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler; -import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse; +import org.odpi.openmetadata.accessservices.governanceprogram.rest.ExternalReferenceListResponse; +import org.odpi.openmetadata.accessservices.governanceprogram.rest.ExternalReferenceResponse; import org.odpi.openmetadata.commonservices.ffdc.rest.NameRequestBody; -import org.odpi.openmetadata.commonservices.ffdc.rest.NullRequestBody; import org.odpi.openmetadata.commonservices.ffdc.rest.SearchStringRequestBody; import org.odpi.openmetadata.frameworks.auditlog.AuditLog; import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException; @@ -145,7 +143,7 @@ public String createExternalReference(String userId, PropertyServerException { final String methodName = "createExternalReference"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references"; final String propertiesParameterName = "properties"; return super.createReferenceable(userId, properties, propertiesParameterName, urlTemplate, methodName); @@ -173,7 +171,7 @@ public void updateExternalReference(String userId, PropertyServerException { final String methodName = "updateExternalReference"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references/{2}/update?isMergeUpdate={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references/{2}/update?isMergeUpdate={4}"; final String guidParameterName = "externalReferenceGUID"; final String propertiesParameterName = "properties"; @@ -198,7 +196,7 @@ public void deleteExternalReference(String userId, PropertyServerException { final String methodName = "deleteExternalReference"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references/{2}/delete"; final String guidParameterName = "externalReferenceGUID"; super.removeReferenceable(userId, externalReferenceGUID, guidParameterName, urlTemplate, methodName); @@ -226,7 +224,7 @@ public void linkExternalReferenceToElement(String userI UserNotAuthorizedException { final String methodName = "linkExternalReferenceToElement"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/external-references/{3}/link"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/external-references/{3}/link"; final String elementGUIDParameterName = "attachedToGUID"; final String externalReferenceGUIDParameterName = "externalReferenceGUID"; @@ -255,7 +253,7 @@ public void unlinkExternalReferenceFromElement(String userId, UserNotAuthorizedException { final String methodName = "unlinkExternalReferenceToElement"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/external-references/{3}/unlink"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/external-references/{3}/unlink"; final String elementGUIDParameterName = "attachedToGUID"; final String externalReferenceGUIDParameterName = "externalReferenceGUID"; @@ -284,7 +282,7 @@ public ExternalReferenceElement getExternalReferenceByGUID(String userId, { final String methodName = "getExternalReferenceByGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references/{2}"; final String guidParameterName = "externalReferenceGUID"; @@ -292,7 +290,7 @@ public ExternalReferenceElement getExternalReferenceByGUID(String userId, invalidParameterHandler.validateGUID(externalReferenceGUID, guidParameterName, methodName); ExternalReferenceResponse restResult = restClient.callExternalReferenceGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, externalReferenceGUID); @@ -324,7 +322,7 @@ public List<ExternalReferenceElement> findExternalReferencesById(String userId, UserNotAuthorizedException { final String methodName = "findExternalReferencesById"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references/by-resource-id?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references/by-resource-id?startFrom={2}&pageSize={3}"; final String resourceIdParameterName = "resourceId"; invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); @@ -338,7 +336,7 @@ public List<ExternalReferenceElement> findExternalReferencesById(String userId, requestBody.setSearchStringParameterName(resourceIdParameterName); ExternalReferenceListResponse restResult = restClient.callExternalReferenceListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -372,7 +370,7 @@ public List<ExternalReferenceElement> getExternalReferencesByURL(String userId, UserNotAuthorizedException { final String methodName = "getExternalReferencesByURL"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references/by-url?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/external-references/by-url?startFrom={2}&pageSize={3}"; final String urlParameterName = "resourceId"; invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); @@ -385,7 +383,7 @@ public List<ExternalReferenceElement> getExternalReferencesByURL(String userId, requestBody.setNameParameterName(urlParameterName); ExternalReferenceListResponse restResult = restClient.callExternalReferenceListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -419,7 +417,7 @@ public List<ExternalReferenceElement> retrieveAttachedExternalReferences(String UserNotAuthorizedException { final String methodName = "retrieveAttachedExternalReferences"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/external-references?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/external-references?startFrom={3}&pageSize={4}"; final String guidParameterName = "attachedToGUID"; invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); @@ -429,12 +427,12 @@ public List<ExternalReferenceElement> retrieveAttachedExternalReferences(String int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); ExternalReferenceListResponse restResult = restClient.callExternalReferenceListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - attachedToGUID, - startFrom, - queryPageSize); + urlTemplate, + serverName, + userId, + attachedToGUID, + startFrom, + queryPageSize); return restResult.getElements(); } @@ -464,7 +462,7 @@ public List<RelatedElement> getElementsForExternalReference(String userId, { final String methodName = "getElementsForExternalReference"; final String guidParameter = "externalReferenceGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/external-references/{2}?&startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/external-references/{2}?&startFrom={3}&pageSize={4}"; return super.getRelatedElements(userId, externalReferenceGUID, guidParameter, urlTemplate, startFrom, pageSize, methodName); } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceClassificationLevelManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceClassificationLevelManager.java index 8cb865cdea9..26fd56364a6 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceClassificationLevelManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceClassificationLevelManager.java @@ -149,13 +149,13 @@ public String createStandardGovernanceClassificationLevels(String userId, final String methodName = "createStandardGovernanceClassificationLevels"; final String classificationNameParameter = "classificationName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/standard-set/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/standard-set/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(classificationName, classificationNameParameter, methodName); GUIDResponse response = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -193,7 +193,7 @@ public String createGovernanceLevelIdentifierSet(String final String classificationNameParameter = "classificationName"; final String identifierPropertyNameParameter = "identifierPropertyName"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets"; invalidParameterHandler.validateObject(properties, propertiesParameter, methodName); invalidParameterHandler.validateName(properties.getClassificationName(), classificationNameParameter, methodName); @@ -227,7 +227,7 @@ public void updateGovernanceLevelIdentifierSet(String final String identifierPropertyNameParameter = "identifierPropertyName"; final String guidParameter = "setGUID"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/{2}/update"; invalidParameterHandler.validateObject(properties, propertiesParameter, methodName); invalidParameterHandler.validateName(properties.getClassificationName(), classificationNameParameter, methodName); @@ -255,7 +255,7 @@ public void removeGovernanceLevelIdentifierSet(String userId, { final String methodName = "removeGovernanceLevelIdentifierSet"; final String guidParameter = "setGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/{2}/delete"; super.removeReferenceable(userId, setGUID, guidParameter, urlTemplate, methodName); } @@ -279,12 +279,12 @@ public List<GovernanceLevelIdentifierSetElement> getGovernanceLevelIdentifierSet { final String methodName = "getGovernanceLevelIdentifierSets"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets"; invalidParameterHandler.validateUserId(userId, methodName); GovernanceLevelIdentifierSetListResponse restResult = restClient.callLevelIdentifierSetListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId); return restResult.getElements(); @@ -312,13 +312,13 @@ public GovernanceLevelIdentifierSetElement getGovernanceLevelIdentifierSet(Strin final String methodName = "getGovernanceLevelIdentifierSet"; final String classificationNameParameter = "classificationName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/classification-name/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/classification-name/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(classificationName, classificationNameParameter, methodName); GovernanceLevelIdentifierSetResponse restResult = restClient.callLevelIdentifierSetGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, classificationName); @@ -349,13 +349,13 @@ public GovernanceLevelIdentifierSetElement getGovernanceLevelIdentifierSetByGUID final String methodName = "getGovernanceLevelIdentifierSet"; final String guidParameter = "setGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(setGUID, guidParameter, methodName); GovernanceLevelIdentifierSetResponse restResult = restClient.callLevelIdentifierSetGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, setGUID); @@ -391,7 +391,7 @@ public String createGovernanceLevelIdentifier(String final String guidParameter = "setGUID"; final String propertiesParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/identifier"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/identifier"; return super.createReferenceableWithAnchor(userId, setGUID, guidParameter, properties, propertiesParameter, urlTemplate, methodName); } @@ -419,7 +419,7 @@ public void updateGovernanceLevelIdentifier(String final String guidParameter = "identifierGUID"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/identifier/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/identifier/{2}/update"; super.updateReferenceable(userId, identifierGUID, guidParameter, false, properties, propertiesParameter, urlTemplate, methodName); } @@ -444,7 +444,7 @@ public void removeGovernanceLevelIdentifier(String userId, final String methodName = "removeGovernanceLevelIdentifier"; final String guidParameter = "identifierGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/identifier/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/identifier/{2}/delete"; super.removeReferenceable(userId, identifierGUID, guidParameter, urlTemplate, methodName); } @@ -473,13 +473,13 @@ public GovernanceLevelIdentifierElement getGovernanceLevelIdentifier(String user final String methodName = "getGovernanceLevelIdentifier"; final String classificationNameParameter = "classificationName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/classification-name/{2}/identifier/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/classification-level-sets/classification-name/{2}/identifier/{3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(classificationName, classificationNameParameter, methodName); GovernanceLevelIdentifierResponse restResult = restClient.callLevelIdentifierGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, classificationName, diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDefinitionManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDefinitionManager.java index 6dd0a915a04..97f3cb9dac2 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDefinitionManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDefinitionManager.java @@ -193,7 +193,7 @@ public String createGovernanceDefinition(String userId, PropertyServerException { final String methodName = "createGovernanceDefinition"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions"; final String propertiesParameterName = "properties"; return super.createGovernanceDefinition(userId, properties, propertiesParameterName, initialStatus, urlTemplate, methodName); @@ -221,7 +221,7 @@ public void updateGovernanceDefinition(String userId, PropertyServerException { final String methodName = "updateGovernanceDefinition"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/update?isMergeUpdate={3}"; final String guidParameterName = "definitionGUID"; final String propertiesParameterName = "properties"; @@ -278,7 +278,7 @@ public void deleteGovernanceDefinition(String userId, PropertyServerException { final String methodName = "deleteGovernanceDefinition"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/delete"; final String guidParameterName = "definitionGUID"; super.removeReferenceable(userId, definitionGUID, guidParameterName, urlTemplate, methodName); @@ -314,7 +314,7 @@ public void linkPeerDefinitions(String userId, PropertyServerException { final String methodName = "linkPeerDefinitions"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/peers/{3}/link"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/peers/{3}/link"; final String definitionOneGUIDParameterName = "definitionOneGUID"; final String definitionTwoGUIDParameterName = "definitionTwoGUID"; @@ -355,7 +355,7 @@ public void unlinkPeerDefinitions(String userId, PropertyServerException { final String methodName = "unlinkPeerDefinitions"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/peers/{3}/unlink"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/peers/{3}/unlink"; final String definitionOneGUIDParameterName = "definitionOneGUID"; final String definitionTwoGUIDParameterName = "definitionTwoGUID"; @@ -403,7 +403,7 @@ public void setupSupportingDefinition(String userId, PropertyServerException { final String methodName = "setupSupportingDefinition"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/supporting-definitions/{3}/link"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/supporting-definitions/{3}/link"; final String definitionOneGUIDParameterName = "definitionGUID"; final String definitionTwoGUIDParameterName = "supportingDefinitionGUID"; @@ -444,7 +444,7 @@ public void clearSupportingDefinition(String userId, PropertyServerException { final String methodName = "clearSupportingDefinition"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/supporting-definitions/{3}/unlink"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/supporting-definitions/{3}/unlink"; final String definitionOneGUIDParameterName = "definitionGUID"; final String definitionTwoGUIDParameterName = "supportingDefinitionGUID"; diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDomainManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDomainManager.java index 79db16f3d0b..4f8c11aaf60 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDomainManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceDomainManager.java @@ -220,7 +220,7 @@ public String createGovernanceDomainSet(String userId, { final String methodName = "createGovernanceDomainSet"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets"; return super.createReferenceable(userId, properties, propertiesParameter, urlTemplate, methodName); } @@ -248,7 +248,7 @@ public void updateGovernanceDomainSet(String userId, final String guidParameter = "governanceDomainSetGUID"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}/update"; super.updateReferenceable(userId, governanceDomainSetGUID, guidParameter, false, properties, propertiesParameter, urlTemplate, methodName); } @@ -273,7 +273,7 @@ public void removeGovernanceDomainSet(String userId, final String methodName = "removeGovernanceDomainSet"; final String guidParameter = "governanceDomainSetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}/delete"; super.removeReferenceable(userId, governanceDomainSetGUID, guidParameter, urlTemplate, methodName); } @@ -305,7 +305,7 @@ public List<GovernanceDomainSetElement> findGovernanceDomainSets(String userId, final String methodName = "findGovernanceDomainSets"; final String searchStringParameterName = "searchString"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/by-search-string?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); @@ -318,7 +318,7 @@ public List<GovernanceDomainSetElement> findGovernanceDomainSets(String userId, requestBody.setSearchStringParameterName(searchStringParameterName); GovernanceDomainSetListResponse restResult = restClient.callGovernanceDomainSetListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -354,7 +354,7 @@ public List<GovernanceDomainSetElement> getGovernanceDomainSetsByName(String use final String methodName = "getGovernanceDomainSetsByName"; final String nameParameterName = "name"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/by-name?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(name, nameParameterName, methodName); @@ -367,7 +367,7 @@ public List<GovernanceDomainSetElement> getGovernanceDomainSetsByName(String use requestBody.setNameParameterName(nameParameterName); GovernanceDomainSetListResponse restResult = restClient.callGovernanceDomainSetListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -398,16 +398,16 @@ public GovernanceDomainSetElement getGovernanceDomainSetByGUID(String userId, final String methodName = "getGovernanceDomainSetByGUID"; final String guidParameterName = "governanceDomainSetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(governanceDomainSetGUID, guidParameterName, methodName); GovernanceDomainSetResponse restResult = restClient.callGovernanceDomainSetGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - governanceDomainSetGUID); + urlTemplate, + serverName, + userId, + governanceDomainSetGUID); return restResult.getElement(); } @@ -440,7 +440,7 @@ public String createGovernanceDomain(String userId, final String guidParameter = "setGUID"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/governance-domains"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/governance-domains"; return super.createReferenceableWithAnchor(userId, setGUID, guidParameter, properties, propertiesParameter, urlTemplate, methodName); } @@ -468,7 +468,7 @@ public void updateGovernanceDomain(String userId, final String guidParameter = "governanceDomainGUID"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/{2}/update"; super.updateReferenceable(userId, governanceDomainGUID, guidParameter, false, properties, propertiesParameter, urlTemplate, methodName); } @@ -493,7 +493,7 @@ public void deleteGovernanceDomain(String userId, final String methodName = "deleteGovernanceDomain"; final String guidParameter = "governanceDomainGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/{2}/delete"; super.removeReferenceable(userId, governanceDomainGUID, guidParameter, urlTemplate, methodName); } @@ -521,7 +521,7 @@ public void addDomainToSet(String userId, final String guid1Parameter = "governanceDomainSetGUID"; final String guid2Parameter = "governanceDomainGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}/governance-domains/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}/governance-domains/{3}"; super.setupRelationship(userId, governanceDomainSetGUID, @@ -557,7 +557,7 @@ public void removeDomainFromSet(String userId, final String guid1Parameter = "governanceDomainSetGUID"; final String guid2Parameter = "governanceDomainGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}/governance-domains/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/{2}/governance-domains/{3}/delete"; super.clearRelationship(userId, governanceDomainSetGUID, @@ -591,14 +591,14 @@ public List<GovernanceDomainElement> getGovernanceDomains(String userId, PropertyServerException { final String methodName = "getGovernanceDomains"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); GovernanceDomainListResponse restResult = restClient.callGovernanceDomainListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, startFrom, @@ -633,7 +633,7 @@ public List<GovernanceDomainElement> findGovernanceDomains(String userId, final String methodName = "findGovernanceDomains"; final String searchStringParameterName = "searchString"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/by-search-string?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); @@ -646,7 +646,7 @@ public List<GovernanceDomainElement> findGovernanceDomains(String userId, requestBody.setSearchStringParameterName(searchStringParameterName); GovernanceDomainListResponse restResult = restClient.callGovernanceDomainListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -681,7 +681,7 @@ public List<GovernanceDomainSetElement> getSetsForGovernanceDomain(String userId final String methodName = "getSetsForGovernanceDomain"; final String guidParameterName = "governanceDomainGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/by-governance-domains/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domain-sets/by-governance-domains/{2}?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceDomainGUID, guidParameterName, methodName); @@ -689,12 +689,12 @@ public List<GovernanceDomainSetElement> getSetsForGovernanceDomain(String userId int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); GovernanceDomainSetListResponse restResult = restClient.callGovernanceDomainSetListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - governanceDomainGUID, - startFrom, - queryPageSize); + urlTemplate, + serverName, + userId, + governanceDomainGUID, + startFrom, + queryPageSize); return restResult.getElements(); } @@ -725,7 +725,7 @@ public List<GovernanceDomainElement> getGovernanceDomainsByName(String userId, final String methodName = "getGovernanceDomainsByName"; final String nameParameterName = "name"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/by-name?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/by-name?startFrom={2}&pageSize={3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(name, nameParameterName, methodName); @@ -738,7 +738,7 @@ public List<GovernanceDomainElement> getGovernanceDomainsByName(String userId, requestBody.setNameParameterName(nameParameterName); GovernanceDomainListResponse restResult = restClient.callGovernanceDomainListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -768,18 +768,17 @@ public GovernanceDomainElement getGovernanceDomainByGUID(String userId, PropertyServerException { final String methodName = "getGovernanceDomainByGUID"; - final String guidParameterName = "governanceDomainGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceDomainGUID, guidParameterName, methodName); GovernanceDomainResponse restResult = restClient.callGovernanceDomainGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - governanceDomainGUID); + urlTemplate, + serverName, + userId, + governanceDomainGUID); return restResult.getElement(); } @@ -803,13 +802,12 @@ public GovernanceDomainElement getGovernanceDomainByIdentifier(String userId, PropertyServerException { final String methodName = "getGovernanceDomainByIdentifier"; - - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/by-identifier/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-domains/by-identifier/{2}"; invalidParameterHandler.validateUserId(userId, methodName); GovernanceDomainResponse restResult = restClient.callGovernanceDomainGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, domainIdentifier); diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceMetricsManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceMetricsManager.java index 39720963049..7dc92b095a7 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceMetricsManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceMetricsManager.java @@ -143,7 +143,7 @@ public String createGovernanceMetric(String userId, PropertyServerException { final String methodName = "createGovernanceMetric"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics"; final String propertiesParameterName = "metricProperties"; return super.createReferenceable(userId, metricProperties, propertiesParameterName, urlTemplate, methodName); @@ -171,7 +171,7 @@ public void updateGovernanceMetric(String userId, PropertyServerException { final String methodName = "updateGovernanceMetric"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/update?isMergeUpdate={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/update?isMergeUpdate={4}"; final String guidParameterName = "metricGUID"; final String propertiesParameterName = "metricProperties"; @@ -197,7 +197,7 @@ public void deleteGovernanceMetric(String userId, PropertyServerException { final String methodName = "deleteExternalReference"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/delete"; final String guidParameterName = "metricGUID"; super.removeReferenceable(userId, metricGUID, guidParameterName, urlTemplate, methodName); @@ -226,7 +226,7 @@ public void setupGovernanceDefinitionMetric(String PropertyServerException { final String methodName = "setupGovernanceDefinitionMetric"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/governance-definitions/{3}/link"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/governance-definitions/{3}/link"; final String metricGUIDParameterName = "metricGUID"; final String governanceDefinitionGUIDParameterName = "governanceDefinitionGUID"; @@ -254,7 +254,7 @@ public void clearGovernanceDefinitionMetric(String userId, PropertyServerException { final String methodName = "clearGovernanceDefinitionMetric"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/governance-definitions/{3}/unlink"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/governance-definitions/{3}/unlink"; final String metricGUIDParameterName = "metricGUID"; final String governanceDefinitionGUIDParameterName = "governanceDefinitionGUID"; @@ -284,7 +284,7 @@ public void setupGovernanceResults(String userId, PropertyServerException { final String methodName = "setupGovernanceResults"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/governance-results/{3}/link"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/governance-results/{3}/link"; final String metricGUIDParameterName = "metricGUID"; final String dataSetGUIDParameterName = "dataSetGUID"; @@ -312,7 +312,7 @@ public void clearGovernanceResults(String userId, PropertyServerException { final String methodName = "clearGovernanceResults"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/governance-results/{3}/unlink"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}/governance-results/{3}/unlink"; final String metricGUIDParameterName = "metricGUID"; final String governanceDefinitionGUIDParameterName = "dataSetGUID"; @@ -340,7 +340,7 @@ public void setGovernanceMeasurementsDataSet(String { final String methodName = "setGovernanceMeasurementsDataSet"; final String guidParameter = "dataSetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/data-sets/{2}/classify-as-governance-measurements-set"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/data-sets/{2}/classify-as-governance-measurements-set"; super.setReferenceableClassification(userId, dataSetGUID, guidParameter, properties, urlTemplate, methodName); } @@ -363,7 +363,7 @@ public void clearGovernanceMeasurementsDataSet(String userId, { final String methodName = "clearGovernanceMeasurementsDataSet"; final String guidParameter = "dataSetGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/data-sets/{2}/classify-as-governance-measurements-set/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/data-sets/{2}/classify-as-governance-measurements-set/delete"; super.removeReferenceableClassification(userId, dataSetGUID, guidParameter, urlTemplate, methodName); } @@ -388,7 +388,7 @@ public void setGovernanceExpectations(String userId, { final String methodName = "setGovernanceExpectations"; final String guidParameter = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/classify-with-governance-expectations"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/classify-with-governance-expectations"; super.setReferenceableClassification(userId, elementGUID, guidParameter, properties, urlTemplate, methodName); } @@ -411,7 +411,7 @@ public void clearGovernanceExpectations(String userId, { final String methodName = "clearGovernanceExpectations"; final String guidParameter = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/classify-with-governance-expectations/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/classify-with-governance-expectations/delete"; super.removeReferenceableClassification(userId, elementGUID, guidParameter, urlTemplate, methodName); } @@ -437,7 +437,7 @@ public void setGovernanceMeasurements(String userId, { final String methodName = "setGovernanceMeasurements"; final String guidParameter = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/classify-with-governance-measurements"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/classify-with-governance-measurements"; super.setReferenceableClassification(userId, elementGUID, guidParameter, properties, urlTemplate, methodName); } @@ -460,7 +460,7 @@ public void clearGovernanceMeasurements(String userId, { final String methodName = "clearGovernanceMeasurements"; final String guidParameter = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/classify-with-governance-measurements/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/classify-with-governance-measurements/delete"; super.removeReferenceableClassification(userId, elementGUID, guidParameter, urlTemplate, methodName); } @@ -485,7 +485,7 @@ public GovernanceMetricElement getGovernanceMetricByGUID(String userId, PropertyServerException { final String methodName = "getGovernanceMetricByGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/{2}"; final String guidParameterName = "metricGUID"; @@ -493,10 +493,10 @@ public GovernanceMetricElement getGovernanceMetricByGUID(String userId, invalidParameterHandler.validateGUID(metricGUID, guidParameterName, methodName); GovernanceMetricResponse restResult = restClient.callGovernanceMetricGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, - serverName, - userId, - metricGUID); + urlTemplate, + serverName, + userId, + metricGUID); return restResult.getElement(); } @@ -525,10 +525,9 @@ public List<GovernanceMetricElement> findGovernanceMetrics(String userId, UserNotAuthorizedException { final String methodName = "findGovernanceMetrics"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/by-search-string?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-metrics/by-search-string?startFrom={2}&pageSize={3}"; final String searchStringParameterName = "searchString"; - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, searchStringParameterName, methodName); @@ -539,7 +538,7 @@ public List<GovernanceMetricElement> findGovernanceMetrics(String userId, requestBody.setSearchStringParameterName(searchStringParameterName); GovernanceMetricListResponse restResult = restClient.callGovernanceMetricListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramBaseClient.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramBaseClient.java index 34b53d56352..a5fcc65e431 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramBaseClient.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramBaseClient.java @@ -236,7 +236,7 @@ String createReferenceable(String userId, requestBody.setProperties(properties); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -283,7 +283,7 @@ String createReferenceableWithAnchor(String userId, requestBody.setProperties(properties); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -332,7 +332,7 @@ String createGovernanceDefinition(String userId, requestBody.setInitialStatus(initialStatus); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -377,7 +377,7 @@ String createGovernanceRole(String userId, requestBody.setProperties(properties); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId); @@ -431,7 +431,7 @@ void updateReferenceable(String userId, requestBody.setProperties(properties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -486,7 +486,7 @@ void updateGovernanceDefinition(String userId, requestBody.setProperties(properties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -518,7 +518,7 @@ public void updateGovernanceDefinitionStatus(String userId, UserNotAuthorizedException, PropertyServerException { - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/update-status"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-definitions/{2}/update-status"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName); @@ -529,7 +529,7 @@ public void updateGovernanceDefinitionStatus(String userId, requestBody.setStatus(newStatus); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -583,7 +583,7 @@ void updateGovernanceRole(String userId, requestBody.setProperties(properties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -624,7 +624,7 @@ void setReferenceableClassification(String userId, requestBody.setProperties(properties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -660,7 +660,7 @@ void removeReferenceableClassification(String userId, ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -707,7 +707,7 @@ void setupRelationship(String userId, requestBody.setProperties(properties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -757,7 +757,7 @@ String setupMultiLinkRelationship(String userId, requestBody.setProperties(properties); GUIDResponse response = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -805,7 +805,7 @@ public void updateRelationship(String userId, requestBody.setProperties(properties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -846,7 +846,7 @@ void clearRelationship(String userId, requestBody.setRelationshipName(relationshipName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -890,7 +890,7 @@ void clearRelationship(String userId, requestBody.setRelationshipName(relationshipName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -929,7 +929,7 @@ List<RelatedElement> getRelatedElements(String userId, invalidParameterHandler.validateGUID(startingElementGUID, startingElementGUIDParameterName, methodName); RelatedElementListResponse restResult = restClient.callRelatedElementListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, startingElementGUID, @@ -970,7 +970,7 @@ List<ElementStub> getElementStubsByName(String userId, invalidParameterHandler.validateName(name, nameParameterName, methodName); ElementStubListResponse restResult = restClient.callElementStubListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, name, @@ -1011,7 +1011,7 @@ List<GovernanceDefinitionElement> getGovernanceDefinitionElements(String userId, invalidParameterHandler.validateGUID(startingElementGUID, startingElementGUIDParameterName, methodName); GovernanceDefinitionListResponse restResult = restClient.callGovernanceDefinitionListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, startingElementGUID, @@ -1090,7 +1090,7 @@ public void removeReferenceable(String userId, ExternalSourceRequestBody requestBody = new ExternalSourceRequestBody(); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -1122,7 +1122,7 @@ public void setupMoreInformation(String userId, final String elementGUIDParameterName = "elementGUID"; final String detailGUIDParameterName = "detailGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/more-information/{3}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/more-information/{3}"; this.setupRelationship(userId, elementGUID, @@ -1158,7 +1158,7 @@ public void clearMoreInformation(String userId, final String elementGUIDParameterName = "elementGUID"; final String detailGUIDParameterName = "detailGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/more-information/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/more-information/{3}/delete"; this.clearRelationship(userId, elementGUID, @@ -1195,7 +1195,7 @@ public List<RelatedElement> getMoreInformation(String userId, final String methodName = "getMoreInformation"; final String guidPropertyName = "elementGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/more-information/by-descriptive-element/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/more-information/by-descriptive-element/{2}?startFrom={3}&pageSize={4}"; return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1225,7 +1225,7 @@ public List<RelatedElement> getDescriptiveElements(String userId, final String methodName = "getDescriptiveElements"; final String guidPropertyName = "detailGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/more-information/by-detail-element/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/more-information/by-detail-element/{2}?startFrom={3}&pageSize={4}"; return this.getRelatedElements(userId, detailGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1255,7 +1255,7 @@ public void setupGovernedBy(String userId, final String elementGUIDParameterName = "elementGUID"; final String governanceDefinitionGUIDParameterName = "governanceDefinitionGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/governed-by/{3}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/governed-by/{3}"; this.setupRelationship(userId, elementGUID, @@ -1291,7 +1291,7 @@ public void clearGovernedBy(String userId, final String elementGUIDParameterName = "elementGUID"; final String governanceDefinitionGUIDParameterName = "governanceDefinitionGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/governed-by/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/governed-by/{3}/delete"; this.clearRelationship(userId, elementGUID, @@ -1328,7 +1328,7 @@ public List<GovernanceDefinitionElement> getGovernanceDefinitionsForElement(Stri final String methodName = "getGovernanceDefinitionsForElement"; final String guidPropertyName = "elementGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/governed-by/by-element/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/governed-by/by-element/{2}?startFrom={3}&pageSize={4}"; return this.getGovernanceDefinitionElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1358,7 +1358,7 @@ public List<RelatedElement> getGovernedElements(String userId, final String methodName = "getGovernedElements"; final String guidPropertyName = "governanceDefinitionGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/governed-by/by-governance-definition/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/governed-by/by-governance-definition/{2}?startFrom={3}&pageSize={4}"; return this.getRelatedElements(userId, governanceDefinitionGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1386,7 +1386,7 @@ public void setupGovernanceDefinitionScope(String userId, final String scopeGUIDParameterName = "scopeGUID"; final String governanceDefinitionGUIDParameterName = "governanceDefinitionGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/governance-definition-scopes/{3}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/governance-definition-scopes/{3}"; this.setupRelationship(userId, scopeGUID, @@ -1423,7 +1423,7 @@ public void clearGovernanceDefinitionScope(String userId, final String scopeGUIDParameterName = "scopeGUID"; final String governanceDefinitionGUIDParameterName = "governanceDefinitionGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/governance-definition-scopes/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/governance-definition-scopes/{3}/delete"; this.clearRelationship(userId, scopeGUID, @@ -1460,7 +1460,7 @@ public List<RelatedElement> getGovernanceDefinitionScopes(String userId, final String methodName = "getGovernanceDefinitionScopes"; final String guidPropertyName = "governanceDefinitionGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/governance-definition-scopes/by-governance-definition/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/governance-definition-scopes/by-governance-definition/{2}?startFrom={3}&pageSize={4}"; return this.getRelatedElements(userId, governanceDefinitionGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1490,7 +1490,7 @@ public List<GovernanceDefinitionElement> getScopedGovernanceDefinitions(String u final String methodName = "getScopedGovernanceDefinitions"; final String guidPropertyName = "scopeGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/governance-definition-scopes/by-scope/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/governance-definition-scopes/by-scope/{2}?startFrom={3}&pageSize={4}"; return this.getGovernanceDefinitionElements(userId, scopeGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1518,7 +1518,7 @@ public void setupGovernanceResponsibilityAssignment(String userId, final String personRoleGUIDParameterName = "personRoleGUID"; final String governanceResponsibilityGUIDParameterName = "governanceResponsibilityGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/governance-responsibility-assignments/{3}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/governance-responsibility-assignments/{3}"; this.setupRelationship(userId, personRoleGUID, @@ -1554,7 +1554,7 @@ public void clearGovernanceResponsibilityAssignment(String userId, final String personRoleGUIDParameterName = "personRoleGUID"; final String governanceResponsibilityGUIDParameterName = "governanceResponsibilityGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/governance-responsibility-assignments/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/governance-responsibility-assignments/{3}/delete"; this.clearRelationship(userId, personRoleGUID, @@ -1591,7 +1591,7 @@ public List<GovernanceRoleElement> getResponsibleRoles(String userId, final String methodName = "getResponsibleRole"; final String guidPropertyName = "governanceResponsibilityGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/governance-responsibility-assignments/by-responsibility/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/governance-responsibility-assignments/by-responsibility/{2}?startFrom={3}&pageSize={4}"; return this.getGovernanceRoleElements(userId, governanceResponsibilityGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1621,7 +1621,7 @@ public List<GovernanceDefinitionElement> getRoleResponsibilities(String userId, final String methodName = "getRoleResponsibilities"; final String guidPropertyName = "personRoleGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/governance-responsibility-assignments/by-role/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/governance-responsibility-assignments/by-role/{2}?startFrom={3}&pageSize={4}"; return this.getGovernanceDefinitionElements(userId, personRoleGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); @@ -1652,7 +1652,7 @@ public void setupStakeholder(String userId, final String elementGUIDParameterName = "elementGUID"; final String stakeholderGUIDParameterName = "stakeholderGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/stakeholders/{3}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/stakeholders/{3}"; this.setupRelationship(userId, elementGUID, @@ -1688,7 +1688,7 @@ public void clearStakeholder(String userId, final String elementGUIDParameterName = "elementGUID"; final String stakeholderGUIDParameterName = "stakeholderGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/stakeholders/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/stakeholders/{3}/delete"; this.clearRelationship(userId, elementGUID, @@ -1725,7 +1725,7 @@ public List<RelatedElement> getStakeholders(String userId, final String methodName = "getStakeholders"; final String guidPropertyName = "elementGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/stakeholders/by-commissioned-element/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/stakeholders/by-commissioned-element/{2}?startFrom={3}&pageSize={4}"; return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1755,7 +1755,7 @@ public List<RelatedElement> getStakeholderCommissionedElements(String userId, final String methodName = "getStakeholderCommissionedElements"; final String guidPropertyName = "stakeholderGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/stakeholders/by-stakeholder/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/stakeholders/by-stakeholder/{2}?startFrom={3}&pageSize={4}"; return this.getRelatedElements(userId, stakeholderGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1786,7 +1786,7 @@ public void setupAssignmentScope(String userId, final String elementGUIDParameterName = "elementGUID"; final String scopeGUIDParameterName = "scopeGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/assignment-scopes/{3}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/assignment-scopes/{3}"; this.setupRelationship(userId, elementGUID, @@ -1822,7 +1822,7 @@ public void clearAssignmentScope(String userId, final String elementGUIDParameterName = "elementGUID"; final String scopeGUIDParameterName = "scopeGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/assignment-scopes/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/assignment-scopes/{3}/delete"; this.clearRelationship(userId, elementGUID, @@ -1859,7 +1859,7 @@ public List<RelatedElement> getAssignedScopes(String userId, final String methodName = "getAssignedScopes"; final String guidPropertyName = "elementGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/assignment-scopes/by-assigned-actor/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/assignment-scopes/by-assigned-actor/{2}?startFrom={3}&pageSize={4}"; return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1889,7 +1889,7 @@ public List<RelatedElement> getAssignedActors(String userId, final String methodName = "getAssignedActors"; final String guidPropertyName = "scopeGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/assignment-scopes/by-assigned-scope/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/assignment-scopes/by-assigned-scope/{2}?startFrom={3}&pageSize={4}"; return this.getRelatedElements(userId, scopeGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -1920,7 +1920,7 @@ public void setupResource(String userId, final String elementGUIDParameterName = "elementGUID"; final String resourceGUIDParameterName = "resourceGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/resource-list/{3}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/resource-list/{3}"; this.setupRelationship(userId, elementGUID, @@ -1956,7 +1956,7 @@ public void clearResource(String userId, final String elementGUIDParameterName = "elementGUID"; final String resourceGUIDParameterName = "resourceGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/{2}/resource-list/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/{2}/resource-list/{3}/delete"; this.clearRelationship(userId, elementGUID, @@ -1993,7 +1993,7 @@ public List<RelatedElement> getResourceList(String userId, final String methodName = "getResourceList"; final String guidPropertyName = "elementGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/resource-list/by-assignee/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/resource-list/by-assignee/{2}?startFrom={3}&pageSize={4}"; return this.getRelatedElements(userId, elementGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } @@ -2023,7 +2023,7 @@ public List<RelatedElement> getSupportedByResource(String userId, final String methodName = "getSupportedByResource"; final String guidPropertyName = "resourceGUID"; - final String urlTemplate = elementsURLTemplatePrefix + "/resource-list/by-resource/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + elementsURLTemplatePrefix + "/resource-list/by-resource/{2}?startFrom={3}&pageSize={4}"; return this.getRelatedElements(userId, resourceGUID, guidPropertyName, urlTemplate, startFrom, pageSize, methodName); } diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramReviewManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramReviewManager.java index 0e2a390ad18..c76abd1b876 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramReviewManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceProgramReviewManager.java @@ -139,12 +139,12 @@ public GovernanceDefinitionElement getGovernanceDefinitionByGUID(String userId, PropertyServerException { final String methodName = "getGovernanceDefinitionByGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}"; invalidParameterHandler.validateUserId(userId, methodName); GovernanceDefinitionResponse restResult = restClient.callGovernanceDefinitionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, definitionGUID); @@ -178,14 +178,14 @@ public List<GovernanceDefinitionElement> getGovernanceDefinitionsForDomain(Strin PropertyServerException { final String methodName = "getGovernanceDefinitionsForDomain"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}/for-domain?domainIdentifier={3}&startFrom={4}&pageSize={5}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}/for-domain?domainIdentifier={3}&startFrom={4}&pageSize={5}"; invalidParameterHandler.validateUserId(userId, methodName); int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); GovernanceDefinitionListResponse restResult = restClient.callGovernanceDefinitionListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, getTypeName(typeName), @@ -223,7 +223,7 @@ public List<GovernanceDefinitionElement> getGovernanceDefinitionsForDocId(String PropertyServerException { final String methodName = "getGovernanceDefinitionsForDocId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}/for-document-id/{3}?startFrom={4}&pageSize={5}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}/for-document-id/{3}?startFrom={4}&pageSize={5}"; final String docIdParameterName = "docId"; @@ -233,7 +233,7 @@ public List<GovernanceDefinitionElement> getGovernanceDefinitionsForDocId(String int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); GovernanceDefinitionListResponse restResult = restClient.callGovernanceDefinitionListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, getTypeName(typeName), @@ -283,14 +283,14 @@ public GovernanceDefinitionGraph getGovernanceDefinitionInContext(String userId, PropertyServerException { final String methodName = "getGovernanceDefinitionInContext"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}/in-context"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}/in-context"; final String guidParameterName = "governanceDefinitionGUID"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceDefinitionGUID, guidParameterName, methodName); GovernanceDefinitionGraphResponse restResult = restClient.callGovernanceDefinitionGraphGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, governanceDefinitionGUID); @@ -324,10 +324,9 @@ public List<GovernanceDefinitionElement> findGovernanceDefinitions(String userId PropertyServerException { final String methodName = "findGovernanceDefinitions"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}/by-search-string?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}/by-search-string?startFrom={3}&pageSize={4}"; final String searchStringParameterName = "searchString"; - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(searchString, searchString, methodName); @@ -338,7 +337,7 @@ public List<GovernanceDefinitionElement> findGovernanceDefinitions(String userId requestBody.setSearchStringParameterName(searchStringParameterName); GovernanceDefinitionListResponse restResult = restClient.callGovernanceDefinitionListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -372,7 +371,7 @@ public List<GovernanceMetricImplementation> getGovernanceDefinitionMetrics(Strin PropertyServerException { final String methodName = "getGovernanceDefinitionMetrics"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}/metrics-implementation?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-definitions/{2}/metrics-implementation?startFrom={3}&pageSize={4}"; final String guidParameterName = "governanceDefinitionGUID"; invalidParameterHandler.validateUserId(userId, methodName); @@ -381,7 +380,7 @@ public List<GovernanceMetricImplementation> getGovernanceDefinitionMetrics(Strin int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); GovernanceMetricImplementationListResponse restResult = restClient.callGovernanceMetricsImplementationListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, governanceDefinitionGUID, @@ -417,7 +416,7 @@ public List<ElementStub> getGovernanceZoneMembers(String userId, PropertyServerException { final String methodName = "getElementsGovernedByDefinition"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-zones/{2}/members/{3}?startFrom={4}&pageSize={5}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/review/governance-zones/{2}/members/{3}?startFrom={4}&pageSize={5}"; final String nameParameterName = "zoneName"; final String assetTypeName = "Asset"; @@ -433,7 +432,7 @@ public List<ElementStub> getGovernanceZoneMembers(String userId, } ElementStubListResponse restResult = restClient.callElementStubListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, zoneName, diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceRoleManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceRoleManager.java index 6e062ce44f0..deaac52240a 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceRoleManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceRoleManager.java @@ -148,7 +148,7 @@ public String createGovernanceRole(String userId, UserNotAuthorizedException { final String methodName = "createGovernanceRole"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles"; final String propertiesParameterName = "properties"; return super.createGovernanceRole(userId, properties, propertiesParameterName, urlTemplate, methodName); @@ -177,7 +177,7 @@ public void updateGovernanceRole(String userId, UserNotAuthorizedException { final String methodName = "updateGovernanceRole"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}?isMergeUpdate={3}"; final String guidParameterName = "governanceRoleGUID"; final String propertiesParameterName = "properties"; @@ -210,7 +210,7 @@ public void deleteGovernanceRole(String userId, UserNotAuthorizedException { final String methodName = "deleteGovernanceRole"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}/delete"; final String guidParameterName = "governanceRoleGUID"; invalidParameterHandler.validateGUID(governanceRoleGUID, guidParameterName, methodName); @@ -237,7 +237,7 @@ public GovernanceRoleElement getGovernanceRoleByGUID(String userId, UserNotAuthorizedException { final String methodName = "getGovernanceRoleByGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}"; final String guidParameterName = "governanceRoleGUID"; @@ -245,7 +245,7 @@ public GovernanceRoleElement getGovernanceRoleByGUID(String userId, invalidParameterHandler.validateGUID(governanceRoleGUID, guidParameterName, methodName); GovernanceRoleResponse restResult = restClient.callGovernanceRoleGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, governanceRoleGUID); @@ -272,7 +272,7 @@ public GovernanceRoleHistory getGovernanceRoleHistoryByGUID(String userId, UserNotAuthorizedException { final String methodName = "getGovernanceRoleHistoryByGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}/history"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}/history"; final String guidParameterName = "governanceRoleGUID"; @@ -280,7 +280,7 @@ public GovernanceRoleHistory getGovernanceRoleHistoryByGUID(String userId, invalidParameterHandler.validateGUID(governanceRoleGUID, guidParameterName, methodName); GovernanceRoleHistoryResponse restResult = restClient.callGovernanceRoleHistoryGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, governanceRoleGUID); @@ -311,7 +311,7 @@ public List<GovernanceRoleElement> getGovernanceRoleByRoleId(String userId, UserNotAuthorizedException { final String methodName = "getGovernanceRoleByRoleId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/by-role-id/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/by-role-id/{2}"; final String appointmentIdParameterName = "appointmentId"; @@ -319,7 +319,7 @@ public List<GovernanceRoleElement> getGovernanceRoleByRoleId(String userId, invalidParameterHandler.validateName(roleId, appointmentIdParameterName, methodName); GovernanceRoleListResponse restResult = restClient.callGovernanceRoleListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, roleId); @@ -351,7 +351,7 @@ public List<GovernanceRoleElement> getGovernanceRolesByDomainId(String userId, UserNotAuthorizedException { final String methodName = "getGovernanceRolesByDomainId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/by-domain/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/by-domain/{2}?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); invalidParameterHandler.validateUserId(userId, methodName); @@ -359,7 +359,7 @@ public List<GovernanceRoleElement> getGovernanceRolesByDomainId(String userId, int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); GovernanceRoleListResponse restResult = restClient.callGovernanceRoleListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, domainIdentifier, @@ -393,10 +393,9 @@ public List<GovernanceRoleElement> getGovernanceRolesByTitle(String userId, PropertyServerException { final String methodName = "getGovernanceRolesByTitle"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/by-title?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/by-title?startFrom={2}&pageSize={3}"; final String titleParameterName = "title"; - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateSearchString(title, titleParameterName, methodName); @@ -407,7 +406,7 @@ public List<GovernanceRoleElement> getGovernanceRolesByTitle(String userId, requestBody.setSearchStringParameterName(titleParameterName); GovernanceRoleListResponse restResult = restClient.callGovernanceRoleListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -441,7 +440,7 @@ public List<GovernanceRoleAppointee> getCurrentGovernanceRoleAppointments(String UserNotAuthorizedException { final String methodName = "getCurrentGovernanceRoleAppointments"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/by-domain/{2}/current-appointments?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/by-domain/{2}/current-appointments?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); invalidParameterHandler.validateUserId(userId, methodName); @@ -449,7 +448,7 @@ public List<GovernanceRoleAppointee> getCurrentGovernanceRoleAppointments(String int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); GovernanceRoleAppointeeListResponse restResult = restClient.callGovernanceRoleAppointeeListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, domainIdentifier, @@ -482,12 +481,11 @@ public String appointGovernanceRole(String userId, UserNotAuthorizedException { final String methodName = "appointGovernanceRole"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}/appoint"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}/appoint"; final String governanceRoleGUIDParameterName = "governanceRoleGUID"; final String profileGUIDParameterName = "profileGUID"; - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceRoleGUID, governanceRoleGUIDParameterName, methodName); invalidParameterHandler.validateGUID(profileGUID, profileGUIDParameterName, methodName); @@ -497,7 +495,7 @@ public String appointGovernanceRole(String userId, requestBody.setEffectiveDate(startDate); GUIDResponse restResult = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -530,12 +528,11 @@ public void relieveGovernanceRole(String userId, UserNotAuthorizedException { final String methodName = "relieveGovernanceRole"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}/relieve/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-roles/{2}/relieve/{3}"; final String governanceRoleGUIDParameterName = "governanceRoleGUID"; final String profileGUIDParameterName = "profileGUID"; - invalidParameterHandler.validateOMAGServerPlatformURL(serverPlatformURLRoot, serverName, methodName); invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(governanceRoleGUID, governanceRoleGUIDParameterName, methodName); invalidParameterHandler.validateGUID(profileGUID, profileGUIDParameterName, methodName); @@ -545,7 +542,7 @@ public void relieveGovernanceRole(String userId, requestBody.setEffectiveDate(endDate); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceStatusLevelManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceStatusLevelManager.java index 7d09d4ac6cd..9e869add802 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceStatusLevelManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceStatusLevelManager.java @@ -147,13 +147,12 @@ public String createStandardGovernanceStatusLevels(String userId) throws Invalid PropertyServerException { final String methodName = "createStandardGovernanceStatusLevels"; - - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/standard-set"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/standard-set"; invalidParameterHandler.validateUserId(userId, methodName); GUIDResponse response = restClient.callGUIDPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId); @@ -187,7 +186,7 @@ public String createGovernanceStatusIdentifierSet(String { final String methodName = "createGovernanceStatusIdentifierSet"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets"; return super.createReferenceable(userId, properties, propertiesParameter, urlTemplate, methodName); @@ -215,7 +214,7 @@ public void updateGovernanceStatusIdentifierSet(String final String methodName = "updateGovernanceStatusIdentifierSet"; final String guidParameter = "setGUID"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/{2}/update"; super.updateReferenceable(userId, setGUID, guidParameter, false, properties, propertiesParameter, urlTemplate, methodName); } @@ -239,7 +238,7 @@ public void removeGovernanceStatusIdentifierSet(String userId, { final String methodName = "removeGovernanceStatusIdentifierSet"; final String guidParameter = "setGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/{2}/delete"; super.removeReferenceable(userId, setGUID, guidParameter, urlTemplate, methodName); } @@ -262,12 +261,12 @@ public List<GovernanceStatusIdentifierSetElement> getGovernanceStatusIdentifierS PropertyServerException { final String methodName = "getGovernanceStatusIdentifierSets"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets"; invalidParameterHandler.validateUserId(userId, methodName); GovernanceStatusIdentifierSetListResponse restResult = restClient.callStatusIdentifierSetListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId); return restResult.getElements(); @@ -294,13 +293,13 @@ public GovernanceStatusIdentifierSetElement getGovernanceStatusIdentifierSetByGU { final String methodName = "getGovernanceStatusIdentifierSet"; final String guidParameter = "setGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(setGUID, guidParameter, methodName); GovernanceStatusIdentifierSetResponse restResult = restClient.callStatusIdentifierSetGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, setGUID); @@ -335,7 +334,7 @@ public String createGovernanceStatusIdentifier(String final String methodName = "createGovernanceStatusIdentifier"; final String guidParameter = "setGUID"; final String propertiesParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/identifier"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/identifier"; return super.createReferenceableWithAnchor(userId, setGUID, guidParameter, properties, propertiesParameter, urlTemplate, methodName); } @@ -362,7 +361,7 @@ public void updateGovernanceStatusIdentifier(String final String methodName = "updateGovernanceStatusIdentifier"; final String guidParameter = "identifierGUID"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/identifier/{2}/update"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/identifier/{2}/update"; super.updateReferenceable(userId, identifierGUID, guidParameter, false, properties, propertiesParameter, urlTemplate, methodName); } @@ -386,7 +385,7 @@ public void removeGovernanceStatusIdentifier(String userId, { final String methodName = "removeGovernanceStatusIdentifier"; final String guidParameter = "identifierGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/identifier/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/identifier/{2}/delete"; super.removeReferenceable(userId, identifierGUID, guidParameter, urlTemplate, methodName); } @@ -411,12 +410,12 @@ public GovernanceStatusIdentifierElement getGovernanceStatusIdentifier(String us PropertyServerException { final String methodName = "getGovernanceStatusIdentifier"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/identifier/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-status-sets/identifier/{2}"; invalidParameterHandler.validateUserId(userId, methodName); GovernanceStatusIdentifierResponse restResult = restClient.callStatusIdentifierGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, levelIdentifier); diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceZoneManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceZoneManager.java index 2f54af7d12f..ac3263634eb 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceZoneManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/GovernanceZoneManager.java @@ -145,7 +145,7 @@ public String createGovernanceZone(String userId, final String methodName = "createGovernanceZone"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones"; return super.createReferenceable(userId, properties, propertiesParameter, urlTemplate, methodName); } @@ -175,7 +175,7 @@ public void updateGovernanceZone(String userId, final String guidParameter = "zoneGUID"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}?isMergeUpdate={3}"; super.updateReferenceable(userId, zoneGUID, @@ -207,7 +207,7 @@ public void deleteGovernanceZone(String userId, final String methodName = "deleteGovernanceZone"; final String guidParameter = "zoneGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}/delete}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}/delete}"; super.removeReferenceable(userId, zoneGUID, guidParameter, urlTemplate, methodName); } @@ -236,7 +236,7 @@ public void linkZonesInHierarchy(String userId, final String parentZoneGUIDParameterName = "parentZoneGUID"; final String childZoneGUIDParameterName = "childZoneGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}/nested-zone/{3}/link"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}/nested-zone/{3}/link"; super.setupRelationship(userId, parentZoneGUID, @@ -272,7 +272,7 @@ public void unlinkZonesInHierarchy(String userId, final String parentZoneGUIDParameterName = "parentZoneGUID"; final String childZoneGUIDParameterName = "childZoneGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}/nested-zone/{3}/unlink"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}/nested-zone/{3}/unlink"; clearRelationship(userId, parentZoneGUID, @@ -306,13 +306,13 @@ public GovernanceZoneElement getGovernanceZoneByGUID(String userId, final String methodName = "getGovernanceZoneByGUID"; final String guidParameter = "zoneGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(zoneGUID, guidParameter, methodName); GovernanceZoneResponse restResult = restClient.callGovernanceZoneGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, zoneGUID); @@ -340,13 +340,13 @@ public GovernanceZoneElement getGovernanceZoneByName(String userId, final String methodName = "getGovernanceZoneByName"; final String qualifiedNameParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/name/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/name/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameter, methodName); GovernanceZoneResponse restResult = restClient.callGovernanceZoneGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, qualifiedName); @@ -378,14 +378,14 @@ public List<GovernanceZoneElement> getGovernanceZonesForDomain(String userId, PropertyServerException { final String methodName = "getGovernanceZonesForDomain"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/for-domain?domainIdentifier={2}&startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/for-domain?domainIdentifier={2}&startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); GovernanceZoneListResponse restResult = restClient.callGovernanceZoneListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, domainIdentifier, @@ -417,13 +417,13 @@ public GovernanceZoneDefinition getGovernanceZoneDefinitionByGUID(String userId, final String methodName = "getGovernanceZoneDefinitionByGUID"; final String guidParameter = "zoneGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}/with-definitions"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/governance-zones/{2}/with-definitions"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(zoneGUID, guidParameter, methodName); GovernanceZoneDefinitionResponse restResult = restClient.callGovernanceZoneDefinitionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, zoneGUID); diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/RightsManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/RightsManager.java index 70470f8fe08..4e2084c31f1 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/RightsManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/RightsManager.java @@ -149,7 +149,7 @@ public String createLicenseType(String userId, PropertyServerException { final String methodName = "createLicenseType"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types"; final String propertiesParameterName = "properties"; return super.createGovernanceDefinition(userId, properties, propertiesParameterName, initialStatus, urlTemplate, methodName); @@ -177,7 +177,7 @@ public void updateLicenseType(String userId, PropertyServerException { final String methodName = "updateLicenseType"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/{2}/update?isMergeUpdate={3}"; final String guidParameterName = "licenseTypeGUID"; final String propertiesParameterName = "properties"; @@ -234,7 +234,7 @@ public void deleteLicenseType(String userId, PropertyServerException { final String methodName = "deleteLicenseType"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/{2}/delete"; final String guidParameterName = "licenseTypeGUID"; super.removeReferenceable(userId, licenseTypeGUID, guidParameterName, urlTemplate, methodName); @@ -260,7 +260,7 @@ public LicenseTypeElement getLicenseTypeByGUID(String userId, PropertyServerException { final String methodName = "getLicenseTypeByGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/{2}"; final String guidParameterName = "licenseTypeGUID"; @@ -268,7 +268,7 @@ public LicenseTypeElement getLicenseTypeByGUID(String userId, invalidParameterHandler.validateGUID(licenseTypeGUID, guidParameterName, methodName); LicenseTypeResponse restResult = restClient.callLicenseTypeGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, licenseTypeGUID); @@ -296,7 +296,7 @@ public LicenseTypeElement getLicenseTypeByDocId(String userId, PropertyServerException { final String methodName = "getLicenseTypeByDocId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/by-document-id/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/by-document-id/{2}"; final String documentIdParameterName = "documentId"; @@ -304,7 +304,7 @@ public LicenseTypeElement getLicenseTypeByDocId(String userId, invalidParameterHandler.validateName(documentIdentifier, documentIdParameterName, methodName); LicenseTypeResponse restResult = restClient.callLicenseTypeGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, documentIdentifier); @@ -336,7 +336,7 @@ public List<LicenseTypeElement> getLicenseTypesByTitle(String userId, PropertyServerException { final String methodName = "getLicenseTypesByTitle"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/by-title?startFrom={2}&pageSize={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/by-title?startFrom={2}&pageSize={3}"; final String titleParameterName = "title"; invalidParameterHandler.validateUserId(userId, methodName); @@ -349,7 +349,7 @@ public List<LicenseTypeElement> getLicenseTypesByTitle(String userId, requestBody.setSearchStringParameterName(titleParameterName); LicenseTypeListResponse restResult = restClient.callLicenseTypeListPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -383,14 +383,14 @@ public List<LicenseTypeElement> getLicenseTypeByDomainId(String userId, PropertyServerException { final String methodName = "getLicenseTypeByDomainId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/by-domain/{2}?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/license-types/by-domain/{2}?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); LicenseTypeListResponse restResult = restClient.callLicenseTypeListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, domainIdentifier, @@ -428,7 +428,7 @@ public String licenseElement(String userId, PropertyServerException { final String methodName = "licenseElement"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/license-types/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/license-types/{3}"; final String elementGUIDParameterName = "elementGUID"; final String licenseTypeGUIDParameterName = "licenseTypeGUID"; @@ -466,7 +466,7 @@ public void updateLicense(String userId, PropertyServerException { final String methodName = "updateLicense"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/licenses/{2}/update?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/licenses/{2}/update?isMergeUpdate={3}"; final String licenseGUIDParameterName = "licenseGUID"; @@ -498,7 +498,7 @@ public void unlicenseElement(String userId, PropertyServerException { final String methodName = "unlicenseElement"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/licenses/{2}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/licenses/{2}/delete"; final String licenseGUIDParameterName = "licenseGUID"; @@ -535,7 +535,7 @@ public List<RelatedElement> getLicensedElements(String userId, { final String methodName = "getLicencedElements"; final String guidParameter = "licenseGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/licenses/{2}?&startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/licenses/{2}?&startFrom={3}&pageSize={4}"; return super.getRelatedElements(userId, licenseGUID, guidParameter, urlTemplate, startFrom, pageSize, methodName); } @@ -565,7 +565,7 @@ public List<LicenseElement> getLicenses(String userId, { final String methodName = "getLicences"; final String guidParameterName = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/licenses?&startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/licenses?&startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, guidParameterName, methodName); @@ -573,7 +573,7 @@ public List<LicenseElement> getLicenses(String userId, int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); LicenseListResponse restResult = restClient.callLicenseListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, elementGUID, diff --git a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java index 0443f991c2b..e14f85c9825 100644 --- a/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java +++ b/open-metadata-implementation/access-services/governance-program/governance-program-client/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/client/SubjectAreaManager.java @@ -143,7 +143,7 @@ public String createSubjectArea(String userId, final String methodName = "createSubjectArea"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas"; return super.createReferenceable(userId, properties, propertiesParameter, urlTemplate, methodName); } @@ -173,7 +173,7 @@ public void updateSubjectArea(String userId, final String guidParameter = "subjectAreaGUID"; final String propertiesParameter = "properties"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}?isMergeUpdate={3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}?isMergeUpdate={3}"; super.updateReferenceable(userId, subjectAreaGUID, guidParameter, isMergeUpdate, properties, propertiesParameter, urlTemplate, methodName); } @@ -198,7 +198,7 @@ public void deleteSubjectArea(String userId, final String methodName = "deleteSubjectArea"; final String guidParameter = "subjectAreaGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/delete}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/delete}"; super.removeReferenceable(userId, subjectAreaGUID, guidParameter, urlTemplate, methodName); } @@ -227,7 +227,7 @@ public void linkSubjectAreasInHierarchy(String userId, final String parentSubjectAreaGUIDParameterName = "parentSubjectAreaGUID"; final String childSubjectAreaGUIDParameterName = "childSubjectAreaGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/nested-subject-area/{3}/link"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/nested-subject-area/{3}/link"; super.setupRelationship(userId, parentSubjectAreaGUID, @@ -263,7 +263,7 @@ public void unlinkSubjectAreasInHierarchy(String userId, final String parentSubjectAreaGUIDParameterName = "parentSubjectAreaGUID"; final String childSubjectAreaGUIDParameterName = "childSubjectAreaGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/nested-subject-area/{3}/unlink"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/nested-subject-area/{3}/unlink"; super.clearRelationship(userId, parentSubjectAreaGUID, @@ -296,13 +296,13 @@ public SubjectAreaElement getSubjectAreaByGUID(String userId, final String methodName = "getSubjectAreaByGUID"; final String guidParameter = "subjectAreaGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(subjectAreaGUID, guidParameter, methodName); SubjectAreaResponse restResult = restClient.callSubjectAreaGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, subjectAreaGUID); @@ -331,13 +331,13 @@ public SubjectAreaElement getSubjectAreaByName(String userId, final String methodName = "getSubjectAreaByName"; final String qualifiedNameParameter = "qualifiedName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/name/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/name/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameter, methodName); SubjectAreaResponse restResult = restClient.callSubjectAreaGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, qualifiedName); @@ -369,14 +369,14 @@ public List<SubjectAreaElement> getSubjectAreasForDomain(String userId, PropertyServerException { final String methodName = "getSubjectAreasForDomain"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/for-domain?domainIdentifier={2}&startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/for-domain?domainIdentifier={2}&startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); int queryPageSize = invalidParameterHandler.validatePaging(startFrom, pageSize, methodName); SubjectAreaListResponse restResult = restClient.callSubjectAreaListGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, domainIdentifier, @@ -406,15 +406,14 @@ public SubjectAreaDefinition getSubjectAreaDefinitionByGUID(String userId, PropertyServerException { final String methodName = "getSubjectAreaDefinitionByGUID"; - final String guidParameter = "subjectAreaGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/with-definitions"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/with-definitions"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(subjectAreaGUID, guidParameter, methodName); SubjectAreaDefinitionResponse restResult = restClient.callSubjectAreaDefinitionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, subjectAreaGUID); @@ -443,7 +442,7 @@ public void addSubjectAreaMemberClassification(String final String methodName = "addSubjectAreaMemberClassification"; final String guidParameter = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/subject-area"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/subject-area"; super.setReferenceableClassification(userId, elementGUID, guidParameter, properties, urlTemplate, methodName); } @@ -467,7 +466,7 @@ public void deleteSubjectAreaMemberClassification(String userId, { final String methodName = "deleteSubjectAreaMemberClassification"; final String guidParameter = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/subject-area/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/elements/{2}/subject-area/delete"; super.removeReferenceableClassification(userId, elementGUID, guidParameter, urlTemplate, methodName); } @@ -497,7 +496,7 @@ public List<ElementStub> getMembersOfSubjectArea(String userId, { final String methodName = "getMembersOfSubjectArea"; final String nameParameter = "subjectAreaName"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/members?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/governance-program/users/{1}/subject-areas/{2}/members?startFrom={3}&pageSize={4}"; return super.getElementStubsByName(userId, subjectAreaName, nameParameter, urlTemplate, startFrom, pageSize, methodName); } diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/EndpointManagerClient.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/EndpointManagerClient.java index ae40e046478..2cb2e3e5593 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/EndpointManagerClient.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/EndpointManagerClient.java @@ -447,7 +447,7 @@ public List<EndpointElement> findEndpoints(String userId, requestBody.setSearchStringParameterName(parameterName); EndpointsResponse restResult = restClient.callEndpointsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -496,7 +496,7 @@ public List<EndpointElement> getEndpointsByName(String userId, requestBody.setNamePropertyName(nameParameter); EndpointsResponse restResult = restClient.callEndpointsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -545,7 +545,7 @@ public List<EndpointElement> getEndpointsByNetworkAddress(String userId, requestBody.setNamePropertyName(nameParameter); EndpointsResponse restResult = restClient.callEndpointsPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/ITInfrastructureEventClient.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/ITInfrastructureEventClient.java index 605137be1eb..5eb0651f11c 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/ITInfrastructureEventClient.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-client/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/client/ITInfrastructureEventClient.java @@ -152,7 +152,7 @@ public void registerListener(String userId, final String nameParameter = "listener"; final String callerIdParameter = "callerId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/it-infrastructure/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/it-infrastructure/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); @@ -165,7 +165,7 @@ public void registerListener(String userId, * event bus. */ ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITProfileRESTServices.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITProfileRESTServices.java index 9b3739fe855..5bdd6b77071 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITProfileRESTServices.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-server/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/ITProfileRESTServices.java @@ -934,6 +934,9 @@ public VoidResponse addIdentityToProfile(String serverName, profileGUIDParameterName, null, null, + null, + null, + null, false, false, new Date(), diff --git a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITProfileResource.java b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITProfileResource.java index dce5120a460..8c21fcb4dbf 100644 --- a/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITProfileResource.java +++ b/open-metadata-implementation/access-services/it-infrastructure/it-infrastructure-spring/src/main/java/org/odpi/openmetadata/accessservices/itinfrastructure/server/spring/ITProfileResource.java @@ -41,7 +41,7 @@ public class ITProfileResource { - private ITProfileRESTServices restAPI = new ITProfileRESTServices(); + private final ITProfileRESTServices restAPI = new ITProfileRESTServices(); /** * Default constructor @@ -52,11 +52,11 @@ public ITProfileResource() /** - * Create a definition of a IT profile. + * Create a definition of an IT profile. * * @param serverName called server * @param userId calling user - * @param requestBody properties for a IT profile + * @param requestBody properties for an IT profile * * @return unique identifier of IT profile * @@ -365,7 +365,7 @@ public VoidResponse deleteUserIdentity(@PathVariable String s * PropertyServerException - there is a problem retrieving information from the property server(s) or * UserNotAuthorizedException - the requesting user is not authorized to issue this request. */ - @PostMapping(path = "/user-identities/{userIdentityGUID}/personal-profiles/{profileGUID}/link") + @PostMapping(path = "/user-identities/{userIdentityGUID}/profiles/{profileGUID}/link") public VoidResponse addIdentityToProfile(@PathVariable String serverName, @PathVariable String userId, diff --git a/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagementBaseClient.java b/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagementBaseClient.java index 7ea6b9581a2..be0d2795a1b 100644 --- a/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagementBaseClient.java +++ b/open-metadata-implementation/access-services/project-management/project-management-client/src/main/java/org/odpi/openmetadata/accessservices/projectmanagement/client/ProjectManagementBaseClient.java @@ -379,7 +379,7 @@ void setReferenceableClassification(String userId, requestBody.setProperties(properties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -422,7 +422,7 @@ void removeReferenceableClassification(String userId, requestBody.setExternalSourceName(externalSourceName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerBaseClient.java b/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerBaseClient.java index 999728a21c1..20652af6042 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerBaseClient.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerBaseClient.java @@ -373,7 +373,7 @@ void setReferenceableClassification(String userId, requestBody.setProperties(properties); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -416,7 +416,7 @@ void removeReferenceableClassification(String userId, requestBody.setExternalSourceName(externalSourceName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerEventClient.java b/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerEventClient.java index efda4a14c8f..170f90c6d2e 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerEventClient.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-client/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/client/SecurityManagerEventClient.java @@ -156,7 +156,7 @@ public void registerListener(String userId, final String methodName = "registerListener"; final String nameParameter = "listener"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/security-manager/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/security-manager/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); @@ -168,7 +168,7 @@ public void registerListener(String userId, * event bus. */ ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/SecurityManagerRESTServices.java b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/SecurityManagerRESTServices.java index 3e52ca87313..c790672055c 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/SecurityManagerRESTServices.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-server/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/SecurityManagerRESTServices.java @@ -885,6 +885,9 @@ public VoidResponse addIdentityToProfile(String serverName, profileGUIDParameterName, null, null, + null, + null, + null, false, false, new Date(), diff --git a/open-metadata-implementation/access-services/security-manager/security-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/spring/SecurityManagerOMASResource.java b/open-metadata-implementation/access-services/security-manager/security-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/spring/SecurityManagerOMASResource.java index 44e0e03fdef..6ab85709eb3 100644 --- a/open-metadata-implementation/access-services/security-manager/security-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/spring/SecurityManagerOMASResource.java +++ b/open-metadata-implementation/access-services/security-manager/security-manager-spring/src/main/java/org/odpi/openmetadata/accessservices/securitymanager/server/spring/SecurityManagerOMASResource.java @@ -382,7 +382,7 @@ public VoidResponse deleteUserIdentity(@PathVariable String s * PropertyServerException - there is a problem retrieving information from the property server(s) or * UserNotAuthorizedException - the requesting user is not authorized to issue this request. */ - @PostMapping(path = "/user-identities/{userIdentityGUID}/personal-profiles/{profileGUID}/link") + @PostMapping(path = "/user-identities/{userIdentityGUID}/profiles/{profileGUID}/link") public VoidResponse addIdentityToProfile(@PathVariable String serverName, @PathVariable String userId, diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-client/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/client/StewardshipAction.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-client/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/client/StewardshipAction.java index 90683e4f575..404a071df74 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-client/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/client/StewardshipAction.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-client/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/client/StewardshipAction.java @@ -220,7 +220,7 @@ public void linkElementsAsDuplicates(String userId, final String element1GUIDParameter = "element1GUID"; final String element2GUIDParameter = "element2GUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/peer-duplicate-of/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/peer-duplicate-of/{3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(element1GUID, element1GUIDParameter, methodName); @@ -236,7 +236,7 @@ public void linkElementsAsDuplicates(String userId, requestBody.setNotes(notes); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -267,14 +267,14 @@ public void unlinkElementsAsDuplicates(String userId, final String element1GUIDParameter = "element1GUID"; final String element2GUIDParameter = "element2GUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/peer-duplicate-of/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/peer-duplicate-of/{3}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(element1GUID, element1GUIDParameter, methodName); invalidParameterHandler.validateGUID(element2GUID, element2GUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -302,14 +302,14 @@ public void markElementAsKnownDuplicate(String userId, final String methodName = "markElementAsKnownDuplicate"; final String elementGUIDParameter = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/known-duplicate"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/known-duplicate"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -336,14 +336,14 @@ public void unmarkElementAsKnownDuplicate(String userId, final String methodName = "unmarkElementAsKnownDuplicate"; final String elementGUIDParameter = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/known-duplicate/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/known-duplicate/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -375,13 +375,13 @@ public List<DuplicateElement> getPeerDuplicates(String userId, { final String methodName = "getPeerDuplicates"; final String guidParameterName = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/peer-duplicates?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/peer-duplicates?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, guidParameterName, methodName); DuplicatesResponse restResult = restClient.callDuplicatesGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, elementGUID, @@ -426,7 +426,7 @@ public void markAsConsolidatedDuplicate(String userId, final String methodName = "markAsConsolidatedDuplicate"; final String element1GUIDParameter = "consolidatedDuplicateGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/consolidated-duplicate"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/consolidated-duplicate"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(consolidatedDuplicateGUID, element1GUIDParameter, methodName); @@ -441,7 +441,7 @@ public void markAsConsolidatedDuplicate(String userId, requestBody.setNotes(notes); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, requestBody, serverName, userId, @@ -471,14 +471,14 @@ public void linkElementToConsolidatedDuplicate(String userId, final String element1GUIDParameter = "consolidatedDuplicateGUID"; final String element2GUIDParameter = "contributingElementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/consolidated-duplicate/{2}/contributing-element/{3}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/consolidated-duplicate/{2}/contributing-element/{3}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(consolidatedDuplicateGUID, element1GUIDParameter, methodName); invalidParameterHandler.validateGUID(contributingElementGUID, element2GUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -509,14 +509,14 @@ public void unlinkElementFromConsolidatedDuplicate(String userId, final String element1GUIDParameter = "consolidatedDuplicateGUID"; final String element2GUIDParameter = "contributingElementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/consolidated-duplicate/{2}/contributing-elements/{3}/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/consolidated-duplicate/{2}/contributing-elements/{3}/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(consolidatedDuplicateGUID, element1GUIDParameter, methodName); invalidParameterHandler.validateGUID(contributingElementGUID, element2GUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, @@ -549,13 +549,13 @@ public List<ElementStub> getContributingDuplicates(String userId, { final String methodName = "getContributingDuplicates"; final String guidParameterName = "consolidatedDuplicateGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/consolidated-duplicate/{2}/contributing-elements?startFrom={3}&pageSize={4}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/consolidated-duplicate/{2}/contributing-elements?startFrom={3}&pageSize={4}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(consolidatedDuplicateGUID, guidParameterName, methodName); ElementStubsResponse restResult = restClient.callElementStubsGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, consolidatedDuplicateGUID, @@ -586,13 +586,13 @@ public ElementStub getConsolidatedDuplicate(String userId, { final String methodName = "getConsolidatedDuplicate"; final String guidParameterName = "elementGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/consolidated-duplicate"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/consolidated-duplicate"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(elementGUID, guidParameterName, methodName); ElementStubResponse restResult = restClient.callElementStubGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, elementGUID); @@ -620,13 +620,13 @@ public void removeConsolidatedDuplicate(String userId, final String methodName = "removeConsolidatedDuplicate"; final String element1GUIDParameter = "consolidatedDuplicateGUID"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/consolidated-duplicate/delete"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/elements/{2}/consolidated-duplicate/delete"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(consolidatedDuplicateGUID, element1GUIDParameter, methodName); restClient.callVoidPostRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, nullRequestBody, serverName, userId, diff --git a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-client/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/client/StewardshipActionEventClient.java b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-client/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/client/StewardshipActionEventClient.java index 4f8c3d58e1d..520e46ebb47 100644 --- a/open-metadata-implementation/access-services/stewardship-action/stewardship-action-client/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/client/StewardshipActionEventClient.java +++ b/open-metadata-implementation/access-services/stewardship-action/stewardship-action-client/src/main/java/org/odpi/openmetadata/accessservices/stewardshipaction/client/StewardshipActionEventClient.java @@ -119,7 +119,7 @@ public void registerListener(String userId, final String nameParameter = "listener"; final String callerIdParameter = "callerId"; - final String urlTemplate = "/servers/{0}/open-metadata/access-services/asset-consumer/users/{1}/topics/out-topic-connection/{2}"; + final String urlTemplate = serverPlatformURLRoot + "/servers/{0}/open-metadata/access-services/stewardship-action/users/{1}/topics/out-topic-connection/{2}"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateObject(listener, nameParameter, methodName); @@ -132,7 +132,7 @@ public void registerListener(String userId, * event bus. */ ConnectionResponse restResult = restClient.callOCFConnectionGetRESTCall(methodName, - serverPlatformURLRoot + urlTemplate, + urlTemplate, serverName, userId, callerId); diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ActorProfileHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ActorProfileHandler.java index 1b9e0c5be2c..00169fb39be 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ActorProfileHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/ActorProfileHandler.java @@ -269,7 +269,11 @@ public void updateActorProfile(String userId, invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(profileGUID, profileGUIDParameterName, methodName); - invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); + + if (!isMergeUpdate) + { + invalidParameterHandler.validateName(qualifiedName, qualifiedNameParameterName, methodName); + } String typeGUID = invalidParameterHandler.validateTypeName(typeName, OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java index c457115f896..b4ae86adb1e 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/OpenMetadataAPIGenericHandler.java @@ -13573,15 +13573,28 @@ public void relinkElementToNewElement(String userId, /* * Now add the new relationship. */ - - repositoryHandler.createRelationship(userId, - attachmentTypeGUID, - externalSourceGUID, - externalSourceName, - startingGUID, - newAttachingGUID, - relationshipProperties, - methodName); + if (startAtEnd1) + { + repositoryHandler.createRelationship(userId, + attachmentTypeGUID, + externalSourceGUID, + externalSourceName, + startingGUID, + newAttachingGUID, + relationshipProperties, + methodName); + } + else + { + repositoryHandler.createRelationship(userId, + attachmentTypeGUID, + externalSourceGUID, + externalSourceName, + newAttachingGUID, + startingGUID, + relationshipProperties, + methodName); + } /* diff --git a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityHandler.java b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityHandler.java index f14aa2d16b1..689c344ecf6 100644 --- a/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityHandler.java +++ b/open-metadata-implementation/common-services/generic-handlers/src/main/java/org/odpi/openmetadata/commonservices/generichandlers/UserIdentityHandler.java @@ -321,8 +321,7 @@ public void deleteUserIdentity(String userId, /** - * Link a user identity to a profile. This will fail if the user identity is already connected to - * a profile. + * Link a user identity to a profile. * * @param userId calling user * @param externalSourceGUID unique identifier of software capability representing the caller @@ -331,6 +330,9 @@ public void deleteUserIdentity(String userId, * @param userIdentityGUIDParameterName parameter name supplying userIdentityGUID * @param profileGUID unique identifier of the profile * @param profileGUIDParameterName parameter name supplying profileGUID + * @param roleTypeName what is the type of the role that this identity is used for + * @param roleGUID what is the guid of the role that this identity is used for + * @param description describe how this identity is used * @param effectiveFrom starting time for this relationship (null for all time) * @param effectiveTo ending time for this relationship (null for all time) * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned @@ -349,6 +351,9 @@ public void addIdentityToProfile(String userId, String userIdentityGUIDParameterName, String profileGUID, String profileGUIDParameterName, + String roleTypeName, + String roleGUID, + String description, Date effectiveFrom, Date effectiveTo, boolean forLineage, @@ -358,15 +363,9 @@ public void addIdentityToProfile(String userId, UserNotAuthorizedException, PropertyServerException { - InstanceProperties properties = null; - - if ((effectiveFrom != null) || (effectiveTo != null )) - { - properties = new InstanceProperties(); - - properties.setEffectiveFromTime(effectiveFrom); - properties.setEffectiveToTime(effectiveTo); - } + InstanceProperties properties = repositoryHelper.addStringPropertyToInstance(serviceName, null, OpenMetadataAPIMapper.ROLE_TYPE_NAME_PROPERTY_NAME, roleTypeName, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.ROLE_GUID_PROPERTY_NAME, roleGUID, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, description, methodName); this.relinkElementToNewElement(userId, externalSourceGUID, @@ -374,7 +373,7 @@ public void addIdentityToProfile(String userId, userIdentityGUID, userIdentityGUIDParameterName, OpenMetadataAPIMapper.USER_IDENTITY_TYPE_NAME, - true, + false, profileGUID, profileGUIDParameterName, OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, @@ -383,12 +382,83 @@ public void addIdentityToProfile(String userId, supportedZones, OpenMetadataAPIMapper.PROFILE_IDENTITY_RELATIONSHIP_TYPE_GUID, OpenMetadataAPIMapper.PROFILE_IDENTITY_RELATIONSHIP_TYPE_NAME, - properties, + this.setUpEffectiveDates(properties, effectiveFrom, effectiveTo), effectiveTime, methodName); } + + /** + * Update the properties for the link between a user identity to a profile. + * + * @param userId calling user + * @param externalSourceGUID unique identifier of software capability representing the caller + * @param externalSourceName unique name of software capability representing the caller + * @param userIdentityGUID unique identifier of the user identity + * @param userIdentityGUIDParameterName parameter name supplying userIdentityGUID + * @param profileGUID unique identifier of the profile + * @param profileGUIDParameterName parameter name supplying profileGUID + * @param roleTypeName what is the type of the role that this identity is used for + * @param roleGUID what is the guid of the role that this identity is used for + * @param description describe how this identity is used + * @param effectiveFrom starting time for this relationship (null for all time) + * @param effectiveTo ending time for this relationship (null for all time) + * @param isMergeUpdate should the supplied properties be overlaid on the existing properties (true) or replace them (false + * @param forLineage the request is to support lineage retrieval this means entities with the Memento classification can be returned + * @param forDuplicateProcessing the request is for duplicate processing and so must not deduplicate + * @param effectiveTime the time that the retrieved elements must be effective for (null for any time, new Date() for now) + * @param methodName calling method + * + * @throws InvalidParameterException entity not known, null userId or guid + * @throws PropertyServerException problem accessing property server + * @throws UserNotAuthorizedException security access problem + */ + public void updateIdentityProfile(String userId, + String externalSourceGUID, + String externalSourceName, + String userIdentityGUID, + String userIdentityGUIDParameterName, + String profileGUID, + String profileGUIDParameterName, + String roleTypeName, + String roleGUID, + String description, + Date effectiveFrom, + Date effectiveTo, + boolean isMergeUpdate, + boolean forLineage, + boolean forDuplicateProcessing, + Date effectiveTime, + String methodName) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + InstanceProperties properties = repositoryHelper.addStringPropertyToInstance(serviceName, null, OpenMetadataAPIMapper.ROLE_TYPE_NAME_PROPERTY_NAME, roleTypeName, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.ROLE_GUID_PROPERTY_NAME, roleGUID, methodName); + properties = repositoryHelper.addStringPropertyToInstance(serviceName, properties, OpenMetadataAPIMapper.DESCRIPTION_PROPERTY_NAME, description, methodName); + + this.updateElementToElementLink(userId, + externalSourceGUID, + externalSourceName, + profileGUID, + profileGUIDParameterName, + OpenMetadataAPIMapper.ACTOR_PROFILE_TYPE_NAME, + userIdentityGUID, + userIdentityGUIDParameterName, + OpenMetadataAPIMapper.USER_IDENTITY_TYPE_NAME, + forLineage, + forDuplicateProcessing, + supportedZones, + OpenMetadataAPIMapper.PROFILE_IDENTITY_RELATIONSHIP_TYPE_GUID, + OpenMetadataAPIMapper.PROFILE_IDENTITY_RELATIONSHIP_TYPE_NAME, + isMergeUpdate, + this.setUpEffectiveDates(properties, effectiveFrom, effectiveTo), + effectiveTime, + methodName); + } + + /** * Unlink a user identity from a profile. * diff --git a/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/organization/connector/OrganizationIntegratorContext.java b/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/organization/connector/OrganizationIntegratorContext.java index aaef5ed0f2d..c0ad272a9ee 100644 --- a/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/organization/connector/OrganizationIntegratorContext.java +++ b/open-metadata-implementation/integration-services/organization-integrator/organization-integrator-api/src/main/java/org/odpi/openmetadata/integrationservices/organization/connector/OrganizationIntegratorContext.java @@ -863,6 +863,27 @@ public String createUserIdentity(UserIdentityProperties newIdentity) throws Inva } + /** + * Create a UserIdentity that is for the sole use of a specific actor profile. + * + * @param profileGUID unique identifier of the profile + * @param newIdentity properties for the new userIdentity + * + * @return unique identifier of the UserIdentity + * + * @throws InvalidParameterException one of the parameters is invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + public String createUserIdentityForProfile(String profileGUID, + UserIdentityProperties newIdentity) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException + { + return userIdentityClient.createUserIdentityForProfile(userId, externalSourceGUID, externalSourceName, profileGUID, newIdentity); + } + + /** * Update a UserIdentity. * diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-leadership-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/leadership/GovernanceLeadershipSample.java b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-leadership-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/leadership/GovernanceLeadershipSample.java index d144e847a84..418b6b4c542 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-leadership-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/leadership/GovernanceLeadershipSample.java +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-leadership-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/leadership/GovernanceLeadershipSample.java @@ -2,8 +2,11 @@ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.accessservices.governanceprogram.samples.leadership; -import org.odpi.openmetadata.accessservices.communityprofile.client.PersonalProfileManagement; -import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.PersonalProfileUniverse; +import org.odpi.openmetadata.accessservices.communityprofile.client.OrganizationManagement; +import org.odpi.openmetadata.accessservices.communityprofile.client.UserIdentityManagement; +import org.odpi.openmetadata.accessservices.communityprofile.properties.UserIdentityProperties; +import org.odpi.openmetadata.accessservices.communityprofile.properties.ActorProfileProperties; +import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ActorProfileElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.ProfileIdentityElement; import org.odpi.openmetadata.accessservices.communityprofile.metadataelements.UserIdentityElement; import org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceRoleManager; @@ -29,6 +32,9 @@ */ public class GovernanceLeadershipSample { + /* + * Data values to use in the sample + */ private static final String cdoAppointmentId = "EXEC-CDO"; private static final String cpoAppointmentId = "EXEC-CPO"; private static final String csoAppointmentId = "EXEC-CSO"; @@ -45,7 +51,6 @@ public class GovernanceLeadershipSample private static final String pollyTaskerEmpNo = "005"; private static final String reggieMintEmpNo = "018"; - private static final String julesKeeperUserId = "julesKeeper"; private static final String ivorPadlockUserId = "ivorPadlock"; private static final String faithBrokerUserId = "faithBroker"; @@ -54,13 +59,25 @@ public class GovernanceLeadershipSample private static final String pollyTaskerUserId = "pollyTasker"; private static final String reggieMintUserId = "reggieMint"; + /* + * These properties belong to the Person type and are stored as extended properties in an actor profile. + */ + private static final String titlePropertyName = "title"; + private static final String initialsPropertyName = "initials"; + private static final String givenNamesPropertyName = "givenNames"; + private static final String surnamePropertyName = "surname"; + private static final String fullNamePropertyName = "fullName"; + private static final String pronounsPropertyName = "pronouns"; + private static final String jobTitlePropertyName = "jobTitle"; + private static final String employeeNumberPropertyName = "employeeNumber"; + private static final String employeeTypePropertyName = "employeeType"; + private static final String preferredLanguagePropertyName = "preferredLanguage"; + private static final String isPublicPropertyName = "isPublic"; /* - * These are the names of the properties that are not represented in the open metadata types, - * and so they are stored as additional properties. + * This is the name of a properties that is not represented in the open metadata types, and so it is stored as additional properties. */ - private static final String workLocationPropertyName = "WorkLocation"; - private static final String contactTypePropertyName = "ContactType"; + private static final String workLocationPropertyName = "workLocation"; private final String serverName; private final String serverURLRoot; @@ -93,13 +110,13 @@ public GovernanceLeadershipSample(String serverName, String serverURLRoot, Stri * @throws PropertyServerException the property server is not available. * @throws UserNotAuthorizedException the user id is not authorized to access the personal profile. */ - private void printPersonalProfile(PersonalProfileManagement client, - String clientUserId, - String guid) throws InvalidParameterException, - PropertyServerException, - UserNotAuthorizedException + private void printPersonalProfile(OrganizationManagement client, + String clientUserId, + String guid) throws InvalidParameterException, + PropertyServerException, + UserNotAuthorizedException { - PersonalProfileUniverse profile = client.getPersonalProfileByGUID(clientUserId, guid); + ActorProfileElement profile = client.getActorProfileByGUID(clientUserId, guid); System.out.println("----------------------------"); System.out.println("Profile: " + guid); @@ -143,18 +160,21 @@ else if (userIdentities.size() == 1) System.out.println(); } - System.out.println(" Employee Id: " + profile.getProfileProperties().getQualifiedName()); - System.out.println(" Full Name: " + profile.getProfileProperties().getFullName()); + Map<String, Object> extendedProperties = profile.getProfileProperties().getExtendedProperties(); + + System.out.println(" Employee Id: " + extendedProperties.get(employeeNumberPropertyName)); + System.out.println(" Full Name: " + extendedProperties.get(fullNamePropertyName)); System.out.println(" Known Name: " + profile.getProfileProperties().getKnownName()); - System.out.println(" Job Title: " + profile.getProfileProperties().getJobTitle()); - System.out.println(" Job Description: " + profile.getProfileProperties().getJobTitle()); + System.out.println(" Job Title: " + extendedProperties.get(jobTitlePropertyName)); + System.out.println(" Job Description: " + profile.getProfileProperties().getDescription()); if (profile.getProfileProperties().getAdditionalProperties() != null) { System.out.println(" Work Location: " + profile.getProfileProperties().getAdditionalProperties().get(workLocationPropertyName)); - System.out.println(" Contact Type: " + profile.getProfileProperties().getAdditionalProperties().get(contactTypePropertyName)); } + System.out.println(" Employee Type: " + extendedProperties.get(employeeTypePropertyName)); + System.out.println("----------------------------"); } @@ -276,51 +296,176 @@ private void printGovernanceAppointees(List<GovernanceAppointee> appointees) } + /** + * Create a profile for a person linked to their user identifier. + * + * @param orgClient client for working with profiles + * @param uidClient client for working with uer identities + * @param clientUserId userId for calling the server + * @param actorUserId userId for the profile + * @param actorEmployeeNo unique employee identifier + * @param pronouns pronouns to use when addressing the individual + * @param title formal courtesy title + * @param initials initials of the given name + * @param givenNames given names + * @param surname family name + * @param fullName full legal name for travel docs etc + * @param knownName name the individual is known as + * @param jobTitle job title + * @param jobDescription short description of what they do + * @param workLocation where they work + * @return unique identifier of the profile + * @throws InvalidParameterException one of the parameters is invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + private String createPersonalProfile(OrganizationManagement orgClient, + UserIdentityManagement uidClient, + String clientUserId, + String actorUserId, + String actorEmployeeNo, + String pronouns, + String title, + String initials, + String givenNames, + String surname, + String fullName, + String knownName, + String jobTitle, + String jobDescription, + String workLocation) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + final String typeName = "Person"; + + ActorProfileProperties actorProfileProperties = new ActorProfileProperties(); + + actorProfileProperties.setTypeName(typeName); + actorProfileProperties.setQualifiedName(typeName + ":" + actorEmployeeNo); + actorProfileProperties.setKnownName(knownName); + actorProfileProperties.setDescription(jobDescription); + + Map<String, String> additionalProperties = new HashMap<>(); + + additionalProperties.put(workLocationPropertyName, workLocation); + actorProfileProperties.setAdditionalProperties(additionalProperties); + + Map<String, Object> extendedProperties = new HashMap<>(); + + extendedProperties.put(titlePropertyName, title); + extendedProperties.put(initialsPropertyName, initials); + extendedProperties.put(givenNamesPropertyName, givenNames); + extendedProperties.put(surnamePropertyName, surname); + extendedProperties.put(fullNamePropertyName, fullName); + extendedProperties.put(pronounsPropertyName, pronouns); + extendedProperties.put(jobTitlePropertyName, jobTitle); + extendedProperties.put(employeeNumberPropertyName, actorEmployeeNo); + extendedProperties.put(employeeTypePropertyName, "Employee"); + extendedProperties.put(preferredLanguagePropertyName, "English"); + extendedProperties.put(isPublicPropertyName, true); + + actorProfileProperties.setExtendedProperties(extendedProperties); + + String profileGUID = orgClient.createActorProfile(clientUserId, null, null, actorProfileProperties, null); + + /* + * Create a userId for the profile. + */ + UserIdentityProperties userIdentityProperties = new UserIdentityProperties(); + + userIdentityProperties.setQualifiedName("UserIdentity:" + actorUserId); + userIdentityProperties.setUserId(actorUserId); + + /* + * This method anchors the new user identity to the profile so that when the profile is deleted, the user identity is too. + * If you want the user identity to be independent of the profile, use createUserIdentity() followed by addIdentityToProfile(). + */ + uidClient.createUserIdentityForProfile(clientUserId, null, null, profileGUID, userIdentityProperties); + + return profileGUID; + } + + + /** + * Delete the metadata element for an individual's user identifier. + * + * @param uidClient client to work with user identities + * @param clientUserId user id to call the server + * @param actorUserId user id of the individual + * @throws InvalidParameterException one of the parameters is invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ + private void deleteUserIdentity(UserIdentityManagement uidClient, + String clientUserId, + String actorUserId) throws InvalidParameterException, + UserNotAuthorizedException, + PropertyServerException + { + List<UserIdentityElement> userIdentityElements = uidClient.getUserIdentitiesByName(clientUserId, actorUserId, 0, 0); + + for (UserIdentityElement userIdentity : userIdentityElements) + { + uidClient.deleteUserIdentity(clientUserId, null, null, userIdentity.getElementHeader().getGUID()); + } + } + + + /** + * This method runs the sample. + * + * @throws InvalidParameterException one of the parameters is invalid. + * @throws PropertyServerException there is a problem retrieving information from the property server(s). + * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. + */ public void run() throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { - PersonalProfileManagement ppmClient = new PersonalProfileManagement(serverName, serverURLRoot); - GovernanceRoleManager gplClient = new GovernanceRoleManager(serverName, serverURLRoot); + OrganizationManagement orgClient = new OrganizationManagement(serverName, serverURLRoot); + UserIdentityManagement uidClient = new UserIdentityManagement(serverName, serverURLRoot); + GovernanceRoleManager gplClient = new GovernanceRoleManager(serverName, serverURLRoot); GovernanceRoleProperties governanceRoleProperties; System.out.println("Creating profiles for Jules and Ivor"); - Map<String, String> julesAdditionalProperties = new HashMap<>(); - julesAdditionalProperties.put(workLocationPropertyName, "2"); - julesAdditionalProperties.put(contactTypePropertyName, "Employee"); - - String julesKeeperProfileGUID = ppmClient.createPersonalProfile(clientUserId, - null, - null, - julesKeeperUserId, - julesKeeperEmpNo, - "Julian Keeper", - "Jules Keeper", - "Chief Data and Privacy Role", - "Ensuring CocoP makes the best use of data.", - julesAdditionalProperties); - - this.printPersonalProfile(ppmClient, clientUserId, julesKeeperProfileGUID); - - - Map<String, String> ivorAdditionalProperties = new HashMap<>(); - ivorAdditionalProperties.put(workLocationPropertyName, "1"); - ivorAdditionalProperties.put(contactTypePropertyName, "Employee"); - - String ivorPadlockProfileGUID = ppmClient.createPersonalProfile(clientUserId, - null, - null, - ivorPadlockUserId, - ivorPadlockEmpNo, - null, /* optional property */ - "Ivor Padlock", - "Security Executive", - "Manages security for Coco Pharmaceuticals.", - ivorAdditionalProperties); - - this.printPersonalProfile(ppmClient, clientUserId, ivorPadlockProfileGUID); + String julesKeeperProfileGUID = this.createPersonalProfile(orgClient, + uidClient, + clientUserId, + julesKeeperUserId, + julesKeeperEmpNo, + "He/him/his", + "Mr", + "J", + "Julian", + "Keeper", + "Mr Julian Keeper", + "Jules Keeper", + "Chief Data and Privacy Role", + "Ensuring CocoP makes the best use of data.", + "2"); + + this.printPersonalProfile(orgClient, clientUserId, julesKeeperProfileGUID); + + String ivorPadlockProfileGUID = this.createPersonalProfile(orgClient, + uidClient, + clientUserId, + ivorPadlockUserId, + ivorPadlockEmpNo, + "He/him/his", + "Mr", + "I", + "Ivor", + "Padlock", + "Mr Ivor Padlock", + "Ivor Padlock", + "Security Executive", + "Manages security for Coco Pharmaceuticals.", + "1"); + + this.printPersonalProfile(orgClient, clientUserId, ivorPadlockProfileGUID); System.out.println("Creating CDO, CPO and CSO governance officers"); @@ -367,9 +512,9 @@ public void run() throws InvalidParameterException, System.out.println("Appointing CDO, CPO and CSO governance officers"); gplClient.appointGovernanceRole(clientUserId, - cdoGUID, - julesKeeperProfileGUID, - null); + cdoGUID, + julesKeeperProfileGUID, + null); this.printGovernanceRole(gplClient, clientUserId, cdoGUID); @@ -381,30 +526,31 @@ public void run() throws InvalidParameterException, this.printGovernanceRole(gplClient, clientUserId, cpoGUID); gplClient.appointGovernanceRole(clientUserId, - csoGUID, - ivorPadlockProfileGUID, - null); + csoGUID, + ivorPadlockProfileGUID, + null); this.printGovernanceRole(gplClient, clientUserId, csoGUID); System.out.println("Changing CPO to Faith"); - Map<String, String> faithAdditionalProperties = new HashMap<>(); - faithAdditionalProperties.put(workLocationPropertyName, "1"); - faithAdditionalProperties.put(contactTypePropertyName, "Employee"); - - String faithBrokerProfileGUID = ppmClient.createPersonalProfile(clientUserId, - null, - null, - faithBrokerUserId, - faithBrokerEmpNo, - "Faith Charity Broker", - "Faith Broker", - "Human Resources Director", - "Providing support to Coco Pharmaceutical employees.", - faithAdditionalProperties); - - this.printPersonalProfile(ppmClient, clientUserId, faithBrokerProfileGUID); + String faithBrokerProfileGUID = this.createPersonalProfile(orgClient, + uidClient, + clientUserId, + faithBrokerUserId, + faithBrokerEmpNo, + "She/her/hers", + "Mrs", + "F C J", + "Faith Charity Jean", + "Broker", + "Mrs Faith Charity Jean Broker", + "Faith Broker", + "Human Resources Director", + "Providing support to Coco Pharmaceutical employees.", + "1"); + + this.printPersonalProfile(orgClient, clientUserId, faithBrokerProfileGUID); long handoverTime = new Date().getTime(); Date handoverDate = new Date(handoverTime + 100); @@ -467,40 +613,45 @@ public void run() throws InvalidParameterException, /* * Update Jules' job title */ - ppmClient.updatePersonalProfile(clientUserId, - null, - null, - julesKeeperProfileGUID, - julesKeeperEmpNo, - "Julian Keeper", - "Jules Keeper", - "Chief Data Role", - "Ensuring CocoP makes the best use of data.", - null, - julesAdditionalProperties); + ActorProfileProperties updateProperties = new ActorProfileProperties(); + + Map<String, Object> updateExtendedProperties = new HashMap<>(); - this.printPersonalProfile(ppmClient, clientUserId, julesKeeperProfileGUID); + updateExtendedProperties.put(jobTitlePropertyName, "Chief Data Role"); + updateProperties.setExtendedProperties(updateExtendedProperties); + + orgClient.updateActorProfile(clientUserId, + null, + null, + julesKeeperProfileGUID, + true, + updateProperties, + null); + + this.printPersonalProfile(orgClient, clientUserId, julesKeeperProfileGUID); /* * Appointing Erin Overview as the CDO for IT */ System.out.println("Creating profile for Erin"); - Map<String, String> erinAdditionalProperties = new HashMap<>(); - erinAdditionalProperties.put(workLocationPropertyName, "2"); - erinAdditionalProperties.put(contactTypePropertyName, "Employee"); - String erinOverviewProfileGUID = ppmClient.createPersonalProfile(clientUserId, - null, - null, - erinOverviewUserId, - erinOverviewEmpNo, - null, /* optional property */ - "Erin Overview", - "Information Architect", - "Manages all information architecture and standards for Coco Pharmaceuticals IT systems.", - erinAdditionalProperties); - - this.printPersonalProfile(ppmClient, clientUserId, erinOverviewProfileGUID); + String erinOverviewProfileGUID = this.createPersonalProfile(orgClient, + uidClient, + clientUserId, + erinOverviewUserId, + erinOverviewEmpNo, + "She/her/hers", + "Dr", + "E", + "Erin", + "Overview", + "Dr Erin Overview", + "Erin Overview", + "Information Architect", + "Manages all information architecture and standards for Coco Pharmaceuticals IT systems.", + "2"); + + this.printPersonalProfile(orgClient, clientUserId, erinOverviewProfileGUID); System.out.println("Creating CDO for IT governance officer"); @@ -513,16 +664,16 @@ public void run() throws InvalidParameterException, governanceRoleProperties.setScope("IT Systems"); governanceRoleProperties.setTitle("Chief Data Role (CDO) for IT"); - String cdoForITGUID = gplClient.createGovernanceRole(clientUserId, governanceRoleProperties); + String cdoForInfoTechGUID = gplClient.createGovernanceRole(clientUserId, governanceRoleProperties); System.out.println("Appointing Erin as CDO for IT"); gplClient.appointGovernanceRole(clientUserId, - cdoForITGUID, + cdoForInfoTechGUID, erinOverviewProfileGUID, new Date()); - this.printGovernanceRole(gplClient, clientUserId, cdoForITGUID); + this.printGovernanceRole(gplClient, clientUserId, cdoForInfoTechGUID); /* @@ -530,21 +681,23 @@ public void run() throws InvalidParameterException, */ System.out.println("Creating profile for Gary"); - Map<String, String> garyAdditionalProperties = new HashMap<>(); - garyAdditionalProperties.put(workLocationPropertyName, "1"); - garyAdditionalProperties.put(contactTypePropertyName, "Employee"); - String garyGeekeProfileGUID = ppmClient.createPersonalProfile(clientUserId, - null, - null, - garyGeekeUserId, - garyGeekeEmpNo, - null, /* optional property */ - "Gary Geeke", - "Infrastructure Architect", - "Manages all the IT infrastructure for Coco Pharmaceuticals.", - garyAdditionalProperties); - - this.printPersonalProfile(ppmClient, clientUserId, garyGeekeProfileGUID); + String garyGeekeProfileGUID = this.createPersonalProfile(orgClient, + uidClient, + clientUserId, + garyGeekeUserId, + garyGeekeEmpNo, + "He/him/his", + "Mr", + "G", + "Gary", + "Geeke", + "Mr Gary Geeke", + "Gary Geeke", + "Infrastructure Architect", + "Manages all the IT infrastructure for Coco Pharmaceuticals.", + "1"); + + this.printPersonalProfile(orgClient, clientUserId, garyGeekeProfileGUID); System.out.println("Creating IT governance officer"); governanceRoleProperties = new GovernanceRoleProperties(); @@ -572,21 +725,23 @@ public void run() throws InvalidParameterException, */ System.out.println("Creating profile for Polly"); - Map<String, String> pollyAdditionalProperties = new HashMap<>(); - pollyAdditionalProperties.put(workLocationPropertyName, "1"); - pollyAdditionalProperties.put(contactTypePropertyName, "Employee"); - String pollyTaskerProfileGUID = ppmClient.createPersonalProfile(clientUserId, - null, - null, - pollyTaskerUserId, - pollyTaskerEmpNo, - null, /* optional property */ - "Polly Tasker", - "Lead Project Manager for IT", - "Manages IT projects for Coco Pharmaceuticals.", - pollyAdditionalProperties); - - this.printPersonalProfile(ppmClient, clientUserId, pollyTaskerProfileGUID); + String pollyTaskerProfileGUID = this.createPersonalProfile(orgClient, + uidClient, + clientUserId, + pollyTaskerUserId, + pollyTaskerEmpNo, + "She/her/hers", + "Ms", + "P", + "Polly", + "Tasker", + "Ms Polly Tasker", + "Polly Tasker", + "Lead Project Manager for IT", + "Manages IT projects for Coco Pharmaceuticals.", + "1"); + + this.printPersonalProfile(orgClient, clientUserId, pollyTaskerProfileGUID); System.out.println("Creating SDLC governance officer"); governanceRoleProperties = new GovernanceRoleProperties(); @@ -602,9 +757,9 @@ public void run() throws InvalidParameterException, System.out.println("Appointing Polly as gov officer for Software Development"); gplClient.appointGovernanceRole(clientUserId, - projLeadForITGUID, - pollyTaskerProfileGUID, - null); + projLeadForITGUID, + pollyTaskerProfileGUID, + null); this.printGovernanceRole(gplClient, clientUserId, projLeadForITGUID); @@ -613,21 +768,23 @@ public void run() throws InvalidParameterException, */ System.out.println("Creating profile for Reggie"); - Map<String, String> reggieAdditionalProperties = new HashMap<>(); - reggieAdditionalProperties.put(workLocationPropertyName, "1"); - reggieAdditionalProperties.put(contactTypePropertyName, "Employee"); - String reggieMintProfileGUID = ppmClient.createPersonalProfile(clientUserId, - null, - null, - reggieMintUserId, - reggieMintEmpNo, - "Reginald S P Mint", /* optional property */ - "Reggie Mint", - "Chief Finance Role", - "Manages finance for Coco Pharmaceuticals.", - reggieAdditionalProperties); - - this.printPersonalProfile(ppmClient, clientUserId, pollyTaskerProfileGUID); + String reggieMintProfileGUID = this.createPersonalProfile(orgClient, + uidClient, + clientUserId, + reggieMintUserId, + reggieMintEmpNo, + "He/him/his", + "Mr", + "R S P", + "Reginald Sidney", + "Mint", + "Mr Reginald S Mint", + "Reggie Mint", + "Chief Finance Role", + "Manages finance for Coco Pharmaceuticals.", + "1"); + + this.printPersonalProfile(orgClient, clientUserId, pollyTaskerProfileGUID); System.out.println("Creating corporate governance officer"); governanceRoleProperties = new GovernanceRoleProperties(); @@ -643,9 +800,9 @@ public void run() throws InvalidParameterException, System.out.println("Appointing Reggie as corporate gov officer"); gplClient.appointGovernanceRole(clientUserId, - corpGUID, - reggieMintProfileGUID, - null); + corpGUID, + reggieMintProfileGUID, + null); this.printGovernanceRole(gplClient, clientUserId, corpGUID); @@ -658,9 +815,9 @@ public void run() throws InvalidParameterException, governanceRoleProperties.setTitle("Chief Information Security Role (CISO)"); gplClient.updateGovernanceRole(clientUserId, - csoGUID, - true, - governanceRoleProperties); + csoGUID, + true, + governanceRoleProperties); governanceRoles = gplClient.getGovernanceRolesByDomainId(clientUserId, 0, 0, 0); @@ -674,30 +831,54 @@ public void run() throws InvalidParameterException, printGovernanceRoleAppointee(governanceRole); } + /* + * Check that the userIdentities are created. + */ + List<UserIdentityElement> activeUserIdentities = uidClient.findUserIdentities(clientUserId, ".*", 0, 0); + + if (activeUserIdentities == null) + { + System.out.println("No user identities have been created"); + System.exit(-1); + } + else if (activeUserIdentities.size() != 7) + { + System.out.println(activeUserIdentities.size() + " number of active user identities rather than 7: " + activeUserIdentities); + System.exit(-1); + } + System.out.println("Deleting all profiles and governance officers"); /* * Delete all the governance officers */ gplClient.deleteGovernanceRole(clientUserId, cdoGUID); - gplClient.deleteGovernanceRole(clientUserId, cdoForITGUID); + gplClient.deleteGovernanceRole(clientUserId, cdoForInfoTechGUID); gplClient.deleteGovernanceRole(clientUserId, cpoGUID); gplClient.deleteGovernanceRole(clientUserId, csoGUID); gplClient.deleteGovernanceRole(clientUserId, corpGUID); gplClient.deleteGovernanceRole(clientUserId, projLeadForITGUID); gplClient.deleteGovernanceRole(clientUserId, infraGovForITGUID); + this.deleteUserIdentity(uidClient, clientUserId, julesKeeperUserId); + this.deleteUserIdentity(uidClient, clientUserId, ivorPadlockUserId); + this.deleteUserIdentity(uidClient, clientUserId, faithBrokerUserId); + this.deleteUserIdentity(uidClient, clientUserId, erinOverviewUserId); + this.deleteUserIdentity(uidClient, clientUserId, garyGeekeUserId); + this.deleteUserIdentity(uidClient, clientUserId, reggieMintUserId); + this.deleteUserIdentity(uidClient, clientUserId, pollyTaskerUserId); /* * Delete all the personal profiles */ - ppmClient.deletePersonalProfile(clientUserId, null, null, julesKeeperProfileGUID, julesKeeperEmpNo); - ppmClient.deletePersonalProfile(clientUserId, null, null, ivorPadlockProfileGUID, ivorPadlockEmpNo); - ppmClient.deletePersonalProfile(clientUserId, null, null, faithBrokerProfileGUID, faithBrokerEmpNo); - ppmClient.deletePersonalProfile(clientUserId, null, null, erinOverviewProfileGUID, erinOverviewEmpNo); - ppmClient.deletePersonalProfile(clientUserId, null, null, garyGeekeProfileGUID, garyGeekeEmpNo); - ppmClient.deletePersonalProfile(clientUserId, null, null, reggieMintProfileGUID, reggieMintEmpNo); - ppmClient.deletePersonalProfile(clientUserId, null, null, pollyTaskerProfileGUID, pollyTaskerEmpNo); + orgClient.deleteActorProfile(clientUserId, null, null, julesKeeperProfileGUID); + orgClient.deleteActorProfile(clientUserId, null, null, ivorPadlockProfileGUID); + orgClient.deleteActorProfile(clientUserId, null, null, faithBrokerProfileGUID); + orgClient.deleteActorProfile(clientUserId, null, null, erinOverviewProfileGUID); + orgClient.deleteActorProfile(clientUserId, null, null, garyGeekeProfileGUID); + orgClient.deleteActorProfile(clientUserId, null, null, reggieMintProfileGUID); + orgClient.deleteActorProfile(clientUserId, null, null, pollyTaskerProfileGUID); + /* * Sleep so that the deletes propagate throughout the cohort. @@ -731,6 +912,18 @@ public void run() throws InvalidParameterException, { System.out.println("All governance officers gone"); } + + /* + * Check that the userIdentities are deleted. The user identities are anchored to the profiles, so they should be deleted with their + * corresponding profile. + */ + List<UserIdentityElement> abandonedUserIdentities = uidClient.findUserIdentities(clientUserId, ".*", 0, 0); + + if (abandonedUserIdentities != null) + { + System.out.println(abandonedUserIdentities.size() + " abandoned user identities: " + abandonedUserIdentities); + System.exit(-1); + } } @@ -774,7 +967,7 @@ public static void main(String[] args) sample.run(); } - catch (Throwable error) + catch (Exception error) { System.out.println("Exception: " + error.getClass().getName() + " with message " + error.getMessage()); System.exit(-1); diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-zone-create-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/zonecreate/CreateGovernanceZoneSample.java b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-zone-create-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/zonecreate/CreateGovernanceZoneSample.java index 8ee13004af8..6921f0fca86 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-zone-create-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/zonecreate/CreateGovernanceZoneSample.java +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/governance-program-client-samples/governance-zone-create-sample/src/main/java/org/odpi/openmetadata/accessservices/governanceprogram/samples/zonecreate/CreateGovernanceZoneSample.java @@ -132,6 +132,7 @@ public void run() catch (Exception error) { System.out.println("There was an exception when calling the GovernanceZoneManager client. Error message is: " + error.getMessage()); + System.exit(-1); } } From 25db6630741fdd16344605d6cb9140a395634f53 Mon Sep 17 00:00:00 2001 From: Mandy Chessell <mandy.e.chessell@gmail.com> Date: Thu, 8 Sep 2022 18:30:57 +0100 Subject: [PATCH 3/9] Add ocf-metadata-api dependency Signed-off-by: Mandy Chessell <mandy.e.chessell@gmail.com> --- .../discovery-engine/discovery-engine-client/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/build.gradle b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/build.gradle index 2741df6df66..9119c97b64d 100644 --- a/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/build.gradle +++ b/open-metadata-implementation/access-services/discovery-engine/discovery-engine-client/build.gradle @@ -11,6 +11,7 @@ dependencies { implementation project(':open-metadata-implementation:access-services:discovery-engine:discovery-engine-api') implementation project(':open-metadata-implementation:common-services:ffdc-services') implementation project(':open-metadata-implementation:repository-services:repository-services-apis') + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation 'org.springframework:spring-core' compileOnly 'com.fasterxml.jackson.core:jackson-annotations' From f19ff97756e33f6d808a00e53d2e4efa290fa3ec Mon Sep 17 00:00:00 2001 From: Mandy Chessell <mandy.e.chessell@gmail.com> Date: Thu, 8 Sep 2022 18:49:52 +0100 Subject: [PATCH 4/9] Add aditional dependencies Signed-off-by: Mandy Chessell <mandy.e.chessell@gmail.com> --- .../asset-analysis/asset-analysis-api/build.gradle | 2 ++ .../asset-analysis/asset-analysis-client/build.gradle | 1 + .../asset-analysis/asset-analysis-server/build.gradle | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-api/build.gradle b/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-api/build.gradle index 92a3248d6ea..cd90b007e5f 100644 --- a/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-api/build.gradle +++ b/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-api/build.gradle @@ -9,6 +9,8 @@ dependencies { implementation project(':open-metadata-implementation:frameworks:open-connector-framework') implementation project(':open-metadata-implementation:common-services:ffdc-services') implementation project(':open-metadata-implementation:repository-services:repository-services-apis') + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') testImplementation project(':open-metadata-test:open-metadata-ut') testImplementation 'org.testng:testng' implementation 'org.slf4j:slf4j-api' diff --git a/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-client/build.gradle b/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-client/build.gradle index b4dfbdd3a6e..6bc34667083 100644 --- a/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-client/build.gradle +++ b/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-client/build.gradle @@ -8,6 +8,7 @@ dependencies { implementation project(':open-metadata-implementation:frameworks:audit-log-framework') implementation project(':open-metadata-implementation:frameworks:open-connector-framework') implementation project(':open-metadata-implementation:frameworks:open-discovery-framework') + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-implementation:common-services:ffdc-services') implementation project(':open-metadata-implementation:engine-services:asset-analysis:asset-analysis-api') diff --git a/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-server/build.gradle b/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-server/build.gradle index b0e1acd3d3e..5cd2c2d4263 100644 --- a/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-server/build.gradle +++ b/open-metadata-implementation/engine-services/asset-analysis/asset-analysis-server/build.gradle @@ -10,6 +10,7 @@ dependencies { implementation project(':open-metadata-implementation:frameworks:open-discovery-framework') implementation project(':open-metadata-implementation:frameworks:governance-action-framework') implementation project(':open-metadata-implementation:common-services:ffdc-services') + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-implementation:access-services:discovery-engine:discovery-engine-api') implementation project(':open-metadata-implementation:access-services:discovery-engine:discovery-engine-client') @@ -20,7 +21,6 @@ dependencies { implementation 'org.slf4j:slf4j-api' implementation project(':open-metadata-implementation:engine-services:asset-analysis:asset-analysis-api') implementation project(':open-metadata-implementation:common-services:multi-tenant') - implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') compileOnly 'com.fasterxml.jackson.core:jackson-annotations' } From cf344fe9beb787d72e1e4a10d3b1dd75ba3bee28 Mon Sep 17 00:00:00 2001 From: Mandy Chessell <mandy.e.chessell@gmail.com> Date: Thu, 8 Sep 2022 21:06:35 +0100 Subject: [PATCH 5/9] Add ocf-metadata-api dependencies Signed-off-by: Mandy Chessell <mandy.e.chessell@gmail.com> --- .../asset-create-avro-sample/build.gradle | 1 + .../asset-create-csv-sample/build.gradle | 1 + .../asset-reader-avro-sample/build.gradle | 1 + .../asset-reader-csv-sample/build.gradle | 1 + 4 files changed, 4 insertions(+) diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle index 6b0df4635f8..3888a9b46a8 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle @@ -12,6 +12,7 @@ dependencies { implementation project(':open-metadata-implementation:access-services:asset-owner:asset-owner-client') implementation project(':open-metadata-implementation:access-services:asset-owner:asset-owner-api') runtimeOnly 'ch.qos.logback:logback-classic' + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-implementation:frameworks:open-connector-framework') implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper') diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle index f0b7d738e43..28b240b5d4a 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle @@ -13,6 +13,7 @@ dependencies { implementation project(':open-metadata-implementation:access-services:asset-owner:asset-owner-api') implementation project(':open-metadata-implementation:frameworks:open-connector-framework') runtimeOnly 'ch.qos.logback:logback-classic' + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper') diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle index dbb28b5dca4..13146ed9bb6 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle @@ -15,6 +15,7 @@ dependencies { implementation project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-client') implementation project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-api') runtimeOnly 'ch.qos.logback:logback-classic' + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') compileOnly 'com.fasterxml.jackson.core:jackson-annotations' implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper') diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle index eb0eba228ea..cebb8a2d1f2 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle @@ -14,6 +14,7 @@ dependencies { implementation project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-client') implementation project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-api') runtimeOnly 'ch.qos.logback:logback-classic' + implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:basic-file-connector') compileOnly 'com.fasterxml.jackson.core:jackson-annotations' From dd69b23009bf7df0b2bc694f2dba21a08773a384 Mon Sep 17 00:00:00 2001 From: Mandy Chessell <mandy.e.chessell@gmail.com> Date: Fri, 9 Sep 2022 10:19:33 +0100 Subject: [PATCH 6/9] Fix up dependencies Signed-off-by: Mandy Chessell <mandy.e.chessell@gmail.com> --- .../open-metadata-labs/README.md | 21 ------------------- .../asset-create-avro-sample/build.gradle | 3 +-- .../asset-create-csv-sample/build.gradle | 2 +- .../asset-reader-avro-sample/build.gradle | 2 +- .../asset-reader-csv-sample/build.gradle | 2 +- .../asset-consumer-fvt/build.gradle | 1 + .../asset-owner-fvt/build.gradle | 1 + 7 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 open-metadata-resources/open-metadata-labs/README.md diff --git a/open-metadata-resources/open-metadata-labs/README.md b/open-metadata-resources/open-metadata-labs/README.md deleted file mode 100644 index 9d5cbcbaeb9..00000000000 --- a/open-metadata-resources/open-metadata-labs/README.md +++ /dev/null @@ -1,21 +0,0 @@ -<!-- SPDX-License-Identifier: CC-BY-4.0 --> -<!-- Copyright Contributors to the ODPi Egeria project. --> - -# Open Metadata Labs - -The open metadata labs contain an interactive environment that allow you to -experiment with different capabilities of ODPi Egeria. As such we often refer to them as -**Hands-on Labs**. - -* [Documentation on setup and running](https://egeria-project.org/education/open-metadata-labs/overview/) - -All source for the labs has now moved to https://github.com/odpi/egeria-jupyter-notebooks - ----- -* Return to [open-metadata-resources](..) -* Return to [Site Map](../../Content-Organization.md) -* Return to [Home Page](https://egeria-project.org/) - ----- -License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), -Copyright Contributors to the ODPi Egeria project. diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle index 3888a9b46a8..f3f2f5a5087 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle @@ -12,11 +12,10 @@ dependencies { implementation project(':open-metadata-implementation:access-services:asset-owner:asset-owner-client') implementation project(':open-metadata-implementation:access-services:asset-owner:asset-owner-api') runtimeOnly 'ch.qos.logback:logback-classic' - implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-implementation:frameworks:open-connector-framework') implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper') - } description = 'Asset create avro sample' diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle index 28b240b5d4a..6d987cd4651 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle @@ -13,7 +13,7 @@ dependencies { implementation project(':open-metadata-implementation:access-services:asset-owner:asset-owner-api') implementation project(':open-metadata-implementation:frameworks:open-connector-framework') runtimeOnly 'ch.qos.logback:logback-classic' - implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper') diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle index 13146ed9bb6..b08d5d56ee9 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle @@ -15,7 +15,7 @@ dependencies { implementation project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-client') implementation project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-api') runtimeOnly 'ch.qos.logback:logback-classic' - implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') compileOnly 'com.fasterxml.jackson.core:jackson-annotations' implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper') diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle index cebb8a2d1f2..522e27f5fc0 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle @@ -14,7 +14,7 @@ dependencies { implementation project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-client') implementation project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-api') runtimeOnly 'ch.qos.logback:logback-classic' - implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:basic-file-connector') compileOnly 'com.fasterxml.jackson.core:jackson-annotations' diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-consumer-fvt/build.gradle b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-consumer-fvt/build.gradle index b6ff00471f0..776d013ab84 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-consumer-fvt/build.gradle +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-consumer-fvt/build.gradle @@ -24,6 +24,7 @@ dependencies { implementation project(':open-metadata-implementation:common-services:ffdc-services') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-test:open-metadata-fvt:fvt-utilities') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') testImplementation project(':open-metadata-distribution:open-metadata-assemblies') testImplementation 'org.junit.jupiter:junit-jupiter-api' testImplementation 'org.junit.jupiter:junit-jupiter-engine' diff --git a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/build.gradle b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/build.gradle index d6cb1f01f5f..71fa1d9002a 100644 --- a/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/build.gradle +++ b/open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/build.gradle @@ -21,6 +21,7 @@ dependencies { implementation project(':open-metadata-implementation:common-services:ffdc-services') implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-test:open-metadata-fvt:fvt-utilities') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') testImplementation project(':open-metadata-distribution:open-metadata-assemblies') testImplementation 'org.junit.jupiter:junit-jupiter-api' testImplementation 'org.junit.jupiter:junit-jupiter-engine' From d65dfce99d6e5fb0ec042a2742415de3c5675d9e Mon Sep 17 00:00:00 2001 From: Mandy Chessell <mandy.e.chessell@gmail.com> Date: Fri, 9 Sep 2022 10:57:22 +0100 Subject: [PATCH 7/9] Add Override Signed-off-by: Mandy Chessell <mandy.e.chessell@gmail.com> --- .../accessservices/assetowner/client/AssetOwner.java | 1 + 1 file changed, 1 insertion(+) diff --git a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java index 002d2afd6c6..82912c3c7db 100644 --- a/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java +++ b/open-metadata-implementation/access-services/asset-owner/asset-owner-client/src/main/java/org/odpi/openmetadata/accessservices/assetowner/client/AssetOwner.java @@ -167,6 +167,7 @@ public AssetOwner(String serverName, * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. */ + @Override public AssetUniverse getAssetProperties(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, From 58c509ba2aed3276e953e53dc972b57f625cc85f Mon Sep 17 00:00:00 2001 From: Mandy Chessell <mandy.e.chessell@gmail.com> Date: Fri, 9 Sep 2022 10:58:46 +0100 Subject: [PATCH 8/9] Add Override Signed-off-by: Mandy Chessell <mandy.e.chessell@gmail.com> --- .../accessservices/assetconsumer/client/AssetConsumer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java index 0068280fd80..c895684378b 100644 --- a/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java +++ b/open-metadata-implementation/access-services/asset-consumer/asset-consumer-client/src/main/java/org/odpi/openmetadata/accessservices/assetconsumer/client/AssetConsumer.java @@ -400,7 +400,6 @@ public List<String> getAssetsByToken(String userId, } - /** * Returns a comprehensive collection of properties about the requested asset. * @@ -413,6 +412,7 @@ public List<String> getAssetsByToken(String userId, * @throws PropertyServerException there is a problem retrieving the asset properties from the property servers). * @throws UserNotAuthorizedException the requesting user is not authorized to issue this request. */ + @Override public AssetUniverse getAssetProperties(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, From c097782b8cd7504cb2040f5495e3cabb57875268 Mon Sep 17 00:00:00 2001 From: Mandy Chessell <mandy.e.chessell@gmail.com> Date: Fri, 9 Sep 2022 11:11:47 +0100 Subject: [PATCH 9/9] Fix up dependencies Signed-off-by: Mandy Chessell <mandy.e.chessell@gmail.com> --- .../asset-create-avro-sample/build.gradle | 6 +++--- .../asset-create-csv-sample/build.gradle | 2 +- .../asset-reader-avro-sample/build.gradle | 2 +- .../asset-reader-csv-sample/build.gradle | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle index 37340b6b9df..244472e112b 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-avro-sample/build.gradle @@ -12,9 +12,9 @@ dependencies { implementation project(':open-metadata-implementation:access-services:asset-owner:asset-owner-client') compileOnly project(':open-metadata-implementation:access-services:asset-owner:asset-owner-api') runtimeOnly 'ch.qos.logback:logback-classic' - compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') - implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') - implementation project(':open-metadata-implementation:frameworks:open-connector-framework') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') + compileOnly project(':open-metadata-implementation:frameworks:open-connector-framework') implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper') } diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle index 0904619c397..43dcd0be21f 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-create-csv-sample/build.gradle @@ -14,7 +14,7 @@ dependencies { compileOnly project(':open-metadata-implementation:frameworks:open-connector-framework') runtimeOnly 'ch.qos.logback:logback-classic' compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') - implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper') } diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle index 6de2b1b6675..7f77bbdb024 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-avro-sample/build.gradle @@ -16,7 +16,7 @@ dependencies { compileOnly project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-api') runtimeOnly 'ch.qos.logback:logback-classic' compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') - implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') compileOnly 'com.fasterxml.jackson.core:jackson-annotations' implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper') diff --git a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle index e7cd7d0cfe3..ffa1147d378 100644 --- a/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle +++ b/open-metadata-resources/open-metadata-samples/access-services-samples/asset-management-samples/asset-reader-csv-sample/build.gradle @@ -14,9 +14,9 @@ dependencies { implementation project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-client') compileOnly project(':open-metadata-implementation:access-services:asset-consumer:asset-consumer-api') runtimeOnly 'ch.qos.logback:logback-classic' - compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') - implementation project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') - implementation project(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:basic-file-connector') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-api') + compileOnly project(':open-metadata-implementation:common-services:ocf-metadata-management:ocf-metadata-client') + compileOnly project(':open-metadata-implementation:adapters:open-connectors:data-store-connectors:file-connectors:basic-file-connector') compileOnly 'com.fasterxml.jackson.core:jackson-annotations' implementation project(':open-metadata-implementation:adapters:authentication-plugins:http-helper')