* Please note that custom authentication preferences, if used, need to be updated accordingly * for the new {@link AuthScheme authentication scheme} to take effect. *
* * @param name the identifier for this scheme * @param factory the {@link AuthSchemeFactory} class to register * * @see #getAuthScheme */ public void register( final String name, final AuthSchemeFactory factory) { Args.notNull(name, "Name"); Args.notNull(factory, "Authentication scheme factory"); registeredSchemes.put(name.toLowerCase(Locale.ENGLISH), factory); } /** * Unregisters the class implementing an {@link AuthScheme authentication scheme} with * the given name. * * @param name the identifier of the class to unregister */ public void unregister(final String name) { Args.notNull(name, "Name"); registeredSchemes.remove(name.toLowerCase(Locale.ENGLISH)); } /** * Gets the {@link AuthScheme authentication scheme} with the given name. * * @param name the {@link AuthScheme authentication scheme} identifier * @param params the {@link HttpParams HTTP parameters} for the authentication * scheme. * * @return {@link AuthScheme authentication scheme} * * @throws IllegalStateException if a scheme with the given name cannot be found */ public AuthScheme getAuthScheme(final String name, final HttpParams params) throws IllegalStateException { Args.notNull(name, "Name"); final AuthSchemeFactory factory = registeredSchemes.get(name.toLowerCase(Locale.ENGLISH)); if (factory != null) { return factory.newInstance(params); } else { throw new IllegalStateException("Unsupported authentication scheme: " + name); } } /** * Obtains a list containing the names of all registered {@link AuthScheme authentication * schemes} * * @return list of registered scheme names */ public List