public class ProductRequest
extends java.lang.Object
Constructor and Description |
---|
ProductRequest()
A default no arg constructor.
|
ProductRequest(LASConfig lasConfig,
LASUIRequest lasRequest,
java.lang.String debug,
java.lang.String JSESSIONID)
Make a product request object from the UI request.
|
Modifier and Type | Method and Description |
---|---|
void |
addProperty(org.jdom.Element properties,
java.lang.String propertyGroup,
java.lang.String name,
java.lang.String value)
Add a new property to a given group, create the group if necessary.
|
void |
chainResults(java.lang.String ID,
LASBackendResponse lasResponse)
When one sub-operation is chained to another, this method makes sure any output from a previous operation
that is input into the next operation gets in the right place in the Request XML before the next operation is fired.
|
int |
findOperationIndex(java.lang.String ID)
Given a particular operation ID, find the index of said operation.
|
java.lang.String |
getCacheKey()
Get the global cache key for this product request.
|
java.lang.String |
getCacheKey(java.lang.String ID)
Get the cache key for a particular sub-operation.
|
java.lang.String |
getDataSetProperty(org.jdom.Element data,
java.lang.String group,
java.lang.String name)
Get a data set property from a particular backend request data Element.
|
LASUIRequest |
getLasRequest() |
java.lang.String |
getOperationID(int index)
Find the ID of a particular sub-operation based on the index.
|
java.util.ArrayList |
getOperationNames()
Get a list of all the operation names that can be used in the status page.
|
java.lang.String |
getProperty(java.lang.String ID,
java.lang.String group,
java.lang.String name)
Get a property from a particular request in this chain of product requests.
|
LASBackendRequest |
getRequestByService(java.lang.String service) |
java.util.ArrayList<LASBackendRequest> |
getRequestXML()
Get the list of XML Backend Request objects for this product request chain.
|
java.lang.String |
getServiceName(java.lang.String ID)
Get the name of the service that will be contacted to perform this sub-operation
|
java.lang.String |
getSubCacheKey(int i)
Get the cache key for a particular request in the chain
|
java.lang.String |
getTemplate()
Get the name of the output template that is needed to render the output from this product request.
|
java.lang.String |
getTemplateMimeType() |
boolean |
getUseCache()
The "global" value of use_cache.
|
boolean |
getUseCache(java.lang.String ID)
Determine whether or not to use the cache for a particular sub-operation
|
void |
makeRequest(org.jdom.Element operation,
LASConfig lasConfig,
LASUIRequest lasRequest,
java.lang.String debug,
java.lang.String JSESSIONID)
Takes each individual sub-operation and creates the LASBackendRequest request object that will be used
to request the product from the backend service.
|
java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> |
propertiesToHashMap(org.jdom.Element properties)
Takes a JDOM element of the form:
|
void |
setLasRequest(LASUIRequest lasRequest) |
public ProductRequest()
public ProductRequest(LASConfig lasConfig, LASUIRequest lasRequest, java.lang.String debug, java.lang.String JSESSIONID) throws gov.noaa.pmel.tmap.exception.LASException, java.io.UnsupportedEncodingException, org.jdom.JDOMException
lasConfig
- - the instantiation of the entire las.xml configuration.lasRequest
- - the current request from the LAS User Interface client (or external client).debug
- - the debug level.JSESSIONID
- - a session id string (can be null).gov.noaa.pmel.tmap.exception.LASException
java.io.UnsupportedEncodingException
org.jdom.JDOMException
public void makeRequest(org.jdom.Element operation, LASConfig lasConfig, LASUIRequest lasRequest, java.lang.String debug, java.lang.String JSESSIONID) throws org.jdom.JDOMException, gov.noaa.pmel.tmap.exception.LASException, java.io.UnsupportedEncodingException
operation
- lasConfig
- lasRequest
- org.jdom.JDOMException
gov.noaa.pmel.tmap.exception.LASException
java.io.UnsupportedEncodingException
public java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> propertiesToHashMap(org.jdom.Element properties)
properties
- public java.lang.String getProperty(java.lang.String ID, java.lang.String group, java.lang.String name) throws gov.noaa.pmel.tmap.exception.LASException
ID
- - the ID of the operation whose sub-request we want to examine for the propertygroup
- - the property grouname
- - the name of the propertygov.noaa.pmel.tmap.exception.LASException
public java.lang.String getDataSetProperty(org.jdom.Element data, java.lang.String group, java.lang.String name)
data
- - the data element to be examinedgroup
- - the property group namename
- - the name of the propertypublic java.util.ArrayList<LASBackendRequest> getRequestXML()
public java.lang.String getCacheKey()
public java.lang.String getSubCacheKey(int i)
i
- - the index of the requestpublic java.lang.String getTemplate()
public java.lang.String getTemplateMimeType()
public java.lang.String getServiceName(java.lang.String ID) throws gov.noaa.pmel.tmap.exception.LASException
ID
- - the ID of the sub-operationgov.noaa.pmel.tmap.exception.LASException
public java.lang.String getOperationID(int index)
index
- - the index of the sub-operation to be looked up.public boolean getUseCache(java.lang.String ID) throws gov.noaa.pmel.tmap.exception.LASException
ID
- - the ID of the operation being examinedgov.noaa.pmel.tmap.exception.LASException
public boolean getUseCache()
public java.lang.String getCacheKey(java.lang.String ID) throws gov.noaa.pmel.tmap.exception.LASException
ID
- - the ID of the operationgov.noaa.pmel.tmap.exception.LASException
public void chainResults(java.lang.String ID, LASBackendResponse lasResponse) throws gov.noaa.pmel.tmap.exception.LASException
ID
- - The ID of the operation that is looking for chained input.lasResponse
- - The response object so far from which the chained output will be extracted.gov.noaa.pmel.tmap.exception.LASException
public int findOperationIndex(java.lang.String ID) throws gov.noaa.pmel.tmap.exception.LASException
ID
- - the ID of the sought after operation.gov.noaa.pmel.tmap.exception.LASException
public void addProperty(org.jdom.Element properties, java.lang.String propertyGroup, java.lang.String name, java.lang.String value)
properties
- - the existing properties colleciton.propertyGroup
- - the name of the group.name
- - the name of the propertyvalue
- - the value of the propertypublic java.util.ArrayList getOperationNames()
public LASUIRequest getLasRequest()
public void setLasRequest(LASUIRequest lasRequest)
public LASBackendRequest getRequestByService(java.lang.String service) throws org.jdom.JDOMException, gov.noaa.pmel.tmap.exception.LASException
org.jdom.JDOMException
gov.noaa.pmel.tmap.exception.LASException