public class ResultSet
extends java.lang.Object
ResultSet
element provides a container for placing produced records and for consuming them.
It organizes them in a chain of parts explicitly created by the producer. It provides incremental
population of the results through the chain of parts. The contents of the result set parts are immutable
once createdConstructor and Description |
---|
ResultSet(CreationParams params)
Creates a new
ResultSet |
ResultSet(java.lang.String filename)
Creates a new
ResultSet |
ResultSet(java.lang.String[] properties,
boolean dataFlow)
Creates a new
ResultSet |
ResultSet(java.lang.String properties,
boolean dataFlow)
Creates a new
ResultSet |
ResultSet(java.lang.String filename,
int noDecrypt)
Creates a new
ResultSet |
ResultSet(java.lang.String filename,
java.security.PrivateKey privkey)
Creates a new
ResultSet |
Modifier and Type | Method and Description |
---|---|
boolean |
addResults(java.lang.String[] results)
Adds teh provided results to the underlying buffer
|
boolean |
addText(java.lang.String[] results)
Adds teh provided text records in the underlying buffer
|
void |
addWSEPR(java.lang.String epr)
Adds a WS-EPR serialization to the head properties container
|
void |
clear()
Clears underlying structures
|
java.lang.String |
cloneRS()
Clones the implied
ResultSet |
void |
disableAccessLeasing() |
void |
disableTimeLeasing() |
void |
endAuthoring()
Stops the authoring of the current part and makes it available
|
java.lang.String |
executeQueryOnDocument(java.lang.String xPath)
Evaluates the provided xPath expression against the head part document and returns the output
as a serialized string.
|
java.lang.String |
executeQueryOnHead(java.lang.String xPath)
Evaluates the provided xPath expression against the head part document and returns the output
as a serialized string.
|
java.lang.String[] |
executeQueryOnResults(java.lang.String xPath)
Evaluates the provided expression against each of the results in the current payload part and if it
produces output the entire result serialization is considered as output.
|
void |
extendAccessLeasing(int extend)
Extend the access leasing
|
boolean |
extendTimeLeasing(java.util.Date extend)
Extend the time leasing
|
java.lang.String |
filterRS(java.lang.String xPath)
|
java.lang.String |
filterRS(java.lang.String xPath,
java.lang.String[] properties)
|
int |
getAccessLeasing()
Get the access leasing
|
java.lang.String |
getCurrentContentPartName()
Retrieves the name of the current payload part
|
java.lang.String |
getCurrentContentPartPayload()
Retrieves the payload of the current content part
|
byte[] |
getEncKey()
Get the encryption key
|
java.lang.String |
getFileContent(java.lang.String filename)
Retrieves the content of the provided local file
|
boolean |
getFirstPart()
Sets the current part to be the first payload part
|
org.gcube.common.searchservice.searchlibrary.resultset.security.HeadMnemonic |
getHeadMnemonic()
Get security properties
|
java.lang.String |
getHeadName()
Retrieves the name of the head part containing file
|
java.lang.String |
getHostIP()
Retrieves the IP address of the host that the
ResultSet receides in |
java.lang.String |
getHostName()
Retrieves the name of the host that the
ResultSet receides in |
org.gcube.common.searchservice.searchlibrary.resultset.security.Mnemonic |
getMnemonic()
Get security properties
|
boolean |
getNextPart(int waitMax)
Sets the next part in the chain as the current one waiting at most the provided amount of time in
milliseconds for it to become available
|
int |
getNumberOfResults(java.lang.String type)
Retrieves the number of results stored in a payload part of the
ResultSet |
boolean |
getPreviousPart()
Sets the current part to be the previous part
|
java.lang.String[] |
getProperties(java.lang.String type)
Retrieves the properties of the provided type
|
java.lang.String |
getResult(int index)
Retrieves the result that has the specified index in the current payload part
|
java.lang.String[] |
getResults()
Retrieves all the results that are in the current payload part
|
java.lang.String[] |
getResults(int from,
int to)
Retrieves all the results that are in the current payload part that have an index in the specified
index span
|
ResultSetRef |
getRSRef()
Retrieves the container of the
ResultSet info |
java.util.Date |
getTimeLeasing()
Get the time leasing
|
boolean |
isFirst()
Checks if the current part is the first payload part
|
boolean |
isForward()
Is the RS forward reading only.
|
boolean |
isLast()
Checks if the current part is the last payload part
|
java.lang.String |
keepTop(int count,
short type)
|
java.lang.String |
keepTop(java.lang.String[] properties,
int count,
short type)
|
RSConstants.CONTROLFLOW |
more(long time)
/**
Checks whether or not more results should be produced.
|
boolean |
nextAvailable()
Checks without blocking if the next part in this chain is available
|
void |
overrideProperties(PropertyElementBase[] properties)
removes any existing properties and sets the new ones
|
void |
overrideProperties(java.lang.String properties)
removes any existing properties and sets the new ones
|
boolean |
removePreviousPart()
Sets the current part to be the previous part
|
java.lang.String |
retrieveCustomProperties()
Retrieves a serialization of the head custom properties
|
boolean |
setForward(boolean f)
Set an RS to be forward
|
java.lang.String[] |
splitClear()
Splits the current payload part in sized defined by the
RSConstants.partSize property |
java.lang.String[] |
splitEncoded()
Splits the current payload part in sized defined by the
RSConstants.partSize property and encdes
them using Base64 encoding |
void |
startNewPart()
Starts a new part in the chain of parts, making the part that was currently authored available
|
java.lang.String |
transformByXSLT(java.lang.String xslt)
Performs an xslt transformation against the current payload part
|
java.lang.String |
transformByXSLTAndPersist(java.lang.String xslt)
Performs an xslt transformation against the current payload part
|
java.lang.String |
transformByXSLTAndPersist(javax.xml.transform.Templates xslt)
Performs an xslt transformation against the current payload part
|
java.lang.String |
transformRS(java.lang.String transformation)
|
java.lang.String |
transformRS(java.lang.String transformation,
java.lang.String[] properties)
|
void |
wrapFile(java.lang.String filename)
Wraps the provided file content
|
public ResultSet(CreationParams params) throws java.lang.Exception
ResultSet
params
- RS creation paramsjava.lang.Exception
- An unrecoverable for the operation error occuredpublic ResultSet(java.lang.String[] properties, boolean dataFlow) throws java.lang.Exception
ResultSet
public ResultSet(java.lang.String properties, boolean dataFlow) throws java.lang.Exception
ResultSet
public ResultSet(java.lang.String filename) throws java.lang.Exception
ResultSet
filename
- The file that holds the head of the existing ResultSet
chain to point tojava.lang.Exception
- An unrecoverable for the operation error occuredpublic ResultSet(java.lang.String filename, int noDecrypt) throws java.lang.Exception
ResultSet
filename
- The file that holds the head of the existing ResultSet
chain to point tonoDecrypt
- Flag saying to do a decryptjava.lang.Exception
- An unrecoverable for the operation error occuredpublic ResultSet(java.lang.String filename, java.security.PrivateKey privkey) throws java.lang.Exception
ResultSet
filename
- The file that holds the head of the existing ResultSet
chain to point toprivkey
- Private key to be used with the RSjava.lang.Exception
- An unrecoverable for the operation error occurredpublic void addWSEPR(java.lang.String epr) throws java.lang.Exception
epr
- The WS-EPR to addjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String getHeadName() throws java.lang.Exception
java.lang.Exception
- An unrecoverable for the operation error occuredpublic void clear() throws java.lang.Exception
java.lang.Exception
- An unrecoverable for the operation error occuredpublic ResultSetRef getRSRef()
ResultSet
infopublic boolean addResults(java.lang.String[] results) throws java.lang.Exception
results
- to addtrue
if all the results were successfully added, false
otherwisejava.lang.Exception
- An unrecoverable for the operation error occuredpublic boolean addText(java.lang.String[] results) throws java.lang.Exception
results
- The records to addtrue
if all the records were successfully written, false
otherwisejava.lang.Exception
- An unrecoverable for the operation error occuredpublic RSConstants.CONTROLFLOW more(long time) throws java.lang.Exception
ResultSet
is no longer
used, or the timeout the user specified has been reachedtime
- The timeout for the answerjava.lang.Exception
- An unrecoverabvle for the operation error has occuredpublic void startNewPart() throws java.lang.Exception
java.lang.Exception
- An unrecoverable for the operation error occuredpublic void endAuthoring() throws java.lang.Exception
java.lang.Exception
- An unrecoverable for the operation error occuredpublic void overrideProperties(PropertyElementBase[] properties) throws java.lang.Exception
properties
- teh proeprties to setjava.lang.Exception
- An unrecoverable for the operatiuon error occuredpublic void overrideProperties(java.lang.String properties) throws java.lang.Exception
properties
- teh proeprties to setjava.lang.Exception
- An unrecoverable for the operatiuon error occuredpublic void wrapFile(java.lang.String filename) throws java.lang.Exception
filename
- Teh filename to wrapjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String[] getProperties(java.lang.String type) throws java.lang.Exception
type
- The type of properties to retrievejava.lang.Exception
- An unrecoverable for the operation error occuredpublic boolean nextAvailable() throws java.lang.Exception
true
if it is, false
otherwisejava.lang.Exception
- An unrecoverable for the operation error occuredpublic boolean getNextPart(int waitMax) throws java.lang.Exception
waitMax
- T he amount of time to wait for the next part to become available. If this is negative,
a default amount of time defiened in RSConstants.sleepMax
is usedtrue
if there is a next part and it has become the current one, false
if there is no next partjava.lang.Exception
- An unrecoverable for the operation error occured or the timer expiredpublic boolean getFirstPart() throws java.lang.Exception
true
if the operation was successful,false
otehrwisejava.lang.Exception
- An unrecoverable for the operation error occured or the timer expiredpublic boolean getPreviousPart() throws java.lang.Exception
true
if the operation was successful,false
otehrwisejava.lang.Exception
- An unrecoverable for the operation error occured or the timer expiredpublic boolean removePreviousPart() throws java.lang.Exception
true
if the operation was successful,false
otehrwisejava.lang.Exception
- An unrecoverable for the operation error occured or the timer expiredpublic boolean isFirst() throws java.lang.Exception
true
if it is, false
otherwisejava.lang.Exception
- An unrecoverable for the operation error occured or the timer expiredpublic boolean isLast() throws java.lang.Exception
true
if it is, false
otherwisejava.lang.Exception
- An unrecoverable for the operation error occured or the timer expiredpublic int getNumberOfResults(java.lang.String type) throws java.lang.Exception
ResultSet
type
- The type of the RS part whose records should be contedjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String getCurrentContentPartPayload() throws java.lang.Exception
java.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String getResult(int index) throws java.lang.Exception
index
- The index of the result to be retrievedjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String[] getResults() throws java.lang.Exception
java.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String[] getResults(int from, int to) throws java.lang.Exception
from
- the starting indexto
- the ending indexjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String getHostIP() throws java.lang.Exception
ResultSet
receides injava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String getHostName() throws java.lang.Exception
ResultSet
receides injava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String[] splitEncoded() throws java.lang.Exception
RSConstants.partSize
property and encdes
them using Base64 encodingjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String[] splitClear() throws java.lang.Exception
RSConstants.partSize
propertyjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String getFileContent(java.lang.String filename) throws java.lang.Exception
filename
- The file whose content must e retrievedjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String retrieveCustomProperties() throws java.lang.Exception
java.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String cloneRS() throws java.lang.Exception
ResultSet
java.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String keepTop(int count, short type) throws java.lang.Exception
ResultSet
chain and creates a bew ResultSet
with the top kept. The new ResultSet
has the same properties with the current onecount
- The number of top elements to keeptype
- The type of operation to perform. This can be one of KeepTopThreadGeneric.PERPART
, KeepTopThreadGeneric.PERRECORD
ResultSet
java.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String keepTop(java.lang.String[] properties, int count, short type) throws java.lang.Exception
ResultSet
chain and creates a bew ResultSet
with the top keptproperties
- The properties the new ResultSet
must havecount
- The number of top elements to keeptype
- The type of operation to perform. This can be one of KeepTopThreadGeneric.PERPART
, KeepTopThreadGeneric.PERRECORD
ResultSet
java.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String getCurrentContentPartName() throws java.lang.Exception
java.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String executeQueryOnHead(java.lang.String xPath) throws java.lang.Exception
xPath
- The xPath to be evaluatedjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String executeQueryOnDocument(java.lang.String xPath) throws java.lang.Exception
xPath
- The xPath to be evaluatedjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String[] executeQueryOnResults(java.lang.String xPath) throws java.lang.Exception
xPath
- The xPath expression to be evaluated. it must start evaluation under the current nodejava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String filterRS(java.lang.String xPath) throws java.lang.Exception
public java.lang.String filterRS(java.lang.String xPath, java.lang.String[] properties) throws java.lang.Exception
ResultSet
returning
the name of the local file that holds the head part of the new ResultSet
. The xPath is applied to each result
and should begin referencing the current nodexPath
- The xpath to apply to the referenced ResultSet
results to create the new oneproperties
- The properties the new ResultSet
should haveResultSet
java.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String transformByXSLT(java.lang.String xslt) throws java.lang.Exception
xslt
- The xslt to applyjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String transformByXSLTAndPersist(java.lang.String xslt) throws java.lang.Exception
xslt
- The xslt to applyjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String transformByXSLTAndPersist(javax.xml.transform.Templates xslt) throws java.lang.Exception
xslt
- The xslt to applyjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String transformRS(java.lang.String transformation) throws java.lang.Exception
ResultSet
and creates
a new ResultSet
with payload the output of each transformation. The new ResultSet
has as properties the properties of the current onetransformation
- The tranformation to applyResultSet
head partjava.lang.Exception
- An unrecoverable for the operation error occuredpublic java.lang.String transformRS(java.lang.String transformation, java.lang.String[] properties) throws java.lang.Exception
public void disableAccessLeasing() throws java.lang.Exception
java.lang.Exception
- when access leasing cannot be disabledpublic void extendAccessLeasing(int extend) throws java.lang.Exception
extend
- Extend for how muchjava.lang.Exception
- when extending failedpublic int getAccessLeasing() throws java.lang.Exception
java.lang.Exception
- when retriving the access leasing failedpublic boolean isForward() throws java.lang.Exception
java.lang.Exception
- when information retrival failedpublic boolean setForward(boolean f) throws java.lang.Exception
f
- true if to set forwardjava.lang.Exception
- when seting forward failedpublic java.util.Date getTimeLeasing() throws java.lang.Exception
java.lang.Exception
- when retriving the time leasing failedpublic boolean extendTimeLeasing(java.util.Date extend) throws java.lang.Exception
extend
- Extend for how longjava.lang.Exception
- when extending failedpublic void disableTimeLeasing() throws java.lang.Exception
java.lang.Exception
- when time leasing cannot be disabledpublic org.gcube.common.searchservice.searchlibrary.resultset.security.Mnemonic getMnemonic()
public org.gcube.common.searchservice.searchlibrary.resultset.security.HeadMnemonic getHeadMnemonic()
public byte[] getEncKey() throws java.lang.Exception
java.lang.Exception
- An error occurred