org.apache.lucene.store.jdbc.handler
Class NoOpFileEntryHandler

java.lang.Object
  extended by org.apache.lucene.store.jdbc.handler.NoOpFileEntryHandler
All Implemented Interfaces:
FileEntryHandler

public class NoOpFileEntryHandler
extends Object
implements FileEntryHandler

A No Operation file entry handler. Performs no actual dirty operations, and returns empty data for read operations.

Author:
kimchy

Constructor Summary
NoOpFileEntryHandler()
           
 
Method Summary
 void close()
          Closes the file entry handler.
 void configure(JdbcDirectory jdbcDirectory)
          Called after the entry is created (during the JdbcDirectory initialization process.
 IndexOutput createOutput(String name)
          Creates an IndexOutput in order to write the file contents.
 void deleteFile(String name)
          Deletes the given file name.
 List deleteFiles(List names)
          Deletes a list of files.
 boolean fileExists(String name)
          Checks if the file exists for the given file name.
 long fileLength(String name)
          Returns the length of the file (in bytes).
 long fileModified(String name)
          Returns the last modified date of the file.
 IndexInput openInput(String name)
          Opens an IndexInput in order to read the file contents.
 void renameFile(String from, String to)
          Renames the file entry from "from" to "to".
 void touchFile(String name)
          Updates the last modified date of the file to the current time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoOpFileEntryHandler

public NoOpFileEntryHandler()
Method Detail

configure

public void configure(JdbcDirectory jdbcDirectory)
Description copied from interface: FileEntryHandler
Called after the entry is created (during the JdbcDirectory initialization process.

Specified by:
configure in interface FileEntryHandler

fileExists

public boolean fileExists(String name)
                   throws IOException
Description copied from interface: FileEntryHandler
Checks if the file exists for the given file name.

Specified by:
fileExists in interface FileEntryHandler
Parameters:
name - The name of the file
Returns:
true of the file exists, false if it does not.
Throws:
IOException

fileModified

public long fileModified(String name)
                  throws IOException
Description copied from interface: FileEntryHandler
Returns the last modified date of the file.

Specified by:
fileModified in interface FileEntryHandler
Parameters:
name - The name of the file
Returns:
The last modified date in millis.
Throws:
IOException

touchFile

public void touchFile(String name)
               throws IOException
Description copied from interface: FileEntryHandler
Updates the last modified date of the file to the current time.

Specified by:
touchFile in interface FileEntryHandler
Parameters:
name - The name of the file
Throws:
IOException

deleteFile

public void deleteFile(String name)
                throws IOException
Description copied from interface: FileEntryHandler
Deletes the given file name.

Specified by:
deleteFile in interface FileEntryHandler
Parameters:
name - The name of the file to delete
Throws:
IOException

deleteFiles

public List deleteFiles(List names)
                 throws IOException
Description copied from interface: FileEntryHandler
Deletes a list of files. It must be verified by the caller that all files correlate to this file entry handler.

Specified by:
deleteFiles in interface FileEntryHandler
Parameters:
names - The list of file names to delete
Returns:
List of files that were not deleted (or null if all were deleted)
Throws:
IOException

renameFile

public void renameFile(String from,
                       String to)
                throws IOException
Description copied from interface: FileEntryHandler
Renames the file entry from "from" to "to". The from entry is the one that maps to the actual file entry handler.

Specified by:
renameFile in interface FileEntryHandler
Parameters:
from - The name to rename from
to - The name to rename to
Throws:
IOException

fileLength

public long fileLength(String name)
                throws IOException
Description copied from interface: FileEntryHandler
Returns the length of the file (in bytes).

Specified by:
fileLength in interface FileEntryHandler
Parameters:
name - The name of the file
Returns:
The length of the file (in bytes)
Throws:
IOException

openInput

public IndexInput openInput(String name)
                     throws IOException
Description copied from interface: FileEntryHandler
Opens an IndexInput in order to read the file contents.

Specified by:
openInput in interface FileEntryHandler
Parameters:
name - The name of the file
Returns:
An IndexInput in order to read the file contents.
Throws:
IOException

createOutput

public IndexOutput createOutput(String name)
                         throws IOException
Description copied from interface: FileEntryHandler
Creates an IndexOutput in order to write the file contents.

Specified by:
createOutput in interface FileEntryHandler
Parameters:
name - The name of the file
Returns:
An IndexOutput to write the file contents
Throws:
IOException

close

public void close()
           throws IOException
Description copied from interface: FileEntryHandler
Closes the file entry handler.

Specified by:
close in interface FileEntryHandler
Throws:
IOException


Copyright (c) 2004-2008 The Compass Project.