org.gcube.indexmanagement.forwardindexupdater
Class ForwardIndexUpdaterResource

java.lang.Object
  extended by IndexUpdaterWSResource
      extended by org.gcube.indexmanagement.forwardindexupdater.ForwardIndexUpdaterResource

public class ForwardIndexUpdaterResource
extends IndexUpdaterWSResource

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


Field Summary
static java.lang.String RP_COMMITED_DOC_COUNT
           
static java.lang.String RP_CONTENT_TYPE
           
static java.lang.String RP_KEY_DESCRIPTION
           
static java.lang.String RP_MERGED_DOC_COUNT
           
static java.lang.String RP_NOT_COMMITED_DOC_COUNT
           
 
Constructor Summary
ForwardIndexUpdaterResource()
          The ForwardIndexResource constructor.
 
Method Summary
 void closeCurrentDeltaFile()
          Closing the current delta, and opens a new delta file
 void commit()
          Commit the current update, making the changes candidates for being merged into the main index.
 void deletePair(int key)
          Delete a tuple stored in the database.
 void finishCurrentUpdate()
          Close the current update, committing and merging the changes.
 int getCommitedDocCount()
          Getter method for the CommitedDocCount Resource Property
 org.gcube.indexmanagement.forwardindexupdater.stubs.KeyDescriptionType[] getKeyDescription()
          Getter method for the KeyDescription Resource Property
 int getMergedDocCount()
          Getter method for the MergedDocCount Resource Property
 int getNotCommitedDocCount()
          Getter method for the NotCommitedDocCount Resource Property
 void insertPair(int key, int value)
          Insert a key and value pair in the database.
 boolean isDeltaComplete()
           
 void onResourceRemoval()
           
 void onUpdaterNotificationReceived(org.w3c.dom.Element arg0)
           
 void process(java.lang.String rowset)
          Process the keys and values from a row set.
 ProcessResultSetResponse processResultSet(java.lang.String resultSet)
          Process the keys and values from a row set received in the result set
 void selfDestruct()
          Schedules the destruction of this resource, allowing for unfinished merges to complete.
 void sendMerge()
          Force a merge of the commited updates to the main index.
 void setCommitedDocCount(int commitedDocCount)
          Setter method for the CommitedDocCount Resource Property
 void setContentType(java.lang.String contentType)
          Sets the index content type
 void setKeyDescription(org.gcube.indexmanagement.forwardindexupdater.stubs.KeyDescriptionType[] keyDescription)
          Setter method for the KeyDescription Resource Property
 void setMergedDocCount(int mergedDocCount)
          Setter method for the MergedDocCount Resource Property
 void setNotCommitedDocCount(int notCommitedDocCount)
          Setter method for the NotCommitedDocCount 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_NOT_COMMITED_DOC_COUNT

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

RP_COMMITED_DOC_COUNT

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

RP_MERGED_DOC_COUNT

public static final java.lang.String RP_MERGED_DOC_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

ForwardIndexUpdaterResource

public ForwardIndexUpdaterResource()
The ForwardIndexResource constructor.

Method Detail

onResourceRemoval

public void onResourceRemoval()

getNotCommitedDocCount

public int getNotCommitedDocCount()
Getter method for the NotCommitedDocCount Resource Property

Returns:
int the number of documents which have not been commited.

getCommitedDocCount

public int getCommitedDocCount()
Getter method for the CommitedDocCount Resource Property

Returns:
int the number of documents which have been commited but not merged.

getMergedDocCount

public int getMergedDocCount()
Getter method for the MergedDocCount Resource Property

Returns:
int the number of documents which have been merged into the main index.

getKeyDescription

public org.gcube.indexmanagement.forwardindexupdater.stubs.KeyDescriptionType[] getKeyDescription()
Getter method for the KeyDescription Resource Property

Returns:
KeyDescriptionType[] the KeyDscription of this Index

setKeyDescription

public void setKeyDescription(org.gcube.indexmanagement.forwardindexupdater.stubs.KeyDescriptionType[] keyDescription)
Setter method for the KeyDescription Resource Property

Parameters:
keyDescription - KeyDescriptionType[] the new keyDescription

setContentType

public void setContentType(java.lang.String contentType)
Sets the index content type

Parameters:
contentType - the content type

setNotCommitedDocCount

public void setNotCommitedDocCount(int notCommitedDocCount)
Setter method for the NotCommitedDocCount Resource Property

Parameters:
notCommitedDocCount - int the new number of documents which have not been commited

setCommitedDocCount

public void setCommitedDocCount(int commitedDocCount)
Setter method for the CommitedDocCount Resource Property

Parameters:
commitedDocCount - int the new number of documents which have been commited but not merged.

setMergedDocCount

public void setMergedDocCount(int mergedDocCount)
Setter method for the MergedDocCount Resource Property

Parameters:
mergedDocCount - int the new number of documents which have been merged with the main index

deletePair

public void deletePair(int key)
                throws IndexException
Delete a tuple stored in the database.

Parameters:
key - to delete.
Throws:
IndexException - in case of failure.

insertPair

public void insertPair(int key,
                       int value)
                throws IndexException
Insert a key and value pair in the database.

Parameters:
key - - The key int to insert
value - - The value int to insert
Throws:
IndexException - in case of failure.

process

public void process(java.lang.String rowset)
             throws IndexException
Process the keys and values from a row set.

Parameters:
rowset - - the row set that contains the keys.
Throws:
IndexException - in case of failure.

processResultSet

public ProcessResultSetResponse processResultSet(java.lang.String resultSet)
                                          throws java.rmi.RemoteException
Process the keys and values from a row set received in the result set

Parameters:
resultSet - - The a string String representing the resultSet EPS
Returns:
ProcessResultSetResponse - The response.
Throws:
java.rmi.RemoteException - in case of failure.

selfDestruct

public void selfDestruct()
                  throws IndexException
Schedules the destruction of this resource, allowing for unfinished merges to complete.

Throws:
IndexException - - in case of failure.

finishCurrentUpdate

public void finishCurrentUpdate()
                         throws IndexException
Close the current update, committing and merging the changes.

Throws:
IndexException

commit

public void commit()
Commit the current update, making the changes candidates for being merged into the main index.


sendMerge

public void sendMerge()
Force a merge of the commited updates to the main index. Synchronized with the FullTextIndexBatchUpdaterServices commit().


closeCurrentDeltaFile

public void closeCurrentDeltaFile()
                           throws java.lang.Exception
Closing the current delta, and opens a new delta file

Throws:
java.lang.Exception - - In case of a failure during the close.

isDeltaComplete

public boolean isDeltaComplete()

onUpdaterNotificationReceived

public void onUpdaterNotificationReceived(org.w3c.dom.Element arg0)