/** * @param scope * @param provider * @return old provider if entry already existed and was replaced, else null. */ synchronized public CredentialsProvider insert(String principal, AuthScope scope, CredentialsProvider provider) throws HTTPException { return insert(new Entry(principal, scope, provider)); }
try { AuthScope scope = new AuthScope(ANY_HOST, ANY_PORT, ANY_REALM, HTTPAuthPolicy.SSL); insert(new Entry(ANY_PRINCIPAL, scope, creds)); } catch (HTTPException he) { log.error("HTTPAuthStore: could not insert default SSL data");
synchronized public void deserialize(InputStream istream, String password) throws HTTPException { ObjectInputStream ois = null; try { ois = openobjectstream(istream, password); List<Entry> entries = getDeserializedEntries(ois); for(Entry e : entries) { insert(e); } } finally { if(ois != null) try { ois.close(); } catch (IOException e) {/*ignore*/} } }
static synchronized protected void defineCredentialsProvider(String principal, AuthScope scope, CredentialsProvider provider, HTTPAuthStore store) { // Add/remove entry to AuthStore try { if(provider == null) {//remove store.remove(new HTTPAuthStore.Entry(principal, scope, provider)); } else { // add store.insert(new HTTPAuthStore.Entry(principal, scope, provider)); } } catch (HTTPException he) { log.error("HTTPSession.setCredentialsProvider failed"); } }