@Component(value="anyline.data.datasource.holder.elasticsearch") public class ElasticSearchDatasourceHolder extends DatasourceHolder
factory, params, types| 构造器和说明 |
|---|
ElasticSearchDatasourceHolder() |
| 限定符和类型 | 方法和说明 |
|---|---|
List<String> |
callCopy(DataRuntime runtime) |
void |
callDestroy(String datasource) |
boolean |
callHit(DataRuntime runtime) |
DataRuntime |
callTemporary(Object datasource,
String database,
DriverAdapter adapter) |
boolean |
callValidate(DataRuntime runtime) |
static List<String> |
copy() |
static List<String> |
copy(DataRuntime runtime)
根据当前数据源查询全部数据库列表,每个数据库创建一个数据源
|
static List<String> |
copy(String datasource) |
static void |
destroy(String datasource) |
static boolean |
exeValidate(org.elasticsearch.client.RestClient client) |
static String |
reg(String key,
Map<String,Object> param) |
static String |
reg(String key,
Map<String,Object> param,
boolean override) |
static org.elasticsearch.client.RestClient |
reg(String key,
org.elasticsearch.client.RestClient client) |
static org.elasticsearch.client.RestClient |
reg(String key,
org.elasticsearch.client.RestClient client,
boolean override) |
static String |
reg(String key,
String prefix,
org.springframework.core.env.Environment env) |
static String |
reg(String key,
String url,
String user,
String password)
注册数据源(生产环境不要调用这个方法,这里只设置几个必需参数用来测试)
|
static boolean |
validate() |
static boolean |
validate(DataRuntime runtime) |
static boolean |
validate(org.elasticsearch.client.RestClient client) |
static boolean |
validate(String ds)
检测数据源是否连接正常
|
public static String reg(String key, String url, String user, String password) throws Exception
key - 切换数据源依据 默认key=dataSourceurl - urluser - 用户名password - 密码Exception - 异常 Exceptionpublic static String reg(String key, Map<String,Object> param, boolean override) throws Exception
Exceptionpublic static org.elasticsearch.client.RestClient reg(String key, org.elasticsearch.client.RestClient client, boolean override) throws Exception
Exceptionpublic static org.elasticsearch.client.RestClient reg(String key, org.elasticsearch.client.RestClient client) throws Exception
Exceptionpublic static String reg(String key, String prefix, org.springframework.core.env.Environment env)
public DataRuntime callTemporary(Object datasource, String database, DriverAdapter adapter) throws Exception
callTemporary 在类中 DatasourceHolderExceptionpublic static boolean validate(String ds)
ds - 数据源名称public static boolean validate()
public static boolean validate(DataRuntime runtime)
public static boolean validate(org.elasticsearch.client.RestClient client)
public static boolean exeValidate(org.elasticsearch.client.RestClient client)
public boolean callValidate(DataRuntime runtime)
callValidate 在类中 DatasourceHolderpublic boolean callHit(DataRuntime runtime) throws Exception
callHit 在类中 DatasourceHolderExceptionpublic static void destroy(String datasource)
public void callDestroy(String datasource)
callDestroy 在类中 DatasourceHolderpublic static List<String> copy(DataRuntime runtime)
runtime - runtimepublic List<String> callCopy(DataRuntime runtime)
callCopy 在类中 DatasourceHolderCopyright © 2024. All rights reserved.