org.deegree.commons.config
Interface ResourceManager

All Known Subinterfaces:
ExtendedResourceManager<T>
All Known Implementing Classes:
AbstractBasicResourceManager, AbstractResourceManager, BatchedMTStoreManager, ConnectionManager, CoverageBuilderManager, CRSManager, FeatureStoreManager, FunctionManager, LayerStoreManager, MetadataStoreManager, ObservationStoreManager, ProcessManager, ProxyUtils, RemoteOWSManager, RemoteOWSStoreManager, RenderableStoreManager, SecurityConfiguration, SQLDialectManager, SQLFunctionManager, StyleStoreManager, ThemeManager, WebServicesConfiguration

public interface ResourceManager

Responsible for managing and creating a specific type of Resources from configuration documents.

Version:
$Revision: 30337 $, $Date: 2011-04-04 14:21:18 +0200 (Mon, 04 Apr 2011) $
Author:
Andreas Schmitz, last edited by: $Author: mschneider $

Method Summary
 ResourceState<?> activate(String id)
          Activates the resource with the given identifier.
 ResourceState<?> createResource(String id, InputStream config)
          Creates a new Resource (which is initially in state ResourceState.StateType.deactivated).
 ResourceState<?> deactivate(String id)
          Deactivates the resource with the given identifier.
 ResourceState<?> deleteResource(String id)
          Removes the specified resource and deletes the corresponding configuration file.
 Class<? extends ResourceManager>[] getDependencies()
           
 ResourceManagerMetadata getMetadata()
           
 ResourceState<?> getState(String id)
          Returns the state of the resource.
 ResourceState<?>[] getStates()
          Returns the state of all resources.
 void shutdown()
          Is called upon workspace shutdown.
 void startup(DeegreeWorkspace workspace)
          Is called upon workspace startup.
 

Method Detail

startup

void startup(DeegreeWorkspace workspace)
             throws ResourceInitException
Is called upon workspace startup.

Throws:
ResourceInitException

shutdown

void shutdown()
Is called upon workspace shutdown.


getDependencies

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

getMetadata

ResourceManagerMetadata getMetadata()
Returns:
a metadata object, may be null

getStates

ResourceState<?>[] getStates()
Returns the state of all resources.

Returns:
the states, never null

getState

ResourceState<?> getState(String id)
Returns the state of the resource.

Parameters:
id - resource identifier, must not be null
Returns:
the state or null (if the specified resource does not exist)

activate

ResourceState<?> activate(String id)
Activates the resource with the given identifier.

Parameters:
id - resource identifier, must not be null
Returns:
resource state after activation (may be unsuccessful), but never null

deactivate

ResourceState<?> deactivate(String id)
Deactivates the resource with the given identifier.

Parameters:
id - resource identifier, must not be null
Returns:
resource state after deactivation (may be unsuccessful), but never null

createResource

ResourceState<?> createResource(String id,
                                InputStream config)
                                throws IllegalArgumentException
Creates a new Resource (which is initially in state ResourceState.StateType.deactivated).

Parameters:
id - resource identifier, must not be null
config - provides the configuration file content, must not be null
Returns:
resource state after creation (ResourceState.StateType.deactivated), never null
Throws:
IllegalArgumentException - if a resource with the specified identifier already exists

deleteResource

ResourceState<?> deleteResource(String id)
Removes the specified resource and deletes the corresponding configuration file.

Parameters:
id - resource identifier, must not be null
Returns:
resource state after deletion, usually null (if not, deletion failed)


Copyright © 2011. All Rights Reserved.