Interface AppEngineServiceUtils

  • All Known Implementing Classes:
    AppEngineServiceUtilsImpl

    public interface AppEngineServiceUtils
    A wrapper for ModulesService that provides a saner API.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String convertToSingleSubdomain​(java.lang.String hostname)
      Converts a multi-level App Engine host name (not URL) to the -dot- single subdomain format.
      java.lang.String getCurrentVersionHostname​(java.lang.String service)
      Returns a host name to use for the given service and current version.
      java.lang.String getServiceHostname​(java.lang.String service)
      Returns a host name to use for the given service.
      java.lang.String getVersionHostname​(java.lang.String service, java.lang.String version)
      Returns a host name to use for the given service and version.
      void setNumInstances​(java.lang.String service, java.lang.String version, long numInstances)
      Set the number of instances at runtime for a given service and version.
    • Method Detail

      • getServiceHostname

        java.lang.String getServiceHostname​(java.lang.String service)
        Returns a host name to use for the given service.

        Note that this host name will not include a version, so it will always be whatever the live version is at the time that you hit the URL.

      • getCurrentVersionHostname

        java.lang.String getCurrentVersionHostname​(java.lang.String service)
        Returns a host name to use for the given service and current version.

        Note that this host name will include the current version now at time of URL generation, which will not be the live version in the future.

      • getVersionHostname

        java.lang.String getVersionHostname​(java.lang.String service,
                                            java.lang.String version)
        Returns a host name to use for the given service and version.
      • convertToSingleSubdomain

        java.lang.String convertToSingleSubdomain​(java.lang.String hostname)
        Converts a multi-level App Engine host name (not URL) to the -dot- single subdomain format.

        This is needed because appspot.com only has a single wildcard SSL certificate, so the native App Engine URLs of the form service.projectid.appspot.com or version.service.projectid.appspot.com won't work over HTTPS when being fetched from outside of GCP. The work-around is to change all of the "." subdomain markers to "-dot-". E.g.:

        • tools.projectid.appspot.com --> tools-dot-projectid.appspot.com
        • version.backend.projectid.appspot.com --> version-dot-backend-dot-projectid.appspot.com
        See Also:
        How App Engine requests are routed
      • setNumInstances

        void setNumInstances​(java.lang.String service,
                             java.lang.String version,
                             long numInstances)
        Set the number of instances at runtime for a given service and version.