Package com.cloudofficeprint.Resources
Class ExternalResource
- java.lang.Object
-
- com.cloudofficeprint.RenderElements.RenderElement
-
- com.cloudofficeprint.Resources.ExternalResource
-
- Direct Known Subclasses:
GraphQLResource
,RESTResource
public abstract class ExternalResource extends RenderElement
Abstract base class for external resources.
-
-
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAuth()
java.lang.String
getDataSource()
java.lang.String
getEndpoint()
java.lang.String
getFileName()
com.google.gson.JsonArray
getHeaders()
com.google.gson.JsonObject
getJSON()
void
setAuth(java.lang.String auth)
void
setDataSource(java.lang.String dataSource)
void
setEndpoint(java.lang.String endpoint)
void
setFileName(java.lang.String fileName)
void
setHeaders(com.google.gson.JsonArray headers)
-
Methods inherited from class com.cloudofficeprint.RenderElements.RenderElement
getName, getTemplateTags, getValue, setName, setValue
-
-
-
-
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 classRenderElement
- Returns:
- JSONObject with the tags for this element for the Cloud Office Print server.
-
-