Class CfCredentials

java.lang.Object
io.pivotal.cfenv.core.CfCredentials

public class CfCredentials extends Object
Access service credentials.
Author:
Mark Pollack
  • Constructor Details

  • Method Details

    • getMap

      public Map<String,Object> getMap()
    • getDerivedCredentials

      public Map<String,String> getDerivedCredentials()
      Get a map that contains credentials derived from the credentials map
      Returns:
      derived credentials
    • getHost

      public String getHost()
      Return the host, under the keys 'host' and 'hostname' in the credential map. If it is not found try to obtain the host from the uri field.
      Returns:
      value of the host, null if not found.
    • getPort

      public String getPort()
      Return the port, under the key 'port' in the credential map. If it is not found try to obtain the port from the uri field.
      Returns:
      value of the port, null if not found.
    • getName

      public String getName()
    • getUsername

      public String getUsername()
      Return the username, under the keys 'username' and 'user' in the credential map. If it is not found try to obtain the username from the uri field.
      Returns:
      value of the username, null if not found.
    • getPassword

      public String getPassword()
      Return the password, under the key 'password' in the credential map. If it is not found try to obtain the password in the uri field.
      Returns:
      value of the password, null if not found.
    • getUri

      public String getUri(String... uriSchemes)
      Return the URI field, by default look under the field name 'uri' and 'url', but also optionally look in field names that begin with the uriScheme and are suffixed with 'Uri', 'uri', 'Url' and 'url'
      Parameters:
      uriSchemes - optional list of uri scheme names to use as a prefix for an expanded search of the uri field
      Returns:
      the value of the uri field
    • getUriInfo

      public UriInfo getUriInfo()
      Return UriInfo derived from the field 'uri' or 'url'
      Returns:
      the UriInfo object
    • getUriInfo

      public UriInfo getUriInfo(String uriScheme)
      Return UriInfo derived from URI field
      Parameters:
      uriScheme - a uri scheme name to use as a prefix to search of the uri field
      Returns:
      the UriInfo object
    • getString

      public String getString(String... keys)