Interface JRTServerConfigRequest

    • Method Detail

      • setDelayedResponse

        void setDelayedResponse​(boolean delayedResponse)
        Notify this request that its delayed due to no new config being available at this point. The value provided in this function should be returned when calling isDelayedResponse().
        Parameters:
        delayedResponse - true if response is delayed, false if not.
      • addErrorResponse

        void addErrorResponse​(int errorCode,
                              java.lang.String message)
        Signal error when handling this request. The error should be reflected in the request state and propagated back to the client.
        Parameters:
        errorCode - error code, as described in ErrorCode.
        message - message to display for this error, typically printed by client.
      • addOkResponse

        void addOkResponse​(Payload payload,
                           long generation,
                           boolean internalRedeployment,
                           java.lang.String configMd5)
        Signal that the request was handled and provide return values typically needed by a client.
        Parameters:
        payload - The config payload that the client should receive.
        generation - The config generation of the given payload.
        internalRedeployment - whether this payload was generated from an internal redeployment not an application package change
        configMd5 - The md5sum of the given payload.
      • getRequestConfigMd5

        java.lang.String getRequestConfigMd5()
        Get the current config md5 of the client config.
        Specified by:
        getRequestConfigMd5 in interface JRTConfigRequest
        Returns:
        a config md5.
      • getRequestGeneration

        long getRequestGeneration()
        Get the current config generation of the client config.
        Specified by:
        getRequestGeneration in interface JRTConfigRequest
        Returns:
        the current config generation.
      • isDelayedResponse

        boolean isDelayedResponse()
        Check whether or not this request is delayed.
        Returns:
        true if delayed, false if not.
      • isInternalRedeploy

        boolean isInternalRedeploy()
        Returns whether the response config was created by a system internal redeploy, not an application package change
      • getRequestTrace

        Trace getRequestTrace()
        Get the request trace for this request. The trace can be used to trace config execution to provide useful debug info in production environments.
        Returns:
        a Trace instance.
      • payloadFromResponse

        Payload payloadFromResponse​(ConfigResponse response)
        Extract the appropriate payload for this request type for a given config response.
        Parameters:
        response - ConfigResponse to get payload from.
        Returns:
        A Payload that satisfies this request format.