org.gcube.contentmanagement.contentmanager.state
Class Factory

java.lang.Object
  extended by GCUBEWSResource
      extended by org.gcube.contentmanagement.contentmanager.state.Factory

public class Factory
extends GCUBEWSResource

The singleton resource of the factory port-type.

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
Factory()
           
 
Method Summary
 boolean addActivation(ActivationRecord record)
          Memorises the processing of an ActivationRecord.
 java.util.List<CollectionReference> create(java.lang.String pluginName, org.w3c.dom.Element parameters)
          Creates one or more CollectionManagers from input parameters.
 void deleteManagers(java.lang.String collectionID, GCUBEScope... scopes)
          Deletes all the managers associated with a given collection and, optionally,in one or more scopes.
 PluginContext getContext(java.lang.String name)
          Returns the context of a plugin with a given name.
 java.lang.String[] getPropertyNames()
          
 boolean knowsActivation(ActivationRecord record)
          Indicates whether an activation record was previously processed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Factory

public Factory()
Method Detail

addActivation

public boolean addActivation(ActivationRecord record)
Memorises the processing of an ActivationRecord.

Parameters:
record - the record.
Returns:
true if the record was never processed before, false otherwise.

knowsActivation

public boolean knowsActivation(ActivationRecord record)
Indicates whether an activation record was previously processed.

Parameters:
record - the record

create

public java.util.List<CollectionReference> create(java.lang.String pluginName,
                                                  org.w3c.dom.Element parameters)
                                           throws java.lang.Exception
Creates one or more CollectionManagers from input parameters.

Parameters:
pluginName - the name of a plugin that can process the parameters.
parameters - the parameters.
Returns:
a list of references to the collection managers.
Throws:
java.lang.Exception - if the resources could not be created.

deleteManagers

public void deleteManagers(java.lang.String collectionID,
                           GCUBEScope... scopes)
                    throws java.lang.Exception
Deletes all the managers associated with a given collection and, optionally,in one or more scopes.

Parameters:
collectionID - the collection identifier.
(optional) - scopes the scopes. If omitted, the managers are removed in all their scopes.
Throws:
java.lang.UnsupportedOperationException - if the plugin does not support collection deletion.
java.lang.Exception - if the collection could not be deleted.

getContext

public PluginContext getContext(java.lang.String name)
                         throws java.lang.Exception
Returns the context of a plugin with a given name.

Parameters:
name - the name.
Returns:
the context, or null if the plugin is unknown.
Throws:
java.lang.Exception

getPropertyNames

public java.lang.String[] getPropertyNames()