org.apache.lucene.gdata.storage.lucenestorage
Class StorageEntryWrapper

java.lang.Object
  extended by org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper
All Implemented Interfaces:
Serializable, Comparable<StorageEntryWrapper>, StorageWrapper

public class StorageEntryWrapper
extends Object
implements Comparable<StorageEntryWrapper>, Serializable, StorageWrapper

This immutable class wrapps ServerBaseEntry for an internal Storage representation of an entry. This class also acts as a Documentfactory for lucene documents to be stored inside the index.

Author:
Simon Willnauer
See Also:
Serialized Form

Nested Class Summary
static class StorageEntryWrapper.StorageOperation
          Storage operations
 
Field Summary
static String FIELD_CONTENT
          lucene field name entry content
static String FIELD_ENTRY_ID
          lucene field name Entry id
static String FIELD_FEED_REFERENCE
          lucene field name feed id
static String FIELD_TIMESTAMP
          lucene field name creating timestamp
static String FIELD_VERSION
          lucene field name entry version
 
Constructor Summary
StorageEntryWrapper(ServerBaseEntry entry, StorageEntryWrapper.StorageOperation operation)
          Creates a new StorageEntryWrapper.
 
Method Summary
 int compareTo(StorageEntryWrapper arg0)
          This compare method compares the timestamps of the wrapper instances.
 ProvidedService getConfigurator()
           
 com.google.gdata.data.BaseEntry getEntry()
           
 String getEntryId()
           
 String getFeedId()
           
 Document getLuceneDocument()
          Returns a Lucene document representing the Wrapped Entry
 StorageEntryWrapper.StorageOperation getOperation()
           
 Long getTimestamp()
           
 int getVersion()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_ENTRY_ID

public static final String FIELD_ENTRY_ID
lucene field name Entry id

See Also:
Constant Field Values

FIELD_FEED_REFERENCE

public static final String FIELD_FEED_REFERENCE
lucene field name feed id

See Also:
Constant Field Values

FIELD_CONTENT

public static final String FIELD_CONTENT
lucene field name entry content

See Also:
Constant Field Values

FIELD_TIMESTAMP

public static final String FIELD_TIMESTAMP
lucene field name creating timestamp

See Also:
Constant Field Values

FIELD_VERSION

public static final String FIELD_VERSION
lucene field name entry version

See Also:
Constant Field Values
Constructor Detail

StorageEntryWrapper

public StorageEntryWrapper(ServerBaseEntry entry,
                           StorageEntryWrapper.StorageOperation operation)
                    throws IOException
Creates a new StorageEntryWrapper.

Parameters:
entry - - the entry to wrap
operation - - the StorageOperation
Throws:
IOException - - if the entry content can not be generated
Method Detail

getLuceneDocument

public Document getLuceneDocument()
Description copied from interface: StorageWrapper
Returns a Lucene document representing the Wrapped Entry

Specified by:
getLuceneDocument in interface StorageWrapper
Returns:
a Lucene Document
See Also:
StorageWrapper.getLuceneDocument()

getEntry

public com.google.gdata.data.BaseEntry getEntry()
Returns:
- the wrapped entry

getEntryId

public String getEntryId()
Returns:
- the entry id

getFeedId

public String getFeedId()
Returns:
- the feed id

getOperation

public StorageEntryWrapper.StorageOperation getOperation()
Returns:
the specified storage operation

compareTo

public int compareTo(StorageEntryWrapper arg0)
This compare method compares the timestamps of the wrapper instances.

Specified by:
compareTo in interface Comparable<StorageEntryWrapper>
Parameters:
arg0 - - the wrapper to compare
Returns:
- 0 if the wrappers timestamp are the same, an integer > 0 if the given wrapper is after this wrapper

getConfigurator

public ProvidedService getConfigurator()
Returns:
- the specified ProvidedServiceConfig

getTimestamp

public Long getTimestamp()
Returns:
Returns the timestamp.

getVersion

public int getVersion()
Returns:
- the version of the entry


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.