Class ConnectionHandler
- java.lang.Object
-
- org.odpi.openmetadata.commonservices.ocf.metadatamanagement.handlers.RootHandler
-
- org.odpi.openmetadata.commonservices.ocf.metadatamanagement.handlers.ConnectionHandler
-
public class ConnectionHandler extends RootHandler
ConnectionHandler retrieves Connection objects from the property server. It runs server-side in the the OMAG Server Platform and retrieves Connections through the OMRSRepositoryConnector.
-
-
Field Summary
-
Fields inherited from class org.odpi.openmetadata.commonservices.ocf.metadatamanagement.handlers.RootHandler
invalidParameterHandler, repositoryHandler, repositoryHelper, serverName, serviceName
-
-
Constructor Summary
Constructors Constructor Description ConnectionHandler(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper)Construct the connection handler with information needed to work with Connection objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectiongetConnection(String userId, String connectionGUID)Retrieve the requested connection object.ConnectiongetConnectionByName(String userId, String name, String methodName)Returns the connection object corresponding to the supplied connection name.voidremoveConnection(String userId, String externalSourceGUID, String externalSourceName, String connectionGUID)Remove the requested Connection and any associated objects if they are no longer connected to anything else.StringsaveConnection(String userId, String externalSourceGUID, String externalSourceName, Connection connection)Determine if the Connection object is stored in the repository and create it if it is not.-
Methods inherited from class org.odpi.openmetadata.commonservices.ocf.metadatamanagement.handlers.RootHandler
getRepositoryHelper, getServiceName
-
-
-
-
Constructor Detail
-
ConnectionHandler
public ConnectionHandler(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper)
Construct the connection handler with information needed to work with Connection objects.- Parameters:
serviceName- name of this serviceserverName- name of the local serverinvalidParameterHandler- handler for managing parameter errorsrepositoryHandler- handler for interfacing with the repository servicesrepositoryHelper- helper utilities for managing repository services objects
-
-
Method Detail
-
saveConnection
public String saveConnection(String userId, String externalSourceGUID, String externalSourceName, Connection connection) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Determine if the Connection object is stored in the repository and create it if it is not. If the connection is located, there is no check that the connection values are equal to those in the supplied object.- Parameters:
userId- calling userIdexternalSourceGUID- guid of the software server capability entity that represented the external source - null for localexternalSourceName- name of the software server capability entity that represented the external sourceconnection- object to add- Returns:
- unique identifier of the connection in the repository.
- Throws:
InvalidParameterException- the bean properties are invalidUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
removeConnection
public void removeConnection(String userId, String externalSourceGUID, String externalSourceName, String connectionGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Remove the requested Connection and any associated objects if they are no longer connected to anything else.- Parameters:
userId- calling userexternalSourceGUID- guid of the software server capability entity that represented the external source - null for localexternalSourceName- name of the software server capability entity that represented the external sourceconnectionGUID- object to delete- Throws:
InvalidParameterException- the entity guid is not knownUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
getConnection
public Connection getConnection(String userId, String connectionGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve the requested connection object.- Parameters:
userId- calling userconnectionGUID- unique identifier of the connection object.- Returns:
- Connection bean
- Throws:
InvalidParameterException- the parameters are invalidUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
getConnectionByName
public Connection getConnectionByName(String userId, String name, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Returns the connection object corresponding to the supplied connection name.- Parameters:
userId- String - userId of user making request.name- this may be the qualifiedName or displayName of the connection.methodName- calling method- 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.
-
-