@Contract(threading=IMMUTABLE) public class AuthScope extends Object
AuthScope
represents an authentication scope consisting of a host name,
a port number, a realm name and an authentication scheme name.
This class can also optionally contain a host of origin, if created in response to authentication challenge from a specific host.
Modifier and Type | Field and Description |
---|---|
static AuthScope |
ANY
Default scope matching any host, port, realm and authentication scheme.
|
static String |
ANY_HOST
The
null value represents any host. |
static int |
ANY_PORT
The
-1 value represents any port. |
static String |
ANY_REALM
The
null value represents any realm. |
static String |
ANY_SCHEME
The
null value represents any authentication scheme. |
Constructor and Description |
---|
AuthScope(AuthScope authscope)
Creates a copy of the given credentials scope.
|
AuthScope(org.apache.http.HttpHost origin)
Defines auth scope for a specific host of origin.
|
AuthScope(org.apache.http.HttpHost origin,
String realm,
String schemeName)
Defines auth scope for a specific host of origin.
|
AuthScope(String host,
int port)
Defines auth scope with the given
host and port . |
AuthScope(String host,
int port,
String realm)
Defines auth scope with the given
host , port and realm . |
AuthScope(String host,
int port,
String realm,
String schemeName)
Defines auth scope with the given
host , port , realm , and
schemeName . |
public static final String ANY_HOST
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
-1
value represents any port.public static final String ANY_REALM
null
value represents any realm.public static final String ANY_SCHEME
null
value represents any authentication scheme.public static final AuthScope ANY
public AuthScope(String host, int port, String realm, String schemeName)
host
, port
, realm
, and
schemeName
.host
- authentication host. May be ANY_HOST
if applies
to any host.port
- authentication port. May be ANY_PORT
if applies
to any port of the host.realm
- authentication realm. May be ANY_REALM
if applies
to any realm on the host.schemeName
- authentication scheme. May be ANY_SCHEME
if applies
to any scheme supported by the host.public AuthScope(org.apache.http.HttpHost origin, String realm, String schemeName)
origin
- host of originrealm
- authentication realm. May be ANY_REALM
if applies
to any realm on the host.schemeName
- authentication scheme. May be ANY_SCHEME
if applies
to any scheme supported by the host.public AuthScope(org.apache.http.HttpHost origin)
origin
- host of originpublic AuthScope(String host, int port, String realm)
host
, port
and realm
.public AuthScope(String host, int port)
host
and port
.public AuthScope(AuthScope authscope)
public org.apache.http.HttpHost getOrigin()
public String getHost()
public int getPort()
public String getRealm()
public String getScheme()
public int match(AuthScope that)
public boolean equals(Object o)
equals
in class Object
Object.equals(Object)
public String toString()
toString
in class Object
Object.toString()
public int hashCode()
hashCode
in class Object
Object.hashCode()
Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.