diff options
author | HuabingZhao <zhao.huabing@zte.com.cn> | 2017-08-18 17:27:07 +0800 |
---|---|---|
committer | HuabingZhao <zhao.huabing@zte.com.cn> | 2017-08-18 17:27:34 +0800 |
commit | c58657cd2a5d14389ab235c65a43283300ac3cfe (patch) | |
tree | 800de87e48c7c8f51ec4045e1a161b0a39a0fe2b /src/main/java | |
parent | 9252e604db14785fe5382e33cedffbdd2759091d (diff) |
Change comments to English
Issue_Id: MSB-22
Change-Id: I9cc5eee1adeb3c271f543ff6a8ff717764ccd5a7
Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/msb/sdk/httpclient/RetrofitServiceCreater.java | 10 | ||||
-rw-r--r-- | src/main/java/org/onap/msb/sdk/httpclient/conf/HttpClientConf.java | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/msb/sdk/httpclient/handler/RetrofitServiceHandlerContext.java | 8 | ||||
-rw-r--r-- | src/main/java/org/onap/msb/sdk/httpclient/handler/RetrofitServiceHandlerFactory.java | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/msb/sdk/httpclient/msb/MSBServiceClient.java (renamed from src/main/java/org/onap/msb/sdk/httpclient/msb/MSBServiceWrapperClient.java) | 68 |
6 files changed, 16 insertions, 80 deletions
diff --git a/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java b/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java index 698092e..e874962 100644 --- a/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java +++ b/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java @@ -24,7 +24,7 @@ public class MicroServiceFullInfo extends Service<NodeInfo> implements Serializa private Set<NodeInfo> nodes; - // 状态 0:不可用 1:可用,预留 + //Reserved private String status = "1"; public Set<NodeInfo> getNodes() { diff --git a/src/main/java/org/onap/msb/sdk/httpclient/RetrofitServiceCreater.java b/src/main/java/org/onap/msb/sdk/httpclient/RetrofitServiceCreater.java index 413189c..fba8518 100644 --- a/src/main/java/org/onap/msb/sdk/httpclient/RetrofitServiceCreater.java +++ b/src/main/java/org/onap/msb/sdk/httpclient/RetrofitServiceCreater.java @@ -24,22 +24,18 @@ import java.util.List; import org.onap.msb.sdk.httpclient.conf.HttpClientConf; import org.onap.msb.sdk.httpclient.handler.RetrofitServiceHandlerContext; import org.onap.msb.sdk.httpclient.handler.RetrofitServiceHandlerFactory; -import org.onap.msb.sdk.httpclient.msb.MSBServiceWrapperClient; +import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; -/** - * @author 10071214 - * - */ public class RetrofitServiceCreater { private RetrofitServiceHandlerFactory factory = new RetrofitServiceHandlerFactory(); - private MSBServiceWrapperClient msbClient; + private MSBServiceClient msbClient; public RetrofitServiceCreater(HttpClientConf globalHttpClientConf, - MSBServiceWrapperClient msbClient) { + MSBServiceClient msbClient) { RetrofitServiceHandlerContext.setGlobalHttpClientConf(globalHttpClientConf); this.msbClient = msbClient; diff --git a/src/main/java/org/onap/msb/sdk/httpclient/conf/HttpClientConf.java b/src/main/java/org/onap/msb/sdk/httpclient/conf/HttpClientConf.java index f3e5006..3e6b491 100644 --- a/src/main/java/org/onap/msb/sdk/httpclient/conf/HttpClientConf.java +++ b/src/main/java/org/onap/msb/sdk/httpclient/conf/HttpClientConf.java @@ -18,10 +18,6 @@ package org.onap.msb.sdk.httpclient.conf; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * @author 10071214 - * - */ public class HttpClientConf { @JsonProperty diff --git a/src/main/java/org/onap/msb/sdk/httpclient/handler/RetrofitServiceHandlerContext.java b/src/main/java/org/onap/msb/sdk/httpclient/handler/RetrofitServiceHandlerContext.java index 68ee16c..713d0f6 100644 --- a/src/main/java/org/onap/msb/sdk/httpclient/handler/RetrofitServiceHandlerContext.java +++ b/src/main/java/org/onap/msb/sdk/httpclient/handler/RetrofitServiceHandlerContext.java @@ -23,7 +23,7 @@ import org.onap.msb.sdk.httpclient.conf.HttpClientConf; import org.onap.msb.sdk.httpclient.convert.IConverterFactoryBuilder; import org.onap.msb.sdk.httpclient.lb.ILoadBalanceStrategy; import org.onap.msb.sdk.httpclient.metric.MetricManager; -import org.onap.msb.sdk.httpclient.msb.MSBServiceWrapperClient; +import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; /** @@ -65,7 +65,7 @@ public class RetrofitServiceHandlerContext { private HttpClientConf httpClientConf; - private MSBServiceWrapperClient msbClient; + private MSBServiceClient msbClient; @@ -79,11 +79,11 @@ public class RetrofitServiceHandlerContext { - public MSBServiceWrapperClient getMsbClient() { + public MSBServiceClient getMsbClient() { return msbClient; } - public void setMsbClient(MSBServiceWrapperClient msbClient) { + public void setMsbClient(MSBServiceClient msbClient) { this.msbClient = msbClient; } diff --git a/src/main/java/org/onap/msb/sdk/httpclient/handler/RetrofitServiceHandlerFactory.java b/src/main/java/org/onap/msb/sdk/httpclient/handler/RetrofitServiceHandlerFactory.java index fb78820..1d65661 100644 --- a/src/main/java/org/onap/msb/sdk/httpclient/handler/RetrofitServiceHandlerFactory.java +++ b/src/main/java/org/onap/msb/sdk/httpclient/handler/RetrofitServiceHandlerFactory.java @@ -28,7 +28,7 @@ import org.onap.msb.sdk.httpclient.handler.impl.LBBuilder; import org.onap.msb.sdk.httpclient.handler.impl.MetricmanagerBuilder; import org.onap.msb.sdk.httpclient.handler.impl.RetrofitHandlerContextBuilder; import org.onap.msb.sdk.httpclient.handler.impl.ServiceHttpEndPointBeanObjectBuilder; -import org.onap.msb.sdk.httpclient.msb.MSBServiceWrapperClient; +import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; import com.google.common.collect.Lists; @@ -89,7 +89,7 @@ public class RetrofitServiceHandlerFactory { public InvocationHandler buildInvocationHandler(Class<?> retrofitSrvInterfaceClazz, ServiceHttpEndPointBeanObject serviceHttpEndPointBeanObject, HttpClientConf httpClientConf, - MSBServiceWrapperClient msbClient) { + MSBServiceClient msbClient) { RetrofitServiceHandlerContext ctx = new RetrofitServiceHandlerContext(); ctx.setRetrofitSrvInterfaceClazz(retrofitSrvInterfaceClazz); diff --git a/src/main/java/org/onap/msb/sdk/httpclient/msb/MSBServiceWrapperClient.java b/src/main/java/org/onap/msb/sdk/httpclient/msb/MSBServiceClient.java index f72f711..34aae64 100644 --- a/src/main/java/org/onap/msb/sdk/httpclient/msb/MSBServiceWrapperClient.java +++ b/src/main/java/org/onap/msb/sdk/httpclient/msb/MSBServiceClient.java @@ -25,31 +25,24 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class MSBServiceWrapperClient { +public class MSBServiceClient { - private static final Logger logger = LoggerFactory.getLogger(MSBServiceWrapperClient.class); + private static final Logger logger = LoggerFactory.getLogger(MSBServiceClient.class); private String msbSvrAddress; private MSBService msbService = new MSBService(); - private String nameSpace; - - public MSBServiceWrapperClient(String msbSvrIp, int msbSvrPort) { + public MSBServiceClient(String msbSvrIp, int msbSvrPort) { super(); this.msbSvrAddress = msbSvrIp + ":" + msbSvrPort; - logger.info("msb service info:msbSvrAddress:{},nameSpace:{}", this.msbSvrAddress, - this.nameSpace); - + logger.info("msb service info:msbSvrAddress:{}", this.msbSvrAddress); } public MicroServiceFullInfo queryMicroServiceInfo(String serviceName, String version) throws RouteException { - return invokeMsb(() -> msbService.queryMicroServiceInfo(msbSvrAddress, serviceName, version)); - - } private <V> V invokeMsb(Callable<V> callable) throws RouteException { @@ -67,13 +60,6 @@ public class MSBServiceWrapperClient { } - /** - * 注册微服务-默认追加方式,在msb上注册服务信息,服务的信息都可以填充在MicroServiceInfo上,包括:租户的信息等 - * - * @param microServiceInfo 微服务注册实体类 - * @throws RouteException - * @return MicroServiceFullInfo - */ public MicroServiceFullInfo registerMicroServiceInfo(MicroServiceInfo msinfo) throws RouteException { @@ -82,14 +68,6 @@ public class MSBServiceWrapperClient { - /** - * 注册微服务,在msb上注册服务信息,服务的信息都可以填充在MicroServiceInfo上,包括:租户的信息等 - * - * @param microServiceInfo 微服务注册实体类 - * @param createOrUpdate true:新增或追加更新 ,false:重新添加 - * @throws RouteException - * @return MicroServiceFullInfo - */ public MicroServiceFullInfo registerMicroServiceInfo(MicroServiceInfo msinfo, boolean createOrUpdate) throws RouteException { @@ -100,12 +78,7 @@ public class MSBServiceWrapperClient { /** - * @Title cancelMicroServiceInfo - * @Description TODO(注销全部微服务) - * @param serviceName 服务名[必填,若自定义服务名包含/,用*代替] - * @param version 版本号[若无版本号,传空字符串] - * @throws RouteException - * @return RouteResult + * unregister all the instances of a service */ public RouteResult cancelMicroServiceInfo(String serviceName, String version) throws RouteException { @@ -115,14 +88,7 @@ public class MSBServiceWrapperClient { /** - * 注销单个微服务 - * - * @param serviceName 服务名[必填,若自定义服务名包含/,用*代替] - * @param version 版本号[若无版本号,传空字符串] - * @param ip - * @param port - * @throws RouteException - * @return RouteResult + * unregister the specified instance of a service */ public RouteResult cancelMicroServiceInfo(String serviceName, String version, String ip, @@ -137,26 +103,4 @@ public class MSBServiceWrapperClient { return msbSvrAddress; } - - - /** - * 请求服务实例TTL健康检查,默认使用本租户的信息 - * - * @param serviceName 服务名 - * @param version 版本号[若无版本号,传空字符串] - * @param ip 实例IP - * @param port 实例端口 - * @throws RouteException - * @return CheckNode - */ - public NodeAddress healthCheckbyTTL(String serviceName, String version, String ip, String port) - throws RouteException { - - return invokeMsb( - () -> msbService.healthCheckbyTTL(msbSvrAddress, serviceName, version, ip, port)); - - } - - - } |