ants.p2p.utils.indexer
Class BackgroundEngine

java.lang.Object
  extended by java.lang.Thread
      extended by ants.p2p.utils.indexer.BackgroundEngine
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.lang.Runnable, java.util.EventListener

public class BackgroundEngine
extends java.lang.Thread
implements java.beans.PropertyChangeListener


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int broadcastTimeToLive
           
 boolean forceUploadingLists
           
 java.util.Hashtable lastTimeUploadedFileList
           
static int maxRemoteDocsToTrace
           
 java.util.Hashtable nestedDirectories
           
static boolean recursiveExplore
           
static int refreshRate
           
 java.util.Hashtable remoteFilesIndexED2KHash
           
 java.util.Hashtable remoteFilesIndexHash
           
static int remoteIndexedDocumentsTimeout
           
 java.util.ArrayList sharedDirectories
           
 java.util.Hashtable sharedFilesIndexED2KHash
           
 java.util.Hashtable sharedFilesIndexHash
           
 java.util.Hashtable sharedFilesIndexName
           
static boolean shareDownloadPath
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void addDirectory(java.io.File directory)
           
 void addPartialFile(InterruptedDownload id)
           
 void addPartialFile(MultipleSourcesDownloadManager msdm)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
           
 void addRemoteFile(QueryFileTuple qft)
           
 long computeRemoteIndexedSharedSize()
           
 void finishedUploadingFileList()
           
 void forceExternalUpdate()
           
 java.util.ArrayList getCompleteFileList()
           
 java.util.Hashtable getHttpServersList()
           
 int getHttpServersSize()
           
static BackgroundEngine getInstance()
           
static BackgroundEngine getInstance(java.io.File store)
           
 java.util.ArrayList getLastUploadedList(java.lang.String dest)
           
 FileInfos getLocalFile(java.lang.String hash, java.lang.String hashType)
           
 java.lang.Object getPartialFile(java.lang.String hash, java.lang.String hashType)
           
 java.util.Enumeration getPartialFiles()
           
 java.util.ArrayList getPartialFilesHashes()
           
 QueryPartialFileTuple getPartialFileTuple(java.lang.String sessionKey, java.lang.String fileHash, java.lang.String type, java.lang.String ownerID, java.lang.Integer freeSlots, java.lang.String connectionType, boolean getChunkHashes)
           
 RemoteFileInfos getRemoteFile(java.lang.String hash, java.lang.String hashType)
           
 java.util.Hashtable getSupernodeList()
           
 int getSupernodesSize()
           
 int getTimesToRemoteCrawling()
           
 long getTotalLocalSharedSize()
           
 long getTotalRemoteSharedSize()
           
 boolean isUploadingFileList()
           
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void recursiveExplore(java.io.File directory, java.util.ArrayList fileList, java.util.Hashtable tempHashtable)
           
 boolean recursiveExploreForModifications(java.io.File directory)
           
 void removeDirectory(java.io.File directory)
           
 void removePartialFile(java.lang.String hash)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
           
 void resetIndexingCycle()
           
 void resetPartialFiles()
           
 void run()
           
 java.util.ArrayList search(java.lang.String item, boolean content)
           
 java.util.ArrayList searchRemoteFiles(java.lang.String item, boolean localSearch)
           
 void setLastUploadedList(java.lang.String dest, java.util.ArrayList lastUploadedList)
           
 void setStoreFile(java.io.File store)
           
 void setWarriorAnt(WarriorAnt wa)
           
 void storeLocal()
           
 void synchronizeLocalIndex(boolean optimize, boolean showExit)
           
 void synchronizeRemoteIndex(boolean showFrame)
           
 void terminate(boolean join)
           
 void uploadingFileList()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sharedFilesIndexName

public java.util.Hashtable sharedFilesIndexName

sharedFilesIndexHash

public java.util.Hashtable sharedFilesIndexHash

sharedFilesIndexED2KHash

public java.util.Hashtable sharedFilesIndexED2KHash

sharedDirectories

public java.util.ArrayList sharedDirectories

nestedDirectories

public java.util.Hashtable nestedDirectories

remoteFilesIndexHash

public java.util.Hashtable remoteFilesIndexHash

remoteFilesIndexED2KHash

public java.util.Hashtable remoteFilesIndexED2KHash

lastTimeUploadedFileList

public java.util.Hashtable lastTimeUploadedFileList

forceUploadingLists

public boolean forceUploadingLists

refreshRate

public static int refreshRate

maxRemoteDocsToTrace

public static int maxRemoteDocsToTrace

broadcastTimeToLive

public static int broadcastTimeToLive

remoteIndexedDocumentsTimeout

public static int remoteIndexedDocumentsTimeout

shareDownloadPath

public static boolean shareDownloadPath

recursiveExplore

public static boolean recursiveExplore
Method Detail

getInstance

public static BackgroundEngine getInstance(java.io.File store)

getInstance

public static BackgroundEngine getInstance()

terminate

public void terminate(boolean join)

getSupernodeList

public java.util.Hashtable getSupernodeList()

getHttpServersList

public java.util.Hashtable getHttpServersList()

getTotalLocalSharedSize

public long getTotalLocalSharedSize()

getTotalRemoteSharedSize

public long getTotalRemoteSharedSize()

getSupernodesSize

public int getSupernodesSize()

getHttpServersSize

public int getHttpServersSize()

computeRemoteIndexedSharedSize

public long computeRemoteIndexedSharedSize()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)

addPartialFile

public void addPartialFile(MultipleSourcesDownloadManager msdm)

addPartialFile

public void addPartialFile(InterruptedDownload id)

resetPartialFiles

public void resetPartialFiles()

removePartialFile

public void removePartialFile(java.lang.String hash)

addRemoteFile

public void addRemoteFile(QueryFileTuple qft)

getPartialFiles

public java.util.Enumeration getPartialFiles()

getPartialFilesHashes

public java.util.ArrayList getPartialFilesHashes()

getPartialFile

public java.lang.Object getPartialFile(java.lang.String hash,
                                       java.lang.String hashType)

getRemoteFile

public RemoteFileInfos getRemoteFile(java.lang.String hash,
                                     java.lang.String hashType)

getLocalFile

public FileInfos getLocalFile(java.lang.String hash,
                              java.lang.String hashType)

getPartialFileTuple

public QueryPartialFileTuple getPartialFileTuple(java.lang.String sessionKey,
                                                 java.lang.String fileHash,
                                                 java.lang.String type,
                                                 java.lang.String ownerID,
                                                 java.lang.Integer freeSlots,
                                                 java.lang.String connectionType,
                                                 boolean getChunkHashes)

synchronizeLocalIndex

public void synchronizeLocalIndex(boolean optimize,
                                  boolean showExit)
                           throws java.lang.Exception
Throws:
java.lang.Exception

synchronizeRemoteIndex

public void synchronizeRemoteIndex(boolean showFrame)
                            throws java.lang.Exception
Throws:
java.lang.Exception

isUploadingFileList

public boolean isUploadingFileList()

uploadingFileList

public void uploadingFileList()

finishedUploadingFileList

public void finishedUploadingFileList()

setLastUploadedList

public void setLastUploadedList(java.lang.String dest,
                                java.util.ArrayList lastUploadedList)

getLastUploadedList

public java.util.ArrayList getLastUploadedList(java.lang.String dest)

forceExternalUpdate

public void forceExternalUpdate()

setStoreFile

public void setStoreFile(java.io.File store)

storeLocal

public void storeLocal()

addDirectory

public void addDirectory(java.io.File directory)

removeDirectory

public void removeDirectory(java.io.File directory)

recursiveExplore

public void recursiveExplore(java.io.File directory,
                             java.util.ArrayList fileList,
                             java.util.Hashtable tempHashtable)

recursiveExploreForModifications

public boolean recursiveExploreForModifications(java.io.File directory)

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

resetIndexingCycle

public void resetIndexingCycle()

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getTimesToRemoteCrawling

public int getTimesToRemoteCrawling()

setWarriorAnt

public void setWarriorAnt(WarriorAnt wa)

getCompleteFileList

public java.util.ArrayList getCompleteFileList()

search

public java.util.ArrayList search(java.lang.String item,
                                  boolean content)

searchRemoteFiles

public java.util.ArrayList searchRemoteFiles(java.lang.String item,
                                             boolean localSearch)