Class RVHeadersDataSourceCredentials

java.lang.Object
io.revealbi.core.data.RVHeadersDataSourceCredentials
All Implemented Interfaces:
IRVDataSourceCredential

public class RVHeadersDataSourceCredentials extends Object implements IRVDataSourceCredential
The class used to represent authentication using headers (including cookies), supported only by Web Resource and REST API data sources. When sending HTTP requests to get data for the data source, the specified headers will be included.
  • Constructor Details

    • RVHeadersDataSourceCredentials

      public RVHeadersDataSourceCredentials()
      Creates an empty headers credentials object, you can use addHeader(String, String) to add headers.
    • RVHeadersDataSourceCredentials

      public RVHeadersDataSourceCredentials(Map<String,String> headers)
      Constructor used to indicate the headers that should be included in data requests.
      Parameters:
      headers - A map with the headers to send, supports only single-valued headers.
    • RVHeadersDataSourceCredentials

      public RVHeadersDataSourceCredentials(String singleHeaderName, String singleHeaderValue)
      Helper constructor to create a headers credentials with a single header, you can add additional headers with addHeader(String, String).
      Parameters:
      singleHeaderName - Header name, it will be ignored if null
      singleHeaderValue - Header value, it will be ignored if null
  • Method Details

    • addHeader

      public void addHeader(String headerName, String headerValue)
      Adds a new header to this credentials object.
      Parameters:
      headerName - Header name, it will be ignored if null.
      headerValue - Header value, it will be ignored if null.
    • getHeaders

      public Map<String,String> getHeaders()
      Returns the HTTP headers that will be included in data requests.
      Returns:
      A map of header names to header values.