org.alfresco.filesys.state
Class FileStateTable

java.lang.Object
  extended by org.alfresco.filesys.state.FileStateTable

public class FileStateTable
extends java.lang.Object

File State Table Class

Contains an indexed list of the currently open files/folders.


Constructor Summary
FileStateTable()
          Class constructor
 
Method Summary
 void addFileState(FileState fstate)
          Add a new file state
 void Dump()
          Dump the state cache entries to the specified stream
 java.util.Enumeration enumerate()
          Enumerate the file state cache
 FileState findFileState(java.lang.String path)
          Find the file state for the specified path
 FileState findFileState(java.lang.String path, boolean isdir, boolean create)
          Find the file state for the specified path, and optionally create a new file state if not found
 long getCacheTimer()
          Get the file state cache timer, in milliseconds
 int numberOfStates()
          Return the number of states in the cache
 void removeAllFileStates()
          Remove all file states from the cache
 int removeExpiredFileStates()
          Remove expired file states from the cache
 FileState removeFileState(java.lang.String path)
          Remove the file state for the specified path
 void renameFileState(java.lang.String newPath, FileState state)
          Rename a file state, remove the existing entry, update the path and add the state back into the cache using the new path.
 void setCacheTimer(long tmo)
          Set the default file state cache timer, in milliseconds
 FileState updateFileState(java.lang.String oldName, java.lang.String newName)
          Update the name that a file state is cached under, and the associated file state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileStateTable

public FileStateTable()
Class constructor

Method Detail

getCacheTimer

public final long getCacheTimer()
Get the file state cache timer, in milliseconds

Returns:
long

numberOfStates

public final int numberOfStates()
Return the number of states in the cache

Returns:
int

setCacheTimer

public final void setCacheTimer(long tmo)
Set the default file state cache timer, in milliseconds

Parameters:
tmo - long

addFileState

public final void addFileState(FileState fstate)
Add a new file state

Parameters:
fstate - FileState

findFileState

public final FileState findFileState(java.lang.String path)
Find the file state for the specified path

Parameters:
path - String
Returns:
FileState

findFileState

public final FileState findFileState(java.lang.String path,
                                     boolean isdir,
                                     boolean create)
Find the file state for the specified path, and optionally create a new file state if not found

Parameters:
path - String
isdir - boolean
create - boolean
Returns:
FileState

updateFileState

public final FileState updateFileState(java.lang.String oldName,
                                       java.lang.String newName)
Update the name that a file state is cached under, and the associated file state

Parameters:
oldName - String
newName - String
Returns:
FileState

enumerate

public final java.util.Enumeration enumerate()
Enumerate the file state cache

Returns:
Enumeration

removeFileState

public final FileState removeFileState(java.lang.String path)
Remove the file state for the specified path

Parameters:
path - String
Returns:
FileState

renameFileState

public final void renameFileState(java.lang.String newPath,
                                  FileState state)
Rename a file state, remove the existing entry, update the path and add the state back into the cache using the new path.

Parameters:
newPath - String
state - FileState

removeAllFileStates

public final void removeAllFileStates()
Remove all file states from the cache


removeExpiredFileStates

public final int removeExpiredFileStates()
Remove expired file states from the cache

Returns:
int

Dump

public final void Dump()
Dump the state cache entries to the specified stream



Copyright © 2005 - 2008 Alfresco Software, Inc. All Rights Reserved.