dk.netarkivet.wayback.indexer
Class ArchiveFile

java.lang.Object
  extended by dk.netarkivet.wayback.indexer.ArchiveFile

public class ArchiveFile
extends java.lang.Object

This class represents a file in the arcrepository which may be indexed by the indexer.


Constructor Summary
ArchiveFile()
          Constructor, creates a new instance in the unindexed state.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getFilename()
          The filename is used as a natural key because it is a fundamental property of the arcrepository that filenames are unique.
 java.util.Date getIndexedDate()
          Returns indexedDate.
 int getIndexingFailedAttempts()
          Gets the number of failed indexing attempts.
 java.lang.String getOriginalIndexFileName()
          Gets originalIndexFileName.
 int hashCode()
           
 void index()
          Run a batch job to index this file, storing the result locally.
 boolean isIndexed()
          Returns true if the file has been indexed.
 void setFilename(java.lang.String filename)
          Sets the filename.
 void setIndexed(boolean indexed)
          Sets whether the file has been indexed.
 void setIndexedDate(java.util.Date indexedDate)
          Sets indexedDate.
 void setIndexingFailedAttempts(int indexingFailedAttempts)
          Sets the number of failed indexing attempts.
 void setOriginalIndexFileName(java.lang.String originalIndexFileName)
          Sets originalIndexFileName.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveFile

public ArchiveFile()
Constructor, creates a new instance in the unindexed state.

Method Detail

getOriginalIndexFileName

public java.lang.String getOriginalIndexFileName()
Gets originalIndexFileName.

Returns:
the originalIndexFileName

setOriginalIndexFileName

public void setOriginalIndexFileName(java.lang.String originalIndexFileName)
Sets originalIndexFileName.

Parameters:
originalIndexFileName - The new original index filename

getIndexedDate

public java.util.Date getIndexedDate()
Returns indexedDate.

Returns:
the date indexed.

setIndexedDate

public void setIndexedDate(java.util.Date indexedDate)
Sets indexedDate.

Parameters:
indexedDate - The new indexed date.

getFilename

public java.lang.String getFilename()
The filename is used as a natural key because it is a fundamental property of the arcrepository that filenames are unique.

Returns:
the filename.

setFilename

public void setFilename(java.lang.String filename)
Sets the filename.

Parameters:
filename - The new filename

isIndexed

public boolean isIndexed()
Returns true if the file has been indexed.

Returns:
whether the file is indexed

setIndexed

public void setIndexed(boolean indexed)
Sets whether the file has been indexed.

Parameters:
indexed - The new value of the isIndexed variable.

getIndexingFailedAttempts

public int getIndexingFailedAttempts()
Gets the number of failed indexing attempts.

Returns:
the number of failed attempts

setIndexingFailedAttempts

public void setIndexingFailedAttempts(int indexingFailedAttempts)
Sets the number of failed indexing attempts.

Parameters:
indexingFailedAttempts - The number of failed indexing attempts

index

public void index()
           throws IllegalState
Run a batch job to index this file, storing the result locally. If this method runs successfully, the isIndexed flag will be set to true and the originalIndexFileName field will be set to the (arbitrary) name of the file containing the results. The values are persisted to the datastore.

Throws:
IllegalState - If the indexing has already been done.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object