|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.jxta.impl.cm.Cm
This class implements a limited document storing mechanism intended to provide a mean for DiscoveryService, ResolverService, PipeResolver and Cache services to search and exchange documents over the group. Only Core Services are intended to use this mechanism, the security relies on the generic PeerGroup security service. XXX: this need to be optimized
Inner Class Summary | |
static interface |
Cm.ExpirationListener
|
Field Summary | |
static java.lang.String |
PrivateDirName
|
static java.lang.String |
PublicDirName
|
static java.lang.String |
RootDirBase
|
static java.lang.String |
TmpDirName
|
Constructor Summary | |
Cm()
Makes a temporary storage area with a unique name. |
|
Cm(java.lang.String areaName)
|
|
Cm(java.lang.String areaName,
Cm.ExpirationListener listener)
|
Method Summary | |
void |
cleanupFolder(java.lang.String dn)
Returns true if the directory exists |
void |
createFolder(java.lang.String f)
Creates a new folder. |
static java.lang.String |
createTmpName()
Generates a random file name |
static java.lang.String |
createTmpName(net.jxta.document.StructuredDocument doc)
Generates a random file name using doc hashcode |
boolean |
exists(java.lang.String dn,
java.lang.String fn)
Tests if a file does exist |
long |
getExpirationTime(java.lang.String dn,
java.lang.String fn)
|
java.lang.String[] |
getFileNames(java.lang.String dn)
Gets the list of all the files into the given folder |
java.io.FileInputStream |
getInputStream(java.lang.String dn,
java.lang.String fn)
|
java.lang.String |
getOldestFile(java.lang.String dn)
Returns the name of the oldest file in a given directory |
boolean |
isFolder(java.lang.String dn)
Returns true if the directory exists |
void |
remove(java.lang.String dn,
java.lang.String fn)
Remove a file |
net.jxta.document.StructuredDocument |
restore(java.lang.String dn,
java.lang.String fn)
Restore a saved file |
byte[] |
restoreBytes(java.lang.String dn,
java.lang.String fn)
|
void |
save(java.lang.String dn,
java.lang.String fn,
net.jxta.document.StructuredDocument doc)
|
void |
save(java.lang.String dn,
java.lang.String fn,
net.jxta.document.StructuredDocument doc,
long timeoutInMyCache,
long timeoutForOthers)
|
void |
saveBytes(java.lang.String dn,
java.lang.String fn,
byte[] buffer)
|
void |
saveBytes(java.lang.String dn,
java.lang.String fn,
java.io.InputStream source)
|
java.util.Enumeration |
search(java.lang.String dn,
java.lang.String tag,
java.lang.String value)
Search and recovers documents that contains at least a mathing pair of tag/value. |
java.util.Enumeration |
searchLocal(java.lang.String dn,
java.lang.String tag,
java.lang.String value)
Search and recovers documents that contains at least a mathing pair of tag/value. |
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 RootDirBase
public static final java.lang.String PublicDirName
public static final java.lang.String PrivateDirName
public static final java.lang.String TmpDirName
Constructor Detail |
public Cm()
public Cm(java.lang.String areaName)
public Cm(java.lang.String areaName, Cm.ExpirationListener listener)
Method Detail |
public void createFolder(java.lang.String f) throws java.io.IOException
f
- contains the name of the new folderpublic static java.lang.String createTmpName()
public static java.lang.String createTmpName(net.jxta.document.StructuredDocument doc)
doc
- to hash to generate a unique namepublic void remove(java.lang.String dn, java.lang.String fn) throws java.io.IOException
dn
- contains the name of the folderfn
- contains the name of the filepublic boolean exists(java.lang.String dn, java.lang.String fn) throws java.io.IOException
dn
- contains the name of the folderfn
- contains the name of the filepublic long getExpirationTime(java.lang.String dn, java.lang.String fn)
public net.jxta.document.StructuredDocument restore(java.lang.String dn, java.lang.String fn) throws java.io.IOException, java.lang.reflect.InvocationTargetException
dn
- contains the name of the folderfn
- contains the name of the filepublic byte[] restoreBytes(java.lang.String dn, java.lang.String fn) throws java.io.IOException
public void save(java.lang.String dn, java.lang.String fn, net.jxta.document.StructuredDocument doc) throws java.io.IOException
public void save(java.lang.String dn, java.lang.String fn, net.jxta.document.StructuredDocument doc, long timeoutInMyCache, long timeoutForOthers) throws java.io.IOException
public void saveBytes(java.lang.String dn, java.lang.String fn, byte[] buffer) throws java.io.IOException
public void saveBytes(java.lang.String dn, java.lang.String fn, java.io.InputStream source) throws java.io.IOException
public java.lang.String[] getFileNames(java.lang.String dn)
dn
- contains the name of the folderpublic java.lang.String getOldestFile(java.lang.String dn)
dn
- contains the name of the folderpublic boolean isFolder(java.lang.String dn)
dn
- contains the name of the folderpublic void cleanupFolder(java.lang.String dn) throws java.io.IOException
dn
- contains the name of the folderpublic java.util.Enumeration search(java.lang.String dn, java.lang.String tag, java.lang.String value)
dn
- contains the name of the folder on which to perform the searchtag
- contains the name of the tag on which to search onvalue
- contains the value to search on.public java.util.Enumeration searchLocal(java.lang.String dn, java.lang.String tag, java.lang.String value)
tag
- contains the name of the tag on which to search onvalue
- contains the value to search on.public java.io.FileInputStream getInputStream(java.lang.String dn, java.lang.String fn) throws java.io.IOException
|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |