Interface JRTServerConfigRequest

All Superinterfaces:
GetConfigRequest, JRTConfigRequest
All Known Implementing Classes:
JRTServerConfigRequestV3

public interface JRTServerConfigRequest extends JRTConfigRequest, GetConfigRequest
Interface for config requests at the server end point.
Author:
Ulf Lilleengen
  • Method Details

    • 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, 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 applyOnRestart, PayloadChecksums payloadChecksums)
      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.
      applyOnRestart - true if this config should only be applied on the next restart, false if it should be applied right away
      payloadChecksums - checksums of the given payload.
    • getRequestDefMd5

      String getRequestDefMd5()
      Returns the md5 of the config definition in the request.
      Specified by:
      getRequestDefMd5 in interface GetConfigRequest
      Specified by:
      getRequestDefMd5 in interface JRTConfigRequest
      Returns:
      an md5 of config definition in request.
    • 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.
    • applyOnRestart

      boolean applyOnRestart()
    • 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.
    • configPayloadChecksums

      PayloadChecksums configPayloadChecksums()
      Returns the payload checksums from the config request.
      Specified by:
      configPayloadChecksums in interface GetConfigRequest
      Returns:
      the payload checksumss from request.