com.microsoft.tfs.core.credentials
Class CachedCredentials

java.lang.Object
  extended by com.microsoft.tfs.core.credentials.CachedCredentials

public class CachedCredentials
extends java.lang.Object

Represents credentials used to authenticate to TFS or other network resources (HTTP proxies) that can be saved on the client.

Thread-safety:
thread-safe

Constructor Summary
CachedCredentials(java.net.URI uri, Cookie[] cookies)
          Creates CachedCredentials for the given URI.
CachedCredentials(java.net.URI uri, Credentials credentials)
          Creates CachedCredentials from an existing Credentials object.
CachedCredentials(java.net.URI uri, java.lang.String username, java.lang.String password)
          Creates CachedCredentials for the given URI.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Cookie[] getCookies()
           
 java.lang.String getPassword()
           
 java.net.URI getURI()
           
 java.lang.String getUsername()
           
 int hashCode()
           
 Credentials toCredentials()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedCredentials

public CachedCredentials(java.net.URI uri,
                         Credentials credentials)
Creates CachedCredentials from an existing Credentials object.

Parameters:
uri - the URI the credentials are for (must not be null)
credentials - the credentials (must not be null)

CachedCredentials

public CachedCredentials(java.net.URI uri,
                         java.lang.String username,
                         java.lang.String password)
Creates CachedCredentials for the given URI.

Parameters:
uri - the URI (must not be null)
username - the username including domain (may be null or empty)
password - the password (may be null or empty)

CachedCredentials

public CachedCredentials(java.net.URI uri,
                         Cookie[] cookies)
Creates CachedCredentials for the given URI.

Parameters:
uri - the URI (must not be null)
cookies - the cookies for Federated Authentication)
Method Detail

getURI

public java.net.URI getURI()
Returns:
the URI these credentials are for (never null)

getUsername

public java.lang.String getUsername()
Returns:
the username with domain (may be null)

getPassword

public java.lang.String getPassword()
Returns:
the password (may be null)

getCookies

public Cookie[] getCookies()
Returns:
the cookies (may be null)

toCredentials

public Credentials toCredentials()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


© 2015 Microsoft. All rights reserved.