|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectoracle.ide.persistence.NameSpace
The NameSpace class provides access to the persistent storage system.
General concept:
The persistent storage system is designed to store searchable information between jdev sessions.
The smallest ammount of information stored is a record consisting of a String key and a byte[] data. Both the key and the data array are of arbitrary size.
Keys are grouped together in NameSpaces, Each NameSpace contains it's own set of records. Individual users of NameSpace have to coordinate to avoid name conflict in NameSpaces names.
In version 1.0, all datas are stored in a single file in the user system directory, if for any reason 2 instances of jdev (on the same machine or not) atempt to use the same storage file, it will try to use and create if needed the next one, files will be called :
XXXX_N.stf
where XXXX is the base storage name and N a number. This means that if at any time 3 instances of jdev are launched you should have 3 files :
XXXX_0.stf, XXXX_1.stf and XXXX_3.stf Launching one more instance in parallel will create XXXX_4.stf and so on ....
| Field Summary | |
protected static oracle.ide.persistence.StorageFile |
_store
|
static int |
NSTYPE_NORMAL
Get a 'handle' on a NameSpace, If the NameSpace already exists, it will be opened or a new NameSpace will be created. |
static int |
NSTYPE_PACKED
|
| Method Summary | |
void |
cancelAutoFlush()
|
boolean |
checkRecord(java.lang.String key)
Check if a key is present in the current namespace |
void |
close()
Same as flush (in v 1.0) |
static void |
deleteNameSpace(java.lang.String name)
delete permanently all records of a given NameSpace and remove the NameSpace itself from the NameSpace list. |
void |
delRecord(java.lang.String key)
Delete the record associated with the key, and remove the key itself. |
void |
flush()
Saves all pending operations to disk, and tag the NameSpace 'clean'. |
static NamedTimer |
getFlushTimer()
|
java.util.Iterator |
getKeyIterator()
Get an Iterator Object on all keys contained in this workspace. |
java.util.Iterator |
getKeyIterator(java.lang.String prefix)
Get an Iterator Object on all keys contained in this workspace starting with the specified prefix. |
java.util.Iterator |
getKeyIterator(java.lang.String prefix,
boolean ignorecase)
Get an Iterator Object on all keys contained in this workspace starting with the specified prefix ignoring the case if needed. |
static NameSpace |
getNameSpace(java.lang.String name)
|
static NameSpace |
getNameSpace(java.lang.String name,
int type)
|
static java.util.Iterator |
getNameSpaceIterator()
Get an Iterator Object on all nameSpace contained in the persistence system. |
static java.util.Iterator |
getNameSpaceIterator(java.lang.String prefix)
Get an Iterator Object on all nameSpace contained in the persistence system. |
static java.util.Iterator |
getNameSpaceIterator(java.lang.String prefix,
boolean ignorecase)
Get an Iterator Object on all nameSpace contained in the persistence system. |
byte[] |
getRecord(java.lang.String key)
Returns the datas (byte[]) associated with a key. |
java.io.InputStream |
getRecordStream(java.lang.String key)
Returns an Stream object on the datas (byte[]) associated with a key. |
java.util.Iterator |
getReverseKeyIterator()
|
java.util.Iterator |
getReverseKeyIterator(java.lang.String prefix)
|
java.util.Iterator |
getReverseKeyIterator(java.lang.String prefix,
boolean ignorecase)
|
static java.util.Iterator |
getReverseNameSpaceIterator()
|
static java.util.Iterator |
getReverseNameSpaceIterator(java.lang.String prefix)
|
static java.util.Iterator |
getReverseNameSpaceIterator(java.lang.String prefix,
boolean ignorecase)
|
void |
putRecord(java.lang.String key,
byte[] data)
Add or update the record associated with the key using a byte[]. |
java.io.OutputStream |
putRecordStream(java.lang.String key)
Add or update the record associated with the key using a stream To effectively enter the record the close() function have to be called on this OutputStream. |
void |
setAutoFlush(long delay)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static oracle.ide.persistence.StorageFile _store
public static final int NSTYPE_NORMAL
If multiple Threads access the same NameSpace, they should all have their own NameSpace object to access it.
public static final int NSTYPE_PACKED
| Method Detail |
public static java.util.Iterator getNameSpaceIterator()
equivalent to getNameSpaceIterator("", false)
public static java.util.Iterator getReverseNameSpaceIterator()
public static java.util.Iterator getNameSpaceIterator(java.lang.String prefix)
The next() function of this Iterator will always returns String objects
equivalent to getNameSpaceIterator(prefix, false)
prefix - Prefix of the wanted namespaces.
public static java.util.Iterator getReverseNameSpaceIterator(java.lang.String prefix)
public static java.util.Iterator getNameSpaceIterator(java.lang.String prefix,
boolean ignorecase)
AAA, BBB, BBb, Bbb, Cxx, aaa, bBB, bbB
This iterator will have no more elements once the prefix changes.
getNameSpaceIterator('bb', true), will return only 3 keys :
BBB, BBb, Bbb
The next() function of this Iterator will always returns String objects
prefix - Prefix of the wanted keys.ignorecase - Case sensitive or not ....
public static java.util.Iterator getReverseNameSpaceIterator(java.lang.String prefix,
boolean ignorecase)
public static NameSpace getNameSpace(java.lang.String name,
int type)
public static NameSpace getNameSpace(java.lang.String name)
public static void deleteNameSpace(java.lang.String name)
name - the name of the NameSpace to delete permanently.public java.io.InputStream getRecordStream(java.lang.String key)
key - key of the record.
null if there is no record with that key.public static NamedTimer getFlushTimer()
public void setAutoFlush(long delay)
public void cancelAutoFlush()
public byte[] getRecord(java.lang.String key)
key - key of the record.
null if there is no record with that key.public void flush()
All modifying operations will tag a NameSpace 'dirty' and it will be automaticaly erased during the next launch. don't forget to flush ...
public void close()
flush()public void delRecord(java.lang.String key)
key - key name of the record.flush()public java.io.OutputStream putRecordStream(java.lang.String key)
Warning, NameSpace.flush() doesn't automaticaly close all 'openned' OutputStream you have to call close() on them before fvlushing the NameSpace.
After this operation the NameSpace will be tagged 'dirty', use flush sometime.
key - key name of the record.
flush()public boolean checkRecord(java.lang.String key)
key - key name of the record.
public void putRecord(java.lang.String key,
byte[] data)
After this operation the NameSpace will be tagged 'dirty', use flush sometime. If data is null or have a 0 length, no space will be allocated to store the data. get functions on this key will return either a 0 length array or an empty stream.
key - key name of the record.data - byte[] containing the datas associated with the key.flush()public java.util.Iterator getKeyIterator()
equivalent to getKeyIterator("", false)
public java.util.Iterator getReverseKeyIterator()
public java.util.Iterator getKeyIterator(java.lang.String prefix)
The next() function of this Iterator will always returns String objects
equivalent to getKeyIterator(prefix, false)
prefix - Prefix of the wanted keys.
public java.util.Iterator getReverseKeyIterator(java.lang.String prefix)
public java.util.Iterator getKeyIterator(java.lang.String prefix,
boolean ignorecase)
AAA, BBB, BBb, Bbb, Cxx, aaa, bBB, bbB
This iterator will have no more elements once the key prefix changes. getKeyIterator('bb', true), will return only 3 keys :
BBB, BBb, Bbb
The next() function of this Iterator will always returns String objects
prefix - Prefix of the wanted keys.ignorecase - Case sensitive or not ....
public java.util.Iterator getReverseKeyIterator(java.lang.String prefix,
boolean ignorecase)
|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Copyright © 1997, 2005, Oracle.All rights reserved.