Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.autonomy.aci
Class AciCache

    java.lang.Object
      com.autonomy.aci.AciCache

public class AciCache
extends java.lang.Object

The `AciCache` controls the client-side caching of ACI requests made with the ACI api. You should use it to specify which ACI actions are cached and when they are removed from the cache.

Caching is turned on by default, using the action caching details specified in `com.autonomy.aci.CachingDetails` resource bundle.

It is a singleton class, which gets instantiated internally the first time it is used.

Method Summary
`AciResponse` | `getCachedResult(AciConnection aciServer, AciAction aciAction)` Tries to find a valid cached result for the given action sent to the given server.
`static AciCache` | `getInstance()` Gives access to the singleton `AciCache` object.
`long` | `getMaxCachingTime()` Returns the maximum time for which results are cached.
`void` | `setCachingDetailsForAction(ActionCachingDetails actionCachingDetails)` Details specific cause-effect cases for caching.
`void` | `setLogfileName(java.lang.String sLogfileName)` Specify the path and name for the caching events logfile.
`void` | `setMaxCachingTime(long lCachingTime)` Set the maximum time for which ACI requests are cached.
`void` | `turnLoggingOff()` Stop logging caching events.
`void` | `turnLoggingOn()` Start logging caching events.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static AciCache getInstance()

  Gives access to the singleton `AciCache` object.

  Returns:
    the `AciCache` singleton reference.

### setCachingDetailsForAction

    public void setCachingDetailsForAction(ActionCachingDetails actionCachingDetails)

  Details specific cause-effect cases for caching. See `ActionCachingDetails` for an explanation of how to configure the caching details.

  Parameters:
    `actionCachingDetails` - the caching details for an action.

### getCachedResult

    public AciResponse getCachedResult(AciConnection aciServer,
                                       AciAction aciAction)

  Tries to find a valid cached result for the given action sent to the given server. A cached result is valid if
  - it was sent to the same server
  - it has not been invalidated by another, subsequent, action
  - it has been stored in the cache for less than the time configured for that action

  Parameters:
    `aciServer` - the ACI server that the action request is being sent to.
    `aciAction` - the action that is being sent.
  Returns:
    the cached result if a valid one was found or null otherwise.

### setMaxCachingTime

    public void setMaxCachingTime(long lCachingTime)

  Set the maximum time for which ACI requests are cached.

  Parameters:
    `lCachingTime` - the time for which requests are cached in milliseconds. 0 turns off the cache.

### getMaxCachingTime

    public long getMaxCachingTime()

  Returns the maximum time for which results are cached.

  Returns:
    the maximum time for which results are cached.

### setLogfileName

    public void setLogfileName(java.lang.String sLogfileName)

  Specify the path and name for the caching events logfile. You can then switch logging on and off using `turnLoggingOn` and `turnLoggingOff`.

  Parameters:
    `sLogfileName` - the path of the file into which messages should be logged.

### turnLoggingOn

    public void turnLoggingOn()

  Start logging caching events. You must also give a name for the log file using `setLogfileName` before any logging will occure.

### turnLoggingOff

    public void turnLoggingOff()

  Stop logging caching events.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD