org.apache.http.auth.AuthScope
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
|
|
|
Value |
|
AuthScope |
ANY |
Default scope matching any host, port, realm and authentication scheme. |
|
|
String |
ANY_HOST |
The null value represents any host. |
|
|
int |
ANY_PORT |
The -1 value represents any port. |
-1 |
0xffffffff |
String |
ANY_REALM |
The null value represents any realm. |
|
|
String |
ANY_SCHEME |
The null value represents any authentication scheme. |
|
|
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
public
static
final
AuthScope
ANY
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
The null value represents any host. In the future versions of
HttpClient the use of this parameter will be discontinued.
public
static
final
int
ANY_PORT
The
-1 value represents any port.
Constant Value:
-1
(0xffffffff)
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
public
AuthScope(String host, int port, String realm, String scheme)
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 credenticals are applicable to
any host. |
port
| the port the credentials apply to. May be set
to negative value if credenticals are applicable to
any port. |
realm
| the realm the credentials apply to. May be set
to null if credenticals are applicable to
any realm. |
scheme
| the authentication scheme the credentials apply to.
May be set to null if credenticals are applicable to
any authentication scheme.
|
public
AuthScope(String host, int port, String realm)
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 credenticals are applicable to
any host. |
port
| the port the credentials apply to. May be set
to negative value if credenticals are applicable to
any port. |
realm
| the realm the credentials apply to. May be set
to null if credenticals are applicable to
any realm.
|
public
AuthScope(String host, int port)
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 credenticals are applicable to
any host. |
port
| the port the credentials apply to. May be set
to negative value if credenticals are applicable to
any port.
|
public
AuthScope(AuthScope authscope)
Creates a copy of the given credentials scope.
Public Methods
public
boolean
equals(Object o)
Compares the argument to the receiver, and returns true if they represent
the
same object using a class specific comparison. The
implementation in Object returns true only if the argument is the exact
same object as the receiver (==).
Parameters
o
| Object the object to compare with this object. |
Returns
- boolean
true
if the object is the same as this
object false
if it is different from this object.
public
int
hashCode()
Returns an integer hash code for the receiver. Any two objects which
answer
true
when passed to
.equals
must
answer the same value for this method.
public
int
match(AuthScope that)
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()
Returns a string containing a concise, human-readable description of the
receiver.
Returns
- String a printable representation for the receiver.