Oracle Reports
Java API Reference
11g Release 1 (11.1.1)
E10775-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.
 long 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
 long 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

void start(java.util.Properties cacheSystemProps,
           oracle.reports.utility.Trace trace)
           throws 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.
Throws:
RWException

stop

void stop()
Stops the Oracle Reports caching service.


manage

void manage()
            throws 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.

Throws:
RWException

getMaxCapacity

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


setMaxCapacity

void setMaxCapacity(int capacity)
                    throws RWException
Sets the maximum cache capacity in megabytes (MB).

Parameters:
capacity - The capacity of the entire cache.
Throws:
RWException

getCurrentCapacity

long getCurrentCapacity()
Returns the current cache capacity in bytes.


getMaxNumberOfFiles

int getMaxNumberOfFiles()
Returns the maximum number of files.


setMaxNumberOfFiles

void setMaxNumberOfFiles(int maxNumberOfFiles)
                         throws RWException
Sets the maximum number of files.

Parameters:
maxNumberOfFiles - Maximum number of files.
Throws:
RWException

getCurrentNumberOfFiles

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


empty

void empty()
           throws RWException
Clears the entire cache.

Throws:
RWException

newItem

CacheItem newItem(Job job,
                  java.lang.String key)
                  throws 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.
Throws:
RWException

deleteItem

void deleteItem(CacheItem item)
                throws RWException
Deletes the CacheItem.

Parameters:
item - CacheItem to be deleted.
Throws:
RWException

findItem

CacheItem findItem(java.util.Properties jobProps,
                   java.lang.String key)
                   throws 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.

Throws:
RWException

getIgnoreParams

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


Oracle Reports
Java API Reference

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