public ServiceHttpProxy getOpenHttpProxy() { if (null == _host) { BaseException e = new BaseException(this, "null == _host"); throw e; } if (null != _openHttpProxy) { return _openHttpProxy; } NetworkAddress networkAddress = new NetworkAddress(_host, _port); HttpDispatcher httpDispatcher = new HttpDispatcher(networkAddress); _openHttpProxy = new ServiceHttpProxy(httpDispatcher); return _openHttpProxy; }
private ServiceHttpProxy buildServiceHttpProxy(bool useAuthService) { Authenticator authenticator = null; if (useAuthService) { SecurityConfiguration securityConfiguration = SecurityConfiguration.TEST; authenticator = new Authenticator(false, securityConfiguration); } HttpDispatcher httpDispatcher = new HttpDispatcher(_networkAddress); ServiceHttpProxy answer = new ServiceHttpProxy(httpDispatcher, authenticator); return answer; }
public ServiceHttpProxy getAuthHttpProxy(ClientSecurityConfiguration clientSecurityConfiguration) { if (null == _host) { BaseException e = new BaseException(this, "null == _host"); throw e; } if (null != _authHttpProxy && _authHttpProxy.Authenticator.getSecurityConfiguration() == clientSecurityConfiguration) { return _authHttpProxy; } NetworkAddress networkAddress = new NetworkAddress(_host, _port); HttpDispatcher httpDispatcher = new HttpDispatcher(networkAddress); Authenticator authenticator = new Authenticator(false, clientSecurityConfiguration); _authHttpProxy = new ServiceHttpProxy(httpDispatcher, authenticator); return _authHttpProxy; }
//////////////////////////////////////////////////////////////////////////// // username, realm, password can be null public void initialize(String host, int port ) { _host = host; _port = port; _openHttpProxy = null; _authHttpProxy = null; }