org.gcube.indexmanagement.common
Class IndexManagementWSResource

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.IndexManagementWSResource
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 IndexManagementWSResource
extends IndexWSResource

Author:
Spyros Boutsis, NKUA

Nested Class Summary
 
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 MANAGER_STATUS_EMPTY
          The list of possible management status values
static String MANAGER_STATUS_FINISHED
           
static String MANAGER_STATUS_UPDATING
           
protected  org.globus.wsrf.Topic sharedStateChangeTopic
          The state change notification topic
 
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
IndexManagementWSResource()
           
 
Method Summary
 void addUpdater(int updater)
          Adds a new value to the Updater Resource Property
 void deleteUpdater(int updater)
          Deletes a value from the Updater Resource Property
 int getConnectionCount()
          Getter method for the ConnectionCount Resource Property
 int getDocumentCount()
          Getter method for the DocumentCount Resource Property
 String getIndexStatus()
          Getter method for the IndexStatus Resource Property
 int[] getUpdater()
          Getter method for the Updater Resource Property
 int getUpdaterCount()
          Returns the number of values in the Updater Resource Property
 void initialise(String namespace, 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.
protected  void onStore(ObjectOutputStream oos)
          Invoked when the state of the resource must be saved (resource serialization)
 void sendSharedStateChangeNotification(Object message)
          Sends a state change notification message
 void setConnectionCount(int connectionCount)
          Setter method for the ConnectionCount Resource Property
 void setDocumentCount(int docCount)
          Setter method for the DocumentCount Resource Property
 void setIndexStatus(String indexStatus)
          Setter method for the IndexStatus Resource Property
 void setUpdater(int[] updaters)
          Setter method for the Updater 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, isInitializing, isTopicRegistered, onResourceRemoval, 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

MANAGER_STATUS_EMPTY

public static final String MANAGER_STATUS_EMPTY
The list of possible management status values

See Also:
Constant Field Values

MANAGER_STATUS_UPDATING

public static final String MANAGER_STATUS_UPDATING
See Also:
Constant Field Values

MANAGER_STATUS_FINISHED

public static final String MANAGER_STATUS_FINISHED
See Also:
Constant Field Values

sharedStateChangeTopic

protected org.globus.wsrf.Topic sharedStateChangeTopic
The state change notification topic

Constructor Detail

IndexManagementWSResource

public IndexManagementWSResource()
Method Detail

initialise

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

Overrides:
initialise in class IndexWSResource
Parameters:
namespace - the namespace of the service that this resource belongs to
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
indicates - if the resource is being loaded for the first time (hard load) or not (soft load)
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

sendSharedStateChangeNotification

public void sendSharedStateChangeNotification(Object message)
Sends a state change notification message

Parameters:
message - the notification message to send

getIndexStatus

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

Returns:
String the requested status indicator

getConnectionCount

public int getConnectionCount()
Getter method for the ConnectionCount Resource Property

Returns:
int the requested ConnectionCount

getDocumentCount

public int getDocumentCount()
Getter method for the DocumentCount Resource Property

Returns:
int the requested DocumentCount

getUpdater

public int[] getUpdater()
Getter method for the Updater Resource Property

Returns:
int[] the values of the requested Updater property

getUpdaterCount

public int getUpdaterCount()
Returns the number of values in the Updater Resource Property

Returns:
the number of updaters

setIndexStatus

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

Parameters:
indexStatus - String the new status of the resource

setConnectionCount

public void setConnectionCount(int connectionCount)
Setter method for the ConnectionCount Resource Property

Parameters:
ConnectionCount - int the new Connection count

setDocumentCount

public void setDocumentCount(int docCount)
Setter method for the DocumentCount Resource Property

Parameters:
DocumentCount - int the new document count

setUpdater

public void setUpdater(int[] updaters)
Setter method for the Updater Resource Property

Parameters:
updater - int[] the new updater values

addUpdater

public void addUpdater(int updater)
Adds a new value to the Updater Resource Property

Parameters:
updater - int the new updater

deleteUpdater

public void deleteUpdater(int updater)
Deletes a value from the Updater Resource Property

Parameters:
updater - int the updater value to remove


Copyright © 2012. All Rights Reserved.