Protege-2000 1.7

edu.stanford.smi.protege.storage.jdbc
Class DatabaseStorage

java.lang.Object
  |
  +--edu.stanford.smi.protege.storage.jdbc.DatabaseStorage
All Implemented Interfaces:
DatabaseConstants, Disposable, Storage

public class DatabaseStorage
extends Object
implements Storage, DatabaseConstants

Implementation of storage interfaces for database. This implementation delegates in memory behavior to FrameDBStorage and additionally sends commands along to its DatabaseManager (from whence they make it to the real db).

Author:
Ray Fergerson

Fields inherited from interface edu.stanford.smi.protege.storage.jdbc.DatabaseConstants
TYPE_BOOLEAN, TYPE_CLASS, TYPE_FACET, TYPE_FLOAT, TYPE_INTEGER, TYPE_INVALID, TYPE_SIMPLE_INSTANCE, TYPE_SLOT, TYPE_STRING
 
Constructor Summary
DatabaseStorage(DefaultKnowledgeBase kb, DatabaseManager manager, FrameDBStorage delegate)
           
 
Method Summary
 void addFrame(Frame frame)
           
 void addValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
           
 void addValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value, int index)
           
 boolean beginTransaction()
           
 boolean containsFrame(Frame frame)
           
 boolean containsFrame(String name)
           
 void dispose()
           
 boolean endTransaction(boolean doCommit)
           
 int getClsCount()
           
 DatabaseManager getDatabaseManager()
           
 int getDBValueCount(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 int getFacetCount()
           
 Frame getFrame(FrameID id)
           
 Frame getFrame(String name)
           
 int getFrameCount()
           
 Collection getFrames()
           
 Collection getMatchingFrames(Slot slot, Facet facet, boolean isTemplate, String matchString, int maxMatches)
           
 Collection getReferences(Object o, int maxReferences)
           
 int getSlotCount()
           
 Object getValue(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 int getValueCount(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 ArrayList getValues(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 boolean hasValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
           
 boolean hasValueAtSomeFrame(Slot slot, Facet facet, boolean isTemplate)
           
 void moveValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, int from, int to)
           
 void remove(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 void removeFrame(Frame frame)
           
 void removeSingleValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
          remove a single occurance of value from the slot/facet value
 void removeValues(Slot slot, Facet facet, boolean isTemplate, Cls cls)
           
 void replace(Frame from, Frame to)
           
 void setValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
           
 void setValues(Frame frame, Slot slot, Facet facet, boolean isTemplate, Collection values)
           
 boolean supportsTransactions()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatabaseStorage

public DatabaseStorage(DefaultKnowledgeBase kb,
                       DatabaseManager manager,
                       FrameDBStorage delegate)
Method Detail

addFrame

public void addFrame(Frame frame)
Specified by:
addFrame in interface Storage

addValue

public void addValue(Frame frame,
                     Slot slot,
                     Facet facet,
                     boolean isTemplate,
                     Object value)
Specified by:
addValue in interface Storage

addValue

public void addValue(Frame frame,
                     Slot slot,
                     Facet facet,
                     boolean isTemplate,
                     Object value,
                     int index)
Specified by:
addValue in interface Storage

beginTransaction

public boolean beginTransaction()
Specified by:
beginTransaction in interface Storage

containsFrame

public boolean containsFrame(Frame frame)
Specified by:
containsFrame in interface Storage

containsFrame

public boolean containsFrame(String name)
Specified by:
containsFrame in interface Storage

dispose

public void dispose()
Specified by:
dispose in interface Disposable

endTransaction

public boolean endTransaction(boolean doCommit)
Specified by:
endTransaction in interface Storage

getDatabaseManager

public DatabaseManager getDatabaseManager()

getDBValueCount

public int getDBValueCount(Frame frame,
                           Slot slot,
                           Facet facet,
                           boolean isTemplate)

getFrame

public Frame getFrame(FrameID id)
Specified by:
getFrame in interface Storage

getFrame

public Frame getFrame(String name)
Specified by:
getFrame in interface Storage

getFrameCount

public int getFrameCount()
Specified by:
getFrameCount in interface Storage

getSlotCount

public int getSlotCount()
Specified by:
getSlotCount in interface Storage

getFacetCount

public int getFacetCount()
Specified by:
getFacetCount in interface Storage

getClsCount

public int getClsCount()
Specified by:
getClsCount in interface Storage

getFrames

public Collection getFrames()
Specified by:
getFrames in interface Storage

getMatchingFrames

public Collection getMatchingFrames(Slot slot,
                                    Facet facet,
                                    boolean isTemplate,
                                    String matchString,
                                    int maxMatches)
Specified by:
getMatchingFrames in interface Storage

getReferences

public Collection getReferences(Object o,
                                int maxReferences)
Specified by:
getReferences in interface Storage

getValue

public Object getValue(Frame frame,
                       Slot slot,
                       Facet facet,
                       boolean isTemplate)
Specified by:
getValue in interface Storage

getValueCount

public int getValueCount(Frame frame,
                         Slot slot,
                         Facet facet,
                         boolean isTemplate)
Specified by:
getValueCount in interface Storage

getValues

public ArrayList getValues(Frame frame,
                           Slot slot,
                           Facet facet,
                           boolean isTemplate)
Specified by:
getValues in interface Storage

hasValue

public boolean hasValue(Frame frame,
                        Slot slot,
                        Facet facet,
                        boolean isTemplate,
                        Object value)
Specified by:
hasValue in interface Storage

hasValueAtSomeFrame

public boolean hasValueAtSomeFrame(Slot slot,
                                   Facet facet,
                                   boolean isTemplate)
Specified by:
hasValueAtSomeFrame in interface Storage

moveValue

public void moveValue(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate,
                      int from,
                      int to)
Specified by:
moveValue in interface Storage

remove

public void remove(Frame frame,
                   Slot slot,
                   Facet facet,
                   boolean isTemplate)
Specified by:
remove in interface Storage

removeFrame

public void removeFrame(Frame frame)
Specified by:
removeFrame in interface Storage

removeSingleValue

public void removeSingleValue(Frame frame,
                              Slot slot,
                              Facet facet,
                              boolean isTemplate,
                              Object value)
Description copied from interface: Storage
remove a single occurance of value from the slot/facet value
Specified by:
removeSingleValue in interface Storage

removeValues

public void removeValues(Slot slot,
                         Facet facet,
                         boolean isTemplate,
                         Cls cls)
Specified by:
removeValues in interface Storage

replace

public void replace(Frame from,
                    Frame to)
Specified by:
replace in interface Storage

setValue

public void setValue(Frame frame,
                     Slot slot,
                     Facet facet,
                     boolean isTemplate,
                     Object value)
Specified by:
setValue in interface Storage

setValues

public void setValues(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate,
                      Collection values)
Specified by:
setValues in interface Storage

supportsTransactions

public boolean supportsTransactions()
Specified by:
supportsTransactions in interface Storage

toString

public String toString()
Overrides:
toString in class Object

Protege-2000 1.7

Submit a bug report or feature request
Protege-2000 is a trademark of Stanford University.
Copyright (c) 1998-2002 Stanford University.