Class ExternalResource

    • Constructor Summary

      Constructors 
      Constructor Description
      ExternalResource​(java.lang.String dataSource, java.lang.String endpoint, java.lang.String fileName, com.google.gson.JsonArray headers, java.lang.String auth)
      Abstract base class for external resources.
    • Constructor Detail

      • ExternalResource

        public ExternalResource​(java.lang.String dataSource,
                                java.lang.String endpoint,
                                java.lang.String fileName,
                                com.google.gson.JsonArray headers,
                                java.lang.String auth)
        Abstract base class for external resources.
        Parameters:
        dataSource - Type of request: graphql or rest.
        endpoint - URL of the data source from where the JSON needs to be read.
        fileName - Name of the output file.
        headers - JsonArray of the HTTP headers, e.g. [{"Content-Type":"application/json"},{"Custom-Auth-Token":"xysazxklj4568asdf46a5sd4f"}]
        auth - Basic authentication i.e. 'user:password' to compute an Authorization header.
    • Method Detail

      • getDataSource

        public java.lang.String getDataSource()
        Returns:
        Type of request: graphql or rest.
      • setDataSource

        public void setDataSource​(java.lang.String dataSource)
        Parameters:
        dataSource - Type of request: graphql or rest
      • getEndpoint

        public java.lang.String getEndpoint()
        Returns:
        URL of the data source from where the JSON needs to be read.
      • setEndpoint

        public void setEndpoint​(java.lang.String endpoint)
        Parameters:
        endpoint - URL of the data source from where the JSON needs to be read.
      • getFileName

        public java.lang.String getFileName()
        Returns:
        Name of the output file.
      • setFileName

        public void setFileName​(java.lang.String fileName)
        Parameters:
        fileName - Name of the output file.
      • getHeaders

        public com.google.gson.JsonArray getHeaders()
        Returns:
        JsonArray of the HTTP headers, e.g. [{"Content-Type":"application/json"},{"Custom-Auth-Token":"xysazxklj4568asdf46a5sd4f"}]
      • setHeaders

        public void setHeaders​(com.google.gson.JsonArray headers)
        Parameters:
        headers - JsonArray of the HTTP headers, e.g. [{"Content-Type":"application/json"},{"Custom-Auth-Token":"xysazxklj4568asdf46a5sd4f"}]
      • getAuth

        public java.lang.String getAuth()
        Returns:
        Basic authentication i.e. 'user:password' to compute an Authorization header.
      • setAuth

        public void setAuth​(java.lang.String auth)
        Parameters:
        auth - Basic authentication i.e. 'user:password' to compute an Authorization header.
      • getJSON

        public com.google.gson.JsonObject getJSON()
        Specified by:
        getJSON in class RenderElement
        Returns:
        JSONObject with the tags for this element for the Cloud Office Print server.