org.gcube.indexmanagement.common
Class IndexUpdaterWSResource

java.lang.Object
  extended by org.gcube.common.core.utils.handlers.GCUBEServiceClientImpl
      extended by org.gcube.common.core.state.GCUBEStatefulResource<org.gcube.common.core.state.GCUBEWSResourceKey>
          extended by org.gcube.common.core.state.GCUBEWSResource
              extended by org.gcube.indexmanagement.common.IndexWSResource
                  extended by org.gcube.indexmanagement.common.IndexUpdaterWSResource
All Implemented Interfaces:
org.gcube.common.core.utils.handlers.GCUBEServiceClient, org.globus.wsrf.PersistenceCallback, org.globus.wsrf.Resource, org.globus.wsrf.ResourceLifetime, org.globus.wsrf.ResourceProperties, org.globus.wsrf.TopicListAccessor

public abstract class IndexUpdaterWSResource
extends IndexWSResource

Author:
Spyros Boutsis, NKUA

Nested Class Summary
 class IndexUpdaterWSResource.ConsumerNotification
          Class that handles the consuming of received notifications
 
Nested classes/interfaces inherited from class org.gcube.indexmanagement.common.IndexWSResource
IndexWSResource.DestructionMode
 
Nested classes/interfaces inherited from class org.gcube.common.core.state.GCUBEStatefulResource
org.gcube.common.core.state.GCUBEStatefulResource.LOCK, org.gcube.common.core.state.GCUBEStatefulResource.TaskContext
 
Field Summary
static String RP_CONNECTION_ID
          The list of standard resource properties defined by every index updater resource
static String RP_DELTA_FILE_SIZE
           
static String RP_INDEX_STATUS
           
static String RP_IS_UPDATED
           
protected  QName sharedStateChangeTopicName
          The state change notification topic QName
static String UPDATER_STATUS_EMPTY
          The list of possible updater status values
static String UPDATER_STATUS_FINISHED
           
static String UPDATER_STATUS_UPDATING
           
 
Fields inherited from class org.gcube.indexmanagement.common.IndexWSResource
bInitializing, destructionMode, initLock, namespace, propNames, RP_COLLECTION_ID, RP_CREATED, RP_FIELDS, RP_INDEX_ID, RP_INDEX_TYPE_NAME, RP_MODIFIED, topicRegistrar
 
Fields inherited from class org.gcube.common.core.state.GCUBEStatefulResource
uuidGen
 
Constructor Summary
IndexUpdaterWSResource()
           
 
Method Summary
 void addConnectionID(int connID)
          Adds a connection ID
 String getConnectionID()
          Getter method for the ConnectionID Resource Property
 long getDeltaFileSize()
          Getter method for the DeltaFileSize Resource Property
 String getIndexStatus()
          Getter method for the IndexStatus Resource Property
 boolean getIsUpdated()
          Getter method for the IsUpdated Resource Property
 String getManagementResourceNamespace()
          Returns the namespace of the management resource associated with this updater resource
 void initialize(String namespace, String managementServiceNamespace, String indexID, String indexTypeName, String[] collectionID)
          Initializes the index management resource.
protected  void onLoad(ObjectInputStream ois, boolean firstLoad)
          Invoked when a resource is being created from a serialized, previously saved state.
 void onResourceRemoval()
          Performs clean-up operations before the resource is removed from the home
protected  void onStore(ObjectOutputStream oos)
          Invoked when the state of the resource must be saved (resource serialization)
abstract  void onUpdaterNotificationReceived(Element message)
          Invoked whenever a message is received for this consumer.
 void setConnectionID(String connectionID)
          Setter method for the ConnectionID Resource Property
 void setDeltaFileSize(long mergeInterval)
          Setter method for the DeltaFileSize Resource Property
 void setIndexStatus(String indexStatus)
          Setter method for the IndexStatus Resource Property
 void setIsUpdated(boolean isUpdated)
          Setter method for the IsUpdated Resource Property
 
Methods inherited from class org.gcube.indexmanagement.common.IndexWSResource
addCollectionID, addField, createProperty, createProperty, createTopic, createTopic, filterFieldInfo, getCollectionID, getCreated, getDestructionMode, getFields, getIndexID, getIndexTypeName, getModified, getNamespace, getPropertyNames, initialise, isInitializing, isTopicRegistered, publish, setCollectionID, setCreated, setDestructionMode, setFields, setIndexID, setIndexTypeName, setIsInitializing, setModified, store, waitUntilInitialized
 
Methods inherited from class org.gcube.common.core.state.GCUBEWSResource
getCurrentTime, getEPR, getPorttypeContext, getProperty, getPublisher, getResourcePropertySet, getServiceContext, getTerminationTime, getTopicList, getTopicNames, initialise, initialise, initialiseContainers, inScope, load, setPortTypeContext, setTerminationTime, unpublish
 
Methods inherited from class org.gcube.common.core.state.GCUBEStatefulResource
getID, getLock, getScheduledTasks, getScope, launchTask, onRemove, setID, setPersistenceDelegate, stopTask
 
Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEServiceClientImpl
getPortTypeMap, setPortTypeMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RP_CONNECTION_ID

public static final String RP_CONNECTION_ID
The list of standard resource properties defined by every index updater resource

See Also:
Constant Field Values

RP_INDEX_STATUS

public static final String RP_INDEX_STATUS
See Also:
Constant Field Values

RP_IS_UPDATED

public static final String RP_IS_UPDATED
See Also:
Constant Field Values

RP_DELTA_FILE_SIZE

public static final String RP_DELTA_FILE_SIZE
See Also:
Constant Field Values

UPDATER_STATUS_EMPTY

public static final String UPDATER_STATUS_EMPTY
The list of possible updater status values

See Also:
Constant Field Values

UPDATER_STATUS_UPDATING

public static final String UPDATER_STATUS_UPDATING
See Also:
Constant Field Values

UPDATER_STATUS_FINISHED

public static final String UPDATER_STATUS_FINISHED
See Also:
Constant Field Values

sharedStateChangeTopicName

protected QName sharedStateChangeTopicName
The state change notification topic QName

Constructor Detail

IndexUpdaterWSResource

public IndexUpdaterWSResource()
Method Detail

initialize

public void initialize(String namespace,
                       String managementServiceNamespace,
                       String indexID,
                       String indexTypeName,
                       String[] collectionID)
                throws Exception
Initializes the index management resource.

Parameters:
namespace - the namespace of the service that this resource belongs to
managementServiceNamespace - the namespace of the corresponding index management service
indexID - the indexID of this resource
indexTypeName - the index type name of this resource
collectionID - the list of collection IDs of this resource
Throws:
Exception - an error occured

onLoad

protected void onLoad(ObjectInputStream ois,
                      boolean firstLoad)
               throws Exception
Invoked when a resource is being created from a serialized, previously saved state.

Overrides:
onLoad in class IndexWSResource
Parameters:
ois - the input stream through which the state can be read
Throws:
Exception - an error occured during resource deserialization

onStore

protected void onStore(ObjectOutputStream oos)
                throws Exception
Invoked when the state of the resource must be saved (resource serialization)

Overrides:
onStore in class IndexWSResource
Parameters:
oos - the output stream to write the resource state to
Throws:
Exception - an error occured during resource serialization

getIndexStatus

public String getIndexStatus()
Getter method for the IndexStatus Resource Property

Returns:
String the requested status indicator

getDeltaFileSize

public long getDeltaFileSize()
Getter method for the DeltaFileSize Resource Property

Returns:
long the requested DeltaFileSize value

getIsUpdated

public boolean getIsUpdated()
Getter method for the IsUpdated Resource Property

Returns:
boolean the requested IsUpdated indicator

addConnectionID

public void addConnectionID(int connID)
Adds a connection ID

Parameters:
connID - - the connectionID to add

getConnectionID

public String getConnectionID()
Getter method for the ConnectionID Resource Property

Returns:
String the requested ConnectionID

setConnectionID

public void setConnectionID(String connectionID)
                     throws Exception
Setter method for the ConnectionID Resource Property

Parameters:
ConnectionID - String[] the new Connection identifier
Throws:
Exception

setDeltaFileSize

public void setDeltaFileSize(long mergeInterval)
Setter method for the DeltaFileSize Resource Property

Parameters:
mergeInterval - long the new DeltaFileSize in bytes

setIsUpdated

public void setIsUpdated(boolean isUpdated)
Setter method for the IsUpdated Resource Property

Parameters:
isUpdated - boolean the updated flag

setIndexStatus

public void setIndexStatus(String indexStatus)
Setter method for the IndexStatus Resource Property

Parameters:
indexStatus - String the new status of the resource

getManagementResourceNamespace

public String getManagementResourceNamespace()
Returns the namespace of the management resource associated with this updater resource

Returns:
the namespace

onResourceRemoval

public void onResourceRemoval()
Description copied from class: IndexWSResource
Performs clean-up operations before the resource is removed from the home

Overrides:
onResourceRemoval in class IndexWSResource

onUpdaterNotificationReceived

public abstract void onUpdaterNotificationReceived(Element message)
Invoked whenever a message is received for this consumer.

Parameters:
message - the received message


Copyright © 2013. All Rights Reserved.