Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable framework serivces in Asset Manager OMAS #7308

Merged
merged 4 commits into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ dependencies {
implementation project(':open-metadata-implementation:common-services:ffdc-services')
implementation project(':open-metadata-implementation:framework-services:ocf-metadata-management:ocf-metadata-api')
implementation project(':open-metadata-implementation:framework-services:ocf-metadata-management:ocf-metadata-client')
implementation project(':open-metadata-implementation:framework-services:gaf-metadata-management:gaf-metadata-api')
implementation project(':open-metadata-implementation:framework-services:gaf-metadata-management:gaf-metadata-client')
implementation project(':open-metadata-implementation:access-services:asset-manager:asset-manager-api')
implementation project(':open-metadata-implementation:frameworks:open-connector-framework')
implementation project(':open-metadata-implementation:frameworks:audit-log-framework')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
<artifactId>ocf-metadata-client</artifactId>
</dependency>

<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>gaf-metadata-client</artifactId>
</dependency>

<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>ffdc-services</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* SPDX-License-Identifier: Apache 2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.accessservices.assetmanager.client;

import org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase;
import org.odpi.openmetadata.frameworks.auditlog.AuditLog;
import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException;

/**
* 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 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 ConnectedAssetClient supports access to the asset properties through the connector.
*/
public class ConnectedAssetClient extends ConnectedAssetClientBase
{
private static final String serviceURLName = "asset-manager";

/**
* 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 null URL or server name
*/
public ConnectedAssetClient(String serverName,
String serverPlatformURLRoot,
AuditLog auditLog) throws InvalidParameterException
{
super(serverName, serverPlatformURLRoot, serviceURLName, 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 null URL or server name
*/
public ConnectedAssetClient(String serverName,
String serverPlatformURLRoot) throws InvalidParameterException
{
super(serverName, serverPlatformURLRoot, serviceURLName);
}


/**
* 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 null URL or server name
*/
public ConnectedAssetClient(String serverName,
String serverPlatformURLRoot,
String userId,
String password,
AuditLog auditLog) throws InvalidParameterException
{
super(serverName, serverPlatformURLRoot, serviceURLName, 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 userId caller's userId embedded in all HTTP requests
* @param password caller's userId embedded in all HTTP requests
* @throws InvalidParameterException null URL or server name
*/
public ConnectedAssetClient(String serverName,
String serverPlatformURLRoot,
String userId,
String password) throws InvalidParameterException
{
super(serverName, serverPlatformURLRoot, serviceURLName, userId, password);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/* SPDX-License-Identifier: Apache 2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.accessservices.assetmanager.client;

import org.odpi.openmetadata.commonservices.gaf.client.OpenMetadataStoreClientBase;
import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException;

/**
* OpenMetadataStoreClientBase sits in the governance context of a governance action service when it is running in the engine host OMAG server.
* It is however shared by all the governance action services running in an engine service so that we only need one connector to the topic
* listener for the watchdog governance services.
*/
public class OpenMetadataStoreClient extends OpenMetadataStoreClientBase
{
private final static String serviceURLMarker = "asset-manager";

/**
* 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 OpenMetadataStoreClient(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 password embedded in all HTTP requests
*
* @throws InvalidParameterException there is a problem creating the client-side components to issue any
* REST API calls.
*/
public OpenMetadataStoreClient(String serverName,
String serverPlatformURLRoot,
String serverUserId,
String serverPassword) throws InvalidParameterException
{
super(serviceURLMarker, serverName, serverPlatformURLRoot, serverUserId, serverPassword);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public OpenMetadataStoreClient(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 serverUserId caller's userId embedded in all HTTP requests
* @param serverPassword caller's userId embedded in all HTTP requests
* @param serverPassword caller's password embedded in all HTTP requests
*
* @throws InvalidParameterException there is a problem creating the client-side components to issue any
* REST API calls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public OpenMetadataStoreClient(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 serverUserId caller's userId embedded in all HTTP requests
* @param serverPassword caller's userId embedded in all HTTP requests
* @param serverPassword caller's password embedded in all HTTP requests
*
* @throws InvalidParameterException there is a problem creating the client-side components to issue any
* REST API calls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public GovernanceEngineClient(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 serverUserId caller's userId embedded in all HTTP requests
* @param serverPassword caller's userId embedded in all HTTP requests
* @param serverPassword caller's password embedded in all HTTP requests
*
* @throws InvalidParameterException there is a problem creating the client-side components to issue any
* REST API calls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public OpenMetadataStoreClient(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 serverUserId caller's userId embedded in all HTTP requests
* @param serverPassword caller's userId embedded in all HTTP requests
* @param serverPassword caller's password embedded in all HTTP requests
*
* @throws InvalidParameterException there is a problem creating the client-side components to issue any
* REST API calls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
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;
Expand All @@ -20,7 +19,7 @@
@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown=true)
public class DeleteRequestBody implements Serializable
public class DeleteRequestBody extends MetadataSourceRequestBody
{
private static final long serialVersionUID = 1L;

Expand All @@ -43,6 +42,8 @@ public DeleteRequestBody()
*/
public DeleteRequestBody(DeleteRequestBody template)
{
super(template);

if (template != null)
{
qualifiedName = template.getQualifiedName();
Expand Down Expand Up @@ -82,8 +83,10 @@ public String getQualifiedName()
public String toString()
{
return "DeleteRequestBody{" +
"qualifiedName='" + qualifiedName + '\'' +
'}';
"qualifiedName='" + qualifiedName + '\'' +
", externalSourceGUID='" + getExternalSourceGUID() + '\'' +
", externalSourceName='" + getExternalSourceName() + '\'' +
'}';
}


Expand All @@ -104,6 +107,10 @@ public boolean equals(Object objectToCompare)
{
return false;
}
if (! super.equals(objectToCompare))
{
return false;
}
DeleteRequestBody that = (DeleteRequestBody) objectToCompare;
return Objects.equals(getQualifiedName(), that.getQualifiedName());
}
Expand All @@ -117,6 +124,6 @@ public boolean equals(Object objectToCompare)
@Override
public int hashCode()
{
return Objects.hash(getQualifiedName());
return Objects.hash(super.hashCode(), getQualifiedName());
}
}
Loading