Class ConfigResponse

  • All Implemented Interfaces:
    RESTMessage, RESTResponse

    public class ConfigResponse
    extends java.lang.Object
    implements RESTResponse
    Represents a response to requesting server-side provided configuration for the REST catalog. This allows client provided values to be overridden by the server or defaulted if not provided by the client.

    The catalog properties, with overrides and defaults applied, should be used to configure the catalog and for all subsequent requests after this initial config request.

    Configuration from the server consists of two sets of key/value pairs.

    • defaults - properties that should be used as default configuration
    • overrides - properties that should be used to override client configuration
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ConfigResponse.Builder  
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigResponse()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ConfigResponse.Builder builder()  
      java.util.Map<java.lang.String,​java.lang.String> defaults()
      Properties that should be used as default configuration.
      java.util.Map<java.lang.String,​java.lang.String> merge​(java.util.Map<java.lang.String,​java.lang.String> clientProperties)
      Merge client-provided config with server side provided configuration to return a single properties map which will be used for instantiating and configuring the REST catalog.
      java.util.Map<java.lang.String,​java.lang.String> overrides()
      Properties that should be used to override client configuration.
      java.lang.String toString()  
      void validate()
      Ensures that a constructed instance of a REST message is valid according to the REST spec.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ConfigResponse

        public ConfigResponse()
    • Method Detail

      • validate

        public void validate()
        Description copied from interface: RESTMessage
        Ensures that a constructed instance of a REST message is valid according to the REST spec.

        This is needed when parsing data that comes from external sources and the object might have been constructed without all the required fields present.

        Specified by:
        validate in interface RESTMessage
      • defaults

        public java.util.Map<java.lang.String,​java.lang.String> defaults()
        Properties that should be used as default configuration. defaults have the lowest priority and should be applied before the client provided configuration.
        Returns:
        properties that should be used as default configuration
      • overrides

        public java.util.Map<java.lang.String,​java.lang.String> overrides()
        Properties that should be used to override client configuration. overrides have the highest priority and should be applied after defaults and any client-provided configuration properties.
        Returns:
        properties that should be given higher precedence than any client provided input
      • merge

        public java.util.Map<java.lang.String,​java.lang.String> merge​(java.util.Map<java.lang.String,​java.lang.String> clientProperties)
        Merge client-provided config with server side provided configuration to return a single properties map which will be used for instantiating and configuring the REST catalog.
        Parameters:
        clientProperties - - Client provided configuration
        Returns:
        Merged configuration, with precedence in the order overrides, then client properties, and then defaults.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object