org.gcube.indexmanagement.forwardindexlookup
Class ForwardIndexLookupResource

java.lang.Object
  extended by IndexLookupWSResource
      extended by org.gcube.indexmanagement.forwardindexlookup.ForwardIndexLookupResource

public class ForwardIndexLookupResource
extends IndexLookupWSResource

Contain the resource instances. More precisely index information like type, format, name, modified date and so on.


Field Summary
static java.lang.String RP_CONTENT_TYPE
           
static java.lang.String RP_KEY_COUNT
           
static java.lang.String RP_KEY_DESCRIPTION
           
 
Constructor Summary
ForwardIndexLookupResource()
          The ForwardIndexResource constructor.
 
Method Summary
 void clearIndex()
           
 java.lang.String getAll(java.lang.String keyName, boolean bAscending, ResultType resType)
          Gets all key and value pairs.
 java.lang.String getContentType()
          Getter method for the ContentType Resource Property
 int getCount(java.lang.String keyName)
           
 java.lang.String getEQ(java.lang.String keyName, java.lang.String key, ResultType resType)
          Gets the key and value pairs where keys are equal the input key.
 java.lang.String getGE(java.lang.String keyName, java.lang.String key, ResultType resType)
          Gets the key and value pairs where keys are GE the input key
 java.lang.String getGEandLE(java.lang.String keyName, java.lang.String keyG, java.lang.String keyL, ResultType resType)
          Gets the key and value pairs where keys are GE the input key1 and LE the input key2
 java.lang.String getGEandLT(java.lang.String keyName, java.lang.String keyG, java.lang.String keyL, ResultType resType)
          Gets the key and value pairs where keys are GE the input key1 and LT the input key2.
 java.lang.String getGT(java.lang.String keyName, java.lang.String key, ResultType resType)
          Gets the key and value pairs where keys are GE the input key.
 java.lang.String getGTandLE(java.lang.String keyName, java.lang.String keyG, java.lang.String keyL, ResultType resType)
          Gets the key and value pairs where keys are GT the input key1 and LE the input key2.
 java.lang.String getGTandLT(java.lang.String keyName, java.lang.String keyG, java.lang.String keyL, ResultType resType)
          Gets the key and value pairs where keys are GT the input key1 and LT the input key2.
 KeyCountType[] getKeyCount()
          Getter method for the KeyCount Resource Property
 KeyDescriptionType[] getKeyDescription()
          Getter method for the KeyDescription Resource Property
 java.lang.String getLE(java.lang.String keyName, java.lang.String key, ResultType resType)
          Gets the key and value pairs where keys are LE the input key.
 java.lang.String getLT(java.lang.String keyName, java.lang.String key, ResultType resType)
          Gets the key and value pairs where keys are LT the input key.
 void mergeAddition(java.io.File deltaIndex, java.lang.String cmsID, int documentCount)
          USED to UPDATE THE FORWARD INDEX.
 void mergeDeletion(java.io.File deletionFile, java.lang.String fileID, int documentCount)
          FORWARD INDEX RECEIVES ALL UPDATES IN mergeAddition Merges the contents of a Deletion DeltaFile into the local index replication (delete documents).
 void onLoad(java.io.ObjectInputStream ois, boolean firstLoad)
           
 void onLookupNotificationReceived(org.w3c.dom.Element message)
           
 void onResourceRemoval()
           
 void onStore(java.io.ObjectOutputStream oos)
           
 java.net.URI query(java.lang.String query)
          Gets all key and value pairs that satisfy query's conditions.
 void setContentType(java.lang.String contentType)
          Setter method for the ContentType Resource Property
 void setKeyCount(KeyCountType[] keyCount)
          Setter method for the KeyCount Resource Property
 void setKeyDescription(KeyDescriptionType[] keyDescription)
          Setter method for the KeyDescription Resource Property
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RP_KEY_DESCRIPTION

public static final java.lang.String RP_KEY_DESCRIPTION
See Also:
Constant Field Values

RP_KEY_COUNT

public static final java.lang.String RP_KEY_COUNT
See Also:
Constant Field Values

RP_CONTENT_TYPE

public static final java.lang.String RP_CONTENT_TYPE
See Also:
Constant Field Values
Constructor Detail

ForwardIndexLookupResource

public ForwardIndexLookupResource()
The ForwardIndexResource constructor.

Method Detail

onStore

public void onStore(java.io.ObjectOutputStream oos)
             throws java.lang.Exception
Throws:
java.lang.Exception

onLoad

public void onLoad(java.io.ObjectInputStream ois,
                   boolean firstLoad)
            throws java.lang.Exception
Throws:
java.lang.Exception

onResourceRemoval

public void onResourceRemoval()

getContentType

public java.lang.String getContentType()
Getter method for the ContentType Resource Property

Returns:
String - the requested ContentType identifier

setContentType

public void setContentType(java.lang.String contentType)
Setter method for the ContentType Resource Property

Parameters:
contentType - String - the new ContentType identifier

getKeyDescription

public KeyDescriptionType[] getKeyDescription()
Getter method for the KeyDescription Resource Property

Returns:
KeyDescriptionType[] the KeyDscription of this Index

getKeyCount

public KeyCountType[] getKeyCount()
Getter method for the KeyCount Resource Property

Returns:
KeyCountType[] the KeyCount of this Index

mergeAddition

public void mergeAddition(java.io.File deltaIndex,
                          java.lang.String cmsID,
                          int documentCount)
                   throws IndexException
USED to UPDATE THE FORWARD INDEX. FORWARD INDEX RECEIVES ALL UPDATES IN mergeIndex Merges the contents of a Addition DeltaFile into the local index replication (add documents). Required by the DeltaFileMerger interface.

Parameters:
deltaIndex - File - the DeltaFile to be merged into the local index replication
cmsID - String - the ID the retrieved file has in CMS
documentCount - int - the document count
Throws:
IndexException - - in case of failure
See Also:
org.diligentproject.indexservice.storagehandling.DeltaFileMerger

mergeDeletion

public void mergeDeletion(java.io.File deletionFile,
                          java.lang.String fileID,
                          int documentCount)
                   throws IndexException
FORWARD INDEX RECEIVES ALL UPDATES IN mergeAddition Merges the contents of a Deletion DeltaFile into the local index replication (delete documents). Required by the DeltaFileMerger interface.

Parameters:
deletionFile - File - the DeltaFile to be merged into the local index replication
fileID - String - the ID the retrieved file has in Storage
documentCount - int - the number if documents present in the DeltaFile
Throws:
IndexException - - in case of failure.
See Also:
org.diligentproject.indexservice.storagehandling.DeltaFileMerger

clearIndex

public void clearIndex()
                throws IndexException
Throws:
IndexException

getEQ

public java.lang.String getEQ(java.lang.String keyName,
                              java.lang.String key,
                              ResultType resType)
                       throws IndexException
Gets the key and value pairs where keys are equal the input key.

Parameters:
keyName - - the keyName to lookup.
key - - the lookup key.
resType - - determines the format of the results.
Returns:
resultSet EPR- with the key and value pairs.
Throws:
IndexException - in case of failure.

getGE

public java.lang.String getGE(java.lang.String keyName,
                              java.lang.String key,
                              ResultType resType)
                       throws IndexException
Gets the key and value pairs where keys are GE the input key

Parameters:
keyName - - the keyName to lookup.
key - - the lookup key.
resType - - determines the format of the results.
Returns:
rowSet EPR- with the key and value pairs.
Throws:
IndexException - in case of failure.

getGT

public java.lang.String getGT(java.lang.String keyName,
                              java.lang.String key,
                              ResultType resType)
                       throws IndexException
Gets the key and value pairs where keys are GE the input key.

Parameters:
keyName - - the keyName to lookup.
key - - the lookup key.
resType - - determines the format of the results.
Returns:
rowSet EPR- with the key and value pairs.
Throws:
IndexException - in case of failure.

getLE

public java.lang.String getLE(java.lang.String keyName,
                              java.lang.String key,
                              ResultType resType)
                       throws IndexException
Gets the key and value pairs where keys are LE the input key.

Parameters:
keyName - - the keyName to lookup.
key - - the lookup key.
resType - - determines the format of the results.
Returns:
rowSet EPR- with the key and value pairs.
Throws:
IndexException - in case of failure.

getLT

public java.lang.String getLT(java.lang.String keyName,
                              java.lang.String key,
                              ResultType resType)
                       throws IndexException
Gets the key and value pairs where keys are LT the input key.

Parameters:
keyName - - the keyName to lookup.
key - - the lookup key.
resType - - determines the format of the results.
Returns:
rowSet EPR- with the key and value pairs.
Throws:
IndexException - in case of failure.

getGEandLE

public java.lang.String getGEandLE(java.lang.String keyName,
                                   java.lang.String keyG,
                                   java.lang.String keyL,
                                   ResultType resType)
                            throws IndexException
Gets the key and value pairs where keys are GE the input key1 and LE the input key2

Parameters:
keyName - - the keyName to lookup.
resType - - determines the format of the results.
keyG- - the GE key.
keyL- - the LE key.
Returns:
rowSet EPR- with the key and value pairs.
Throws:
IndexException - in case of failure.

getGTandLE

public java.lang.String getGTandLE(java.lang.String keyName,
                                   java.lang.String keyG,
                                   java.lang.String keyL,
                                   ResultType resType)
                            throws IndexException
Gets the key and value pairs where keys are GT the input key1 and LE the input key2.

Parameters:
keyName - - the keyName to lookup.
resType - - determines the format of the results.
keyGT- - the GT key.
keyLE- - the LE key.
Returns:
rowSet EPR- with the key and value pairs.
Throws:
IndexException - in case of failure.

getGEandLT

public java.lang.String getGEandLT(java.lang.String keyName,
                                   java.lang.String keyG,
                                   java.lang.String keyL,
                                   ResultType resType)
                            throws IndexException
Gets the key and value pairs where keys are GE the input key1 and LT the input key2.

Parameters:
keyName - - the keyName to lookup.
resType - - determines the format of the results.
keyGE- - the GE key.
keyLT- - the LT key.
Returns:
rowSet EPR- with the key and value pairs.
Throws:
IndexException - exception in case of failure.

getGTandLT

public java.lang.String getGTandLT(java.lang.String keyName,
                                   java.lang.String keyG,
                                   java.lang.String keyL,
                                   ResultType resType)
                            throws IndexException
Gets the key and value pairs where keys are GT the input key1 and LT the input key2.

Parameters:
keyName - - the keyName to lookup.
resType - - determines the format of the results.
keyGT- - the GT key.
keyLT- - the LT key.
Returns:
rowSet EPR- with the key and value pairs.
Throws:
IndexException - in case of failure.

getAll

public java.lang.String getAll(java.lang.String keyName,
                               boolean bAscending,
                               ResultType resType)
                        throws IndexException
Gets all key and value pairs.

Parameters:
keyName - - the keyName to lookup.
resType - - determines the format of the results.
bAscending - - the ordering of the returned results.
Returns:
rowSet EPR- with the key and value pairs.
Throws:
IndexException - in case of failure.

query

public java.net.URI query(java.lang.String query)
                   throws IndexException,
                          GRS2WriterException
Gets all key and value pairs that satisfy query's conditions.

Parameters:
query - the query containing the conditions.
Returns:
rowSet EPR- with the key and value pairs.
Throws:
IndexException - in case of failure.
GRS2WriterException

setKeyDescription

public void setKeyDescription(KeyDescriptionType[] keyDescription)
Setter method for the KeyDescription Resource Property

Parameters:
keyDescription - KeyDescriptionType[] the new keyDescription

setKeyCount

public void setKeyCount(KeyCountType[] keyCount)
Setter method for the KeyCount Resource Property

Parameters:
keyCount - KeyCountType[] the new keyCount

onLookupNotificationReceived

public void onLookupNotificationReceived(org.w3c.dom.Element message)

getCount

public int getCount(java.lang.String keyName)
             throws IndexException
Throws:
IndexException