Android
org.apache.http.auth
public class

org.apache.http.auth.AuthScope

java.lang.Object
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

            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)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
          String  getHost()
          int  getPort()
          String  getRealm()
          String  getScheme()
          int  hashCode()
Returns an integer hash code for the receiver.
          int  match(AuthScope that)
Tests if the authentication scopes match.
          String  toString()
Returns a string containing a concise, human-readable description of the receiver.
Methods inherited from class java.lang.Object

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.

See Also

public String getHost()

Returns

  • the host

public int getPort()

Returns

  • the port

public String getRealm()

Returns

  • the realm name

public String getScheme()

Returns

  • the scheme type

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.

Returns

  • int the receiver's hash.

See Also

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.

See Also

Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48