You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/02/11 02:52:31 UTC
[incubator-linkis] branch dev-1.1.0-datasource updated (c8dd527 -> 0156fd8)
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a change to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git.
from c8dd527 [CodeStyle] remove redundant public for interface method (#1426)
new 8ef8ffb add datasource action interface
new 545a9f7 add the request for create datasource action
new adde8bc add the request for datasource test connect action
new b720999 add the request for delete datasource action
new 6344170 add the request for expire datasource action
new e7c709f add the request for get all datasource types action
new 1cb2c55 add the request for get connect params by datasource id action
new 189a2f0 add the request for get connect params by datasource name action
new ee9dcf4 add the request for get datasource versions action
new e213729 add the request for get info by datasource id action
new 58fd70e add the request for get keytype of datasource action
new 219e963 add the request for get columns of metadata action
new 9a5e767 add the request for get databases of metadata action
new 7f7996e add the request for get partitions of metadata action
new 86bccbc add the request for get table props of metadata action
new e77758f add the request for get tables of metadata action
new 32c0a61 add the request for pushish datasource versons action
new c4e4463 add the request for query datasouce action
new 2c36f2f add the request for query datasouce env action
new c7bd33f add the request for update datasource action
new 0156fd8 add the request for update datasource param action
The 21 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../client/request/CreateDataSourceAction.scala | 70 ++++++++++++++
.../client/request/DataSourceAction.scala | 10 +-
.../request/DataSourceTestConnectAction.scala | 79 ++++++++++++++++
.../client/request/DeleteDataSourceAction.scala | 62 +++++++++++++
.../client/request/ExpireDataSourceAction.scala | 63 +++++++++++++
.../request/GetAllDataSourceTypesAction.scala | 38 +++++---
.../GetConnectParamsByDataSourceIdAction.scala | 75 +++++++++++++++
.../GetConnectParamsByDataSourceNameAction.scala | 83 +++++++++++++++++
.../request/GetDataSourceVersionsAction.scala | 62 +++++++++++++
.../request/GetInfoByDataSourceIdAction.scala | 73 +++++++++++++++
.../request/GetKeyTypeDatasourceAction.scala | 63 +++++++++++++
.../client/request/MetadataGetColumnsAction.scala | 93 +++++++++++++++++++
.../request/MetadataGetDatabasesAction.scala | 73 +++++++++++++++
.../request/MetadataGetPartitionsAction.scala | 91 ++++++++++++++++++
.../request/MetadataGetTablePropsAction.scala | 92 ++++++++++++++++++
.../client/request/MetadataGetTablesAction.scala | 81 ++++++++++++++++
.../request/PublishDataSourceVersionAction.scala | 74 +++++++++++++++
.../client/request/QueryDataSourceAction.scala | 103 +++++++++++++++++++++
.../client/request/QueryDataSourceEnvAction.scala | 89 ++++++++++++++++++
.../client/request/UpdateDataSourceAction.scala | 83 +++++++++++++++++
.../request/UpdateDataSourceParameterAction.scala | 82 ++++++++++++++++
21 files changed, 1519 insertions(+), 20 deletions(-)
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/CreateDataSourceAction.scala
copy linkis-computation-governance/linkis-client/linkis-computation-client/src/main/scala/org/apache/linkis/ujes/client/request/UJESJobAction.scala => linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DataSourceAction.scala (84%)
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DataSourceTestConnectAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DeleteDataSourceAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/ExpireDataSourceAction.scala
copy linkis-computation-governance/linkis-client/linkis-computation-client/src/main/scala/org/apache/linkis/ujes/client/request/GetDBSAction.scala => linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetAllDataSourceTypesAction.scala (58%)
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetConnectParamsByDataSourceIdAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetConnectParamsByDataSourceNameAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetDataSourceVersionsAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetInfoByDataSourceIdAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetKeyTypeDatasourceAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetColumnsAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetDatabasesAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetPartitionsAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetTablePropsAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetTablesAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/PublishDataSourceVersionAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/QueryDataSourceAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/QueryDataSourceEnvAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/UpdateDataSourceAction.scala
create mode 100644 linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/UpdateDataSourceParameterAction.scala
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 08/21: add the request for get connect params by datasource name action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 189a2f03ea3fa81a30798ac3e35ce14022681827
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:33:41 2022 +0800
add the request for get connect params by datasource name action
---
.../GetConnectParamsByDataSourceNameAction.scala | 83 ++++++++++++++++++++++
1 file changed, 83 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetConnectParamsByDataSourceNameAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetConnectParamsByDataSourceNameAction.scala
new file mode 100644
index 0000000..19d6de0
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetConnectParamsByDataSourceNameAction.scala
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import java.net.URLEncoder
+import java.nio.charset.StandardCharsets
+
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.httpclient.request.GetAction
+/**
+ * Get version parameters from data source
+ */
+class GetConnectParamsByDataSourceNameAction extends GetAction with DataSourceAction{
+ private var dataSourceName: String = _
+
+ private var user: String = _
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "name", dataSourceName, "connect_params")
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = user
+}
+
+object GetConnectParamsByDataSourceNameAction{
+ def builder(): Builder = new Builder
+
+ class Builder private[GetConnectParamsByDataSourceNameAction]() {
+ private var dataSourceName: String = _
+ private var system: String = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceName(dataSourceName: String): Builder = {
+ this.dataSourceName = dataSourceName
+ this
+ }
+
+ def setSystem(system: String): Builder = {
+ this.system = system
+ this
+ }
+
+ def build(): GetConnectParamsByDataSourceNameAction = {
+ if (dataSourceName == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(system == null) throw new DataSourceClientBuilderException("system is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+ // Use URIEncoder to encode the datSourceName
+ var requestDataSourceName = this.dataSourceName
+ try {
+ requestDataSourceName = URLEncoder.encode(dataSourceName, StandardCharsets.UTF_8.name())
+ } catch {
+ case e: Exception =>
+ throw new DataSourceClientBuilderException(s"Cannot encode the name of data source:[$dataSourceName] for request", e)
+ }
+ val getConnectParamsByDataSourceNameAction = new GetConnectParamsByDataSourceNameAction
+ getConnectParamsByDataSourceNameAction.dataSourceName = requestDataSourceName
+ getConnectParamsByDataSourceNameAction.setParameter("system", system)
+ getConnectParamsByDataSourceNameAction.setUser(user)
+ getConnectParamsByDataSourceNameAction
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 12/21: add the request for get columns of metadata action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 219e963cab37513f366e26b4d357ed5df0f181eb
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:37:38 2022 +0800
add the request for get columns of metadata action
---
.../client/request/MetadataGetColumnsAction.scala | 93 ++++++++++++++++++++++
1 file changed, 93 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetColumnsAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetColumnsAction.scala
new file mode 100644
index 0000000..39955ba
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetColumnsAction.scala
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.METADATA_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+
+class MetadataGetColumnsAction extends GetAction with DataSourceAction {
+ private var dataSourceId: Long = _
+ private var database: String = _
+ private var table: String = _
+
+ override def suffixURLs: Array[String] = Array(METADATA_SERVICE_MODULE.getValue, "columns", dataSourceId.toString, "db", database, "table", table)
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+
+
+object MetadataGetColumnsAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[MetadataGetColumnsAction]() {
+ private var dataSourceId: Long = _
+ private var database: String = _
+ private var table: String = _
+ private var system: String = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: Long): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def setDatabase(database: String): Builder = {
+ this.database = database
+ this
+ }
+
+ def setTable(table: String): Builder = {
+ this.table = table
+ this
+ }
+
+ def setSystem(system: String): Builder = {
+ this.system = system
+ this
+ }
+
+ def build(): MetadataGetColumnsAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(database == null) throw new DataSourceClientBuilderException("database is needed!")
+ if(table == null) throw new DataSourceClientBuilderException("table is needed!")
+ if(system == null) throw new DataSourceClientBuilderException("system is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+
+ val metadataGetColumnsAction = new MetadataGetColumnsAction
+ metadataGetColumnsAction.dataSourceId = this.dataSourceId
+ metadataGetColumnsAction.database = this.database
+ metadataGetColumnsAction.table = this.table
+ metadataGetColumnsAction.setParameter("system", system)
+ metadataGetColumnsAction.setUser(user)
+ metadataGetColumnsAction
+ }
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 05/21: add the request for expire datasource action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 63441707b6996bc6b3ef661de0cbcca60e792a21
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:29:05 2022 +0800
add the request for expire datasource action
---
.../client/request/ExpireDataSourceAction.scala | 63 ++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/ExpireDataSourceAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/ExpireDataSourceAction.scala
new file mode 100644
index 0000000..ef20f16
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/ExpireDataSourceAction.scala
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.PutAction
+
+class ExpireDataSourceAction extends PutAction with DataSourceAction {
+ override def getRequestPayload: String = ""
+
+ private var user: String = _
+
+ private var dataSourceId: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "info", dataSourceId, "expire")
+}
+object ExpireDataSourceAction{
+ def builder(): Builder = new Builder
+ class Builder private[ExpireDataSourceAction]() {
+ private var user: String = _
+ private var dataSourceId: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: String): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+ def build(): ExpireDataSourceAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val action = new ExpireDataSourceAction()
+ action.dataSourceId = dataSourceId
+ action.user = user
+ action
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 13/21: add the request for get databases of metadata action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 9a5e767d2713f3089b8651e965f74239207f722f
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:38:23 2022 +0800
add the request for get databases of metadata action
---
.../request/MetadataGetDatabasesAction.scala | 73 ++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetDatabasesAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetDatabasesAction.scala
new file mode 100644
index 0000000..bff6435
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetDatabasesAction.scala
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.METADATA_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+
+class MetadataGetDatabasesAction extends GetAction with DataSourceAction {
+ private var dataSourceId: Long = _
+
+ override def suffixURLs: Array[String] = Array(METADATA_SERVICE_MODULE.getValue, "dbs", dataSourceId.toString)
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+
+object MetadataGetDatabasesAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[MetadataGetDatabasesAction]() {
+ private var dataSourceId: Long = _
+ private var system: String = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: Long): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def setSystem(system: String): Builder = {
+ this.system = system
+ this
+ }
+
+ def build(): MetadataGetDatabasesAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(system == null) throw new DataSourceClientBuilderException("system is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val metadataGetDatabasesAction = new MetadataGetDatabasesAction
+ metadataGetDatabasesAction.dataSourceId = this.dataSourceId
+ metadataGetDatabasesAction.setParameter("system", system)
+ metadataGetDatabasesAction.setUser(user)
+ metadataGetDatabasesAction
+ }
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 10/21: add the request for get info by datasource id action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit e21372992ed81f30c4fae035e5cb876086fdc7d9
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:35:35 2022 +0800
add the request for get info by datasource id action
---
.../request/GetInfoByDataSourceIdAction.scala | 73 ++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetInfoByDataSourceIdAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetInfoByDataSourceIdAction.scala
new file mode 100644
index 0000000..b5c5e9b
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetInfoByDataSourceIdAction.scala
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+
+class GetInfoByDataSourceIdAction extends GetAction with DataSourceAction {
+ private var dataSourceId: Long = _
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "info", dataSourceId.toString)
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+
+object GetInfoByDataSourceIdAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[GetInfoByDataSourceIdAction]() {
+ private var dataSourceId: Long = _
+ private var system: String = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: Long): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def setSystem(system: String): Builder = {
+ this.system = system
+ this
+ }
+
+ def build(): GetInfoByDataSourceIdAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(system == null) throw new DataSourceClientBuilderException("system is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val getInfoByDataSourceIdAction = new GetInfoByDataSourceIdAction
+ getInfoByDataSourceIdAction.dataSourceId = this.dataSourceId
+ getInfoByDataSourceIdAction.setParameter("system", system)
+ getInfoByDataSourceIdAction.setUser(user)
+ getInfoByDataSourceIdAction
+ }
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 04/21: add the request for delete datasource action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit b720999e6e60e9389b00d7b585dda1296f5963f0
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:17:06 2022 +0800
add the request for delete datasource action
---
.../client/request/DeleteDataSourceAction.scala | 62 ++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DeleteDataSourceAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DeleteDataSourceAction.scala
new file mode 100644
index 0000000..e373742
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DeleteDataSourceAction.scala
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.DeleteAction
+
+
+class DeleteDataSourceAction extends DeleteAction with DataSourceAction {
+ private var user: String = _
+
+ private var resourceId: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "info", resourceId)
+}
+object DeleteDataSourceAction{
+ def builder(): Builder = new Builder
+ class Builder private[DeleteDataSourceAction]() {
+ private var user: String = _
+ private var resourceId: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setResourceId(resourceId: String): Builder = {
+ this.resourceId = resourceId
+ this
+ }
+
+ def builder(): DeleteDataSourceAction = {
+ if (user == null) throw new DataSourceClientBuilderException("user is needed!")
+ if(resourceId == null) throw new DataSourceClientBuilderException("resourceId is needed!")
+
+ val action = new DeleteDataSourceAction
+ action.user = user
+ action.resourceId = resourceId
+ action
+ }
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 15/21: add the request for get table props of metadata action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 86bccbc024b8fd1def819e25596aefd85d0f6106
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:40:36 2022 +0800
add the request for get table props of metadata action
---
.../request/MetadataGetTablePropsAction.scala | 92 ++++++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetTablePropsAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetTablePropsAction.scala
new file mode 100644
index 0000000..1f67f22
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetTablePropsAction.scala
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.METADATA_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+
+class MetadataGetTablePropsAction extends GetAction with DataSourceAction {
+ private var dataSourceId: Long = _
+ private var database: String = _
+ private var table: String = _
+
+ override def suffixURLs: Array[String] = Array(METADATA_SERVICE_MODULE.getValue, "props", dataSourceId.toString, "db", database, "table", table)
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+
+object MetadataGetTablePropsAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[MetadataGetTablePropsAction]() {
+ private var dataSourceId: Long = _
+ private var database: String = _
+ private var table: String = _
+ private var system: String = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: Long): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def setDatabase(database: String): Builder = {
+ this.database = database
+ this
+ }
+
+ def setTable(table: String): Builder = {
+ this.table = table
+ this
+ }
+
+ def setSystem(system: String): Builder = {
+ this.system = system
+ this
+ }
+
+ def build(): MetadataGetTablePropsAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(database == null) throw new DataSourceClientBuilderException("database is needed!")
+ if(table == null) throw new DataSourceClientBuilderException("table is needed!")
+ if(system == null) throw new DataSourceClientBuilderException("system is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val metadataGetTablePropsAction = new MetadataGetTablePropsAction
+ metadataGetTablePropsAction.dataSourceId = this.dataSourceId
+ metadataGetTablePropsAction.database = this.database
+ metadataGetTablePropsAction.table = this.table
+ metadataGetTablePropsAction.setParameter("system", system)
+ metadataGetTablePropsAction.setUser(user)
+ metadataGetTablePropsAction
+ }
+ }
+
+}
+
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 20/21: add the request for update datasource action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit c7bd33f27d5c39a354003d88ba24b0db9ccd200c
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:44:48 2022 +0800
add the request for update datasource action
---
.../client/request/UpdateDataSourceAction.scala | 83 ++++++++++++++++++++++
1 file changed, 83 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/UpdateDataSourceAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/UpdateDataSourceAction.scala
new file mode 100644
index 0000000..051d80f
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/UpdateDataSourceAction.scala
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.dws.DWSHttpClient
+import org.apache.linkis.httpclient.request.PutAction
+
+import java.util
+import scala.collection.JavaConverters._
+
+class UpdateDataSourceAction extends PutAction with DataSourceAction{
+ override def getRequestPayload: String = DWSHttpClient.jacksonJson.writeValueAsString(getRequestPayloads)
+
+ private var user: String = _
+ private var dataSourceId: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "info", dataSourceId, "json")
+}
+object UpdateDataSourceAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[UpdateDataSourceAction]() {
+ private var user: String = _
+ private var dataSourceId: String = _
+ private var payload: util.Map[String, Any] = new util.HashMap[String, Any]
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: String): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def addRequestPayload(key: String, value: Any): Builder = {
+ if (value != null) this.payload.put(key, value)
+ this
+ }
+
+ def addRequestPayloads(map: util.Map[String, Any]): Builder = {
+ this.synchronized(this.payload = map)
+ this
+ }
+
+ def build(): UpdateDataSourceAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val action = new UpdateDataSourceAction()
+ action.dataSourceId = dataSourceId
+ action.user = user
+
+ this.payload.asScala.foreach(k => {
+ action.addRequestPayload(k._1, k._2)
+ })
+ action
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 07/21: add the request for get connect params by datasource id action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 1cb2c553c7b7694266b7072e2e94b966de3a5c1a
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:32:10 2022 +0800
add the request for get connect params by datasource id action
---
.../GetConnectParamsByDataSourceIdAction.scala | 75 ++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetConnectParamsByDataSourceIdAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetConnectParamsByDataSourceIdAction.scala
new file mode 100644
index 0000000..0c78ec6
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetConnectParamsByDataSourceIdAction.scala
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+
+class GetConnectParamsByDataSourceIdAction extends GetAction with DataSourceAction {
+ private var dataSourceId: Long = _
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, dataSourceId.toString, "connect_params")
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+
+
+object GetConnectParamsByDataSourceIdAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[GetConnectParamsByDataSourceIdAction]() {
+ private var dataSourceId: Long = _
+ private var system: String = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: Long): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def setSystem(system: String): Builder = {
+ this.system = system
+ this
+ }
+
+ def build(): GetConnectParamsByDataSourceIdAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(system == null) throw new DataSourceClientBuilderException("system is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val getConnectParamsByDataSourceIdAction = new GetConnectParamsByDataSourceIdAction
+ getConnectParamsByDataSourceIdAction.dataSourceId = this.dataSourceId
+ getConnectParamsByDataSourceIdAction.setParameter("system", system)
+ getConnectParamsByDataSourceIdAction.setUser(user)
+ getConnectParamsByDataSourceIdAction
+ }
+ }
+
+}
+
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 14/21: add the request for get partitions of metadata action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 7f7996ec931525f77ad8dafd44a4228f92d887b1
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:38:56 2022 +0800
add the request for get partitions of metadata action
---
.../request/MetadataGetPartitionsAction.scala | 91 ++++++++++++++++++++++
1 file changed, 91 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetPartitionsAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetPartitionsAction.scala
new file mode 100644
index 0000000..9bbde2e
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetPartitionsAction.scala
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.METADATA_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+
+class MetadataGetPartitionsAction extends GetAction with DataSourceAction {
+ private var dataSourceId: String = _
+ private var database: String = _
+ private var table: String = _
+
+ override def suffixURLs: Array[String] = Array(METADATA_SERVICE_MODULE.getValue, "partitions", dataSourceId, "db", database, "table", table)
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+
+
+object MetadataGetPartitionsAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[MetadataGetPartitionsAction]() {
+ private var dataSourceId: String = _
+ private var database: String = _
+ private var table: String = _
+ private var system: String = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: String): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def setDatabase(database: String): Builder = {
+ this.database = database
+ this
+ }
+
+ def setTable(table: String): Builder = {
+ this.table = table
+ this
+ }
+
+ def setSystem(system: String): Builder = {
+ this.system = system
+ this
+ }
+
+ def build(): MetadataGetPartitionsAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(database == null) throw new DataSourceClientBuilderException("database is needed!")
+ if(table == null) throw new DataSourceClientBuilderException("table is needed!")
+ if(system == null) throw new DataSourceClientBuilderException("system is needed!")
+
+ val metadataGetPartitionsAction = new MetadataGetPartitionsAction
+ metadataGetPartitionsAction.dataSourceId = this.dataSourceId
+ metadataGetPartitionsAction.database = this.database
+ metadataGetPartitionsAction.table = this.table
+ metadataGetPartitionsAction.setParameter("system", system)
+ metadataGetPartitionsAction.setUser(user)
+ metadataGetPartitionsAction
+ }
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 18/21: add the request for query datasouce action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit c4e446319a22a3a25aef01fe3985e2db5e76244b
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:42:20 2022 +0800
add the request for query datasouce action
---
.../client/request/QueryDataSourceAction.scala | 103 +++++++++++++++++++++
1 file changed, 103 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/QueryDataSourceAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/QueryDataSourceAction.scala
new file mode 100644
index 0000000..af780f5
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/QueryDataSourceAction.scala
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+
+class QueryDataSourceAction extends GetAction with DataSourceAction{
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "info")
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+
+object QueryDataSourceAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[QueryDataSourceAction]() {
+ private var system: String = _
+ private var name: String = _
+ private var typeId: Long = _
+ private var identifies: String = _
+ private var currentPage: Integer = _
+ private var pageSize: Integer = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setSystem(system: String): Builder = {
+ this.system = system
+ this
+ }
+
+ def setName(name: String): Builder = {
+ this.name = name
+ this
+ }
+
+ def setTypeId(typeId: Long): Builder = {
+ this.typeId = typeId
+ this
+ }
+
+ def setIdentifies(identifies: String): Builder = {
+ this.identifies = identifies
+ this
+ }
+
+ def setCurrentPage(currentPage: Integer): Builder = {
+ this.currentPage = currentPage
+ this
+ }
+
+ def setPageSize(pageSize: Integer): Builder = {
+ this.pageSize = pageSize
+ this
+ }
+
+ def build(): QueryDataSourceAction = {
+ if (system == null) throw new DataSourceClientBuilderException("system is needed!")
+ if(name == null) throw new DataSourceClientBuilderException("name is needed!")
+ if(typeId == null) throw new DataSourceClientBuilderException("typeId is needed!")
+ if(identifies == null) throw new DataSourceClientBuilderException("identifies is needed!")
+ if(currentPage == null) throw new DataSourceClientBuilderException("currentPage is needed!")
+ if(pageSize == null) throw new DataSourceClientBuilderException("pageSize is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val queryDataSourceAction = new QueryDataSourceAction
+ queryDataSourceAction.setParameter("system", system)
+ queryDataSourceAction.setParameter("name", name)
+ queryDataSourceAction.setParameter("typeId", typeId)
+ queryDataSourceAction.setParameter("identifies", identifies)
+ queryDataSourceAction.setParameter("currentPage", currentPage)
+ queryDataSourceAction.setParameter("pageSize", pageSize)
+ queryDataSourceAction.setUser(user)
+
+ queryDataSourceAction
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 02/21: add the request for create datasource action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 545a9f7b31c1d3dce1cb33a2e14ce1c52ec0e566
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:14:27 2022 +0800
add the request for create datasource action
---
.../client/request/CreateDataSourceAction.scala | 70 ++++++++++++++++++++++
1 file changed, 70 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/CreateDataSourceAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/CreateDataSourceAction.scala
new file mode 100644
index 0000000..4f3e6d3
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/CreateDataSourceAction.scala
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.httpclient.dws.DWSHttpClient
+import org.apache.linkis.httpclient.request.POSTAction
+
+import java.util
+import scala.collection.JavaConverters._
+
+class CreateDataSourceAction extends POSTAction with DataSourceAction{
+ override def getRequestPayload: String = DWSHttpClient.jacksonJson.writeValueAsString(getRequestPayloads)
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "info", "json")
+}
+object CreateDataSourceAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[CreateDataSourceAction]() {
+ private var user: String = _
+ private var payload: util.Map[String, Any] = new util.HashMap[String, Any]()
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def addRequestPayload(key: String, value: Any): Builder = {
+ if (value != null) this.payload.put(key, value)
+ this
+ }
+
+ def addRequestPayloads(map: util.Map[String, Any]): Builder = {
+ this.synchronized(this.payload = map)
+ this
+ }
+
+ def build(): CreateDataSourceAction = {
+ val action = new CreateDataSourceAction
+ action.setUser(user)
+ this.payload.asScala.foreach(k => {
+ action.addRequestPayload(k._1, k._2)
+ })
+ action
+ }
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 19/21: add the request for query datasouce env action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 2c36f2fecb30627e49d9af6889285f325a8fd9a1
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:44:08 2022 +0800
add the request for query datasouce env action
---
.../client/request/QueryDataSourceEnvAction.scala | 89 ++++++++++++++++++++++
1 file changed, 89 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/QueryDataSourceEnvAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/QueryDataSourceEnvAction.scala
new file mode 100644
index 0000000..97a3504
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/QueryDataSourceEnvAction.scala
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+
+class QueryDataSourceEnvAction extends GetAction with DataSourceAction{
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "env")
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+
+
+object QueryDataSourceEnvAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[QueryDataSourceEnvAction]() {
+ private var name: String = _
+ private var typeId: Long = _
+ private var currentPage: Integer = _
+ private var pageSize: Integer = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setName(name: String): Builder = {
+ this.name = name
+ this
+ }
+
+ def setTypeId(typeId: Long): Builder = {
+ this.typeId = typeId
+ this
+ }
+
+ def setCurrentPage(currentPage: Integer): Builder = {
+ this.currentPage = currentPage
+ this
+ }
+
+ def setPageSize(pageSize: Integer): Builder = {
+ this.pageSize = pageSize
+ this
+ }
+
+ def build(): QueryDataSourceEnvAction = {
+ if (name == null) throw new DataSourceClientBuilderException("name is needed!")
+ if(typeId == null) throw new DataSourceClientBuilderException("typeId is needed!")
+ if(currentPage == null) throw new DataSourceClientBuilderException("currentPage is needed!")
+ if(pageSize == null) throw new DataSourceClientBuilderException("pageSize is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+
+ val queryDataSourceEnvAction = new QueryDataSourceEnvAction
+ queryDataSourceEnvAction.setParameter("name", name)
+ queryDataSourceEnvAction.setParameter("typeId", typeId)
+ queryDataSourceEnvAction.setParameter("currentPage", currentPage)
+ queryDataSourceEnvAction.setParameter("pageSize", pageSize)
+ queryDataSourceEnvAction.setUser(user)
+
+ queryDataSourceEnvAction
+ }
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 16/21: add the request for get tables of metadata action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit e77758fabc7d52085deec9126de6c18ca37f27bb
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:41:05 2022 +0800
add the request for get tables of metadata action
---
.../client/request/MetadataGetTablesAction.scala | 81 ++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetTablesAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetTablesAction.scala
new file mode 100644
index 0000000..be9494f
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/MetadataGetTablesAction.scala
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.METADATA_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+
+class MetadataGetTablesAction extends GetAction with DataSourceAction {
+ private var dataSourceId: Long = _
+ private var database: String = _
+
+ override def suffixURLs: Array[String] = Array(METADATA_SERVICE_MODULE.getValue, "tables", dataSourceId.toString, "db", database)
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+
+object MetadataGetTablesAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[MetadataGetTablesAction]() {
+ private var dataSourceId: Long = _
+ private var database: String = _
+ private var system: String = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+ def setDataSourceId(dataSourceId: Long): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def setDatabase(database: String): Builder = {
+ this.database = database
+ this
+ }
+
+ def setSystem(system: String): Builder = {
+ this.system = system
+ this
+ }
+
+ def build(): MetadataGetTablesAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(database == null) throw new DataSourceClientBuilderException("database is needed!")
+ if(system == null) throw new DataSourceClientBuilderException("system is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val metadataGetTablesAction = new MetadataGetTablesAction
+ metadataGetTablesAction.dataSourceId = this.dataSourceId
+ metadataGetTablesAction.database = this.database
+ metadataGetTablesAction.setParameter("system", system)
+ metadataGetTablesAction.setUser(user)
+ metadataGetTablesAction
+ }
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 03/21: add the request for datasource test connect action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit adde8bc8b695f3fc915d471c2fcb74a10cd46fd0
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:15:30 2022 +0800
add the request for datasource test connect action
---
.../request/DataSourceTestConnectAction.scala | 79 ++++++++++++++++++++++
1 file changed, 79 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DataSourceTestConnectAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DataSourceTestConnectAction.scala
new file mode 100644
index 0000000..49d45cf
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DataSourceTestConnectAction.scala
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.dws.DWSHttpClient
+import org.apache.linkis.httpclient.request.PutAction
+
+
+class DataSourceTestConnectAction private() extends PutAction with DataSourceAction {
+ private var user: String = _
+
+ private var dataSourceId: String = _
+
+ private var version: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, dataSourceId, version, "op", "connect")
+
+ override def getRequestPayload: String = DWSHttpClient.jacksonJson.writeValueAsString(getRequestPayloads)
+}
+object DataSourceTestConnectAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[DataSourceTestConnectAction]() {
+ private var user: String = _
+ private var dataSourceId: String = _
+ private var version: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: String): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def setVersion(version: String): Builder = {
+ this.version = version
+ this
+ }
+
+ def build(): DataSourceTestConnectAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(version == null) throw new DataSourceClientBuilderException("version is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val action = new DataSourceTestConnectAction()
+ action.dataSourceId = dataSourceId
+ action.version = version
+ action.user = user
+
+ action
+ }
+ }
+}
+
+
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 21/21: add the request for update datasource param action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 0156fd85607d12579c47a4bdd29a28c00cc6f1da
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:46:51 2022 +0800
add the request for update datasource param action
---
.../request/UpdateDataSourceParameterAction.scala | 82 ++++++++++++++++++++++
1 file changed, 82 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/UpdateDataSourceParameterAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/UpdateDataSourceParameterAction.scala
new file mode 100644
index 0000000..ee38dea
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/UpdateDataSourceParameterAction.scala
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.dws.DWSHttpClient
+import org.apache.linkis.httpclient.request.POSTAction
+
+import scala.collection.JavaConverters._
+import java.util
+
+class UpdateDataSourceParameterAction extends POSTAction with DataSourceAction {
+ override def getRequestPayload: String = DWSHttpClient.jacksonJson.writeValueAsString(getRequestPayloads)
+
+ private var user: String = _
+ private var dataSourceId: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "parameter", dataSourceId, "json")
+}
+object UpdateDataSourceParameterAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[UpdateDataSourceParameterAction]() {
+ private var user: String = _
+ private var dataSourceId: String = _
+ private var payload: util.Map[String, Any] = new util.HashMap[String, Any]
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: String): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def addRequestPayload(key: String, value: Any): Builder = {
+ if (value != null) this.payload.put(key, value)
+ this
+ }
+
+ def addRequestPayloads(map: util.Map[String, Any]): Builder = {
+ this.synchronized(this.payload = map)
+ this
+ }
+
+ def build(): UpdateDataSourceParameterAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val action = new UpdateDataSourceParameterAction()
+ action.dataSourceId = dataSourceId
+ action.user = user
+ this.payload.asScala.foreach(k => {
+ action.addRequestPayload(k._1, k._2)
+ })
+
+ action
+ }
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 17/21: add the request for pushish datasource versons action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 32c0a61a98fbd8860ffb5fd11d5f7d97a9272ed9
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:41:45 2022 +0800
add the request for pushish datasource versons action
---
.../request/PublishDataSourceVersionAction.scala | 74 ++++++++++++++++++++++
1 file changed, 74 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/PublishDataSourceVersionAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/PublishDataSourceVersionAction.scala
new file mode 100644
index 0000000..e6a7b8e
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/PublishDataSourceVersionAction.scala
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.dws.DWSHttpClient
+import org.apache.linkis.httpclient.request.POSTAction
+
+
+class PublishDataSourceVersionAction extends POSTAction with DataSourceAction{
+ override def getRequestPayload: String = DWSHttpClient.jacksonJson.writeValueAsString(getRequestPayloads)
+ private var user: String = _
+ private var dataSourceId: String = _
+ private var versionId: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "publish", dataSourceId, versionId)
+}
+object PublishDataSourceVersionAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[PublishDataSourceVersionAction]() {
+ private var user: String = _
+ private var dataSourceId: String = _
+ private var versionId: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceId(dataSourceId: String): Builder = {
+ this.dataSourceId = dataSourceId
+ this
+ }
+
+ def setVersion(versionId: String): Builder = {
+ this.versionId = versionId
+ this
+ }
+
+ def build(): PublishDataSourceVersionAction = {
+ if (dataSourceId == null) throw new DataSourceClientBuilderException("dataSourceId is needed!")
+ if(versionId == null) throw new DataSourceClientBuilderException("versionId is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val action = new PublishDataSourceVersionAction()
+ action.dataSourceId = dataSourceId
+ action.versionId = versionId
+ action.user = user
+
+ action
+ }
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 06/21: add the request for get all datasource types action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit e7c709f3279187359e1aaa666573416997c8cb70
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:30:57 2022 +0800
add the request for get all datasource types action
---
.../request/GetAllDataSourceTypesAction.scala | 52 ++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetAllDataSourceTypesAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetAllDataSourceTypesAction.scala
new file mode 100644
index 0000000..d4582c2
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetAllDataSourceTypesAction.scala
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.httpclient.request.GetAction
+
+class GetAllDataSourceTypesAction extends GetAction with DataSourceAction {
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "type", "all")
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+
+object GetAllDataSourceTypesAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[GetAllDataSourceTypesAction]() {
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def build(): GetAllDataSourceTypesAction = {
+ val action = new GetAllDataSourceTypesAction
+ action.setUser(user)
+
+ action
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 11/21: add the request for get keytype of datasource action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 58fd70e0b9c1b02a487842c5fac7ef12de254ae2
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:36:45 2022 +0800
add the request for get keytype of datasource action
---
.../request/GetKeyTypeDatasourceAction.scala | 63 ++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetKeyTypeDatasourceAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetKeyTypeDatasourceAction.scala
new file mode 100644
index 0000000..fcb27e6
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetKeyTypeDatasourceAction.scala
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+
+class GetKeyTypeDatasourceAction extends GetAction with DataSourceAction{
+ private var dataSourceTypeId: Long = _
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, "key_define", "type", dataSourceTypeId.toString)
+
+ private var user: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+}
+object GetKeyTypeDatasourceAction{
+ def builder(): Builder = new Builder
+
+ class Builder private[GetKeyTypeDatasourceAction]() {
+ private var dataSourceTypeId: Long = _
+ private var user: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setDataSourceTypeId(dataSourceTypeId: Long): Builder = {
+ this.dataSourceTypeId = dataSourceTypeId
+ this
+ }
+
+ def build(): GetKeyTypeDatasourceAction = {
+ if (user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val getKeyTypeDatasourceAction = new GetKeyTypeDatasourceAction
+ getKeyTypeDatasourceAction.dataSourceTypeId = this.dataSourceTypeId
+ getKeyTypeDatasourceAction.setUser(user)
+ getKeyTypeDatasourceAction
+ }
+ }
+}
+
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 09/21: add the request for get datasource versions action
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit ee9dcf4526c9a19d725b0e3c8aace121e26a0ad3
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:34:45 2022 +0800
add the request for get datasource versions action
---
.../request/GetDataSourceVersionsAction.scala | 62 ++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetDataSourceVersionsAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetDataSourceVersionsAction.scala
new file mode 100644
index 0000000..e07c5fa
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/GetDataSourceVersionsAction.scala
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.datasource.client.config.DatasourceClientConfig.DATA_SOURCE_SERVICE_MODULE
+import org.apache.linkis.datasource.client.exception.DataSourceClientBuilderException
+import org.apache.linkis.httpclient.request.GetAction
+
+class GetDataSourceVersionsAction extends GetAction with DataSourceAction {
+ private var user: String = _
+ private var resourceId: String = _
+
+ override def setUser(user: String): Unit = this.user = user
+
+ override def getUser: String = this.user
+
+ override def suffixURLs: Array[String] = Array(DATA_SOURCE_SERVICE_MODULE.getValue, resourceId, "versions")
+}
+object GetDataSourceVersionsAction {
+ def builder(): Builder = new Builder
+
+ class Builder private[GetDataSourceVersionsAction]() {
+ private var user: String = _
+ private var resourceId: String = _
+
+ def setUser(user: String): Builder = {
+ this.user = user
+ this
+ }
+
+ def setResourceId(resourceId: String): Builder = {
+ this.resourceId = resourceId
+ this
+ }
+
+ def build(): GetDataSourceVersionsAction = {
+ if (resourceId == null) throw new DataSourceClientBuilderException("resourceId is needed!")
+ if(user == null) throw new DataSourceClientBuilderException("user is needed!")
+
+ val action = new GetDataSourceVersionsAction
+ action.user = user
+ action.resourceId = resourceId
+
+ action
+ }
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org
[incubator-linkis] 01/21: add datasource action interface
Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
peacewong pushed a commit to branch dev-1.1.0-datasource
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
commit 8ef8ffb8ce06dc1a15a92a8d6edb9ed860f95ca2
Author: xiaojie19852006 <xi...@163.com>
AuthorDate: Fri Feb 11 09:12:59 2022 +0800
add datasource action interface
---
.../client/request/DataSourceAction.scala | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DataSourceAction.scala b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DataSourceAction.scala
new file mode 100644
index 0000000..9defeb2
--- /dev/null
+++ b/linkis-public-enhancements/linkis-datasource/linkis-datasource-client/src/main/scala/org/apache/linkis/datasource/client/request/DataSourceAction.scala
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.datasource.client.request
+
+import org.apache.linkis.httpclient.dws.request.DWSHttpAction
+
+trait DataSourceAction extends DWSHttpAction with org.apache.linkis.httpclient.request.UserAction
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org