Class ConnectedAssetClientBase
- java.lang.Object
-
- org.odpi.openmetadata.commonservices.ocf.metadatamanagement.client.ConnectedAssetClientBase
-
public class ConnectedAssetClientBase extends Object
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.
-
-
Field Summary
Fields Modifier and Type Field Description protected AuditLogauditLogprotected InvalidParameterHandlerinvalidParameterHandlerprotected static NullRequestBodynullRequestBodyprotected StringserverNameprotected StringserverPlatformURLRoot
-
Constructor Summary
Constructors Constructor Description ConnectedAssetClientBase(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.ConnectedAssetClientBase(String serverName, String serverPlatformURLRoot, int maxPageSize, AuditLog auditLog)Create a new client with no authentication embedded in the HTTP request.ConnectedAssetClientBase(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 protected StringgetAssetForConnection(OCFRESTClient restClient, String serviceName, String userId, String connectionGUID)Returns the unique identifier for the asset connected to the requested connection.protected AssetUniversegetAssetProperties(String serviceName, String userId, String assetGUID)Returns a comprehensive collection of properties about the requested asset.protected AssetgetAssetSummary(OCFRESTClient restClient, String serviceName, String userId, String guid, String methodName)Return the basic properties of a asset.protected ConnectiongetConnectionByGUID(OCFRESTClient restClient, String serviceName, String userId, String guid)Returns the connection corresponding to the supplied connection GUID.protected ConnectiongetConnectionByName(OCFRESTClient restClient, String serviceName, String userId, String name)Returns the connection object corresponding to the supplied connection name.protected ConnectiongetConnectionForAsset(OCFRESTClient restClient, String serviceName, String userId, String assetGUID)Returns the connection corresponding to the supplied asset GUID.protected ConnectorgetConnectorForConnection(OCFRESTClient restClient, String serviceName, String userId, Connection requestedConnection, String methodName)Use the Open Connector Framework (OCF) to create a connector using the supplied connection.
-
-
-
Field Detail
-
serverName
protected String serverName
-
serverPlatformURLRoot
protected String serverPlatformURLRoot
-
auditLog
protected AuditLog auditLog
-
invalidParameterHandler
protected InvalidParameterHandler invalidParameterHandler
-
nullRequestBody
protected static NullRequestBody nullRequestBody
-
-
Constructor Detail
-
ConnectedAssetClientBase
public ConnectedAssetClientBase(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- 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, 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 OMAS REST serversmaxPageSize- maximum page size for this processauditLog- 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) 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- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Detail
-
getAssetSummary
protected Asset getAssetSummary(OCFRESTClient restClient, String serviceName, String userId, String guid, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the basic properties of a asset.- Parameters:
restClient- client that calls REST APIsserviceName- name of the calling serviceuserId- calling userguid- unique identifier of assetmethodName- calling method- Returns:
- Asset bean
- Throws:
InvalidParameterException- the name is invalidPropertyServerException- there is a problem access in the property serverUserNotAuthorizedException- the user does not have access to the properties
-
getAssetProperties
protected AssetUniverse getAssetProperties(String serviceName, String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Returns a comprehensive collection of properties about the requested asset.- Parameters:
serviceName- name of the calling serviceuserId- 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.
-
getConnectorForConnection
protected Connector getConnectorForConnection(OCFRESTClient restClient, String serviceName, String userId, Connection requestedConnection, String methodName) throws ConnectionCheckedException, ConnectorCheckedException
Use the Open Connector Framework (OCF) to create a connector using the supplied connection.- Parameters:
restClient- client that calls REST APIsserviceName- calling serviceuserId- calling userrequestedConnection- connection describing the required connector.methodName- 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.
-
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
protected 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 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.
-
getAssetForConnection
protected String getAssetForConnection(OCFRESTClient restClient, String serviceName, String userId, String connectionGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Returns the unique identifier for the asset connected to the requested connection.- Parameters:
restClient- initialized client for calling REST APIs.serviceName- name of the calling service.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.
-
-