Changes made to upgrade pom version
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / scheduler / client / HttpBasicClient.java
index 14b0347..b2fff55 100644 (file)
@@ -4,6 +4,8 @@
  * ===================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
  *
  * Unless otherwise specified, all software contained herein is licensed
  * under the Apache License, Version 2.0 (the "License");
 package org.onap.portalapp.portal.scheduler.client;
 
 
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
 import javax.servlet.ServletContext;
+import javax.ws.rs.RuntimeType;
 import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
 
-import org.glassfish.jersey.client.ClientConfig;
+import org.apache.cxf.jaxrs.client.spec.ClientBuilderImpl;
+import org.apache.cxf.jaxrs.impl.ConfigurationImpl;
 import org.glassfish.jersey.client.ClientProperties;
 import org.onap.portalapp.portal.scheduler.util.CustomJacksonJaxBJsonProvider;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
@@ -64,10 +64,6 @@ public class HttpBasicClient{
        
        /** The logger. */
        EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpBasicClient.class);
-       
-       /** The Constant dateFormat. */
-       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-       
        /**
         * Obtain a basic HTTP client .
         *
@@ -76,10 +72,14 @@ public class HttpBasicClient{
         */
        public static Client getClient() throws Exception {
                
-               ClientConfig config = new ClientConfig();
-               config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
+               //ClientConfig config = new ClientConfig();
+
+               ConfigurationImpl config = new ConfigurationImpl(RuntimeType.CLIENT);
+               config.setProperty(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
+               ClientBuilderImpl impl = new ClientBuilderImpl();
                
-               return ClientBuilder.newClient(config)
+               Class.forName(org.apache.cxf.jaxrs.impl.ResponseImpl.class.getName());
+               return impl.withConfig(config).build()
                                .register(CustomJacksonJaxBJsonProvider.class);
        }       
 }