aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaixiliu <liukaixi@chinamobile.com>2023-05-09 16:56:32 +0800
committerkaixiliu <liukaixi@chinamobile.com>2023-05-09 16:56:57 +0800
commit649af3826678c25a3bd21ee84adb14ed9fe775a8 (patch)
treed7654c5242e070c9953a3b1151d31bfdcaf5345e
parentd98c1acefe136b31d9bb3af3a92c592399b377f6 (diff)
Enable uui-intent-analysis support Http requests
Issue-ID: USECASEUI-808 Signed-off-by: kaixiliu <liukaixi@chinamobile.com> Change-Id: Ia1abf56601d5f09bbafe5b2fd4cbe49b1dcd10e0
-rw-r--r--intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/util/RestfulServices.java20
-rw-r--r--intentanalysis/src/main/resources/application.yaml5
2 files changed, 7 insertions, 18 deletions
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/util/RestfulServices.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/util/RestfulServices.java
index a9755bc..c922095 100644
--- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/util/RestfulServices.java
+++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/util/RestfulServices.java
@@ -49,27 +49,21 @@ public class RestfulServices {
public static <T> T create(String baseUrl, Class<T> clazz) {
Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl)
- .addConverterFactory(JacksonConverterFactory.create()).build();
+ .addConverterFactory(JacksonConverterFactory.create()).build();
return retrofit.create(clazz);
}
public static <T> T create(Class<T> clazz, final String userName, final String passWord) {
//Set the interface response time
- OkHttpClient okHttpClient = new OkHttpClient.Builder().authenticator(new Authenticator() {
- @Nullable
- @Override
- public Request authenticate(@Nullable Route route, Response response) throws IOException {
- String authStr = Credentials.basic(userName, passWord);
- return response.request().newBuilder().addHeader("Authorization", authStr).build();
- }
- }).connectTimeout(300, TimeUnit.SECONDS).readTimeout(300, TimeUnit.SECONDS)
- .sslSocketFactory(getSSLSocketFactory(), new CustomTrustManager()).hostnameVerifier(getHostnameVerifier())
- .build();
+ OkHttpClient okHttpClient = new OkHttpClient.Builder()
+ .connectTimeout(300, TimeUnit.SECONDS)
+ .readTimeout(300, TimeUnit.SECONDS)
+ .build();
String msbUrl = getMSBIAGAddress();
- Retrofit retrofit = new Retrofit.Builder().baseUrl("https://" + msbUrl + "/").client(okHttpClient)
- .addConverterFactory(JacksonConverterFactory.create()).build();
+ Retrofit retrofit = new Retrofit.Builder().baseUrl("http://" + msbUrl + "/").client(okHttpClient)
+ .addConverterFactory(JacksonConverterFactory.create()).build();
return retrofit.create(clazz);
}
diff --git a/intentanalysis/src/main/resources/application.yaml b/intentanalysis/src/main/resources/application.yaml
index b4b4d81..6db6b46 100644
--- a/intentanalysis/src/main/resources/application.yaml
+++ b/intentanalysis/src/main/resources/application.yaml
@@ -2,11 +2,6 @@ server:
port: 8083
servlet:
context-path: /api/usecaseui-intent-analysis/v1
- ssl:
- protocol: TLS
- key-store: classpath:keystore/uuiIntentAnalysis.jks
- key-store-password: Aa123456
- key-store-type: JKS
spring:
datasource:
url: jdbc:postgresql://${POSTGRES_IP:127.0.0.1}:${POSTGRES_PORT:5432}/${POSTGRES_DB_NAME:intentdb}