| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectccs.cdb.ChromeCache
public class ChromeCache
This class retrives a file - frequently these files are "chrome" of some kind, hence the name - from a CDB you've previously given it.
| Constructor Summary | |
|---|---|
ChromeCache()
Build a new ChromeCache.  | 
|
| Method Summary | |
|---|---|
 boolean | 
cacheContains(java.lang.String dbID)
Check whether the specified CDB is in the cache.  | 
 CDBeeTree | 
cdbFor(java.lang.String dbID)
Returns the cached CDB itself.  | 
 SwappingBuffer | 
chromeFor(java.lang.String dbID,
          java.lang.String objectID)
Obtain a "chrome" - or indeed, any other - file, from a cached CDB.  | 
 SwappingBuffer | 
chromeFor(java.lang.String dbID,
          java.lang.String objectID,
          java.util.Date modified)
Obtain a "chrome" - or indeed, any other - file, from a cached CDB.  | 
 SwappingBuffer | 
commonChromeFor(java.lang.String objectID)
As well as application-specific chrome, we maintain a CDB of "common chrome".  | 
 SwappingBuffer | 
commonChromeFor(java.lang.String objectID,
                java.util.Date modified)
As well as application-specific chrome, we maintain a CDB of "common chrome".  | 
 java.lang.String[] | 
directoryFor(java.lang.String dbID,
             java.lang.String objectID)
Obtains a directory entry in a CDB filesystem.  | 
 void | 
expire(java.lang.String dbID)
Remove a CDB from the cache.  | 
 void | 
precache(java.lang.String dbID,
         CDBeeTree cdbt)
Add a CDB to the cache.  | 
 void | 
touch(java.lang.String dbID)
Set the last-modified date for the specified CDB to right now, if the CDB is already cached; does nothing if it isn't.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ChromeCache()
| Method Detail | 
|---|
public void precache(java.lang.String dbID,
                     CDBeeTree cdbt)
dbID - An ID for the database (your invention). To avoid potential
        namespace conflicts, make sure your IDs do not include '/' characters.cdbt - The CDB itself.public void expire(java.lang.String dbID)
public boolean cacheContains(java.lang.String dbID)
dbID - The database ID to check for.
public SwappingBuffer chromeFor(java.lang.String dbID,
                                java.lang.String objectID)
                         throws java.io.FileNotFoundException,
                                java.io.IOException
dbID - The database ID.objectID - The ID (i.e. "path") of the file within the CDB.
SwappingBuffer containing the file. Note that this has
        a null mimeType field; your app should use its own 
        MimeRegistry, or some other means, to determine the MIME type.
java.io.FileNotFoundException - if there is no such object in the CDB.
java.io.IOException - if something goes wrong with the transaction.
public SwappingBuffer chromeFor(java.lang.String dbID,
                                java.lang.String objectID,
                                java.util.Date modified)
                         throws java.io.FileNotFoundException,
                                java.io.IOException
dbID - The database ID.objectID - The ID (i.e. "path") of the file within the CDB.modified - The modification date. If present, the result will only
        be returned if it has been modified after this time; if it's unmodified,
        returns null.
SwappingBuffer containing the file. Note that this has
        a null mimeType field; your app should use its own 
        MimeRegistry, or some other means, to determine the MIME type.
java.io.FileNotFoundException - if there is no such object in the CDB.
java.io.IOException - if something goes wrong with the transaction.
public SwappingBuffer commonChromeFor(java.lang.String objectID)
                               throws java.io.IOException
java.io.IOException
public SwappingBuffer commonChromeFor(java.lang.String objectID,
                                      java.util.Date modified)
                               throws java.io.IOException
modified - The modification date. If present, the result will only
        be returned if it has been modified after this time; if it's unmodified,
        returns null.
java.io.IOException
public void touch(java.lang.String dbID)
           throws java.io.FileNotFoundException
dbID - The database ID.
java.io.FileNotFoundException - if the specified CDB is not cached.
public java.lang.String[] directoryFor(java.lang.String dbID,
                                       java.lang.String objectID)
                                throws java.io.FileNotFoundException,
                                       java.io.IOException
dbID - The database ID.objectID - The ID (i.e. "path") of the directory within the CDB.
java.io.FileNotFoundException - if there is no such object in the CDB.
java.io.IOException - if something goes wrong with the transaction.
public CDBeeTree cdbFor(java.lang.String dbID)
                 throws java.io.FileNotFoundException
dbID - The database ID.
java.io.FileNotFoundException - if there is no such object in the CDB.
java.io.IOException - if something goes wrong with the transaction.
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||