Skip to content

Commit

Permalink
add server side connection listener ,and add client version (#3350)
Browse files Browse the repository at this point in the history
* 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
shiyiyue1102 authored Jul 16, 2020
1 parent 6c8dfd6 commit b10a248
Show file tree
Hide file tree
Showing 34 changed files with 1,001 additions and 120 deletions.
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;
}
}
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,24 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.alibaba.nacos.api.config.remote.request;

import com.alibaba.nacos.api.remote.request.RequestTypeConstants;

/**
* config module request type constants.
* @author liuzunfei
* @version $Id: ConfigRequestTypeConstants.java, v 0.1 2020年07月13日 9:09 PM liuzunfei Exp $
*/
public class ConfigRequestTypeConstants extends RequestTypeConstants {


public static final String CHANGE_LISTEN_CONFIG_OPERATION="CHANGE_LISTEN_CONFIG_OPERATION";

public static final String QUERY_CONFIG="QUERY_CONFIG";

public static final String PUBLISH_CONFIG="PUBLISH_CONFIG";


public static final String CHANGE_LISTEN_CONFIG_OPERATION = "CHANGE_LISTEN_CONFIG_OPERATION";

public static final String QUERY_CONFIG = "QUERY_CONFIG";

public static final String PUBLISH_CONFIG = "PUBLISH_CONFIG";

public static final String REMOVE_CONFIG = "REMOVE_CONFIG";
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
*/
public class ConfigChangeNotifyResponse extends Response {

private String ackId;

private String dataId;

private String group;
Expand Down Expand Up @@ -56,23 +54,6 @@ public static ConfigChangeNotifyResponse buildSuccessResponse(String dataId, Str
response.setTenant(tenant);
return response;
}
/**
* Getter method for property <tt>ackId</tt>.
*
* @return property value of ackId
*/
public String getAckId() {
return ackId;
}

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

/**
* Getter method for property <tt>dataId</tt>.
Expand Down
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);
}
}
Loading

0 comments on commit b10a248

Please sign in to comment.