CacheSyncDependency

CacheSyncDependency

A client application can have more than one cache instances initialized. CacheSyncDependency keeps the items present in one cache synchronized with the items present in another cache.


Constructor

# new CacheSyncDependency(remoteCacheId, key, server, port, userId, password)

Initializes a new instance of the CacheSyncDependency with the specified parameters. Internally it tries to initialize the remote cache. If the cache can not be initialized, it throws the exception describing the cause of failure. The remote cache must be running as outproc even if it is on the same machine. The information to connect to the remote cache instance (like server-name and server-port) are picked from the 'client.ncconf'.

Parameters:
Name Type Default Description
remoteCacheId String

The unique id of the remote cache.

key String

The key of the item in the remote cache with which the local cache item will be kept synchronized.

server ServerInfo null
port number 0
userId string null

The user id of the remote cache.

password string null

The Security password of the remote cache.

Methods

# getCacheId() → {string}

The unique Id of the remote cache

Returns:
Type
string

# getKey() → {string}

The key of the item in the remote cache with which the local cache item needs to be synchronized.

Returns:
Type
string

# getPassword() → {ArrayBuffer}

Specifies the user authorization password.

Returns:
Type
ArrayBuffer

# getPort() → {number}

The server port that is used by the clients to connect to the server.

Returns:
Type
number

# getServer() → {string}

The name of the server where the remote cache is running.

Returns:
Type
string

# getUserId() → {string}

Specifies the User Id for user authorization.

Returns:
Type
string