org.archive.wayback.resourcestore.locationdb
Class BDBResourceFileLocationDB

java.lang.Object
  extended by org.archive.wayback.resourcestore.locationdb.BDBResourceFileLocationDB
All Implemented Interfaces:
ResourceFileLocationDB

public class BDBResourceFileLocationDB
extends Object
implements ResourceFileLocationDB

Version:
$Date: 2010-09-29 05:28:38 +0700 (Wed, 29 Sep 2010) $, $Revision: 3262 $
Author:
brad

Constructor Summary
BDBResourceFileLocationDB()
           
 
Method Summary
 void addNameUrl(String name, String url)
          add an url location for a name, unless it already exists
 String getBdbName()
           
 String getBdbPath()
           
 long getCurrentMark()
           
 String getLogPath()
           
 CloseableIterator<String> getNamesBetweenMarks(long start, long end)
           
 void init()
           
static void main(String[] args)
           
 String[] nameToUrls(String name)
          return an array of String URLs for all known locations of name in the DB.
 void removeNameUrl(String name, String url)
          remove a single url location for an name, if it exists
 void setBdbName(String bdbName)
           
 void setBdbPath(String bdbPath)
           
 void setLogPath(String logPath)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BDBResourceFileLocationDB

public BDBResourceFileLocationDB()
Method Detail

shutdown

public void shutdown()
              throws IOException
Specified by:
shutdown in interface ResourceFileLocationDB
Throws:
IOException

init

public void init()
          throws IOException
Throws:
IOException

nameToUrls

public String[] nameToUrls(String name)
                    throws IOException
return an array of String URLs for all known locations of name in the DB.

Specified by:
nameToUrls in interface ResourceFileLocationDB
Parameters:
name -
Returns:
String[] of URLs to name
Throws:
IOException

addNameUrl

public void addNameUrl(String name,
                       String url)
                throws IOException
add an url location for a name, unless it already exists

Specified by:
addNameUrl in interface ResourceFileLocationDB
Parameters:
name -
url -
Throws:
IOException

removeNameUrl

public void removeNameUrl(String name,
                          String url)
                   throws IOException
remove a single url location for an name, if it exists

Specified by:
removeNameUrl in interface ResourceFileLocationDB
Parameters:
name -
url -
Throws:
IOException

getNamesBetweenMarks

public CloseableIterator<String> getNamesBetweenMarks(long start,
                                                      long end)
                                               throws IOException
Specified by:
getNamesBetweenMarks in interface ResourceFileLocationDB
Parameters:
start -
end -
Returns:
Iterator for traversing arcs between start and end.
Throws:
IOException

getCurrentMark

public long getCurrentMark()
Specified by:
getCurrentMark in interface ResourceFileLocationDB
Returns:
current "Mark" for the log. Currently, it's just the length of the log file.

getLogPath

public String getLogPath()
Returns:
the logPath

setLogPath

public void setLogPath(String logPath)
Parameters:
logPath - the logPath to set

getBdbPath

public String getBdbPath()
Returns:
the bdbPath

setBdbPath

public void setBdbPath(String bdbPath)
Parameters:
bdbPath - the bdbPath to set

getBdbName

public String getBdbName()
Returns:
the bdbName

setBdbName

public void setBdbName(String bdbName)
Parameters:
bdbName - the bdbName to set

main

public static void main(String[] args)
Parameters:
args -


Copyright © 2005-2011 Internet Archive. All Rights Reserved.