Package com.cloudofficeprint.Resources
Class GraphQLResource
- java.lang.Object
-
- com.cloudofficeprint.RenderElements.RenderElement
-
- com.cloudofficeprint.Resources.ExternalResource
-
- com.cloudofficeprint.Resources.GraphQLResource
-
public class GraphQLResource extends ExternalResource
Class for working with a GraphQL endpoint as Resource.
-
-
Constructor Summary
Constructors Constructor Description GraphQLResource(java.lang.String endpoint, java.lang.String query, java.lang.String fileName, com.google.gson.JsonArray headers, java.lang.String auth)
Resource from a GraphQL endpoint.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gson.JsonObject
getJSON()
java.lang.String
getQuery()
java.util.Set<java.lang.String>
getTemplateTags()
Cannot be used for a resource.void
setQuery(java.lang.String query)
-
Methods inherited from class com.cloudofficeprint.Resources.ExternalResource
getAuth, getDataSource, getEndpoint, getFileName, getHeaders, setAuth, setDataSource, setEndpoint, setFileName, setHeaders
-
Methods inherited from class com.cloudofficeprint.RenderElements.RenderElement
getName, getValue, setName, setValue
-
-
-
-
Constructor Detail
-
GraphQLResource
public GraphQLResource(java.lang.String endpoint, java.lang.String query, java.lang.String fileName, com.google.gson.JsonArray headers, java.lang.String auth)
Resource from a GraphQL endpoint.- Parameters:
endpoint
- URL of the data source from where the JSON needs to be read.query
- GraphQL query.fileName
- Name of the output file.headers
- 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
-
getQuery
public java.lang.String getQuery()
- Returns:
- GraphQL query.
-
setQuery
public void setQuery(java.lang.String query)
- Parameters:
query
- GraphQL query.
-
getJSON
public com.google.gson.JsonObject getJSON()
- Overrides:
getJSON
in classExternalResource
- Returns:
- JSONObject with the tags for this element for the Cloud Office Print server.
-
getTemplateTags
public java.util.Set<java.lang.String> getTemplateTags()
Cannot be used for a resource.- Specified by:
getTemplateTags
in classRenderElement
- Returns:
- null
-
-