Package com.yahoo.vespa.config.protocol
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addErrorResponse(int errorCode, java.lang.String message)
Signal error when handling this request.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.java.lang.String
getRequestConfigMd5()
Get the current config md5 of the client config.long
getRequestGeneration()
Get the current config generation of the client config.Trace
getRequestTrace()
Get the request trace for this request.boolean
isDelayedResponse()
Check whether or not this request is delayed.boolean
isInternalRedeploy()
Returns whether the response config was created by a system internal redeploy, not an application package changePayload
payloadFromResponse(ConfigResponse response)
Extract the appropriate payload for this request type for a given config response.void
setDelayedResponse(boolean delayedResponse)
Notify this request that its delayed due to no new config being available at this point.-
Methods inherited from interface com.yahoo.vespa.config.GetConfigRequest
getConfigKey, getDefContent, getVespaVersion, noCache
-
Methods inherited from interface com.yahoo.vespa.config.protocol.JRTConfigRequest
errorCode, errorMessage, getClientHostName, getConfigKey, getProtocolVersion, getRequest, getShortDescription, getTimeout, getVespaVersion, validateParameters
-
-
-
-
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 callingisDelayedResponse()
.- 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 inErrorCode
.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 changeconfigMd5
- The md5sum of the given payload.
-
getRequestConfigMd5
java.lang.String getRequestConfigMd5()
Get the current config md5 of the client config.- Specified by:
getRequestConfigMd5
in interfaceJRTConfigRequest
- Returns:
- a config md5.
-
getRequestGeneration
long getRequestGeneration()
Get the current config generation of the client config.- Specified by:
getRequestGeneration
in interfaceJRTConfigRequest
- 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.
-
-