|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkdl.prox.db.DB
public final class DB
The top-level object-oriented view of a Proximity Three database hosted on Monet. All the methods are static. To use, first call open(), and then refer to the static class's methods. Call close() when done.
| Field Summary | |
|---|---|
static java.lang.String |
CONT_ATTR_NST_NAME
|
static java.lang.String |
CONT_NST_NAME
|
static java.lang.String |
LINK_ATTR_NST_NAME
|
static java.lang.String |
LINK_NST_NAME
|
static java.lang.String |
OBJ_ATTR_NST_NAME
|
static java.lang.String |
OBJ_NST_NAME
|
static int |
SCHEMA_MAJOR_VERSION
Schema version. |
static int |
SCHEMA_MINOR_VERSION
|
| Method Summary | |
|---|---|
static NST |
attachLinkAttribute(NST toTable,
java.lang.String onColumn,
java.lang.String attrName)
|
static NST |
attachObjectAttribute(NST toTable,
java.lang.String onColumn,
java.lang.String attrName)
|
static void |
beginScope()
|
static void |
clearDB()
Called by methods that want empty a database. |
static void |
close()
|
static void |
commit()
Commits any dirty (modified) BATs that haven't been saved. |
static NST |
createLinks(NST fromTo)
Receives an NST with from and to columns, with oids of objects that need to be connected, and it creates links between them. |
static Container |
createNewTempContainer()
Utility akin to File.createTempFile(), returns a new temporary container in a standard 'system' location. |
static void |
deleteAllData()
|
static void |
deleteLinks(java.lang.String filterDef)
Deletes links specified in filterDef, and their attribute values |
static void |
deleteObjects(java.lang.String filterDef)
Deletes objects specified in the filterDef. |
static void |
deleteTempContainers()
Deletes all temporary containers created by createNewTempContainer(). |
static java.lang.String |
description()
|
static void |
endScope()
|
static java.lang.String |
generateTempContainerName()
Called by createNewTempContainer(), returns a candidate random name for a new temporary container. |
static NST |
getAttrsForItems(NST itemsNST,
Attributes attrs,
java.lang.String filterDef)
Overload that returns getAttrsForItems only with attributes specified in the filter string. |
static NST |
getAttrsForItems(NST itemsNST,
Attributes attrs,
java.lang.String filterDef,
java.lang.String extraAttrsList)
Given an NST with items and an Attribute, it joins the NST with the tables for the requested item and returns a new NST with columns for all the attrs. |
static Container |
getContainer(java.lang.String containerPath)
|
static Attributes |
getContainerAttrs()
|
static NST |
getContainerNST()
|
static Attributes |
getLinkAttrs()
|
static NST |
getLinkNST()
|
static NST |
getLinks(java.lang.String filterDef)
Returns an NST with the links that match a given condition on attributes and internal columns such as id, o1_id, o2_id. |
static NST |
getLinks(java.lang.String filterDef,
java.lang.String attrList)
|
static Attributes |
getObjectAttrs()
|
static NST |
getObjectNST()
|
static NST |
getObjects(java.lang.String filterDef)
Returns an NST with the objects that match a given condition on attributes and internal columns such as id. |
static NST |
getObjects(java.lang.String filterDef,
java.lang.String attrList)
|
static NST |
getObjectsConnectedTo(int itemId)
Returns the list of objects that are connected to itemId Connected means in o2_id of links where o1_id = itemID, and reverse |
static java.util.List |
getProxNSTNames()
Returns a lst with the names of the Proximity NSTs |
static Container |
getRootContainer()
|
static java.util.List |
getSchemaLog()
Returns this database's schema log, which is an ordered history of the schema versions and the dates they were applied. |
static Container |
getTempParentContainer()
Called by createNewTempContainer(), returns the temporary 'system' container that is to hold randomly-named child containers. |
static void |
initEmptyDB()
Called by methods that want to initialize an empty database, i.e., one with no Proximity tables. |
static int |
insertLink(int o1OID,
int o2OID)
Row-level method that creates a new link and returns its OID. |
static void |
insertLink(int linkOID,
int o1OID,
int o2OID)
Row-level method that creates a new link and returns its OID. |
static int |
insertObject()
Row-level method that creates a new object and returns its OID. |
static void |
insertObject(int objectOID)
Row-level method that creates a new object and returns its OID. |
static boolean |
isLinkExists(int linkId)
|
static boolean |
isObjectExists(int objId)
|
static boolean |
isOpen()
|
static boolean |
isProxNSTBatName(java.lang.String nstName)
|
static boolean |
isProxNSTName(java.lang.String nstName)
Returns true if the name passed in corresponds to one of Proximity's NSTs. |
static boolean |
isProxTablesDefined()
|
static boolean |
isProxTablesEmpty()
|
static java.util.List |
ls()
Returns a list of all the top-level NSTs in the system. |
static void |
open(java.lang.String hostAndPort)
Splits hostAndPort into consituent parts and calls other constructor. |
static void |
open(java.lang.String hostAndPort,
boolean isNoSchemaCheck)
|
static void |
populateDB(java.lang.String fileName)
Populates the DB with information from a file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CONT_ATTR_NST_NAME
public static final java.lang.String CONT_NST_NAME
public static final java.lang.String LINK_ATTR_NST_NAME
public static final java.lang.String LINK_NST_NAME
public static final java.lang.String OBJ_ATTR_NST_NAME
public static final java.lang.String OBJ_NST_NAME
public static final int SCHEMA_MAJOR_VERSION
public static final int SCHEMA_MINOR_VERSION
| Method Detail |
|---|
public static NST attachLinkAttribute(NST toTable,
java.lang.String onColumn,
java.lang.String attrName)
public static NST attachObjectAttribute(NST toTable,
java.lang.String onColumn,
java.lang.String attrName)
public static void beginScope()
public static void clearDB()
initEmptyDB()public static void close()
public static void commit()
public static NST createLinks(NST fromTo)
fromTo: - an NST with two columns, named from and to, with the end points for the links, and possibly othher columns with name attr_*
public static Container createNewTempContainer()
public static void deleteAllData()
public static void deleteLinks(java.lang.String filterDef)
filterDef - public static void deleteObjects(java.lang.String filterDef)
filterDef - public static void deleteTempContainers()
public static java.lang.String description()
public static java.lang.String generateTempContainerName()
public static void endScope()
public static NST getAttrsForItems(NST itemsNST,
Attributes attrs,
java.lang.String filterDef)
itemsNST - the items for which to get attributesattrs - the attributes structure where values are storedfilterDef - a filter to apply to the resulting NST
getAttrsForItems(kdl.prox.dbmgr.NST, kdl.prox.db.Attributes, java.lang.String)
public static NST getAttrsForItems(NST itemsNST,
Attributes attrs,
java.lang.String filterDef,
java.lang.String extraAttrsList)
itemsNST - the items for which to get attributesattrs - the attributes structure where values are storedextraAttrsList - a comma-separated list of names of attributes that should be included in the NSTfilterDef - a filter to apply to the resulting NST
public static Container getContainer(java.lang.String containerPath)
public static Attributes getContainerAttrs()
public static NST getContainerNST()
public static Attributes getLinkAttrs()
public static NST getLinkNST()
public static NST getLinks(java.lang.String filterDef)
public static NST getLinks(java.lang.String filterDef,
java.lang.String attrList)
public static Attributes getObjectAttrs()
public static NST getObjectNST()
public static NST getObjects(java.lang.String filterDef)
public static NST getObjects(java.lang.String filterDef,
java.lang.String attrList)
public static NST getObjectsConnectedTo(int itemId)
itemId -
public static java.util.List getProxNSTNames()
public static Container getRootContainer()
public static java.util.List getSchemaLog()
public static Container getTempParentContainer()
public static void initEmptyDB()
clearDB()
public static int insertLink(int o1OID,
int o2OID)
o1OID - o2OID -
public static void insertLink(int linkOID,
int o1OID,
int o2OID)
linkOID - o1OID - o2OID - public static int insertObject()
public static void insertObject(int objectOID)
objectOID - public static boolean isLinkExists(int linkId)
public static boolean isObjectExists(int objId)
public static boolean isProxNSTBatName(java.lang.String nstName)
nstName -
public static boolean isProxNSTName(java.lang.String nstName)
public static boolean isProxTablesDefined()
getProxNSTNames()public static boolean isProxTablesEmpty()
public static boolean isOpen()
public static java.util.List ls()
public static void open(java.lang.String hostAndPort)
hostAndPort -
public static void open(java.lang.String hostAndPort,
boolean isNoSchemaCheck)
public static void populateDB(java.lang.String fileName)
fileName - PopulateDB
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||