Class ConnectedAssetClient
- java.lang.Object
-
- org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase
-
- org.odpi.openmetadata.accessservices.governanceprogram.client.ConnectedAssetClient
-
public class ConnectedAssetClient extends ConnectedAssetClientBase
The Asset Consumer Open Metadata Access Service (OMAS) 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 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.
-
-
Field Summary
-
Fields inherited from class org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase
auditLog, invalidParameterHandler, nullRequestBody, serverName, serverPlatformURLRoot
-
-
Constructor Summary
Constructors Constructor Description ConnectedAssetClient(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.ConnectedAssetClient(String serverName, String serverPlatformURLRoot, String userId, String password)Create a new client that passes userId and password in each HTTP request.ConnectedAssetClient(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog)Create a new client that passes userId and password in each HTTP request.ConnectedAssetClient(String serverName, String serverPlatformURLRoot, GovernanceProgramRESTClient restClient, int maxPageSize, AuditLog auditLog)Create a new client that is going to be used in an OMAG Server (view service or integration service typically).ConnectedAssetClient(String serverName, String serverPlatformURLRoot, AuditLog auditLog)Create a new client with no authentication embedded in the HTTP request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAssetForConnection(String userId, String connectionGUID)Returns the unique identifier for the asset connected to the requested connection.AssetUniversegetAssetProperties(String userId, String assetGUID)Returns a comprehensive collection of properties about the requested asset.ConnectorgetConnectorByConnection(String userId, Connection connection)Returns the connector corresponding to the supplied connection.ConnectorgetConnectorByGUID(String userId, String connectionGUID)Returns the connector corresponding to the supplied connection GUID.ConnectorgetConnectorByName(String userId, String connectionName)Returns the connector corresponding to the supplied connection name.ConnectorgetConnectorForAsset(String userId, String assetGUID)Returns the connector corresponding to the supplied asset GUID.-
Methods inherited from class org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase
getAssetForConnection, getAssetProperties, getAssetSummary, getConnectionByGUID, getConnectionByName, getConnectionForAsset, getConnectorForConnection
-
-
-
-
Constructor Detail
-
ConnectedAssetClient
public ConnectedAssetClient(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversauditLog- logging destination- Throws:
InvalidParameterException- null URL or server name
-
ConnectedAssetClient
public ConnectedAssetClient(String serverName, String serverPlatformURLRoot) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST servers- Throws:
InvalidParameterException- null URL or server name
-
ConnectedAssetClient
public ConnectedAssetClient(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog) throws InvalidParameterException
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.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requestsauditLog- logging destination- Throws:
InvalidParameterException- null URL or server name
-
ConnectedAssetClient
public ConnectedAssetClient(String serverName, String serverPlatformURLRoot, String userId, String password) throws InvalidParameterException
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.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requests- Throws:
InvalidParameterException- null URL or server name
-
ConnectedAssetClient
public ConnectedAssetClient(String serverName, String serverPlatformURLRoot, GovernanceProgramRESTClient restClient, int maxPageSize, AuditLog auditLog) throws InvalidParameterException
Create a new client that is going to be used in an OMAG Server (view service or integration service typically).- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversrestClient- client that issues the REST API callsmaxPageSize- maximum number of results supported by this serverauditLog- logging destination- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Detail
-
getAssetForConnection
public String getAssetForConnection(String userId, String connectionGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Returns the unique identifier for the asset connected to the requested connection.- Parameters:
userId- the userId of the requesting user.connectionGUID- unique identifier for the connection.- Returns:
- unique identifier of asset.
- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem retrieving information from the property server.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getAssetProperties
public AssetUniverse getAssetProperties(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Returns a comprehensive collection of properties about the requested asset.- Parameters:
userId- userId of user making request.assetGUID- unique identifier for asset.- Returns:
- a comprehensive collection of properties about the asset.
- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem retrieving the asset properties from the property servers).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getConnectorByName
public Connector getConnectorByName(String userId, String connectionName) throws InvalidParameterException, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException, UserNotAuthorizedException
Returns the connector corresponding to the supplied connection name.- Parameters:
userId- userId of user making request.connectionName- this may be the qualifiedName or displayName of the connection.- Returns:
- connector instance - or null if there is no connection
- Throws:
InvalidParameterException- one of the parameters is null or invalid.ConnectionCheckedException- there are errors in the configuration of the connection which is preventing the creation of a connector.ConnectorCheckedException- there are errors in the initialization of the connector.PropertyServerException- there is a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getConnectorForAsset
public Connector getConnectorForAsset(String userId, String assetGUID) throws InvalidParameterException, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException, UserNotAuthorizedException
Returns the connector corresponding to the supplied asset GUID.- Parameters:
userId- userId of user making request.assetGUID- the unique id for the asset within the metadata repository.- Returns:
- connector instance - or null if there is no connection
- Throws:
InvalidParameterException- one of the parameters is null or invalid.ConnectionCheckedException- there are errors in the configuration of the connection which is preventing the creation of a connector.ConnectorCheckedException- there are errors in the initialization of the connector.PropertyServerException- there is a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getConnectorByGUID
public Connector getConnectorByGUID(String userId, String connectionGUID) throws InvalidParameterException, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException, UserNotAuthorizedException
Returns the connector corresponding to the supplied connection GUID.- Parameters:
userId- userId of user making request.connectionGUID- the unique id for the connection within the metadata repository.- Returns:
- connector instance - or null if there is no connection
- Throws:
InvalidParameterException- one of the parameters is null or invalid.ConnectionCheckedException- there are errors in the configuration of the connection which is preventing the creation of a connector.ConnectorCheckedException- there are errors in the initialization of the connector.PropertyServerException- there is a problem retrieving information from the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
getConnectorByConnection
public Connector getConnectorByConnection(String userId, Connection connection) throws InvalidParameterException, ConnectionCheckedException, ConnectorCheckedException
Returns the connector corresponding to the supplied connection.- Parameters:
userId- userId of user making request.connection- the connection object that contains the properties needed to create the connection.- Returns:
- connector instance
- Throws:
InvalidParameterException- one of the parameters is null or invalid.ConnectionCheckedException- there are errors in the configuration of the connection which is preventing the creation of a connector.ConnectorCheckedException- there are errors in the initialization of the connector.
-
-