org.deegree.commons.config
Class AbstractBasicResourceManager

java.lang.Object
  extended by org.deegree.commons.config.AbstractBasicResourceManager
All Implemented Interfaces:
ResourceManager
Direct Known Subclasses:
AbstractResourceManager, BatchedMTStoreManager, ConnectionManager, CRSManager, FunctionManager, ObservationStoreManager, ProxyUtils, RenderableStoreManager, SecurityConfiguration, SQLDialectManager, SQLFunctionManager

public abstract class AbstractBasicResourceManager
extends Object
implements ResourceManager

Provides some basic functionality for implementing ResourceManagers.

Version:
$Revision: 30338 $, $Date: 2011-04-04 15:00:13 +0200 (Mon, 04 Apr 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Field Summary
protected  File dir
           
protected  Map<String,ResourceState> idToState
           
protected  DeegreeWorkspace workspace
           
 
Constructor Summary
AbstractBasicResourceManager()
           
 
Method Summary
 ResourceState createResource(String id, InputStream is)
          Creates a new Resource (which is initially in state ResourceState.StateType.deactivated).
 ResourceState deleteResource(String id)
          Removes the specified resource and deletes the corresponding configuration file.
protected abstract  ResourceProvider getProvider(File file)
           
 ResourceState getState(String id)
          Returns the state of the resource.
 ResourceState[] getStates()
          Returns the state of all resources.
protected  void init(DeegreeWorkspace workspace, File resourceDir)
           
protected abstract  void remove(String id)
           
 
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
activate, deactivate, getDependencies, getMetadata, shutdown, startup
 

Field Detail

workspace

protected DeegreeWorkspace workspace

dir

protected File dir

idToState

protected Map<String,ResourceState> idToState
Constructor Detail

AbstractBasicResourceManager

public AbstractBasicResourceManager()
Method Detail

init

protected void init(DeegreeWorkspace workspace,
                    File resourceDir)

getProvider

protected abstract ResourceProvider getProvider(File file)

remove

protected abstract void remove(String id)

getStates

public ResourceState[] getStates()
Description copied from interface: ResourceManager
Returns the state of all resources.

Specified by:
getStates in interface ResourceManager
Returns:
the states, never null

getState

public ResourceState getState(String id)
Description copied from interface: ResourceManager
Returns the state of the resource.

Specified by:
getState in interface ResourceManager
Parameters:
id - resource identifier, must not be null
Returns:
the state or null (if the specified resource does not exist)

createResource

public ResourceState createResource(String id,
                                    InputStream is)
                             throws IllegalArgumentException
Description copied from interface: ResourceManager
Creates a new Resource (which is initially in state ResourceState.StateType.deactivated).

Specified by:
createResource in interface ResourceManager
Parameters:
id - resource identifier, must not be null
is - 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

public ResourceState deleteResource(String id)
Description copied from interface: ResourceManager
Removes the specified resource and deletes the corresponding configuration file.

Specified by:
deleteResource in interface ResourceManager
Parameters:
id - resource identifier, must not be null
Returns:
resource state after deletion, usually null (if not, deletion failed)


Copyright © 2011. All Rights Reserved.