org.gcube.indexmanagement.storagehandling
Class DeltaFileUploader

java.lang.Object
  extended by org.gcube.indexmanagement.storagehandling.DeltaFileUploader

public class DeltaFileUploader
extends java.lang.Object

This class implements an uploader of delta files to the Content Management layer. Each time a new delta file is created as a result of new data added to (or removed from) the index, the file is added to the uploader queue in order to be stored in the CMS. After the file finally gets uploaded, a notification is sent to the index management resource, so that the delta file list is updated.


Nested Class Summary
 class DeltaFileUploader.ConsumerNotification
          Class that handles the consuming of received notifications
 
Constructor Summary
DeltaFileUploader(java.lang.String indexID, IndexUpdaterWSResource resource, GCUBEServiceContext ctx)
          Constructs a new DeltaFileUploader
 
Method Summary
 void close()
          Closes this DeltaFileUploader
 int getConnectionID()
          Returns the current connection ID
 void upload(java.lang.String deltaFileName, DeltaActionType action, java.lang.String indexTypeID, int documentCount)
          Uploads a delta file to the CMS
 void upload(java.lang.String deltaFileName, java.lang.String indexTypeID, int documentCount)
          Uploads a delta file to the CMS
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeltaFileUploader

public DeltaFileUploader(java.lang.String indexID,
                         IndexUpdaterWSResource resource,
                         GCUBEServiceContext ctx)
                  throws java.lang.Exception
Constructs a new DeltaFileUploader

Parameters:
indexID - the ID of the index that this DeltaFileUploader feeds
resource - the index updater resource that uses this DeltaFileUploader
ctx - the service context used for security and scoping
Throws:
java.lang.Exception - an error occured
Method Detail

upload

public void upload(java.lang.String deltaFileName,
                   java.lang.String indexTypeID,
                   int documentCount)
Uploads a delta file to the CMS

Parameters:
deltaFileName - the filename of the delta file to upload
indexTypeID - the index type ID
documentCount - the number of documents in the delta file to be uploaded

upload

public void upload(java.lang.String deltaFileName,
                   DeltaActionType action,
                   java.lang.String indexTypeID,
                   int documentCount)
Uploads a delta file to the CMS

Parameters:
deltaFileName - the filename of the delta file to upload
action - the delta file action: addition or deletion
indexTypeID - the index type ID
documentCount - the number of documents in the delta file to be uploaded

getConnectionID

public int getConnectionID()
Returns the current connection ID

Returns:
the connection ID

close

public void close()
Closes this DeltaFileUploader