Interface Server


  • public interface Server
    Configures the remote build cache node server.

    The specified values will take precedence over the values defined in the develocity.xml.

    Since:
    1.21
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      Credentials getCredentials()
      Gets the credentials configuration.
      java.lang.String getServerId()
      Gets the remote build cache server ID.
      java.net.URI getUrl()
      Gets the remote build cache node URL.
      boolean isAllowInsecureProtocol()
      Gets whether it is allowed to communicate with the remote build cache node over an insecure HTTP connection.
      boolean isAllowUntrusted()
      Gets whether it is allowed to communicate with the remote build cache node with an untrusted SSL certificate.
      boolean isUseExpectContinue()
      Gets whether the client should use HTTP Expect-Continue when storing data on the server.
      void setAllowInsecureProtocol​(boolean allowInsecureProtocol)
      Sets whether it is allowed to communicate with the remote build cache node over an insecure HTTP connection.
      void setAllowUntrusted​(boolean allowUntrusted)
      Sets whether it is allowed to communicate with the remote build cache node with an untrusted SSL certificate.
      void setServerId​(java.lang.String serverId)
      Sets the remote build cache server ID.
      default void setUrl​(java.lang.String url)
      Sets the remote build cache node URL.
      void setUrl​(java.net.URI url)
      Sets the remote build cache node URL.
      void setUseExpectContinue​(boolean useExpectContinue)
      Sets whether the client should use HTTP Expect-Continue when storing data on the server.
    • Method Detail

      • getServerId

        @Nullable
        java.lang.String getServerId()
        Gets the remote build cache server ID.
        Returns:
        the remote build cache server ID or null
      • setServerId

        void setServerId​(@Nullable
                         java.lang.String serverId)
        Sets the remote build cache server ID.

        Configuration via the develocity.cache.remote.serverId system property will always take precedence.

        Parameters:
        serverId - the remote build cache server ID or null
      • getUrl

        @Nullable
        java.net.URI getUrl()
        Gets the remote build cache node URL.
        Returns:
        the remote build cache node URL or null
      • setUrl

        default void setUrl​(@Nullable
                            java.lang.String url)
        Sets the remote build cache node URL.

        Configuration via the develocity.cache.remote.url system property will always take precedence.

        Parameters:
        url - the remote build cache node URL or null
      • setUrl

        void setUrl​(@Nullable
                    java.net.URI url)
        Sets the remote build cache node URL.

        Configuration via the develocity.cache.remote.url system property will always take precedence.

        Parameters:
        url - the remote build cache node URL or null
      • isAllowUntrusted

        boolean isAllowUntrusted()
        Gets whether it is allowed to communicate with the remote build cache node with an untrusted SSL certificate.
        Returns:
        true if it is allowed to communicate with the remote build cache node with an untrusted SSL certificate, false otherwise
      • setAllowUntrusted

        void setAllowUntrusted​(boolean allowUntrusted)
        Sets whether it is allowed to communicate with the remote build cache node with an untrusted SSL certificate.

        The default (built-in) remote build cache node uses SSL certificates that are trusted by default by standard modern Java environments. If you are using a different remote build cache node, it may use an untrusted certificate. This may be due to the use of an internally provisioned or self-signed certificate.

        In such a scenario, you can either configure the build JVM environment to trust the certificate, or call this method with true to disable verification of the remote build cache node identity.

        Allowing communication with untrusted servers keeps data encrypted during transmission, but makes it easy for a man-in-the-middle to impersonate the intended server and capture data.

        Setting this property to true is a convenient workaround during the initial evaluation, but it is a serious security issue and should not be used in production.

        This value has no effect if the remote build cache node URL is specified using the HTTP protocol (i.e. has SSL disabled).

        Configuration via the develocity.cache.remote.allowUntrustedServer system property will always take precedence.

        Parameters:
        allowUntrusted - whether to allow communication with an HTTPS server with an untrusted certificate
      • isAllowInsecureProtocol

        boolean isAllowInsecureProtocol()
        Gets whether it is allowed to communicate with the remote build cache node over an insecure HTTP connection.
        Returns:
        true if communication over an insecure HTTP connection is allowed, false otherwise
      • setAllowInsecureProtocol

        void setAllowInsecureProtocol​(boolean allowInsecureProtocol)
        Sets whether it is allowed to communicate with the remote build cache node over an insecure HTTP connection.

        For security purposes this intentionally requires a user to opt in to using insecure protocols on case by case basis.

        Allowing communication over insecure protocols allows for a man-in-the-middle to impersonate the intended server, and gives an attacker the ability to serve malicious executable code onto the system.

        Setting this property to true is a convenient workaround during the initial evaluation, but it is a serious security issue and should not be used in production.

        Configuration via the develocity.cache.remote.allowInsecureProtocol system property will always take precedence.

        Parameters:
        allowInsecureProtocol - whether to allow communication over an insecure HTTP connection
      • isUseExpectContinue

        boolean isUseExpectContinue()
        Gets whether the client should use HTTP Expect-Continue when storing data on the server.
        Returns:
        true if the client uses HTTP Expect-Continue, false otherwise
      • setUseExpectContinue

        void setUseExpectContinue​(boolean useExpectContinue)
        Sets whether the client should use HTTP Expect-Continue when storing data on the server.

        Configuration via the develocity.cache.remote.useExpectContinue system property will always take precedence.

        Parameters:
        useExpectContinue - whether the client should use HTTP Expect-Continue
      • getCredentials

        Credentials getCredentials()
        Gets the credentials configuration.

        If not specified and an access key is available for the DevelocityApi.getServer() value, it will be used to authenticate with the build cache (regardless of the build cache server address set with setUrl(String) or setUrl(URI)).

        Returns:
        the credentials configuration