Class CfService

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

public class CfService extends Object
Contains the Map of values and type-safe accessors for properties of a single service defined in VCAP_SERVICES.
Author:
Mark Pollack
  • Constructor Details

  • Method Details

    • createCredentials

      public CfCredentials createCredentials()
    • createVolumes

      public List<CfVolume> createVolumes()
    • getMap

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

      public CfCredentials getCredentials()
    • getTags

      public List<String> getTags()
    • getLabel

      public String getLabel()
    • getPlan

      public String getPlan()
    • getName

      public String getName()
    • getString

      public String getString(String... keys)
    • existsByTagIgnoreCase

      public boolean existsByTagIgnoreCase(String... tags)
    • existsByUriSchemeStartsWith

      public boolean existsByUriSchemeStartsWith(String... uriSchemes)
    • existsByCredentialsContainsUriField

      public boolean existsByCredentialsContainsUriField(String... uriSchemes)
      There are common variations for the name of the uri field that prepend the schema portion of the URI, e.g. if the uri schema is 'mysql' the field name in the JSON maybe 'mysqlUri', 'mysqluri', 'mysqlUrl' or 'mysqlurl'. This method searches for the presence of these alternatively named fields in the credentials of the service
      Parameters:
      uriSchemes - list of uri prefixes to use as uriSchemes
      Returns:
      true if there is a uri field in the credentials map
    • existsByLabelStartsWith

      public boolean existsByLabelStartsWith(String label)
      Parameters:
      label - string to search for as a prefix in the service label
      Returns:
      whether the label starts with the provided string
    • existsByLabelContains

      public boolean existsByLabelContains(String label)
      Parameters:
      label - string to search for in the service label
      Returns:
      whether the label includes the provided string
    • existsByLabelStartsWith

      public boolean existsByLabelStartsWith(String... labels)
      Parameters:
      labels - Strings to search for as a prefix in the service label
      Returns:
      whether any of the provided labels starts with the service label