Oracle Reports
Java API Reference
10g Release 2 (10.1.2)
B14049-01

oracle.reports.cache
Interface Cache


public interface Cache

With the Oracle Reports cache system interface, you can cache frequently requested data in any medium you choose. For example, you can choose to cache data in the database, the file system, or memory.

This class is a Singleton class because there should only be one cache system.


Method Summary
 void deleteItem(CacheItem item)
          Deletes the CacheItem.
 void empty()
          Clears the entire cache.
 CacheItem findItem(java.util.Properties jobProps, java.lang.String key)
          Searches the caching service for items that match specified job properties.
 int getCurrentCapacity()
          Returns the current cache capacity in bytes.
 int getCurrentNumberOfFiles()
          Returns the current number of files in the cache.
 java.lang.String[] getIgnoreParams()
          Get parameter names that will be ignored when calculating the cache item key
 int getMaxCapacity()
          Returns the maximum cache capacity value in megabytes (MB).
 int getMaxNumberOfFiles()
          Returns the maximum number of files.
 void manage()
          Manages the cache.
 CacheItem newItem(Job job, java.lang.String key)
          Creates a new item in the cache for a given job object.
 void setMaxCapacity(int capacity)
          Sets the maximum cache capacity in megabytes (MB).
 void setMaxNumberOfFiles(int maxNumberOfFiles)
          Sets the maximum number of files.
 void start(java.util.Properties cacheSystemProps, oracle.reports.utility.Trace trace)
          Starts the Oracle Reports caching service.
 void stop()
          Stops the Oracle Reports caching service.

 

Method Detail

start

public void start(java.util.Properties cacheSystemProps,
                  oracle.reports.utility.Trace trace)
           throws oracle.reports.RWException
Starts the Oracle Reports caching service.
Parameters:
cacheSystemProps - Contains the properties to initialize the caching service.
trace - Trace object to which trace information is sent.

stop

public void stop()
Stops the Oracle Reports caching service.

manage

public void manage()
            throws oracle.reports.RWException
Manages the cache. For example: checks expired items and deletes them from cache; if the cache size exceeds cache maximum capacity, uses FIFO to delete some items & subitems.

getMaxCapacity

public int getMaxCapacity()
Returns the maximum cache capacity value in megabytes (MB).

setMaxCapacity

public void setMaxCapacity(int capacity)
                    throws oracle.reports.RWException
Sets the maximum cache capacity in megabytes (MB).
Parameters:
capacity - The capacity of the entire cache.

getCurrentCapacity

public int getCurrentCapacity()
Returns the current cache capacity in bytes.

getMaxNumberOfFiles

public int getMaxNumberOfFiles()
Returns the maximum number of files.

setMaxNumberOfFiles

public void setMaxNumberOfFiles(int maxNumberOfFiles)
                         throws oracle.reports.RWException
Sets the maximum number of files.
Parameters:
maxNumberOfFiles - Maximum number of files.

getCurrentNumberOfFiles

public int getCurrentNumberOfFiles()
Returns the current number of files in the cache.

empty

public void empty()
           throws oracle.reports.RWException
Clears the entire cache.

newItem

public CacheItem newItem(Job job,
                         java.lang.String key)
                  throws oracle.reports.RWException
Creates a new item in the cache for a given job object.
Parameters:
job - Job object that owns this cache.
key - Cache key that is used to create the item.
Returns:
A new CacheItem object.

deleteItem

public void deleteItem(CacheItem item)
                throws oracle.reports.RWException
Deletes the CacheItem.
Parameters:
item - CacheItem to be deleted.

findItem

public CacheItem findItem(java.util.Properties jobProps,
                          java.lang.String key)
                   throws oracle.reports.RWException
Searches the caching service for items that match specified job properties.
Parameters:
jobProps - Defines the job properties such as DESFORMAT, user parameters, etc.
key - Cache key used to search for matching item.
Returns:
If found, the item object is returned. If not found, null is returned.

If this is a single job run from the command line, the key will be used for comparision. If this is a distribution job, the group key will be used for comparison. If there is a match, the first item of the group is returned.


getIgnoreParams

public java.lang.String[] getIgnoreParams()
Get parameter names that will be ignored when calculating the cache item key

Oracle Reports
Java API Reference

Copyright © 1994, 2005 Oracle Corporation. All Rights Reserved.