org.deegree.observation.persistence
Class ObservationStoreManager

java.lang.Object
  extended by org.deegree.commons.config.AbstractBasicResourceManager
      extended by org.deegree.observation.persistence.ObservationStoreManager
All Implemented Interfaces:
ResourceManager

public class ObservationStoreManager
extends AbstractBasicResourceManager
implements ResourceManager

The class TODO add class documentation here.

Version:
$Revision: 31619 $, $Date: 2011-08-23 14:56:28 +0200 (Tue, 23 Aug 2011) $
Author:
Andrei Ionita, last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from class org.deegree.commons.config.AbstractBasicResourceManager
dir, idToState, workspace
 
Constructor Summary
ObservationStoreManager()
           
 
Method Summary
 ResourceState activate(String id)
          Activates the resource with the given identifier.
static boolean containsDatastore(String datastoreId)
           
 ResourceState deactivate(String id)
          Deactivates the resource with the given identifier.
static void destroy()
           
static ObservationDatastore get(String id)
          Returns the ObservationDatastore instance with the specified identifier.
static Collection<ObservationDatastore> getAll()
          Returns all active ObservationDatastores.
static ObservationDatastore getDatastoreById(String datastoreId)
           
 Class<? extends ResourceManager>[] getDependencies()
           
 ResourceManagerMetadata getMetadata()
           
protected  ResourceProvider getProvider(File file)
           
static Map<String,ObservationStoreProvider> getProviders()
          Returns all available providers.
static void init(File osDir)
           
protected  void remove(String id)
           
 void shutdown()
          Is called upon workspace shutdown.
 void startup(DeegreeWorkspace workspace)
          Is called upon workspace startup.
 
Methods inherited from class org.deegree.commons.config.AbstractBasicResourceManager
createResource, deleteResource, getState, getStates, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.commons.config.ResourceManager
createResource, deleteResource, getState, getStates
 

Constructor Detail

ObservationStoreManager

public ObservationStoreManager()
Method Detail

init

public static void init(File osDir)
Parameters:
osDir -

get

public static ObservationDatastore get(String id)
Returns the ObservationDatastore instance with the specified identifier.

Parameters:
id - identifier of the observation store instance
Returns:
the corresponding ObservationDatastore instance or null if no such instance has been created

getAll

public static Collection<ObservationDatastore> getAll()
Returns all active ObservationDatastores.

Returns:
the ObservationDatastores instance, may be empty but never null

getProviders

public static Map<String,ObservationStoreProvider> getProviders()
Returns all available providers.


getDatastoreById

public static ObservationDatastore getDatastoreById(String datastoreId)
                                             throws ObservationDatastoreException
Parameters:
datastoreId -
Returns:
a new store
Throws:
ObservationDatastoreException

containsDatastore

public static boolean containsDatastore(String datastoreId)
Parameters:
datastoreId -
Returns:
true, if it does

destroy

public static void destroy()

getDependencies

public Class<? extends ResourceManager>[] getDependencies()
Specified by:
getDependencies in interface ResourceManager
Returns:
an empty array if there are no dependencies

shutdown

public void shutdown()
Description copied from interface: ResourceManager
Is called upon workspace shutdown.

Specified by:
shutdown in interface ResourceManager

startup

public void startup(DeegreeWorkspace workspace)
Description copied from interface: ResourceManager
Is called upon workspace startup.

Specified by:
startup in interface ResourceManager

getMetadata

public ResourceManagerMetadata getMetadata()
Specified by:
getMetadata in interface ResourceManager
Returns:
a metadata object, may be null

activate

public ResourceState activate(String id)
Description copied from interface: ResourceManager
Activates the resource with the given identifier.

Specified by:
activate in interface ResourceManager
Parameters:
id - resource identifier, must not be null
Returns:
resource state after activation (may be unsuccessful), but never null

deactivate

public ResourceState deactivate(String id)
Description copied from interface: ResourceManager
Deactivates the resource with the given identifier.

Specified by:
deactivate in interface ResourceManager
Parameters:
id - resource identifier, must not be null
Returns:
resource state after deactivation (may be unsuccessful), but never null

getProvider

protected ResourceProvider getProvider(File file)
Specified by:
getProvider in class AbstractBasicResourceManager

remove

protected void remove(String id)
Specified by:
remove in class AbstractBasicResourceManager


Copyright © 2011. All Rights Reserved.