|
02/28/2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.epicentric.services.AbstractControllable
|
+--com.epicentric.metastore.MetaStore
The MetaStore is a hierarchical Java object repository. Currently it is implemented over a relational database. It consists of a filesystem-like tree of folders and documents.
MetaStoreFolders are accessed within the MetaStore by their path. Like a filesystem path, a MetaStore path is a list of folders separated by slashes (/). For instance, if a folder named "3" is a child of folder "2", which is itself a child of "1", then the path would be "/1/2/3/".
Each folder may also store any number of named string or integer properties.
MetaStoreDocuments are what information is stored in. Each MetaStoreDocument can store a single piece of data. This data can be a string, byte array, serializable java object, DOM Document, or the contents of a URL.
Along with its primary single piece of data, each document can also store any number of named string properties.
There can be different implementations of the MetaStore with different persistence mechanisms. For instance, one implementation may use a relational database, while another implementation may use LDAP.
The MetaStore is a Service (see com.epicentric.services.ServiceManager). This means there can be multiple MetaStores running in the system. This is not the same as different implementations of the MetaStore: there can be multiple instances of one implementation running. To get one of the MetaStores running in the system, use the static methods getDefaultMetaStore() or getMetaStore(String service_id).
MetaStoreDocument,
MetaStoreFolder,
ServiceManager,
MetaStore.getDefaultMetaStore(),
MetaStore.getMetaStore(String)| Field Summary | |
static String |
BEAN_FOLDER_NAME
|
static String |
LOCAL_SYSTEM_SUB_FOLDER_NAME
|
static String |
PATH_SEPARATOR
|
static String |
ROOT_FOLDER
|
static String |
SERVICE_CODE
|
static String |
SYSTEM_FOLDER_NAME
|
static String |
WEBDATA_FOLDER_NAME
|
| Fields inherited from class com.epicentric.services.AbstractControllable |
controller |
| Constructor Summary | |
MetaStore()
|
|
| Method Summary | |
boolean |
absolutePath(String path)
Return true if the given folder path is absolute to the root of the MetaStore folder system. |
String |
appendPath(String path,
String append)
|
abstract void |
clean()
Removes deleted records and files At the moment, not transaction safe, so should be run with servers shut down |
void |
clearCache()
Deprecated. since version 4.5 |
void |
clearCacheRecursive(String path)
Deprecated. since version 4.5 |
void |
close()
Deprecated. use stop() instead. |
MetaStoreDocument |
createDocument(String path,
String name)
Create a MetaStoreDocument with the given name in the folder at the given path. |
MetaStoreFolder |
createPath(String path)
Creates a MetaStoreFolder unless it already exists. |
MetaStoreDocument[] |
findDocuments(String path,
String propertyName,
String propertyValue)
Find all Documents in the MetaStoreFolder at the given path that contain the given property with the given value. |
MetaStoreFolder[] |
findFolders(String path,
String propertyName,
String propertyValue)
Retrieve all subfolders of the MetaStoreFolder at the given path that contain the given property with the given value. |
MetaStoreFolder |
getBeanFolder()
Get the folder reserved for storing admin-level information about beans. |
static MetaStore |
getDefaultMetaStore()
Return the default MetaStore service. |
static MetaStoreFolder |
getDefaultMetaStoreRootFolder()
Returns the root folder of the default MetaStore. |
String |
getDescription()
Retrieves the service description. |
MetaStoreDocument |
getDocument(String path,
String name)
Retrieve MetaStoreDocument with the given name in the folder at the given path. |
abstract MetaStoreDocument |
getDocument(String path,
String name,
boolean create)
Retrieve the document with the given path and name. |
protected String |
getDocumentUIDType()
|
MetaStoreFolder |
getFolder(String path)
Returns the MetaStoreFolder at the given path. |
abstract MetaStoreFolder |
getFolder(String path,
boolean create)
Returns the MetaStoreFolder at the given path. |
protected String |
getFolderUIDType()
|
String |
getID()
Retrieves the service ID. |
String |
getLastFolderName(String path)
Return terminal folder name in String. |
MetaStoreFolder |
getLocalSystemFolder()
Return the folder reserved for setting local system properties. |
static MetaStore |
getMetaStore(String id)
Return the MetaStore service with the given service id. |
String |
getName()
Retrieves the service name. |
String |
getParentPath(String path)
Return the parent folder path of the given path. |
String[] |
getPathFolderNames(String path)
Return array of all the folder names in the given path. |
abstract MetaStoreFolder |
getRootFolder()
Returns the root folder. |
String |
getServiceInfo()
Retrieves hard-coded information about the service. |
MetaStoreDocument |
getSessionDocument(User user)
Deprecated. |
MetaStoreDocument |
getSessionDocument(User user,
String name)
Deprecated. |
MetaStoreFolder |
getSessionFolder(User user)
Deprecated. |
long |
getSessionID(User user)
Deprecated. |
Collection |
getSupportedUIDTypes()
Returns a collection of the types that the manager supports. |
MetaStoreFolder |
getSystemFolder()
Return the folder reserved for setting system properties. |
WebData |
getWebData(String url)
Return a WebData representing the given URL. |
WebData |
getWebData(String url,
int expire_age)
Return a WebData representing the given URL. |
WebData |
getWebData(String url,
int expire_age,
boolean cache)
Deprecated. since version 4.5. Use #getWebData(String,int) instead. |
WebData |
getWebData(URL url)
Return a WebData representing the given URL. |
WebData |
getWebData(URL url,
int expire_age)
Return a WebData representing the given URL. |
WebData |
getWebData(URL url,
int expire_age,
boolean cache)
Deprecated. since version 4.5. Use #getWebData(URL,int) instead. |
MetaStoreDocument |
getWebDocument(String url)
Return a MetaStoreDocument representing the given URL. |
MetaStoreDocument |
getWebDocument(String url,
int expire_age)
Return a MetaStoreDocument representing the given URL. |
MetaStoreDocument |
getWebDocument(String url,
int expire_age,
boolean cache)
Deprecated. since version 4.5. Use #getWebDocument(String,int) instead. |
MetaStoreDocument |
getWebDocument(URL url)
Return a MetaStoreDocument representing the given URL. |
MetaStoreDocument |
getWebDocument(URL url,
int expire_age)
Return a MetaStoreDocument representing the given URL. |
MetaStoreDocument |
getWebDocument(URL url,
int expire_age,
boolean cache)
Deprecated. since version 4.5. Use #getWebDocument(URL,int) instead. |
void |
init(ServiceConfig config)
Initializes the service. |
MetaStoreFolder |
mount(String path,
MetaStore store)
Deprecated. As of 4.1, to be removed in 8.0 or later |
MetaStoreFolder |
mount(String path,
MetaStoreFolder folder)
Deprecated. As of 4.1, to be removed in 8.0 or later |
String |
normalizePath(String path)
Normalize the syntax of the folder path. |
void |
open()
Deprecated. use start() instead. |
boolean |
pathExists(String path)
Return true if there's a MetaStoreFolder at the given path. |
void |
registerCacheClearingTrigger(javax.servlet.http.HttpSession session,
String path)
Deprecated. 4.1. To be removed in 8.0 or later |
void |
removePath(String path)
Removes the MetaStoreFolder from the database and deletes all associated documents and values, |
void |
restart()
Runs stop() and then start(). |
void |
stop()
Stops the service. |
MetaStoreDocument |
storeBytes(String path,
String name,
Byte[] data)
Same as storeDocument(String, String, Byte[]). |
MetaStoreDocument |
storeDocument(String path,
String name,
Byte[] data)
Create or retrieve the document with given name and path. |
MetaStoreDocument |
storeDocument(String path,
String name,
Node node)
Create or retrieve the document with given name and path. |
MetaStoreDocument |
storeDocument(String path,
String name,
Object object)
Create or retrieve the document with given name and path. |
MetaStoreDocument |
storeDocument(String path,
String name,
String text)
Create or retrieve the document with given name and path. |
MetaStoreDocument |
storeDocument(String path,
String name,
URL url)
Create or retrieve the document with given name and path. |
MetaStoreDocument |
storeNode(String path,
String name,
Node node)
Same as storeDocument(String, String, Node). |
MetaStoreDocument |
storeObject(String path,
String name,
Object object)
Same as storeDocument(String, String, Object). |
MetaStoreDocument |
storeString(String path,
String name,
String text)
Same as storeDocument(String, String, String). |
MetaStoreDocument |
storeURL(String path,
String name,
URL url)
Same as storeDocument(String, String, URL). |
void |
unmount(MetaStoreFolder folder)
Deprecated. As of 4.1, to be removed in 8.0 or later |
void |
unmount(String path)
Deprecated. As of 4.1, to be removed in 8.0 or later |
| Methods inherited from class com.epicentric.services.AbstractControllable |
createController, getServiceController, init, start |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.epicentric.uid.internal.UniquelyIdentifiableManager |
deleteObjectFromUID, getObjectFromUID |
| Methods inherited from interface com.epicentric.services.Service |
start |
| Field Detail |
public static final String SYSTEM_FOLDER_NAME
public static final String BEAN_FOLDER_NAME
public static final String WEBDATA_FOLDER_NAME
public static final String LOCAL_SYSTEM_SUB_FOLDER_NAME
public static final String PATH_SEPARATOR
public static final String ROOT_FOLDER
public static final String SERVICE_CODE
| Constructor Detail |
public MetaStore()
| Method Detail |
public static MetaStore getDefaultMetaStore()
public static MetaStore getMetaStore(String id)
public static MetaStoreFolder getDefaultMetaStoreRootFolder()
MetaStore.getDefaultMetaStore()
public final void registerCacheClearingTrigger(javax.servlet.http.HttpSession session,
String path)
public final void open()
public final void close()
public abstract MetaStoreFolder getRootFolder()
public MetaStoreFolder getSystemFolder()
public MetaStoreFolder getLocalSystemFolder()
public MetaStoreFolder getBeanFolder()
folder = getBeanFolder()
folder.getFolder("newsbean", true);
Note that user-specific info is NOT stored here:
PortalBeanView.getFolder() contains the algorithm
for storing user-specific info.PortalBeanView.getFolder()public MetaStoreFolder getFolder(String path)
public abstract MetaStoreFolder getFolder(String path,
boolean create)
create - If true, creates the folder if it
doesn't exist.
public MetaStoreFolder[] findFolders(String path,
String propertyName,
String propertyValue)
public boolean pathExists(String path)
public MetaStoreFolder createPath(String path)
public void removePath(String path)
public final MetaStoreFolder mount(String path,
MetaStore store)
public final MetaStoreFolder mount(String path,
MetaStoreFolder folder)
public final void unmount(String path)
public final void unmount(MetaStoreFolder folder)
public MetaStoreDocument createDocument(String path,
String name)
path - Path of folder in which document lives.name - Name of document to get.
public MetaStoreDocument getDocument(String path,
String name)
path - Path of folder in which document lives.name - Name of document to get.
public abstract MetaStoreDocument getDocument(String path,
String name,
boolean create)
path - Path of folder in which document lives.name - Name of document to get.create - If true, create document if it doesn't exist.MetaStoreDocument.setExpiration(int)
public MetaStoreDocument storeDocument(String path,
String name,
Node node)
public MetaStoreDocument storeDocument(String path,
String name,
String text)
public MetaStoreDocument storeDocument(String path,
String name,
Object object)
public MetaStoreDocument storeDocument(String path,
String name,
Byte[] data)
public MetaStoreDocument storeDocument(String path,
String name,
URL url)
path - Path of folder containing document.name - Name of document.url - URL of contents of document.
public MetaStoreDocument[] findDocuments(String path,
String propertyName,
String propertyValue)
public WebData getWebData(URL url)
url - The URL whose contents the document will contain.
public WebData getWebData(URL url,
int expire_age)
url - The URL whose contents the document will contain.expire_age - Number of minutes to store contents of URL on local disk.
When expired, getting the contents will trigger
re-retrieval from the source host. Zero or less
means to never refresh.
public WebData getWebData(URL url,
int expire_age,
boolean cache)
url - The URL whose contents the document will contain.expire_age - Number of minutes to store contents of URL on local disk.
When expired, getting the contents will trigger
re-retrieval from the source host. Zero or less
means to never refresh.cache - True: cache in memory permanently, even in low memory conditions.public MetaStoreDocument getWebDocument(URL url)
public MetaStoreDocument getWebDocument(URL url,
int expire_age)
url - The URL whose contents the document will contain.expire_age - Number of minutes to store contents of URL on local disk.
When expired, getting the contents will trigger
re-retrieval from the source host. Zero or less
means to never refresh.
public MetaStoreDocument getWebDocument(URL url,
int expire_age,
boolean cache)
url - The URL whose contents the document will contain.expire_age - Number of minutes to store contents of URL on local disk.
When expired, getting the contents will trigger
re-retrieval from the source host. Zero or less
means to never refresh.cache - True: cache in memory permanently, even in low memory conditions.public final void clearCache()
public final void clearCacheRecursive(String path)
path - The root of the path to clear the cache of.public abstract void clean()
public MetaStoreDocument storeNode(String path,
String name,
Node node)
MetaStore.storeDocument(String, String, Node)
public MetaStoreDocument storeString(String path,
String name,
String text)
MetaStore.storeDocument(String, String, String)
public MetaStoreDocument storeObject(String path,
String name,
Object object)
MetaStore.storeDocument(String, String, Object)
public MetaStoreDocument storeBytes(String path,
String name,
Byte[] data)
MetaStore.storeDocument(String, String, Byte[])
public MetaStoreDocument storeURL(String path,
String name,
URL url)
MetaStore.storeDocument(String, String, URL)public WebData getWebData(String url)
url - The URL whose contents the document will contain.
public WebData getWebData(String url,
int expire_age)
url - The URL whose contents the document will contain.expire_age - Number of minutes to store contents of URL on local disk.
When expired, getting the contents will trigger
re-retrieval from the source host. Zero or less
means to never refresh.
public WebData getWebData(String url,
int expire_age,
boolean cache)
url - The URL whose contents the document will contain.expire_age - Number of minutes to store contents of URL on local disk.
When expired, getting the contents will trigger
re-retrieval from the source host. Zero or less
means to never refresh.cache - True: cache in memory permanently, even in low memory conditions.public MetaStoreDocument getWebDocument(String url)
public MetaStoreDocument getWebDocument(String url,
int expire_age)
url - The URL whose contents the document will contain.expire_age - Number of minutes to store contents of URL on local disk.
When expired, getting the contents will trigger
re-retrieval from the source host. Zero or less
means to never refresh.
public MetaStoreDocument getWebDocument(String url,
int expire_age,
boolean cache)
url - The URL whose contents the document will contain.expire_age - Number of minutes to store contents of URL on local disk.
When expired, getting the contents will trigger
re-retrieval from the source host. Zero or less
means to never refresh.cache - True: cache in memory permanently, even in low memory conditions.public String normalizePath(String path)
public String appendPath(String path,
String append)
public boolean absolutePath(String path)
public String getParentPath(String path)
public String getLastFolderName(String path)
public String[] getPathFolderNames(String path)
public MetaStoreFolder getSessionFolder(User user)
public MetaStoreDocument getSessionDocument(User user,
String name)
public MetaStoreDocument getSessionDocument(User user)
Session properties in a hashtable which is stored in this document.
Although inefficient, session data can also be stored as properties of this document rather than data in the document.
For example:
MetaStoreDocument session = store.getSessionDocument(user);
String name = session.getProperty("name");
public long getSessionID(User user)
public Collection getSupportedUIDTypes()
com.epicentric.uid.internal.UniquelyIdentifiableManagergetSupportedUIDTypes in interface com.epicentric.uid.internal.UniquelyIdentifiableManagercom.epicentric.uid.internal.UniquelyIdentifiableManagerprotected String getFolderUIDType()
protected String getDocumentUIDType()
public void init(ServiceConfig config)
Serviceinit in interface Servicecom.epicentric.services.Serviceconfig - ServiceConfig for this Servicepublic void stop()
Servicestop in interface Service
public void restart()
throws ServiceException
Servicerestart in interface Servicepublic String getServiceInfo()
ServicegetServiceInfo in interface Servicecom.epicentric.services.Servicepublic String getID()
ServicegetID in interface Servicecom.epicentric.services.Servicepublic String getName()
ServicegetName in interface Servicecom.epicentric.services.Servicepublic String getDescription()
ServicegetDescription in interface Servicecom.epicentric.services.Service
|
02/28/2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||