-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add server side connection listener ,and add client version (#3350)
* Add gprc support-> 1.add server side client connection event listener ,base on heart beat expire time check 2.add client version info after grpc connection build * Add gprc support-> add publish config and remove config in rpc channel ;and rename server push response handler
- Loading branch information
1 parent
6c8dfd6
commit b10a248
Showing
34 changed files
with
1,001 additions
and
120 deletions.
There are no files selected for viewing
122 changes: 122 additions & 0 deletions
122
api/src/main/java/com/alibaba/nacos/api/config/remote/request/ConfigPublishRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
/* | ||
* Copyright 1999-2020 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.remote.request; | ||
|
||
/** | ||
* request to publish a config. | ||
* | ||
* @author liuzunfei | ||
* @version $Id: ConfigPublishRequest.java, v 0.1 2020年07月16日 4:30 PM liuzunfei Exp $ | ||
*/ | ||
public class ConfigPublishRequest extends ConfigCommonRequest { | ||
|
||
String dataId; | ||
|
||
String group; | ||
|
||
String tenant; | ||
|
||
String content; | ||
|
||
public ConfigPublishRequest() { | ||
|
||
} | ||
|
||
public ConfigPublishRequest(String dataId, String group, String tenant, String content) { | ||
this.content = content; | ||
this.dataId = dataId; | ||
this.group = group; | ||
this.tenant = tenant; | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return ConfigRequestTypeConstants.PUBLISH_CONFIG; | ||
} | ||
|
||
/** | ||
* Getter method for property <tt>dataId</tt>. | ||
* | ||
* @return property value of dataId | ||
*/ | ||
public String getDataId() { | ||
return dataId; | ||
} | ||
|
||
/** | ||
* Setter method for property <tt>dataId</tt>. | ||
* | ||
* @param dataId value to be assigned to property dataId | ||
*/ | ||
public void setDataId(String dataId) { | ||
this.dataId = dataId; | ||
} | ||
|
||
/** | ||
* Getter method for property <tt>group</tt>. | ||
* | ||
* @return property value of group | ||
*/ | ||
public String getGroup() { | ||
return group; | ||
} | ||
|
||
/** | ||
* Setter method for property <tt>group</tt>. | ||
* | ||
* @param group value to be assigned to property group | ||
*/ | ||
public void setGroup(String group) { | ||
this.group = group; | ||
} | ||
|
||
/** | ||
* Getter method for property <tt>content</tt>. | ||
* | ||
* @return property value of content | ||
*/ | ||
public String getContent() { | ||
return content; | ||
} | ||
|
||
/** | ||
* Setter method for property <tt>content</tt>. | ||
* | ||
* @param content value to be assigned to property content | ||
*/ | ||
public void setContent(String content) { | ||
this.content = content; | ||
} | ||
|
||
/** | ||
* Getter method for property <tt>tenant</tt>. | ||
* | ||
* @return property value of tenant | ||
*/ | ||
public String getTenant() { | ||
return tenant; | ||
} | ||
|
||
/** | ||
* Setter method for property <tt>tenant</tt>. | ||
* | ||
* @param tenant value to be assigned to property tenant | ||
*/ | ||
public void setTenant(String tenant) { | ||
this.tenant = tenant; | ||
} | ||
} |
122 changes: 122 additions & 0 deletions
122
api/src/main/java/com/alibaba/nacos/api/config/remote/request/ConfigRemoveRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
/* | ||
* Copyright 1999-2020 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.remote.request; | ||
|
||
/** | ||
* request to remove a config . | ||
* | ||
* @author liuzunfei | ||
* @version $Id: ConfigRemoveRequest.java, v 0.1 2020年07月16日 4:31 PM liuzunfei Exp $ | ||
*/ | ||
public class ConfigRemoveRequest extends ConfigCommonRequest { | ||
|
||
String dataId; | ||
|
||
String group; | ||
|
||
String tenant; | ||
|
||
String tag; | ||
|
||
public ConfigRemoveRequest() { | ||
|
||
} | ||
|
||
public ConfigRemoveRequest(String dataId, String group, String tenant, String tag) { | ||
this.dataId = dataId; | ||
this.group = group; | ||
this.tag = tag; | ||
this.tenant = tenant; | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return ConfigRequestTypeConstants.REMOVE_CONFIG; | ||
} | ||
|
||
/** | ||
* Getter method for property <tt>dataId</tt>. | ||
* | ||
* @return property value of dataId | ||
*/ | ||
public String getDataId() { | ||
return dataId; | ||
} | ||
|
||
/** | ||
* Getter method for property <tt>tag</tt>. | ||
* | ||
* @return property value of tag | ||
*/ | ||
public String getTag() { | ||
return tag; | ||
} | ||
|
||
/** | ||
* Setter method for property <tt>tag</tt>. | ||
* | ||
* @param tag value to be assigned to property tag | ||
*/ | ||
public void setTag(String tag) { | ||
this.tag = tag; | ||
} | ||
|
||
/** | ||
* Setter method for property <tt>dataId</tt>. | ||
* | ||
* @param dataId value to be assigned to property dataId | ||
*/ | ||
public void setDataId(String dataId) { | ||
this.dataId = dataId; | ||
} | ||
|
||
/** | ||
* Getter method for property <tt>group</tt>. | ||
* | ||
* @return property value of group | ||
*/ | ||
public String getGroup() { | ||
return group; | ||
} | ||
|
||
/** | ||
* Setter method for property <tt>group</tt>. | ||
* | ||
* @param group value to be assigned to property group | ||
*/ | ||
public void setGroup(String group) { | ||
this.group = group; | ||
} | ||
|
||
/** | ||
* Getter method for property <tt>tenant</tt>. | ||
* | ||
* @return property value of tenant | ||
*/ | ||
public String getTenant() { | ||
return tenant; | ||
} | ||
|
||
/** | ||
* Setter method for property <tt>tenant</tt>. | ||
* | ||
* @param tenant value to be assigned to property tenant | ||
*/ | ||
public void setTenant(String tenant) { | ||
this.tenant = tenant; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
api/src/main/java/com/alibaba/nacos/api/config/remote/response/ConfigPubishResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright 1999-2020 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.remote.response; | ||
|
||
import com.alibaba.nacos.api.remote.response.Response; | ||
import com.alibaba.nacos.api.remote.response.ResponseCode; | ||
|
||
/** | ||
* ConfigPubishResponse. | ||
* | ||
* @author liuzunfei | ||
* @version $Id: ConfigPubishResponse.java, v 0.1 2020年07月16日 4:59 PM liuzunfei Exp $ | ||
*/ | ||
public class ConfigPubishResponse extends Response { | ||
|
||
public ConfigPubishResponse() { | ||
super(); | ||
} | ||
|
||
public ConfigPubishResponse(int resultCode, String message) { | ||
super(ConfigResponseTypeConstants.CONFIG_PUBLISH, resultCode, message); | ||
} | ||
|
||
/** | ||
* Buidl success resposne. | ||
* | ||
* @return | ||
*/ | ||
public static ConfigPubishResponse buildSuccessResponse() { | ||
return new ConfigPubishResponse(ResponseCode.SUCCESS.getCode(), ""); | ||
} | ||
|
||
/** | ||
* Buidl fail resposne. | ||
* | ||
* @return | ||
*/ | ||
public static ConfigPubishResponse buildFailResponse(String errorMsg) { | ||
return new ConfigPubishResponse(ResponseCode.FAIL.getCode(), errorMsg); | ||
} | ||
} |
Oops, something went wrong.