public class DynamicDbConfigResolver extends AbstractAnnotatedObject implements DbConfigResolver
DbConfig
from a dynamic DataSourceConfig
.
Resolved DbConfig
are cached and reused every time a
configured is resolved to the same static DataSourceConfig
Modifier and Type | Field and Description |
---|---|
static String |
NO_METADATA_OBTAINED |
static String |
TEST_CONNECTION_ERROR |
PROPERTY_NAME
Constructor and Description |
---|
DynamicDbConfigResolver(String name,
DbConfigFactory dbConfigFactory,
DataSourceFactory dataSourceFactory,
DataSourceConfig dataSourceConfig) |
Modifier and Type | Method and Description |
---|---|
org.mule.common.Result<org.mule.common.metadata.MetaData> |
getMetaData(org.mule.common.metadata.MetaDataKey metaDataKey) |
org.mule.common.Result<List<org.mule.common.metadata.MetaDataKey>> |
getMetaDataKeys() |
DbConfig |
resolve(MuleEvent muleEvent)
Resolves which database configuration to use for a given event
|
org.mule.common.TestResult |
test() |
getAnnotation, getAnnotations, setAnnotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnnotation, getAnnotations, setAnnotations
public static final String TEST_CONNECTION_ERROR
public static final String NO_METADATA_OBTAINED
public DynamicDbConfigResolver(String name, DbConfigFactory dbConfigFactory, DataSourceFactory dataSourceFactory, DataSourceConfig dataSourceConfig)
public DbConfig resolve(MuleEvent muleEvent) throws UnresolvableDbConfigException
DbConfigResolver
resolve
in interface DbConfigResolver
muleEvent
- event used to resolve the configuration. Not null.UnresolvableDbConfigException
- when is not possible to resolve a database configurationpublic org.mule.common.TestResult test()
test
in interface org.mule.common.Testable
public org.mule.common.Result<List<org.mule.common.metadata.MetaDataKey>> getMetaDataKeys()
getMetaDataKeys
in interface org.mule.common.metadata.ConnectorMetaDataEnabled
public org.mule.common.Result<org.mule.common.metadata.MetaData> getMetaData(org.mule.common.metadata.MetaDataKey metaDataKey)
getMetaData
in interface org.mule.common.metadata.ConnectorMetaDataEnabled
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.