org.gcube.indexmanagement.fulltextindexupdater
Class FullTextIndexUpdaterResource

java.lang.Object
  extended by IndexUpdaterWSResource
      extended by org.gcube.indexmanagement.fulltextindexupdater.FullTextIndexUpdaterResource

public class FullTextIndexUpdaterResource
extends IndexUpdaterWSResource

A class containing statefull information regarding an update process, which is used to update a FullText index.

Version:
0.1

Field Summary
static java.lang.String RP_COMMITED_DOC_COUNT
           
static java.lang.String RP_CONTENT_TYPE
           
static java.lang.String RP_INDEX_FORMAT
           
static java.lang.String RP_MERGED_DOC_COUNT
           
static java.lang.String RP_NOT_COMMITED_DOC_COUNT
           
 
Constructor Summary
FullTextIndexUpdaterResource()
          Empty constructor.
 
Method Summary
 void abort()
          Abort the current update, discarding uncommited changes
 void commit()
          Commit the current update, making the changes candidates for being merged into the main index.
 void deleteDocuments(java.lang.String[] IDs)
          Deletes a list of documents from the local and main index.
 void finishCurrentUpdate()
          Close the current update, commiting and merging the changes.
 int getCommitedDocCount()
          Getter method for the CommitedDocCount Resource Property
 java.lang.String getIndexFormat()
          Getter method for the IndexFormat Resource Property
 int getMergedDocCount()
          Getter method for the MergedDocCount Resource Property
 int getNotCommitedDocCount()
          Getter method for the NotCommitedDocCount Resource Property
 void insertRowSet(java.lang.String rowset)
          Inserts a RowSet of documents into the local index.
 boolean isReadyToDie()
           
 void onResourceRemoval()
           
 void onUpdaterNotificationReceived(org.w3c.dom.Element message)
           
 java.util.concurrent.FutureTask<java.lang.Boolean> processResultSet(java.lang.String resultSetLocation)
          Inserts ResultSet of ROWSETS information into an index.
 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 setIndexFormat(java.lang.String indexFormat)
          Setter method for the IndexFormat Resource Property
 void setIndexTypeName(java.lang.String indexTypeName)
          
 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_INDEX_FORMAT

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

FullTextIndexUpdaterResource

public FullTextIndexUpdaterResource()
Empty constructor. Initialization is done throught the initialize(...) method.

Method Detail

getIndexFormat

public java.lang.String getIndexFormat()
Getter method for the IndexFormat Resource Property

Returns:
String the requested IndexFormat

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.

setContentType

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

Parameters:
contentType - the content type

setIndexFormat

public void setIndexFormat(java.lang.String indexFormat)
Setter method for the IndexFormat Resource Property

Parameters:
indexFormat - String the new IndexFormat

setIndexTypeName

public void setIndexTypeName(java.lang.String indexTypeName)
                      throws java.lang.Exception

Throws:
java.lang.Exception

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

processResultSet

public java.util.concurrent.FutureTask<java.lang.Boolean> processResultSet(java.lang.String resultSetLocation)
                                                                    throws java.rmi.RemoteException
Inserts ResultSet of ROWSETS information into an index.

Parameters:
resultSetLocation - String - a String representation of the ResultSet EPR
Returns:
ProcessResultSetResponse - empty object.
Throws:
java.rmi.RemoteException

insertRowSet

public void insertRowSet(java.lang.String rowset)
                  throws IndexException
Inserts a RowSet of documents into the local index.

Parameters:
rowset - String a RowSet of documents to be inserted
Throws:
IndexException

deleteDocuments

public void deleteDocuments(java.lang.String[] IDs)
                     throws IndexException
Deletes a list of documents from the local and main index.

Parameters:
IDs - String[] a list of the IDs of the documents to be deleted
Throws:
IndexException

abort

public void abort()
           throws IndexException
Abort the current update, discarding uncommited changes

Throws:
IndexException

commit

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

Throws:
IndexException

finishCurrentUpdate

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

Throws:
IndexException

sendMerge

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


onResourceRemoval

public void onResourceRemoval()

isReadyToDie

public boolean isReadyToDie()

onUpdaterNotificationReceived

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