org.apache.cocoon.components.store
Class FilesystemStore

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.store.FilesystemStore
All Implemented Interfaces:
Component, Contextualizable, LogEnabled, Parameterizable, ThreadSafe, Store

Deprecated. Use the FilesystemStore

public final class FilesystemStore
extends AbstractLogEnabled
implements Store, Contextualizable, Parameterizable, ThreadSafe

Stores objects on the filesystem: String objects as text files, all other objects are serialized.

Version:
CVS $Id: FilesystemStore.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
?, Vadim Gritsenko

Field Summary
protected  File cacheDir
          Deprecated.  
protected  File directoryFile
          Deprecated. The directory repository
protected  String directoryPath
          Deprecated.  
protected  File workDir
          Deprecated.  
 
Fields inherited from interface org.apache.cocoon.components.store.Store
PERSISTENT_CACHE, ROLE, TRANSIENT_CACHE
 
Constructor Summary
FilesystemStore()
          Deprecated.  
 
Method Summary
protected  void addKeys(org.apache.cocoon.components.store.FilesystemStore.FSEnumeration fsEnum, File directory)
          Deprecated.  
 boolean containsKey(Object key)
          Deprecated. Indicates if the given key is associated to a contained object.
 void contextualize(Context context)
          Deprecated.  
protected  int countKeys(File directory)
          Deprecated.  
protected  String decode(String filename)
          Deprecated. Inverse of encode exept it do not use path.
 String encode(String s)
          Deprecated. Returns a String that uniquely identifies the object.
protected  File fileFromKey(Object key)
          Deprecated.  
 void free()
          Deprecated.  
 Object get(Object key)
          Deprecated. Get the File object associated with the given unique key name.
 String getDirectoryPath()
          Deprecated. Returns the repository's full pathname
 Object getObject(Object key)
          Deprecated.  
 String getString(Object key)
          Deprecated.  
 void hold(Object key, Object value)
          Deprecated. Holds the given object in a volatile state.
 Enumeration keys()
          Deprecated. Returns the list of stored files as an Enumeration of Files
 void parameterize(Parameters params)
          Deprecated.  
 void remove(Object key)
          Deprecated. Remove the object associated to the given key.
 void setDirectory(File directory)
          Deprecated. Sets the repository's location
 void setDirectory(String directory)
          Deprecated. Sets the repository's location
 int size()
          Deprecated. Returns count of the objects in the store, or -1 if could not be obtained.
 void store(Object key, Object value)
          Deprecated. Store the given object in a persistent state. 1) Null values generate empty directories. 2) String values are dumped to text files 3) Object values are serialized
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workDir

protected File workDir
Deprecated. 

cacheDir

protected File cacheDir
Deprecated. 

directoryFile

protected File directoryFile
Deprecated. 
The directory repository


directoryPath

protected volatile String directoryPath
Deprecated. 
Constructor Detail

FilesystemStore

public FilesystemStore()
Deprecated. 
Method Detail

setDirectory

public void setDirectory(String directory)
                  throws IOException
Deprecated. 
Sets the repository's location

Throws:
IOException

contextualize

public void contextualize(Context context)
                   throws ContextException
Deprecated. 
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException

parameterize

public void parameterize(Parameters params)
                  throws ParameterException
Deprecated. 
Specified by:
parameterize in interface Parameterizable
Throws:
ParameterException

setDirectory

public void setDirectory(File directory)
                  throws IOException
Deprecated. 
Sets the repository's location

Throws:
IOException

getDirectoryPath

public String getDirectoryPath()
Deprecated. 
Returns the repository's full pathname


get

public Object get(Object key)
Deprecated. 
Get the File object associated with the given unique key name.

Specified by:
get in interface Store

store

public void store(Object key,
                  Object value)
           throws IOException
Deprecated. 
Store the given object in a persistent state. 1) Null values generate empty directories. 2) String values are dumped to text files 3) Object values are serialized

Specified by:
store in interface Store
Throws:
IOException

hold

public void hold(Object key,
                 Object value)
          throws IOException
Deprecated. 
Holds the given object in a volatile state.

Specified by:
hold in interface Store
Throws:
IOException

remove

public void remove(Object key)
Deprecated. 
Remove the object associated to the given key.

Specified by:
remove in interface Store

containsKey

public boolean containsKey(Object key)
Deprecated. 
Indicates if the given key is associated to a contained object.

Specified by:
containsKey in interface Store

keys

public Enumeration keys()
Deprecated. 
Returns the list of stored files as an Enumeration of Files

Specified by:
keys in interface Store

size

public int size()
Deprecated. 
Returns count of the objects in the store, or -1 if could not be obtained.

Specified by:
size in interface Store

addKeys

protected void addKeys(org.apache.cocoon.components.store.FilesystemStore.FSEnumeration fsEnum,
                       File directory)
Deprecated. 

countKeys

protected int countKeys(File directory)
Deprecated. 

fileFromKey

protected File fileFromKey(Object key)
Deprecated. 

getString

public String getString(Object key)
                 throws IOException
Deprecated. 
Throws:
IOException

free

public void free()
Deprecated. 
Specified by:
free in interface Store

getObject

public Object getObject(Object key)
                 throws IOException,
                        ClassNotFoundException
Deprecated. 
Throws:
IOException
ClassNotFoundException

decode

protected String decode(String filename)
Deprecated. 
Inverse of encode exept it do not use path. So decode(encode(s) - m_path) = s. In other words it returns a String that can be used as key to retive the record contained in the 'filename' file.


encode

public String encode(String s)
Deprecated. 
Returns a String that uniquely identifies the object. Note: since this method uses the Object.toString() method, it's up to the caller to make sure that this method doesn't change between different JVM executions (like it may normally happen). For this reason, it's highly recommended (even if not mandated) that Strings be used as keys.



Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.