public abstract class IndexWSResource
extends org.gcube.common.core.state.GCUBEWSResource
| Modifier and Type | Class and Description |
|---|---|
static class |
IndexWSResource.DestructionMode
The two possible modes of index resource destruction:
FULL_DESTRUCTION: Remove the resource and perform full clean-up of any objects created by it (e.g.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
bInitializing
Is the resource in the initialization state or not?
|
protected IndexWSResource.DestructionMode |
destructionMode
The resource's destruction mode
|
protected Object |
initLock
The corresponding lock Object
|
protected String |
namespace
The service's namespace
|
protected List<String> |
propNames
The list of property names for this resource
|
static String |
RP_COLLECTION_ID |
static String |
RP_CREATED |
static String |
RP_FIELDS |
static String |
RP_INDEX_ID
The list of standard resource properties defined by every index resource
|
static String |
RP_INDEX_TYPE_NAME |
static String |
RP_MODIFIED |
protected org.gcube.indexmanagement.common.IndexWSResource.TopicRegistrar |
topicRegistrar
The object that handles the registration of notification topics
|
| Modifier | Constructor and Description |
|---|---|
protected |
IndexWSResource()
Constructs a new IndexWSResource object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCollectionID(String collectionID)
Adds a collection id to the collectionID resource property
|
void |
addField(String field)
Adds a field to the Fields resource property
|
org.globus.wsrf.ResourceProperty |
createProperty(String propName)
Adds a new ResourceProperty to the resource, given a property name.
|
org.globus.wsrf.ResourceProperty |
createProperty(String propName,
String nameSpace)
Adds a new ResourceProperty to the resource, given a property name and a namespace.
|
org.globus.wsrf.impl.SimpleTopic |
createTopic(String topicName)
Adds a new topic to the resource, given a topic name.
|
org.globus.wsrf.impl.SimpleTopic |
createTopic(String topicName,
String nameSpace)
Adds a new topic to the resource, given a topic name and a namespace.
|
protected void |
filterFieldInfo(ArrayList<String> presentableFields,
ArrayList<String> searchableFields) |
String[] |
getCollectionID()
Getter method for the CollectionID list Resource Property
|
Calendar |
getCreated()
Getter method for the Created Resource Property
|
IndexWSResource.DestructionMode |
getDestructionMode()
Returns the resource's destruction mode
|
String[] |
getFields()
Getter method for the Fields list Resource Property
|
String |
getIndexID()
Getter method for the IndexID Resource Property
|
String |
getIndexTypeName()
Getter method for the IndexTypeName Resource Property
|
Calendar |
getModified()
Getter method for the Modified Resource Property
|
String |
getNamespace()
Returns the namespace of the service this resource belongs to
|
protected String[] |
getPropertyNames() |
void |
initialise(String namespace,
String indexID,
String indexTypeName,
String[] collectionID)
Initializes a IndexWSResource object.
|
boolean |
isInitializing()
Returns the current initialization state of the resource
|
boolean |
isTopicRegistered(org.globus.wsrf.impl.SimpleTopic topic)
Checks if the registration of the given topic has been completed.
|
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)
|
void |
publish(org.gcube.common.core.scope.GCUBEScope... scopes) |
void |
setCollectionID(String[] collectionIDs)
Setter method for the CollectionID list Resource Property
|
void |
setCreated(Calendar created)
Setter method for the Created Resource Property
|
void |
setDestructionMode(IndexWSResource.DestructionMode mode)
Sets the resource's destruction mode
|
void |
setFields(String[] fields)
Setter method for the Fields list Resource Property
|
void |
setIndexID(String indexID)
Setter method for the IndexID Resource Property
|
void |
setIndexTypeName(String indexTypeName)
Setter method for the IndexTypeName Resource Property
|
void |
setIsInitializing(boolean isInitializing)
Specifies the current state of the resource (initializing or not)
|
void |
setModified(Calendar modified)
Setter method for the Modified Resource Property
|
void |
store() |
protected void |
waitUntilInitialized()
Blocks thread execution until WS resource is initialized
|
getCurrentTime, getEPR, getPorttypeContext, getProperty, getPublisher, getResourcePropertySet, getServiceContext, getTerminationTime, getTopicList, getTopicNames, initialise, initialise, initialiseContainers, inScope, load, setPortTypeContext, setTerminationTime, unpublishgetID, getLock, getScheduledTasks, getScope, launchTask, onRemove, setID, setPersistenceDelegate, stopTaskpublic static final String RP_INDEX_ID
public static final String RP_INDEX_TYPE_NAME
public static final String RP_COLLECTION_ID
public static final String RP_FIELDS
public static final String RP_MODIFIED
public static final String RP_CREATED
protected String namespace
protected boolean bInitializing
protected Object initLock
protected org.gcube.indexmanagement.common.IndexWSResource.TopicRegistrar topicRegistrar
protected IndexWSResource.DestructionMode destructionMode
protected IndexWSResource()
public void initialise(String namespace, String indexID, String indexTypeName, String[] collectionID) throws Exception
Exceptionprotected void onLoad(ObjectInputStream ois, boolean firstLoad) throws Exception
ois - the input stream through which the state can be readindicates - if the resource is being loaded for the first time (hard load) or not (soft load)Exception - an error occured during resource deserializationprotected void onStore(ObjectOutputStream oos) throws Exception
oos - the output stream to write the resource state toException - an error occured during resource serializationpublic void store()
store in interface org.globus.wsrf.PersistenceCallbackstore in class org.gcube.common.core.state.GCUBEStatefulResource<org.gcube.common.core.state.GCUBEWSResourceKey>public org.globus.wsrf.ResourceProperty createProperty(String propName) throws Exception
propName - the name of the new resource propertyExceptionpublic org.globus.wsrf.ResourceProperty createProperty(String propName, String nameSpace) throws Exception
propName - the name of the new resource propertynameSpace - the namespace of the new resource propertyExceptionpublic org.globus.wsrf.impl.SimpleTopic createTopic(String topicName, String nameSpace) throws Exception
topicName - the name of the new topicnameSpace - the namespace of the new topicExceptionpublic org.globus.wsrf.impl.SimpleTopic createTopic(String topicName) throws Exception
topicName - the name of the new topicExceptionprotected String[] getPropertyNames()
getPropertyNames in class org.gcube.common.core.state.GCUBEWSResourcepublic String getNamespace()
public String getIndexID()
String the requested indexIDpublic void setIndexID(String indexID)
indexID - String the new IndexIdpublic String[] getCollectionID()
String[] the requested CollectionIDspublic String[] getFields()
String[] the requested Fieldspublic void setCollectionID(String[] collectionIDs) throws Exception
String[] - the new CollectionIDsExceptionpublic void setFields(String[] fields) throws Exception
String[] - the new FieldsExceptionpublic void addCollectionID(String collectionID)
collectionID - String -the ID to be addedpublic void addField(String field)
field - String -the field to be added in the following format:
[collectionID]:[language]:["s"|"p"]:[fieldName]public String getIndexTypeName()
String the requested IndexTypeNamepublic void setIndexTypeName(String indexTypeName) throws Exception
indexTypeName - String the new IndexTypeNameExceptionpublic Calendar getCreated()
Calendar the requested time of creation for this index replicationpublic void setCreated(Calendar created)
created - Calendar representation of the time the resource was created.public Calendar getModified()
Calendar the requested lastModified indicatorpublic void setModified(Calendar modified)
modified - Calendar representation of the time the resource was modifiedpublic boolean isInitializing()
public void setIsInitializing(boolean isInitializing)
isInitializing - the initialization state to setprotected void waitUntilInitialized()
protected void filterFieldInfo(ArrayList<String> presentableFields, ArrayList<String> searchableFields)
public IndexWSResource.DestructionMode getDestructionMode()
public void setDestructionMode(IndexWSResource.DestructionMode mode)
mode - the destruction mode to be setpublic void onResourceRemoval()
public void publish(org.gcube.common.core.scope.GCUBEScope... scopes)
throws org.globus.wsrf.ResourceException
publish in class org.gcube.common.core.state.GCUBEWSResourceorg.globus.wsrf.ResourceExceptionpublic boolean isTopicRegistered(org.globus.wsrf.impl.SimpleTopic topic)
throws Exception
topic - the topic whose registration to checkExceptionCopyright © 2014. All Rights Reserved.