org.galagosearch.core.store
Class SQLDocumentStore

java.lang.Object
  extended by org.galagosearch.core.store.SQLDocumentStore
All Implemented Interfaces:
java.lang.Iterable<Document>, java.util.Collection<Document>, DocumentStore

public class SQLDocumentStore
extends java.lang.Object
implements java.util.Collection<Document>, DocumentStore

Author:
trevor

Constructor Summary
SQLDocumentStore(org.galagosearch.tupleflow.Parameters parameters)
           
SQLDocumentStore(java.lang.String driverName, java.lang.String databaseUrl)
           
SQLDocumentStore(org.galagosearch.tupleflow.TupleFlowParameters parameters)
           
 
Method Summary
 boolean add(Document document)
           
 boolean addAll(java.util.Collection<? extends Document> documents)
           
 void addMetadata(long documentID, Document document)
           
 void addMetadata(java.lang.String oldKey, java.lang.String oldValue, java.lang.String newKey, java.lang.String newValue)
           
 void clear()
           
 void close()
           
static java.sql.Connection connect(java.lang.String driverName, java.lang.String databaseUrl)
           
 boolean contains(Document d)
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection<?> documents)
           
static void createDatabase(java.lang.String driverName, java.lang.String databaseUrl)
           
static void dropDatabase(java.lang.String driverName, java.lang.String databaseUrl)
           
 Document get(long documentID)
           
 Document get(java.lang.String identifier)
           
 Document get(java.lang.String metadataKey, java.lang.String metadataValue)
           
 boolean isEmpty()
           
 java.util.Iterator<Document> iterator()
           
static void main(java.lang.String[] args)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> objects)
           
 boolean retainAll(java.util.Collection<?> objects)
           
 int size()
           
 Document[] toArray()
           
<T> T[]
toArray(T[] example)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

SQLDocumentStore

public SQLDocumentStore(org.galagosearch.tupleflow.TupleFlowParameters parameters)
                 throws java.sql.SQLException,
                        java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException

SQLDocumentStore

public SQLDocumentStore(org.galagosearch.tupleflow.Parameters parameters)
                 throws java.sql.SQLException,
                        java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException

SQLDocumentStore

public SQLDocumentStore(java.lang.String driverName,
                        java.lang.String databaseUrl)
                 throws java.sql.SQLException,
                        java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException
Method Detail

connect

public static java.sql.Connection connect(java.lang.String driverName,
                                          java.lang.String databaseUrl)
                                   throws java.sql.SQLException,
                                          java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException

dropDatabase

public static void dropDatabase(java.lang.String driverName,
                                java.lang.String databaseUrl)
                         throws java.sql.SQLException,
                                java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException

createDatabase

public static void createDatabase(java.lang.String driverName,
                                  java.lang.String databaseUrl)
                           throws java.sql.SQLException,
                                  java.lang.ClassNotFoundException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface DocumentStore
Throws:
java.io.IOException

add

public boolean add(Document document)
Specified by:
add in interface java.util.Collection<Document>

addMetadata

public void addMetadata(java.lang.String oldKey,
                        java.lang.String oldValue,
                        java.lang.String newKey,
                        java.lang.String newValue)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

iterator

public java.util.Iterator<Document> iterator()
Specified by:
iterator in interface java.lang.Iterable<Document>
Specified by:
iterator in interface java.util.Collection<Document>

addMetadata

public void addMetadata(long documentID,
                        Document document)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

get

public Document get(java.lang.String identifier)
             throws java.io.IOException
Specified by:
get in interface DocumentStore
Throws:
java.io.IOException

get

public Document get(long documentID)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

get

public Document get(java.lang.String metadataKey,
                    java.lang.String metadataValue)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

size

public int size()
Specified by:
size in interface java.util.Collection<Document>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<Document>

contains

public boolean contains(Document d)

toArray

public Document[] toArray()
Specified by:
toArray in interface java.util.Collection<Document>

toArray

public <T> T[] toArray(T[] example)
Specified by:
toArray in interface java.util.Collection<Document>

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<Document>

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection<Document>

containsAll

public boolean containsAll(java.util.Collection<?> documents)
Specified by:
containsAll in interface java.util.Collection<Document>

addAll

public boolean addAll(java.util.Collection<? extends Document> documents)
Specified by:
addAll in interface java.util.Collection<Document>

removeAll

public boolean removeAll(java.util.Collection<?> objects)
Specified by:
removeAll in interface java.util.Collection<Document>

retainAll

public boolean retainAll(java.util.Collection<?> objects)
Specified by:
retainAll in interface java.util.Collection<Document>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<Document>

main

public static void main(java.lang.String[] args)
                 throws java.sql.SQLException,
                        java.lang.ClassNotFoundException,
                        java.io.IOException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException
java.io.IOException


Copyright © 2009. All Rights Reserved.