public class

AuthScope

extends Object
java.lang.Object
   ↳ org.apache.http.auth.AuthScope

Class Overview

The class represents an authentication scope consisting of a host name, a port number, a realm name and an authentication scheme name which Credentials apply to.

Summary

Constants
int ANY_PORT The -1 value represents any port.
Fields
public static final AuthScope ANY Default scope matching any host, port, realm and authentication scheme.
public static final String ANY_HOST The null value represents any host.
public static final String ANY_REALM The null value represents any realm.
public static final String ANY_SCHEME The null value represents any authentication scheme.
Public Constructors
AuthScope(String host, int port, String realm, String scheme)
Creates a new credentials scope for the given host, port, realm, and authentication scheme.
AuthScope(String host, int port, String realm)
Creates a new credentials scope for the given host, port, realm, and any authentication scheme.
AuthScope(String host, int port)
Creates a new credentials scope for the given host, port, any realm name, and any authentication scheme.
AuthScope(AuthScope authscope)
Creates a copy of the given credentials scope.
Public Methods
boolean equals(Object o)
String getHost()
int getPort()
String getRealm()
String getScheme()
int hashCode()
int match(AuthScope that)
Tests if the authentication scopes match.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int ANY_PORT

Also: HttpClient

The -1 value represents any port.

Constant Value: -1 (0xffffffff)

Fields

public static final AuthScope ANY

Also: HttpClient

Default scope matching any host, port, realm and authentication scheme. In the future versions of HttpClient the use of this parameter will be discontinued.

public static final String ANY_HOST

Also: HttpClient

The null value represents any host. In the future versions of HttpClient the use of this parameter will be discontinued.

public static final String ANY_REALM

Also: HttpClient

The null value represents any realm.

public static final String ANY_SCHEME

Also: HttpClient

The null value represents any authentication scheme.

Public Constructors

public AuthScope (String host, int port, String realm, String scheme)

Also: HttpClient

Creates a new credentials scope for the given host, port, realm, and authentication scheme.

Parameters
host the host the credentials apply to. May be set to null if credentials are applicable to any host.
port the port the credentials apply to. May be set to negative value if credentials are applicable to any port.
realm the realm the credentials apply to. May be set to null if credentials are applicable to any realm.
scheme the authentication scheme the credentials apply to. May be set to null if credentials are applicable to any authentication scheme.

public AuthScope (String host, int port, String realm)

Also: HttpClient

Creates a new credentials scope for the given host, port, realm, and any authentication scheme.

Parameters
host the host the credentials apply to. May be set to null if credentials are applicable to any host.
port the port the credentials apply to. May be set to negative value if credentials are applicable to any port.
realm the realm the credentials apply to. May be set to null if credentials are applicable to any realm.

public AuthScope (String host, int port)

Also: HttpClient

Creates a new credentials scope for the given host, port, any realm name, and any authentication scheme.

Parameters
host the host the credentials apply to. May be set to null if credentials are applicable to any host.
port the port the credentials apply to. May be set to negative value if credentials are applicable to any port.

public AuthScope (AuthScope authscope)

Also: HttpClient

Creates a copy of the given credentials scope.

Public Methods

public boolean equals (Object o)

See Also

public String getHost ()

Also: HttpClient

Returns
  • the host

public int getPort ()

Also: HttpClient

Returns
  • the port

public String getRealm ()

Also: HttpClient

Returns
  • the realm name

public String getScheme ()

Also: HttpClient

Returns
  • the scheme type

public int hashCode ()

See Also

public int match (AuthScope that)

Also: HttpClient

Tests if the authentication scopes match.

Returns
  • the match factor. Negative value signifies no match. Non-negative signifies a match. The greater the returned value the closer the match.

public String toString ()

See Also