FileDocCategorySizeDatePackage
RecoverWriter.javaAPI DocApache Lucene 2.1.04009Wed Feb 14 10:46:04 GMT 2007org.apache.lucene.gdata.storage.lucenestorage.recover

RecoverWriter

public class RecoverWriter extends Object
Writes the recover objects to the hard disc.
author
Simon Willnauer

Fields Summary
protected static final String
META_DATA_SEPARATOR
protected static final String
META_DATA_ENTRY_SEPARATOR
protected static final String
STORAGE_OPERATION_SEPARATOR
protected static final String
OPERATION_DELETE
protected static final String
OPERATION_UPDATE
protected static final String
OPERATION_INSERT
protected static final String
FILE_PREFIX
Constructors Summary
Methods Summary
public voidwriteEntry(org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper wrapper, java.io.Writer writer)

param
wrapper
throws
IOException

   
    
    
                  
         
        
        writeOperation(wrapper.getOperation(),writer);
        writeFeedID(wrapper.getFeedId(),writer);
        writeEntryID(wrapper.getEntryId(),writer);
        writeTimeStamp(wrapper.getTimestamp().toString(),writer);
        if(!wrapper.getOperation().equals(StorageOperation.DELETE)){
        writeService(wrapper,writer);
            writer.write(META_DATA_ENTRY_SEPARATOR);
            BaseEntry entry = wrapper.getEntry();
            XmlWriter xmlWriter = new XmlWriter(writer);
            entry.generateAtom(xmlWriter,wrapper.getConfigurator().getExtensionProfile());
        }
        writer.write(META_DATA_ENTRY_SEPARATOR);
        writer.write(STORAGE_OPERATION_SEPARATOR);
        writer.write(META_DATA_ENTRY_SEPARATOR);
        writer.flush();
    
private voidwriteEntryID(java.lang.String entryId, java.io.Writer writer)

        writer.write(entryId);
        writer.write(META_DATA_SEPARATOR);
    
private voidwriteFeedID(java.lang.String feedId, java.io.Writer writer)

        writer.write(feedId);
        writer.write(META_DATA_SEPARATOR);
    
private voidwriteOperation(org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper.StorageOperation operation, java.io.Writer writer)

        if(operation.equals(StorageOperation.INSERT))
            writer.write(OPERATION_INSERT);
        else if (operation.equals(StorageOperation.UPDATE)) 
            writer.write(OPERATION_UPDATE);
        else if (operation.equals(StorageOperation.DELETE)) 
            writer.write(OPERATION_DELETE);
        writer.write(META_DATA_SEPARATOR);
    
private voidwriteService(org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper wrapper, java.io.Writer writer)

        ProvidedService config = wrapper.getConfigurator();
        writer.write(config.getName());
        writer.write(META_DATA_SEPARATOR);
    
private voidwriteTimeStamp(java.lang.String timestamp, java.io.Writer writer)

        writer.write(timestamp);
        writer.write(META_DATA_SEPARATOR);