Skip to content

Commit

Permalink
convert payload type from full name to simple name;abilities both on …
Browse files Browse the repository at this point in the history
…client-server& server cluster submit (#4791)

* convert payload type from full name  to simple name.

* abilities both on client-server& server cluster submit

* Cas of update config, beta,tag publish

* tenant support on connection.

* modify health check tps point name
  • Loading branch information
shiyiyue1102 authored Jan 25, 2021
1 parent 7e58b5c commit 3cfa183
Show file tree
Hide file tree
Showing 38 changed files with 1,071 additions and 164 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed 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 com.alibaba.nacos.api.ability;

import com.alibaba.nacos.api.config.ClientConfigAbility;
import com.alibaba.nacos.api.naming.ClientNamingAbility;

/**
* abilities of nacos client.
*
* @author liuzunfei
* @version $Id: ClientAbilities.java, v 0.1 2021年01月24日 00:09 AM liuzunfei Exp $
*/
public class ClientAbilities {

private ClientRemoteAbility remoteAbility = new ClientRemoteAbility();

private ClientConfigAbility configAbility = new ClientConfigAbility();

private ClientNamingAbility namingAbility = new ClientNamingAbility();

public ClientRemoteAbility getRemoteAbility() {
return remoteAbility;
}

public void setRemoteAbility(ClientRemoteAbility remoteAbility) {
this.remoteAbility = remoteAbility;
}

public ClientConfigAbility getConfigAbility() {
return configAbility;
}

public void setConfigAbility(ClientConfigAbility configAbility) {
this.configAbility = configAbility;
}

public ClientNamingAbility getNamingAbility() {
return namingAbility;
}

public void setNamingAbility(ClientNamingAbility namingAbility) {
this.namingAbility = namingAbility;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed 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 com.alibaba.nacos.api.ability;

/**
* remote abilities of nacos client.
*
* @author liuzunfei
* @version $Id: ClientRemoteAbility.java, v 0.1 2021年01月24日 00:09 AM liuzunfei Exp $
*/
public class ClientRemoteAbility {

/**
* if support remote connection.
*/
private boolean supportRemoteConnection;

public boolean isSupportRemoteConnection() {
return this.supportRemoteConnection;
}

public void setSupportRemoteConnection(boolean supportRemoteConnection) {
this.supportRemoteConnection = supportRemoteConnection;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed 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 com.alibaba.nacos.api.ability;

import com.alibaba.nacos.api.config.ServerConfigAbility;
import com.alibaba.nacos.api.naming.ServerNamingAbility;

/**
* abilities of nacos server.
*
* @author liuzunfei
* @version $Id: ServerAbilities.java, v 0.1 2021年01月24日 00:09 AM liuzunfei Exp $
*/
public class ServerAbilities {

private ServerRemoteAbility remoteAbility = new ServerRemoteAbility();

private ServerConfigAbility configAbility = new ServerConfigAbility();

private ServerNamingAbility namingAbility = new ServerNamingAbility();

public ServerRemoteAbility getRemoteAbility() {
return remoteAbility;
}

public void setRemoteAbility(ServerRemoteAbility remoteAbility) {
this.remoteAbility = remoteAbility;
}

public ServerConfigAbility getConfigAbility() {
return configAbility;
}

public void setConfigAbility(ServerConfigAbility configAbility) {
this.configAbility = configAbility;
}

public ServerNamingAbility getNamingAbility() {
return namingAbility;
}

public void setNamingAbility(ServerNamingAbility namingAbility) {
this.namingAbility = namingAbility;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed 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 com.alibaba.nacos.api.ability;

/**
* remote abilities of nacos server.
*
* @author liuzunfei
* @version $Id: ServerRemoteAbility.java, v 0.1 2021年01月24日 00:09 AM liuzunfei Exp $
*/
public class ServerRemoteAbility {

/**
* if support remote connection.
*/
private boolean supportRemoteConnection;

public boolean isSupportRemoteConnection() {
return this.supportRemoteConnection;
}

public void setSupportRemoteConnection(boolean supportRemoteConnection) {
this.supportRemoteConnection = supportRemoteConnection;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed 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 com.alibaba.nacos.api.config;

/**
* config abilities of nacos client.
*
* @author liuzunfei
* @version $Id: ClientConfigAbility.java, v 0.1 2021年01月24日 00:09 AM liuzunfei Exp $
*/
public class ClientConfigAbility {

/**
* support remote metrics get.
*/
private boolean supportRemoteMetrics;

public boolean isSupportRemoteMetrics() {
return supportRemoteMetrics;
}

public void setSupportRemoteMetrics(boolean supportRemoteMetrics) {
this.supportRemoteMetrics = supportRemoteMetrics;
}
}
27 changes: 27 additions & 0 deletions api/src/main/java/com/alibaba/nacos/api/config/ConfigService.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ String getConfigAndSignListener(String dataId, String group, long timeoutMs, Lis
*/
boolean publishConfig(String dataId, String group, String content) throws NacosException;


/**
* Publish config.
*
Expand All @@ -91,6 +92,32 @@ String getConfigAndSignListener(String dataId, String group, long timeoutMs, Lis
*/
boolean publishConfig(String dataId, String group, String content, String type) throws NacosException;

/**
* Cas Publish config.
*
* @param dataId dataId
* @param group group
* @param content content
* @param casMd5 casMd5 prev content's md5 to cas.
* @return Whether publish
* @throws NacosException NacosException
*/
boolean publishConfigCas(String dataId, String group, String content, String casMd5) throws NacosException;

/**
* Cas Publish config.
*
* @param dataId dataId
* @param group group
* @param content content
* @param casMd5 casMd5 prev content's md5 to cas.
* @param type config type {@link ConfigType}
* @return Whether publish
* @throws NacosException NacosException
*/
boolean publishConfigCas(String dataId, String group, String content, String casMd5, String type)
throws NacosException;

/**
* Remove config.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed 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 com.alibaba.nacos.api.config;

/**
* config abilities of nacos server.
*
* @author liuzunfei
* @version $Id: ServerConfigAbility.java, v 0.1 2021年01月24日 00:09 AM liuzunfei Exp $
*/
public class ServerConfigAbility {

/**
* support remote metrics get.
*/
private boolean supportRemoteMetrics;

public boolean isSupportRemoteMetrics() {
return supportRemoteMetrics;
}

public void setSupportRemoteMetrics(boolean supportRemoteMetrics) {
this.supportRemoteMetrics = supportRemoteMetrics;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public class ConfigPublishRequest extends AbstractConfigRequest {

String content;

private Map<String, String> additonMap;
String casMd5;

private Map<String, String> additionMap;

public ConfigPublishRequest() {

Expand All @@ -48,7 +50,7 @@ public ConfigPublishRequest() {
* @return value of param ,return null if not exist.
*/
public String getAdditionParam(String key) {
return additonMap == null ? null : additonMap.get(key);
return additionMap == null ? null : additionMap.get(key);
}

/**
Expand All @@ -57,11 +59,11 @@ public String getAdditionParam(String key) {
* @param key key of param.
* @param value value of param.
*/
public void putAdditonalParam(String key, String value) {
if (additonMap == null) {
additonMap = new HashMap<String, String>(2);
public void putAdditionalParam(String key, String value) {
if (additionMap == null) {
additionMap = new HashMap<String, String>(2);
}
additonMap.put(key, value);
additionMap.put(key, value);
}

public ConfigPublishRequest(String dataId, String group, String tenant, String content) {
Expand Down Expand Up @@ -125,6 +127,42 @@ public void setContent(String content) {
this.content = content;
}

/**
* Getter method for property <tt>casMd5</tt>.
*
* @return property value of casMd5
*/
public String getCasMd5() {
return casMd5;
}

/**
* Setter method for property <tt>casMd5</tt>.
*
* @param casMd5 value to be assigned to property content
*/
public void setCasMd5(String casMd5) {
this.casMd5 = casMd5;
}

/**
* Getter method for property <tt>casMd5</tt>.
*
* @return property value of casMd5
*/
public Map<String, String> getAdditionMap() {
return additionMap;
}

/**
* Setter method for property <tt>additionMap</tt>.
*
* @param additionMap value to be assigned to property additionMap
*/
public void setAdditionMap(Map<String, String> additionMap) {
this.additionMap = additionMap;
}

/**
* Getter method for property <tt>tenant</tt>.
*
Expand Down
Loading

0 comments on commit 3cfa183

Please sign in to comment.