## Contents

- Methods

class solace.CacheSession

This class is not exposed for construction by API users. Users should obtain an instance from solace.Session#createCacheSession

A session for performing cache requests.

Applications must use solace.Session#createCacheSession to construct this class.

The supplied solace.CacheSessionProperties will be copied. Subsequent modifications to the passed properties will not modify the session. The properties may be reused.

## Constructor Top

| CacheSession ( ) |  |

## Methods Top

void | dispose ( ) |
solace.CacheSessionProperties | getProperties ( ) |
void | sendCacheRequest ( Number requestID, solace.Destination topic, Boolean subscribe, solace.CacheLiveDataAction liveDataAction, solace.CacheCBInfo cbInfo ) |

## Constructor details Top

###
CacheSession ( )

This class is not exposed for construction by API users. Users should obtain an instance from solace.Session#createCacheSession

A session for performing cache requests.

Applications must use solace.Session#createCacheSession to construct this class.

The supplied solace.CacheSessionProperties will be copied. Subsequent modifications to the passed properties will not modify the session. The properties may be reused.

## Methods Detail Top

###
public void dispose ( )

Disposes the session. No cache requests will be sent by this CacheSession after it is _disposed.

Any subsequent operations on the session will throw {OperationError}.

Any pending operations will immediately terminate, returning

- solace.CacheRequestResult
  - #returnCode === solace.CacheReturnCode.INCOMPLETE
  - #subcode === solace.CacheReturnSubcode.CACHE_SESSION_DISPOSED

#### Return Value

void |

#### Throws

solace.OperationError | if the CacheSession is already _disposed.

###
public solace.CacheSessionProperties getProperties ( )

Gets the cache session properties.

#### Return Value

solace.CacheSessionProperties | The properties for the session.

#### Throws

solace.OperationError | if the CacheSession is disposed.

###
public void sendCacheRequest ( Number requestID, solace.Destination topic, Boolean subscribe, solace.CacheLiveDataAction liveDataAction, solace.CacheCBInfo cbInfo )

Issues an asynchronous cache request. The result of the request will be returned via the listener. Messages returned as a result of issuing the request will be returned to the application via the solace.MessageRxCBInfo associated with this solace.CacheSession's solace.Session

#### Parameters

Number | requestID The application-assigned ID number for the request.
solace.Destination | topic The topic destination for which the cache request will be made.
Boolean | subscribe If true, the session will subscribe to the given {Topic}, if it is not already subscribed, before performing the cache request.
solace.CacheLiveDataAction | liveDataAction The action to perform when the solace.CacheSession receives live data on the given topic.
solace.CacheCBInfo | cbInfo Callback info for the cache request.

#### Return Value

void |

#### Throws

solace.OperationError | In the following cases: If the CacheSession is disposed. Subcode: solace.ErrorSubcode.INVALID_OPERATION If one or more parameters were invalid. Subcode: solace.ErrorSubcode.PARAMETER_INVALID_TYPE If the supplied topic and live data action cannot be combined. Subcode: solace.ErrorSubcode.PARAMETER_CONFLICT If the supplied topic or live data action cannot be used given the current outstanding requests. Subcode: solace.ErrorSubcode.PARAMETER_CONFLICT