Class RawConfig


  • public class RawConfig
    extends com.yahoo.config.ConfigInstance
    Encapsulates config, usually associated with a JRTConfigRequest. An instance of this class can represent either a config that is not yet resolved, a successfully resolved config, or an error.
    Author:
    hmusum
    • Constructor Detail

      • RawConfig

        public RawConfig​(ConfigKey<?> key,
                         java.lang.String defMd5)
        Constructor for an empty config (not yet resolved).
        Parameters:
        key - The ConfigKey
        defMd5 - The md5 sum of the .def-file.
      • RawConfig

        public RawConfig​(ConfigKey<?> key,
                         java.lang.String defMd5,
                         Payload payload,
                         java.lang.String configMd5,
                         long generation,
                         boolean internalRedeploy,
                         java.util.List<java.lang.String> defContent,
                         java.util.Optional<VespaVersion> vespaVersion)
      • RawConfig

        public RawConfig​(RawConfig rawConfig)
        Copy constructor
      • RawConfig

        public RawConfig​(ConfigKey<?> key,
                         java.lang.String defMd5,
                         Payload payload,
                         java.lang.String configMd5,
                         long generation,
                         boolean internalRedeploy,
                         int errorCode,
                         java.util.List<java.lang.String> defContent,
                         java.util.Optional<VespaVersion> vespaVersion)
    • Method Detail

      • getName

        public java.lang.String getName()
      • getNamespace

        public java.lang.String getNamespace()
      • getConfigId

        public java.lang.String getConfigId()
      • getConfigMd5

        public java.lang.String getConfigMd5()
        Overrides:
        getConfigMd5 in class com.yahoo.config.ConfigInstance
      • getDefMd5

        public java.lang.String getDefMd5()
      • getGeneration

        public long getGeneration()
      • setGeneration

        public void setGeneration​(long generation)
      • setInternalRedeploy

        public void setInternalRedeploy​(boolean internalRedeploy)
      • isInternalRedeploy

        public boolean isInternalRedeploy()
        Returns whether this config generation was created by a system internal redeploy, not an application package change.
      • getPayload

        public Payload getPayload()
      • errorCode

        public int errorCode()
      • getDefNamespace

        public java.lang.String getDefNamespace()
      • getVespaVersion

        public java.util.Optional<VespaVersion> getVespaVersion()
      • hasEqualConfig

        public boolean hasEqualConfig​(JRTServerConfigRequest req)
        Returns true if this config is equal to the config (same payload md5) in the given request.
        Parameters:
        req - the request for which to compare config payload with this config.
        Returns:
        true if this config is equal to the config in the given request.
      • hasNewerGeneration

        public boolean hasNewerGeneration​(JRTServerConfigRequest req)
        Returns true if this config has a more recent generation than the config in the given request.
        Parameters:
        req - the request for which to compare generation with this config.
        Returns:
        true if this config has a more recent generation than the config in the given request.
      • isError

        public boolean isError()
        Convenience method.
        Returns:
        true if errorCode() returns 0, false otherwise.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class com.yahoo.config.InnerNode
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class com.yahoo.config.InnerNode
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class com.yahoo.config.InnerNode
      • getDefContent

        public java.util.List<java.lang.String> getDefContent()