public class LASBackendResponse
extends gov.noaa.pmel.tmap.jdom.LASDocument
Constructor and Description |
---|
LASBackendResponse()
Default constructor that builds an empty document with just a root element.
|
Modifier and Type | Method and Description |
---|---|
void |
addError(java.lang.String message)
Add an error result to the response.
|
void |
addError(java.lang.String ID,
java.lang.String message)
Add an error result to the response giving it a particular ID
|
void |
addMapScale(LASMapScale lasMapScale) |
void |
addResponseFromRequest(LASBackendRequest lasBackendRequest)
A convenience method to copy the collection of expected results from the request XML to the
response XML verifying the existence of each result before adding it to the response.
|
void |
addResult(org.jdom.Element result) |
LASBackendResponse |
brief()
Make a new LASBackendResponse without the exception_message.
|
java.util.HashSet<java.lang.String> |
getCacheKeys()
Get a HashSet of unique cache keys associated with this response.
|
java.lang.String |
getDate()
Get the date from the response.
|
java.lang.String |
getError()
Pull out the first error result from the response.
|
java.lang.String |
getFileTransformedByXSL(java.lang.String PATH,
java.lang.String stylesheet)
Get the contents of an XML file transformed by an XSLT stylesheet.
|
java.lang.String |
getResult(java.lang.String ID)
Get a URL reference to a result, the most common method you need to add a result to an HTML page in an <img> or <iframe> tag.
|
java.lang.String |
getResultAsEncodedString(java.lang.String ID)
Get the contents of a result that an XML file as a encoded String.
|
java.lang.String |
getResultAsFile(java.lang.String ID)
Get the full path name of a result by ID
|
java.lang.String |
getResultAsFileByType(java.lang.String in_type)
Return a file path to the first result of a particular type.
|
java.lang.String |
getResultAsJavaScriptSafeString(java.lang.String ID)
Get the contents of a result that an XML file as a JavaScript Safe String.
|
java.lang.String |
getResultAsString(java.lang.String ID)
Get the contents of a result that an XML file as a String.
|
java.lang.String |
getResultAsTable(java.lang.String ID)
A convenience method that is equivalent to getResultTransformedByXSL(ID, "webrowsetToTable")
|
javax.sql.rowset.WebRowSet |
getResultAsWebRowSet(java.lang.String ID,
java.lang.String db_type)
Returns a WebRowSet implementation to match the database type for a given id
|
org.jdom.Element |
getResultByType(java.lang.String in_type)
Helper function that gets the result element by result type.
|
java.util.List<Result> |
getResults() |
java.util.ArrayList<java.lang.String> |
getResultsAsFiles()
Get an ArrayList of result file paths.
|
java.lang.String |
getResultTransformedByXSL(java.lang.String ID,
java.lang.String stylesheet)
Get the contents of an XML result transformed by an XSLT stylesheet.
|
java.lang.String |
getStreamedID()
Deprecated.
|
java.lang.String |
getStreamedMimeType(java.lang.String ID)
Get the MIME type of this result
Before the product server can stream the result back it has to know it's mime time which is part of the operation configuration.
|
java.lang.String |
getTextResultTransformedByXSL(java.lang.String ID,
java.lang.String stylesheet) |
boolean |
hasError()
See if this response contains an error result.
|
boolean |
hasStreamedResult()
Check to see if this reponse has a result that is "streamable"
|
boolean |
isResultByTypeRemote(java.lang.String in_type)
Get a remote result by type
|
boolean |
isResultRemote(java.lang.String ID)
Find out if a result is from a remote service
|
boolean |
isStreamable(java.lang.String ID)
Check to see if a result can be streamed.
|
void |
makeResult(java.lang.String absolutePath) |
void |
mapResultsToURL(java.lang.String serverURL)
Take the suggested file names on the local server and construct URLs for those results
|
void |
merge(LASBackendResponse lasResponse)
Take an LASResponse and merge its results with this one.
|
void |
removeResult(java.lang.String ID)
Remove a result.
|
void |
setError(java.lang.String message)
Deprecated.
|
void |
setError(java.lang.String message,
java.lang.Exception e)
Set this as an error response using the Java Exception for a detailed message.
|
void |
setError(java.lang.String ID,
java.lang.String message)
Turn this response into an error response using the message as the error message.
|
void |
setID(java.lang.String key)
Set an id for this response
|
void |
setOpenId(java.lang.String openid) |
convertProperties, findProperty, findPropertyGroup, findPropertyGroup, findPropertyGroupList, findPropertyGroupList, findPropertyValue, getElementByXPath, getProperty, toCompactString, toEncodedJavaScriptSafeURLString, toEncodedURLString, toJavaScriptSafeString, toJSON, toJSON, toString, toString, write, write, write, writeElement
addContent, addContent, addContent, addContent, clone, cloneContent, detachRootElement, equals, getBaseURI, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getDocType, getDocument, getParent, getProperty, getRootElement, hashCode, hasRootElement, indexOf, removeContent, removeContent, removeContent, removeContent, setBaseURI, setContent, setContent, setContent, setContent, setDocType, setProperty, setRootElement
public LASBackendResponse()
public void addResponseFromRequest(LASBackendRequest lasBackendRequest) throws org.jdom.JDOMException
lasBackendRequest
- - the request object from which the results will be copiedorg.jdom.JDOMException
public java.lang.String getResult(java.lang.String ID)
ID
- - the ID of the result you want.public boolean isResultRemote(java.lang.String ID)
ID
- the id of the result to checkpublic boolean isStreamable(java.lang.String ID)
ID
- - the ID of the result to checkpublic java.lang.String getStreamedID()
public java.lang.String getStreamedMimeType(java.lang.String ID)
ID
- -- The ID of the result you want.public boolean hasStreamedResult()
public java.util.List<Result> getResults()
public org.jdom.Element getResultByType(java.lang.String in_type)
in_type
- public java.lang.String getResultAsFileByType(java.lang.String in_type)
in_type
- public void addResult(org.jdom.Element result)
public void removeResult(java.lang.String ID)
ID
- - the ID of the result to be removedpublic java.util.ArrayList<java.lang.String> getResultsAsFiles()
public java.util.HashSet<java.lang.String> getCacheKeys()
public java.lang.String getResultAsFile(java.lang.String ID)
ID
- the ID of the result you want.public java.lang.String getResultAsString(java.lang.String ID) throws org.jdom.JDOMException, java.io.IOException
ID
- - the ID of the result you wantorg.jdom.JDOMException
java.io.IOException
public java.lang.String getResultAsEncodedString(java.lang.String ID) throws org.jdom.JDOMException, java.io.IOException
ID
- - the ID of the result you wantorg.jdom.JDOMException
java.io.IOException
public java.lang.String getResultAsJavaScriptSafeString(java.lang.String ID) throws org.jdom.JDOMException, java.io.IOException
ID
- - the ID of the result you wantorg.jdom.JDOMException
java.io.IOException
public java.lang.String getResultTransformedByXSL(java.lang.String ID, java.lang.String stylesheet) throws java.io.IOException, org.jdom.JDOMException
ID
- the ID of the result you want to transformstylesheet
- the name of the stylesheet (in resources/productserver/stylesheets) that will be used to transform the XMLorg.jdom.JDOMException
java.io.IOException
public java.lang.String getTextResultTransformedByXSL(java.lang.String ID, java.lang.String stylesheet) throws java.io.IOException, org.jdom.JDOMException
java.io.IOException
org.jdom.JDOMException
public java.lang.String getFileTransformedByXSL(java.lang.String PATH, java.lang.String stylesheet) throws java.io.IOException, org.jdom.JDOMException
PATH
- the full i local path of the file you want to transformstylesheet
- the name of the stylesheet (in resources/productserver/stylesheets) that will be used to transform the XMLorg.jdom.JDOMException
java.io.IOException
public javax.sql.rowset.WebRowSet getResultAsWebRowSet(java.lang.String ID, java.lang.String db_type) throws java.sql.SQLException, java.io.FileNotFoundException, java.io.IOException
ID
- -- the result id of the webrowset. It had better be a result of type webrowsetdb_type
- -- the database implementation, either "mysql" or "oracle"java.sql.SQLException
java.io.FileNotFoundException
java.io.IOException
public java.lang.String getResultAsTable(java.lang.String ID) throws java.io.IOException, org.jdom.JDOMException
ID
- the ID of the result you want to transformorg.jdom.JDOMException
java.io.IOException
public void mapResultsToURL(java.lang.String serverURL)
serverURL
- the URL of the local serverpublic void merge(LASBackendResponse lasResponse)
lasResponse
- the response to be mergedpublic void setID(java.lang.String key)
key
- the ID (usually the cache key)public java.lang.String getError()
public boolean hasError()
public void setError(java.lang.String message)
message
- the message for the error being set.public void addError(java.lang.String message)
message
- the error message to addpublic void setError(java.lang.String ID, java.lang.String message)
ID
- The ID of the error resultmessage
- the message for this errorpublic void addError(java.lang.String ID, java.lang.String message)
ID
- the ID of the error resultmessage
- the error messagepublic java.lang.String getDate()
public void setError(java.lang.String message, java.lang.Exception e)
message
- The LAS messagee
- the Exception from which to get the details of the failure.public boolean isResultByTypeRemote(java.lang.String in_type)
in_type
- the result type that we are checkingpublic LASBackendResponse brief()
public void setOpenId(java.lang.String openid)
public void addMapScale(LASMapScale lasMapScale)
public void makeResult(java.lang.String absolutePath)