Class ConnectedAssetClientBase
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.client.ConnectedAssetClient
org.odpi.openmetadata.frameworkservices.ocf.metadatamanagement.client.ConnectedAssetClientBase
- All Implemented Interfaces:
ConnectorFactoryInterface
- Direct Known Subclasses:
EgeriaConnectedAssetClient
ConnectedAssetClient 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.
-
Field Summary
FieldsFields inherited from class org.odpi.openmetadata.frameworks.connectors.client.ConnectedAssetClient
auditLog, maxPageSize, propertyHelper, serverName, serverPlatformURLRoot, serviceURLMarker
-
Constructor Summary
ConstructorsConstructorDescriptionConnectedAssetClientBase
(String serverName, String serverPlatformURLRoot, String serviceURLMarker, int maxPageSize, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request.ConnectedAssetClientBase
(String serverName, String serverPlatformURLRoot, String serviceURLMarker, String userId, String password, int maxPageSize, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionprotected Connection
getConnectionByGUID
(OCFRESTClient restClient, String serviceName, String userId, String guid) Returns the connection corresponding to the supplied connection GUID.protected Connection
getConnectionByName
(OCFRESTClient restClient, String serviceName, String userId, String name) Returns the connection object corresponding to the supplied connection name.getConnectionForAsset
(OCFRESTClient restClient, String serviceName, String userId, String assetGUID) Returns the connection corresponding to the supplied asset GUID.getConnectorByConnection
(String userId, Connection connection) Returns the connector corresponding to the supplied connection.getConnectorByGUID
(String userId, String connectionGUID) Returns the connector corresponding to the supplied connection GUID.getConnectorByName
(String userId, String connectionName) Returns the connector corresponding to the supplied connection name.getConnectorForAsset
(String userId, String assetGUID) Returns the connector corresponding to the supplied asset GUID.getConnectorForAsset
(String userId, String assetGUID, AuditLog auditLog) Returns the connector corresponding to the supplied asset GUID.protected Connector
getConnectorForConnection
(String serviceName, Connection requestedConnection, String methodName) Use the Open Connector Framework (OCF) to create a connector using the supplied connection.saveConnection
(String userId, String assetGUID, Connection connection) Returns the unique identifier corresponding to the supplied connection.saveConnection
(String userId, Connection connection) Returns the unique identifier corresponding to the supplied connection.
-
Field Details
-
invalidParameterHandler
-
-
Constructor Details
-
ConnectedAssetClientBase
public ConnectedAssetClientBase(String serverName, String serverPlatformURLRoot, String serviceURLMarker, int maxPageSize, 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 OCF REST servicesmaxPageSize
- maximum page size for this processserviceURLMarker
- indicator of the OMAS that this client is supportingauditLog
- destination for log messages- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
ConnectedAssetClientBase
public ConnectedAssetClientBase(String serverName, String serverPlatformURLRoot, String serviceURLMarker, String userId, String password, int maxPageSize, 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 OCF REST servicesuserId
- caller's userId embedded in all HTTP requestspassword
- caller's userId embedded in all HTTP requestsmaxPageSize
- maximum page size for this processserviceURLMarker
- indicator of the OMAS that this client is supportingauditLog
- destination for log messages- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Details
-
getConnectorForConnection
protected Connector getConnectorForConnection(String serviceName, Connection requestedConnection, String methodName) throws ConnectionCheckedException, ConnectorCheckedException, UserNotAuthorizedException Use the Open Connector Framework (OCF) to create a connector using the supplied connection. The connector is initialized by not started.- Parameters:
serviceName
- calling servicerequestedConnection
- connection describing the required connectormethodName
- name of the calling method.- Returns:
- a new connector.
- Throws:
ConnectionCheckedException
- there are issues with the values in the connectionConnectorCheckedException
- the connector had an operational issue accessing the asset.UserNotAuthorizedException
- connector disconnected
-
getConnectionByGUID
protected Connection getConnectionByGUID(OCFRESTClient restClient, String serviceName, String userId, String guid) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Returns the connection corresponding to the supplied connection GUID.- Parameters:
restClient
- client that calls REST APIsserviceName
- name of the calling serviceuserId
- userId of user making request.guid
- the unique id for the connection within the metadata repository.- Returns:
- connection instance.
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
getConnectionByName
protected Connection getConnectionByName(OCFRESTClient restClient, String serviceName, String userId, String name) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Returns the connection object corresponding to the supplied connection name.- Parameters:
restClient
- client that calls REST APIsserviceName
- name of the calling serviceuserId
- String - userId of user making request.name
- this is the qualifiedName of the connection.- Returns:
- Connection retrieved from property server.
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property (metadata) server.UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
getConnectionForAsset
public Connection getConnectionForAsset(OCFRESTClient restClient, String serviceName, String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Returns the connection corresponding to the supplied asset GUID.- Parameters:
restClient
- client that calls REST APIsserviceName
- name of the calling serviceuserId
- userId of user making request.assetGUID
- the unique id for the asset within the metadata repository.- Returns:
- connector instance.
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
saveConnection
public String saveConnection(String userId, Connection connection) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ConnectionCheckedException, ConnectorCheckedException Returns the unique identifier corresponding to the supplied connection.- Specified by:
saveConnection
in classConnectedAssetClient
- Parameters:
userId
- calling userconnection
- the connection object that contains the properties needed to create the connection.- Returns:
- guid
- 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
UserNotAuthorizedException
-
saveConnection
public String saveConnection(String userId, String assetGUID, Connection connection) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ConnectionCheckedException, ConnectorCheckedException Returns the unique identifier corresponding to the supplied connection.- Specified by:
saveConnection
in classConnectedAssetClient
- Parameters:
userId
- calling userassetGUID
- the unique identifier of an asset to attach the connection toconnection
- the connection object that contains the properties needed to create the connection.- Returns:
- guid
- 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
UserNotAuthorizedException
-
getConnectorByName
public Connector getConnectorByName(String userId, String connectionName) throws InvalidParameterException, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException, UserNotAuthorizedException Returns the connector corresponding to the supplied connection name.- Specified by:
getConnectorByName
in interfaceConnectorFactoryInterface
- Specified by:
getConnectorByName
in classConnectedAssetClient
- 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.- Specified by:
getConnectorForAsset
in interfaceConnectorFactoryInterface
- Specified by:
getConnectorForAsset
in classConnectedAssetClient
- 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.
-
getConnectorForAsset
public Connector getConnectorForAsset(String userId, String assetGUID, AuditLog auditLog) throws InvalidParameterException, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException, UserNotAuthorizedException Returns the connector corresponding to the supplied asset GUID.- Specified by:
getConnectorForAsset
in interfaceConnectorFactoryInterface
- Specified by:
getConnectorForAsset
in classConnectedAssetClient
- Parameters:
userId
- userId of user making request.assetGUID
- the unique id for the asset within the metadata repository.auditLog
- optional logging destination- 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.- Specified by:
getConnectorByGUID
in interfaceConnectorFactoryInterface
- Specified by:
getConnectorByGUID
in classConnectedAssetClient
- 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, UserNotAuthorizedException Returns the connector corresponding to the supplied connection.- Specified by:
getConnectorByConnection
in interfaceConnectorFactoryInterface
- Specified by:
getConnectorByConnection
in classConnectedAssetClient
- 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.UserNotAuthorizedException
- connector disconnected
-