String serverAdress = serverAdressParam;
if (!serverAdress.endsWith("/")) {
serverAdress = serverAdress + "/";
}
final LoginService loginService;
final CommonsHttpInvokerRequestExecutor httpInvokerRequestExecutor = new CommonsHttpInvokerRequestExecutor();
DefaultHttpMethodRetryHandler retryHandler = new DefaultHttpMethodRetryHandler(10, false);
httpInvokerRequestExecutor.getHttpClient().getParams().setParameter(HttpMethodParams.RETRY_HANDLER, retryHandler);
httpInvokerRequestExecutor.getHttpClient().getParams().setSoTimeout(1000*60*5);
{
HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
httpInvokerProxyFactoryBean.setServiceUrl(serverAdress + "copperMonitoringService");
httpInvokerProxyFactoryBean.setServiceInterface(LoginService.class);
httpInvokerProxyFactoryBean.setServiceUrl(serverAdress + "loginService");
httpInvokerProxyFactoryBean.afterPropertiesSet();
httpInvokerProxyFactoryBean.setHttpInvokerRequestExecutor(httpInvokerRequestExecutor);
loginService = (LoginService) httpInvokerProxyFactoryBean.getObject();
}
final String sessionId;
if(secureConnect) {
try {
sessionId = loginService.doLogin(user, password);
} catch (RemoteException e) {
throw new RuntimeException(e);
}
} else {
sessionId = "";