aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/msb/sdk/httpclient
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/msb/sdk/httpclient')
-rw-r--r--src/main/java/org/onap/msb/sdk/httpclient/ProxyRetrofitCall.java7
-rw-r--r--src/main/java/org/onap/msb/sdk/httpclient/ServiceHttpEndPointBeanObject.java14
-rw-r--r--src/main/java/org/onap/msb/sdk/httpclient/annotaion/ServiceHttpEndPoint.java17
-rw-r--r--src/main/java/org/onap/msb/sdk/httpclient/builder/impl/ClientRetrofitObjectBuilder.java11
-rw-r--r--src/main/java/org/onap/msb/sdk/httpclient/handler/impl/ServiceHttpEndPointBeanObjectBuilder.java11
-rw-r--r--src/main/java/org/onap/msb/sdk/httpclient/lb/ILoadBalanceStrategy.java9
-rw-r--r--src/main/java/org/onap/msb/sdk/httpclient/lb/LoadBalanceContext.java7
7 files changed, 29 insertions, 47 deletions
diff --git a/src/main/java/org/onap/msb/sdk/httpclient/ProxyRetrofitCall.java b/src/main/java/org/onap/msb/sdk/httpclient/ProxyRetrofitCall.java
index 0e5968d..113df15 100644
--- a/src/main/java/org/onap/msb/sdk/httpclient/ProxyRetrofitCall.java
+++ b/src/main/java/org/onap/msb/sdk/httpclient/ProxyRetrofitCall.java
@@ -1,11 +1,11 @@
/*******************************************************************************
* Copyright 2017 ZTE, Inc. and others.
- *
+ *
* 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
@@ -63,7 +63,6 @@ public class ProxyRetrofitCall<T extends Object> implements Call<T> {
logger.warn("first invoke httpclient error,endPoint:{},method:{},msg:{}", endPoint, method,
e.getMessage());
- // 清理残留的endpoint记录
handler.clean();
try {
return ((Call) handler.reInvoke(proxy, method, args, endPoint)).execute();
diff --git a/src/main/java/org/onap/msb/sdk/httpclient/ServiceHttpEndPointBeanObject.java b/src/main/java/org/onap/msb/sdk/httpclient/ServiceHttpEndPointBeanObject.java
index 4e36a83..f52f705 100644
--- a/src/main/java/org/onap/msb/sdk/httpclient/ServiceHttpEndPointBeanObject.java
+++ b/src/main/java/org/onap/msb/sdk/httpclient/ServiceHttpEndPointBeanObject.java
@@ -1,11 +1,11 @@
/*******************************************************************************
* Copyright 2017 ZTE, Inc. and others.
- *
+ *
* 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
@@ -15,23 +15,17 @@ package org.onap.msb.sdk.httpclient;
public class ServiceHttpEndPointBeanObject {
- // 在MSB上注册的服务名
private String serviceName;
- // 在MSB注册的版本号
private String serviceVersion;
- // 在通过msb转发时,所用的协议
private String msbProtocl = "https";
- // 服务间点对点访问时,所用的协议
private String clientProtocl = "http";
- // 服务所在的租户名
private String nameSpace = "";
- // 服务的可见范围,系统间:“0”,系统内:“1”(默认),可配置多个,以 | 分隔
+ // The visibility of service: '0' if the service can be accessed outside, '1' if it can only be accessed within the system, default '1'
private String visualRange = "0";
- // 在MSB上注册的服务类型
private String serverType = "api";
diff --git a/src/main/java/org/onap/msb/sdk/httpclient/annotaion/ServiceHttpEndPoint.java b/src/main/java/org/onap/msb/sdk/httpclient/annotaion/ServiceHttpEndPoint.java
index 1764503..7d15b43 100644
--- a/src/main/java/org/onap/msb/sdk/httpclient/annotaion/ServiceHttpEndPoint.java
+++ b/src/main/java/org/onap/msb/sdk/httpclient/annotaion/ServiceHttpEndPoint.java
@@ -1,11 +1,11 @@
/*******************************************************************************
* Copyright 2017 ZTE, Inc. and others.
- *
+ *
* 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
@@ -19,8 +19,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * 服务名和版本号不同,接口名就需要不同
- *
+ *
* @author hu.rui
*
*/
@@ -28,25 +27,19 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
public @interface ServiceHttpEndPoint {
- // 在MSB上注册的服务名
String serviceName();
- // 在MSB注册的版本号
String serviceVersion();
- // 在通过msb转发时,所用的协议
String msbProtocl() default "https";
- // 服务间点对点访问时,所用的协议
String clientProtocl() default "http";
- // 服务所在的租户名
String nameSpace() default "";
- // 服务的可见范围,系统间:“0”,系统内:“1”(默认),可配置多个,以 | 分隔
+ // The visibility of service: '0' if the service can be accessed outside, '1' if it can only be accessed within the system, default '1'
String visualRange() default "1";
- // 在MSB上注册的服务类型
String serverType() default "api";
}
diff --git a/src/main/java/org/onap/msb/sdk/httpclient/builder/impl/ClientRetrofitObjectBuilder.java b/src/main/java/org/onap/msb/sdk/httpclient/builder/impl/ClientRetrofitObjectBuilder.java
index 7b7c6af..1b5ef17 100644
--- a/src/main/java/org/onap/msb/sdk/httpclient/builder/impl/ClientRetrofitObjectBuilder.java
+++ b/src/main/java/org/onap/msb/sdk/httpclient/builder/impl/ClientRetrofitObjectBuilder.java
@@ -1,18 +1,18 @@
/*******************************************************************************
* Copyright 2017-2018 ZTE, Inc. and others.
- *
+ *
* 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 org.onap.msb.sdk.httpclient.builder.impl;
@@ -52,7 +52,7 @@ public class ClientRetrofitObjectBuilder implements IRetrofitObjectBuilder {
/*
* (non-Javadoc)
- *
+ *
* @see
* com.zte.ums.zenap.httpclient.retrofit.builder.IRetrofitObjectBuilder#buildRetrofitObject(
* java. util.concurrent.atomic.AtomicReference)
@@ -87,7 +87,6 @@ public class ClientRetrofitObjectBuilder implements IRetrofitObjectBuilder {
srvhttpEndPointBeanObject.getServiceName(),
srvhttpEndPointBeanObject.getServiceVersion(), nodeInfo, cloneFullInfo);
- // 目前支持http
String baseUrl = null;
if (fullInfo.getUrl() == null || fullInfo.getUrl().trim().length() == 0
|| fullInfo.getUrl().equals("/")) {
diff --git a/src/main/java/org/onap/msb/sdk/httpclient/handler/impl/ServiceHttpEndPointBeanObjectBuilder.java b/src/main/java/org/onap/msb/sdk/httpclient/handler/impl/ServiceHttpEndPointBeanObjectBuilder.java
index 5d4bdde..163ba8c 100644
--- a/src/main/java/org/onap/msb/sdk/httpclient/handler/impl/ServiceHttpEndPointBeanObjectBuilder.java
+++ b/src/main/java/org/onap/msb/sdk/httpclient/handler/impl/ServiceHttpEndPointBeanObjectBuilder.java
@@ -1,18 +1,18 @@
/*******************************************************************************
* Copyright 2017 ZTE, Inc. and others.
- *
+ *
* 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 org.onap.msb.sdk.httpclient.handler.impl;
@@ -30,7 +30,7 @@ public class ServiceHttpEndPointBeanObjectBuilder implements HandlerContextBuild
/*
* (non-Javadoc)
- *
+ *
* @see
* com.zte.ums.zenap.versey.rpc.retrofit2.service.impl.handler.HandlerContextBuilder#build(com.zte
* .ums.zenap.versey.rpc.retrofit2.service.impl.handler.RetrofitServiceHandlerContext)
@@ -39,7 +39,6 @@ public class ServiceHttpEndPointBeanObjectBuilder implements HandlerContextBuild
public void build(RetrofitServiceHandlerContext ctx) throws RetrofitServiceRuntimeException {
if (ctx.getServiceHttpEndPointBeanObject() == null) {
- // 从注解上构建
ServiceHttpEndPointBeanObject beanObject =
buildBeanObjectFromClassAnnotion(ctx.getRetrofitSrvInterfaceClazz());
ctx.setServiceHttpEndPointBeanObject(beanObject);
diff --git a/src/main/java/org/onap/msb/sdk/httpclient/lb/ILoadBalanceStrategy.java b/src/main/java/org/onap/msb/sdk/httpclient/lb/ILoadBalanceStrategy.java
index 94ccd67..aa5f50c 100644
--- a/src/main/java/org/onap/msb/sdk/httpclient/lb/ILoadBalanceStrategy.java
+++ b/src/main/java/org/onap/msb/sdk/httpclient/lb/ILoadBalanceStrategy.java
@@ -1,11 +1,11 @@
/*******************************************************************************
* Copyright 2017 ZTE, Inc. and others.
- *
+ *
* 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
@@ -16,8 +16,7 @@ package org.onap.msb.sdk.httpclient.lb;
import org.onap.msb.sdk.httpclient.ServiceHttpEndPointObject;
/**
- * 每个实际的策略对象在运行中会保持单例
- *
+ *
* @author hu.rui
*
*/
diff --git a/src/main/java/org/onap/msb/sdk/httpclient/lb/LoadBalanceContext.java b/src/main/java/org/onap/msb/sdk/httpclient/lb/LoadBalanceContext.java
index ee46de5..dee6ea2 100644
--- a/src/main/java/org/onap/msb/sdk/httpclient/lb/LoadBalanceContext.java
+++ b/src/main/java/org/onap/msb/sdk/httpclient/lb/LoadBalanceContext.java
@@ -1,11 +1,11 @@
/*******************************************************************************
* Copyright 2017 ZTE, Inc. and others.
- *
+ *
* 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
@@ -24,7 +24,6 @@ import org.onap.msb.sdk.httpclient.ServiceHttpEndPointObject;
*/
public class LoadBalanceContext {
- // 从msb上查询到的全部endPoint信息
private List<ServiceHttpEndPointObject> endPoints;
private Object[] args;