public class ConnectionManager extends Object
Created by bmorrise on 2/3/19.
Modifier and Type | Class and Description |
---|---|
static class |
ConnectionManager.Type
Represents the key/value of the name provider type
|
Constructor and Description |
---|
ConnectionManager() |
Modifier and Type | Method and Description |
---|---|
void |
addConnectionProvider(String key,
ConnectionProvider<? extends ConnectionDetails> connectionProvider)
Add a connection provider with a specific key
|
void |
addLookupFilter(LookupFilter lookupFilter)
Add a key lookup filter
|
void |
clear(org.pentaho.metastore.api.IMetaStore metaStore)
Delete all named connections stored in a meta store
|
void |
copy(org.pentaho.metastore.api.IMetaStore sourceMetaStore,
org.pentaho.metastore.api.IMetaStore destinationMetaStore)
Copy the named connections stored in one meta store into another meta store
|
ConnectionDetails |
createConnectionDetails(String scheme)
Get a new connection details object by scheme/key
|
void |
delete(org.pentaho.metastore.api.IMetaStore metaStore,
String name)
Delete a connection by name from a specified meta store
|
void |
delete(String name)
Delete a connection by name from the default
|
boolean |
exists(String name)
Find out if a named connection exists
|
ConnectionDetails |
getConnectionDetails(org.pentaho.metastore.api.IMetaStore metaStore,
String name)
Get the named connection from a specified meta store
|
ConnectionDetails |
getConnectionDetails(org.pentaho.metastore.api.IMetaStore metaStore,
String key,
String name)
Get the named connection from a specified meta store
|
ConnectionDetails |
getConnectionDetails(String name)
Get the named connection from a specified meta store
|
ConnectionDetails |
getConnectionDetails(String key,
String name)
Get the named connection from the default meta store
|
List<? extends ConnectionDetails> |
getConnectionDetailsByScheme(String scheme)
Get all named connections by key/scheme
|
ConnectionProvider<? extends ConnectionDetails> |
getConnectionProvider(String key)
Get a connection provider from the key
|
static ConnectionManager |
getInstance() |
List<ConnectionManager.Type> |
getItems()
Get a list of value/label pairs of named connection types
|
protected String |
getLookupKey(String value)
Get the lookup key for a provider
|
List<String> |
getNames()
Get the names of named connections by provider from the default meta store
|
List<String> |
getNames(boolean clearCache)
Get the names of named connections by provider from the default meta store
|
List<String> |
getNames(org.pentaho.metastore.api.IMetaStore metaStore)
Get the names of named connections by provider from specified meta store
|
List<String> |
getNames(org.pentaho.metastore.api.IMetaStore metaStore,
boolean clearCache)
Get the names of named connections by provider from specified meta store
|
List<String> |
getNamesByKey(String key)
Get the names of named connections by connection type key
|
List<String> |
getNamesByType(Class<? extends ConnectionProvider> clazz)
Get the names of named connection by connection provider type
|
List<ConnectionProvider<? extends ConnectionDetails>> |
getProviders()
Get a list of connection providers
|
List<ConnectionProvider<? extends ConnectionDetails>> |
getProvidersByType(Class<? extends ConnectionProvider> clazz)
Get a list of connection providers by type
|
<T extends ConnectionDetails> |
save(org.pentaho.metastore.api.IMetaStore metaStore,
T connectionDetails)
Save a named connection to a specific meta store
|
<T extends ConnectionDetails> |
save(org.pentaho.metastore.api.IMetaStore metaStore,
T connectionDetails,
boolean prepare)
Save a named connection to a specific meta store
|
<T extends ConnectionDetails> |
save(T connectionDetails)
Save a named connection to the default meta store
|
void |
setMetastoreSupplier(Supplier<org.pentaho.metastore.api.IMetaStore> metaStoreSupplier)
Set the default meta store supplier for the Connection Manager
|
<T extends ConnectionDetails> |
test(T connectionDetails)
Run a test operation on the named connection
|
public static ConnectionManager getInstance()
public void setMetastoreSupplier(Supplier<org.pentaho.metastore.api.IMetaStore> metaStoreSupplier)
metaStoreSupplier
- A meta store supplierpublic void addLookupFilter(LookupFilter lookupFilter)
lookupFilter
- The lookup filter to addpublic void addConnectionProvider(String key, ConnectionProvider<? extends ConnectionDetails> connectionProvider)
key
- The key used to query the connection providerconnectionProvider
- The connection providerpublic ConnectionProvider<? extends ConnectionDetails> getConnectionProvider(String key)
key
- The connection provider keyprotected String getLookupKey(String value)
value
- The key to lookuppublic <T extends ConnectionDetails> boolean save(org.pentaho.metastore.api.IMetaStore metaStore, T connectionDetails)
metaStore
- A meta storeconnectionDetails
- The named connection details to savepublic <T extends ConnectionDetails> boolean save(org.pentaho.metastore.api.IMetaStore metaStore, T connectionDetails, boolean prepare)
metaStore
- A meta storeconnectionDetails
- The named connection details to saveprepare
- Prepare the named connectionpublic <T extends ConnectionDetails> boolean save(T connectionDetails)
connectionDetails
- The named connection details to savepublic <T extends ConnectionDetails> boolean test(T connectionDetails)
connectionDetails
- The named connection details to testpublic void delete(String name)
name
- The name of the named connectionpublic void delete(org.pentaho.metastore.api.IMetaStore metaStore, String name)
metaStore
- A meta storename
- The name of the named connectionpublic List<ConnectionProvider<? extends ConnectionDetails>> getProviders()
public List<ConnectionProvider<? extends ConnectionDetails>> getProvidersByType(Class<? extends ConnectionProvider> clazz)
clazz
- The type of provider to filter bypublic List<String> getNames(org.pentaho.metastore.api.IMetaStore metaStore, boolean clearCache)
metaStore
- A meta storeclearCache
- Whether or not to clear cachepublic List<String> getNames(boolean clearCache)
clearCache
- - Whether or not to clear cachepublic List<String> getNames()
public List<String> getNames(org.pentaho.metastore.api.IMetaStore metaStore)
metaStore
- A meta storepublic boolean exists(String name)
name
- The named connection name to checkpublic List<String> getNamesByType(Class<? extends ConnectionProvider> clazz)
clazz
- The connection provider typepublic List<String> getNamesByKey(String key)
key
- The connection type keypublic ConnectionDetails getConnectionDetails(org.pentaho.metastore.api.IMetaStore metaStore, String key, String name)
metaStore
- A meta storekey
- The provider keyname
- The connection namepublic ConnectionDetails getConnectionDetails(String key, String name)
key
- The provider keyname
- The connection namepublic ConnectionDetails getConnectionDetails(String name)
name
- The connection namepublic ConnectionDetails getConnectionDetails(org.pentaho.metastore.api.IMetaStore metaStore, String name)
metaStore
- A meta storename
- The connection namepublic ConnectionDetails createConnectionDetails(String scheme)
scheme
- The scheme/keypublic List<? extends ConnectionDetails> getConnectionDetailsByScheme(String scheme)
scheme
- The scheme/keypublic void clear(org.pentaho.metastore.api.IMetaStore metaStore)
metaStore
- A meta storepublic void copy(org.pentaho.metastore.api.IMetaStore sourceMetaStore, org.pentaho.metastore.api.IMetaStore destinationMetaStore)
sourceMetaStore
- The meta store to copy fromdestinationMetaStore
- The meta store to copy topublic List<ConnectionManager.Type> getItems()
Copyright © 2020 Hitachi Vantara. All rights reserved.