类 ElasticSearchDatasourceHolder
java.lang.Object
org.anyline.data.datasource.DatasourceHolder
org.anyline.data.elasticsearch.datasource.ElasticSearchDatasourceHolder
@Component("anyline.data.datasource.holder.elasticsearch")
public class ElasticSearchDatasourceHolder
extends DatasourceHolder
-
字段概要
从类继承的字段 org.anyline.data.datasource.DatasourceHolder
factory, params, types -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明callCopy(DataRuntime runtime) voidcallDestroy(String datasource) booleancallHit(DataRuntime runtime) callTemporary(Object datasource, String database, DriverAdapter adapter) booleancallValidate(DataRuntime runtime) copy()copy(DataRuntime runtime) 根据当前数据源查询全部数据库列表,每个数据库创建一个数据源static voidstatic booleanexeValidate(org.elasticsearch.client.RestClient client) static String注册数据源(生产环境不要调用这个方法,这里只设置几个必需参数用来测试)static Stringstatic Stringstatic Stringstatic org.elasticsearch.client.RestClientstatic org.elasticsearch.client.RestClientstatic booleanvalidate()static boolean检测数据源是否连接正常static booleanvalidate(DataRuntime runtime) static booleanvalidate(org.elasticsearch.client.RestClient client)
-
构造器详细资料
-
ElasticSearchDatasourceHolder
public ElasticSearchDatasourceHolder()
-
-
方法详细资料
-
reg
注册数据源(生产环境不要调用这个方法,这里只设置几个必需参数用来测试)- 参数:
key- 切换数据源依据 默认key=dataSourceurl- urluser- 用户名password- 密码- 返回:
- DataSource
- 抛出:
Exception- 异常 Exception
-
reg
- 抛出:
Exception
-
reg
- 抛出:
Exception
-
reg
public static org.elasticsearch.client.RestClient reg(String key, org.elasticsearch.client.RestClient client, boolean override) throws Exception - 抛出:
Exception
-
reg
public static org.elasticsearch.client.RestClient reg(String key, org.elasticsearch.client.RestClient client) throws Exception - 抛出:
Exception
-
reg
-
callTemporary
public DataRuntime callTemporary(Object datasource, String database, DriverAdapter adapter) throws Exception - 指定者:
callTemporary在类中DatasourceHolder- 抛出:
Exception
-
validate
检测数据源是否连接正常- 参数:
ds- 数据源名称- 返回:
- boolean
-
validate
public static boolean validate() -
validate
-
validate
public static boolean validate(org.elasticsearch.client.RestClient client) -
exeValidate
public static boolean exeValidate(org.elasticsearch.client.RestClient client) -
callValidate
- 指定者:
callValidate在类中DatasourceHolder
-
callHit
- 指定者:
callHit在类中DatasourceHolder- 抛出:
Exception
-
destroy
-
callDestroy
- 指定者:
callDestroy在类中DatasourceHolder
-
copy
-
copy
-
copy
根据当前数据源查询全部数据库列表,每个数据库创建一个数据源- 参数:
runtime- runtime- 返回:
- 数据源key列表(全大写)
-
callCopy
- 指定者:
callCopy在类中DatasourceHolder
-