Class HttpDataSource.RequestProperties

  • Enclosing interface:
    HttpDataSource

    public static final class HttpDataSource.RequestProperties
    extends Object
    Stores HTTP request properties (aka HTTP headers) and provides methods to modify the headers in a thread safe way to avoid the potential of creating snapshots of an inconsistent or unintended state.
    • Constructor Detail

      • RequestProperties

        public RequestProperties()
    • Method Detail

      • set

        public void set​(String name,
                        String value)
        Sets the specified property value for the specified name. If a property for this name previously existed, the old value is replaced by the specified value.
        Parameters:
        name - The name of the request property.
        value - The value of the request property.
      • set

        public void set​(Map<String,​String> properties)
        Sets the keys and values contained in the map. If a property previously existed, the old value is replaced by the specified value. If a property previously existed and is not in the map, the property is left unchanged.
        Parameters:
        properties - The request properties.
      • clearAndSet

        public void clearAndSet​(Map<String,​String> properties)
        Removes all properties previously existing and sets the keys and values of the map.
        Parameters:
        properties - The request properties.
      • remove

        public void remove​(String name)
        Removes a request property by name.
        Parameters:
        name - The name of the request property to remove.
      • clear

        public void clear()
        Clears all request properties.
      • getSnapshot

        public Map<String,​String> getSnapshot()
        Gets a snapshot of the request properties.
        Returns:
        A snapshot of the request properties.