Class ConnectedAssetClient
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.client.ConnectedAssetClient
- All Implemented Interfaces:
ConnectorFactoryInterface
- Direct Known Subclasses:
ConnectedAssetClientBase
ConnectedAssetClient provides calls for callers that work with connectors.
In particular, it manages the retrieval of connections for assets, and the creation of connectors.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AuditLog
protected final int
protected PropertyHelper
protected final String
protected final String
protected final String
-
Constructor Summary
ConstructorsConstructorDescriptionConnectedAssetClient
(String serverName, String serverPlatformURLRoot, String serviceURLMarker, int maxPageSize, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionabstract Connector
getConnectorByConnection
(String userId, Connection connection) Returns the connector corresponding to the supplied connection.abstract Connector
getConnectorByGUID
(String userId, String connectionGUID) Returns the connector corresponding to the supplied connection GUID.abstract Connector
getConnectorByName
(String userId, String connectionName) Returns the connector corresponding to the supplied connection name.abstract Connector
getConnectorForAsset
(String userId, String assetGUID) Returns the connector corresponding to the supplied asset GUID.abstract Connector
getConnectorForAsset
(String userId, String assetGUID, AuditLog auditLog) Returns the connector corresponding to the supplied asset GUID.abstract String
saveConnection
(String userId, String assetGUID, Connection connection) Returns the unique identifier corresponding to the supplied connection.abstract String
saveConnection
(String userId, Connection connection) Returns the unique identifier corresponding to the supplied connection.
-
Field Details
-
serverName
-
serverPlatformURLRoot
-
serviceURLMarker
-
auditLog
-
maxPageSize
protected final int maxPageSize -
propertyHelper
-
-
Constructor Details
-
ConnectedAssetClient
public ConnectedAssetClient(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.
-
-
Method Details
-
saveConnection
public abstract String saveConnection(String userId, Connection connection) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ConnectionCheckedException, ConnectorCheckedException Returns the unique identifier corresponding to the supplied connection.- 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 abstract String saveConnection(String userId, String assetGUID, Connection connection) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ConnectionCheckedException, ConnectorCheckedException Returns the unique identifier corresponding to the supplied connection.- 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 abstract 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
- 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 abstract 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
- 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 abstract 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
- 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 abstract 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
- 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 abstract Connector getConnectorByConnection(String userId, Connection connection) throws InvalidParameterException, ConnectionCheckedException, ConnectorCheckedException, UserNotAuthorizedException Returns the connector corresponding to the supplied connection.- Specified by:
getConnectorByConnection
in interfaceConnectorFactoryInterface
- 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
-