public CPEClientSession (CpeActions cpeActions, String username, String passwd, String authtype) { this.cpeActions = cpeActions; this.authtype = authtype; this.username = username; this.passwd = passwd; String urlstr = ((ConfParameter)this.cpeActions.confdb.confs.get(this.cpeActions.confdb.props.getProperty("MgmtServer_URL"))).value; //"http://192.168.1.50:8085/ws?wsdl"; System.out.println("ACS MGMT URL -------> " + urlstr); service = ResourceAPI.getInstance().getResourceAPI(urlstr); if (username != null && passwd != null) { if (authtype.equalsIgnoreCase("digest")) { service.addFilter(new HTTPDigestAuthFilter(username, passwd)); } else { service.addFilter(new HTTPBasicAuthFilter(username, passwd)); } //System.out.println("==========================> " + username + " " + passwd); } //System.out.println(" 2nd time ==============> " + username + " " + passwd); }
@Bean public Client getJerseyClient() { Client client = Client.create(); // thread-safe client.addFilter(new LoggingFilter()); client.addFilter(new HTTPDigestAuthFilter(username, password)); return client; }