Package com.alachisoft.ncache.client
Class CacheSyncDependency
- java.lang.Object
-
- com.alachisoft.ncache.client.CacheSyncDependency
-
public class CacheSyncDependency extends java.lang.Object
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 Summary
Constructors Constructor Description CacheSyncDependency(java.lang.String remoteCacheId, java.lang.String key)
Initializes a new instance of the CacheSyncDependency with the specified parameters.CacheSyncDependency(java.lang.String remoteCacheId, java.lang.String key, java.lang.String userId, byte[] password)
Initializes a new instance of the CacheSyncDependency with the specified parameters.CacheSyncDependency(java.lang.String remoteCacheId, java.lang.String key, java.lang.String server, int port)
Initializes a new instance of the CacheSyncDependency with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCacheId()
The unique ID of the remote cache.java.lang.String
getKey()
The key of the item in the remote cache with which the local cache item needs to be synchronized.byte[]
getPassword()
Specifies the user authorization password.int
getPort()
The server port that is used by the clients to connect to the server.java.lang.String
getServer()
The name of the server where the remote cache is running.java.lang.String
getUserId()
Specifies the User ID for user authorization.
-
-
-
Constructor Detail
-
CacheSyncDependency
public CacheSyncDependency(java.lang.String remoteCacheId, java.lang.String key)
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:
remoteCacheId
- The unique ID of the remote cache.key
- The key of the item in the remote cache with which the local cache item will be kept synchronized.
-
CacheSyncDependency
public CacheSyncDependency(java.lang.String remoteCacheId, java.lang.String key, java.lang.String server, int port)
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.- Parameters:
remoteCacheId
- The unique ID of the remote cache.key
- The key of the item in the remote cache with which the local cache item will be kept synchronized.server
- The name of the server where the remote cache is running.port
- The port used by the client to connect to the server.
-
CacheSyncDependency
public CacheSyncDependency(java.lang.String remoteCacheId, java.lang.String key, java.lang.String userId, byte[] 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.- Parameters:
remoteCacheId
- The unique ID of the remote cache.key
- The key of the item in the remote cache with which the local cache item will be kept synchronized.userId
- The user ID of the remote cache.password
- The security password of the remote cache.
-
-
Method Detail
-
getCacheId
public java.lang.String getCacheId()
The unique ID of the remote cache.- Returns:
- The string cache id.
-
getKey
public java.lang.String getKey()
The key of the item in the remote cache with which the local cache item needs to be synchronized.- Returns:
- The string key of the item in remote cache with which the local cache item needs to be synchronized.
-
getServer
public java.lang.String getServer()
The name of the server where the remote cache is running.- Returns:
- The name of the server or the IP.
-
getUserId
public java.lang.String getUserId()
Specifies the User ID for user authorization.- Returns:
- The User ID.
-
getPassword
public byte[] getPassword()
Specifies the user authorization password.- Returns:
- The password required for user authorization.
-
getPort
public int getPort()
The server port that is used by the clients to connect to the server.- Returns:
- The integer value of the port.
-
-