Caching
Class Logging

java.lang.Object
  |
  +--Caching.Logging

public class Logging
extends java.lang.Object


Method Summary
 boolean addAddMessToLogFile(BufferEntry entry)
          Add an "add" message to the log file.
 boolean addDeleteMessToLogFile(BufferEntry entry)
          Add a "delete" message to the log file.
 boolean addDeleteMessToLogFile(java.lang.String url)
          Add a "delete" message to the log file.
 boolean addUpdateMessToLogFile(BufferEntry entry)
          Add an "update" message to the log file
static Logging getInstance()
          Get an instance of this Log.
 boolean merge()
          Merge the contents of the CacheIndexF and the log
 java.util.Hashtable readMasterFile()
          Reads the cacheIndexF file from disk into memory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Logging getInstance()
Get an instance of this Log.
Since we want this buffer to be global everyone needs to create an instance of this object before making any modifications to any part of it. If the object doesn't exist it will be made anew and a reference to the new instance will be returned

merge

public boolean merge()
Merge the contents of the CacheIndexF and the log

readMasterFile

public java.util.Hashtable readMasterFile()
                                   throws java.io.IOException,
                                          java.io.FileNotFoundException,
                                          java.text.ParseException
Reads the cacheIndexF file from disk into memory

addDeleteMessToLogFile

public boolean addDeleteMessToLogFile(java.lang.String url)
Add a "delete" message to the log file.

addDeleteMessToLogFile

public boolean addDeleteMessToLogFile(BufferEntry entry)
Add a "delete" message to the log file.

addAddMessToLogFile

public boolean addAddMessToLogFile(BufferEntry entry)
Add an "add" message to the log file.

addUpdateMessToLogFile

public boolean addUpdateMessToLogFile(BufferEntry entry)
Add an "update" message to the log file