Renamed CookiePolicy to CookieSpecRegistry and AuthPolicy to AuthSchemeRegistry

git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@527903 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2007-04-12 12:42:35 +00:00
parent 134b0bf0f9
commit 1554373cf8
4 changed files with 15 additions and 14 deletions

View File

@ -39,17 +39,17 @@ import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
/** /**
* Authentication policy class. The Authentication policy provides corresponding * Authentication scheme registry that can be used to obtain the corresponding
* authentication scheme interfrace for a given type of authorization challenge. * authentication scheme implementation for a given type of authorization challenge.
* *
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a> * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
* *
* @version $Revision$ * @version $Revision$
* @since 3.0 * @since 3.0
*/ */
public final class AuthPolicy { public final class AuthSchemeRegistry {
public final static AuthPolicy DEFAULT = new AuthPolicy(); public final static AuthSchemeRegistry DEFAULT = new AuthSchemeRegistry();
private final Map registeredSchemes = new LinkedHashMap(); private final Map registeredSchemes = new LinkedHashMap();

View File

@ -40,21 +40,22 @@ import org.apache.http.cookie.params.CookieSpecParams;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
/** /**
* Cookie management policy class. The cookie policy provides corresponding * Cookie specification registry that can be used to obtain the corresponding
* cookie management interfrace for a given type or version of cookie. * cookie specification implementation for a given type of type or version of
* cookie.
* *
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a> * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
* @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a> * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
* *
* @since 4.0 * @since 4.0
*/ */
public final class CookiePolicy { public final class CookieSpecRegistry {
public final static CookiePolicy DEFAULT = new CookiePolicy(); public final static CookieSpecRegistry DEFAULT = new CookieSpecRegistry();
private final Map registeredSpecs; private final Map registeredSpecs;
public CookiePolicy() { public CookieSpecRegistry() {
super(); super();
this.registeredSpecs = new LinkedHashMap(); this.registeredSpecs = new LinkedHashMap();
} }

View File

@ -105,7 +105,7 @@ public final class CookieSpecParams {
} }
/** /**
* Assigns the {@link org.apache.http.cookie.CookiePolicy cookie policy} to be used * Assigns the {@link org.apache.http.cookie.CookieSpecRegistry cookie policy} to be used
* when executing a request based on these parameters. * when executing a request based on these parameters.
* *
* @param policy the cookie policy * @param policy the cookie policy

View File

@ -45,7 +45,7 @@ import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
/** /**
* Test cases for {@link CookiePolicy}. * Test cases for {@link CookieSpecRegistry}.
*/ */
public class TestCookiePolicy extends TestCase { public class TestCookiePolicy extends TestCase {
@ -63,7 +63,7 @@ public class TestCookiePolicy extends TestCase {
} }
public void testRegisterUnregisterCookieSpecFactory() { public void testRegisterUnregisterCookieSpecFactory() {
CookiePolicy registry = CookiePolicy.DEFAULT; CookieSpecRegistry registry = CookieSpecRegistry.DEFAULT;
List names = registry.getSpecNames(); List names = registry.getSpecNames();
assertNotNull(names); assertNotNull(names);
assertEquals(0, names.size()); assertEquals(0, names.size());
@ -98,7 +98,7 @@ public class TestCookiePolicy extends TestCase {
} }
public void testGetNewCookieSpec() { public void testGetNewCookieSpec() {
CookiePolicy registry = CookiePolicy.DEFAULT; CookieSpecRegistry registry = CookieSpecRegistry.DEFAULT;
registry.register(CookieSpecParams.BROWSER_COMPATIBILITY, registry.register(CookieSpecParams.BROWSER_COMPATIBILITY,
new BrowserCompatSpecFactory()); new BrowserCompatSpecFactory());
registry.register(CookieSpecParams.NETSCAPE, registry.register(CookieSpecParams.NETSCAPE,
@ -131,7 +131,7 @@ public class TestCookiePolicy extends TestCase {
} }
public void testInvalidInput() { public void testInvalidInput() {
CookiePolicy registry = CookiePolicy.DEFAULT; CookieSpecRegistry registry = CookieSpecRegistry.DEFAULT;
try { try {
registry.register(null, null); registry.register(null, null);
fail("IllegalArgumentException should have been thrown"); fail("IllegalArgumentException should have been thrown");