Class KeyDependency
- java.lang.Object
-
- com.alachisoft.ncache.runtime.dependencies.CacheDependency
-
- com.alachisoft.ncache.runtime.dependencies.KeyDependency
-
- All Implemented Interfaces:
java.io.Serializable
public class KeyDependency extends CacheDependency
KeyDependency class is used for providing key based dependency in the cache.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KeyDependency(java.lang.String key)
Initializes a new instance of the KeyExpiration class that monitors a cache key for changes based on the update or remove operation performed and taking effect instantly.KeyDependency(java.lang.String key, KeyDependencyType keyDependencyType)
Initializes a new instance of the KeyExpiration class that monitors a cache key for changes based on the operation performed (that is specified by keyDependencyType argument) and taking effect instantly.KeyDependency(java.lang.String key, java.util.Date startAfter)
Initializes a new instance of the KeyExpiration class that monitors a cache key for changes based on the update or remove operation performed and taking effect instantly corresponding to the date specified.KeyDependency(java.lang.String key, java.util.Date startAfter, KeyDependencyType keyDependencyType)
Initializes a new instance of the KeyExpiration class that monitors a cache key for changes based on the operation performed (that is specified by keyDependencyType argument) and taking effect instantly corresponding to the date specified.KeyDependency(java.util.List<java.lang.String> keys)
Initializes a new instance of the KeyExpiration class that monitors a list of cache keys for changes based on the update or remove operation performed and taking effect instantly.KeyDependency(java.util.List<java.lang.String> keys, KeyDependencyType keyDependencyType)
Initializes a new instance of the KeyExpiration class that monitors a list of cache keys for changes based on the operation performed (that is specified by keyDependencyType argument) and taking effect instantly.KeyDependency(java.util.List<java.lang.String> keys, java.util.Date startAfter)
Initializes a new instance of the KeyExpiration class that monitors a list of cache keys for changes based on the update or remove operation performed and taking effect instantly corresponding to the date specified.KeyDependency(java.util.List<java.lang.String> keys, java.util.Date startAfter, KeyDependencyType keyDependencyType)
Initializes a new instance of the KeyExpiration class that monitors a list of cache keys for changes based on the operation performed (that is specified by keyDependencyType argument) and taking effect instantly corresponding to the date specified.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<java.lang.String>
getCacheKeys()
Gets the list of cache keys.KeyDependencyType
getKeyDependencyType()
Enumeration specifying operation upon which key dependency is to be triggered.long
getStartAfterTicks()
Gets the time after which dependency is to be started.void
setKeyDependencyType(KeyDependencyType value)
Enumeration specifying operation upon which key dependency is to be triggered.-
Methods inherited from class com.alachisoft.ncache.runtime.dependencies.CacheDependency
AddDependencies, DependencyDispose, dispose, getDependencies
-
-
-
-
Constructor Detail
-
KeyDependency
public KeyDependency(java.lang.String key) throws OperationFailedException
Initializes a new instance of the KeyExpiration class that monitors a cache key for changes based on the update or remove operation performed and taking effect instantly.- Parameters:
key
- The cache key which will be monitored for updation or removal.- Throws:
OperationFailedException
-
KeyDependency
public KeyDependency(java.lang.String key, java.util.Date startAfter) throws OperationFailedException
Initializes a new instance of the KeyExpiration class that monitors a cache key for changes based on the update or remove operation performed and taking effect instantly corresponding to the date specified.- Parameters:
key
- The cache key which will be monitored for updation or removal.startAfter
- The time after which specified key is monitored.- Throws:
OperationFailedException
-
KeyDependency
public KeyDependency(java.lang.String key, KeyDependencyType keyDependencyType) throws OperationFailedException
Initializes a new instance of the KeyExpiration class that monitors a cache key for changes based on the operation performed (that is specified by keyDependencyType argument) and taking effect instantly.- Parameters:
key
- The cache key which will be monitored for the specified operations.keyDependencyType
- Specifies operation/operations upon which key dependency is to be triggered.- Throws:
OperationFailedException
-
KeyDependency
public KeyDependency(java.lang.String key, java.util.Date startAfter, KeyDependencyType keyDependencyType) throws OperationFailedException
Initializes a new instance of the KeyExpiration class that monitors a cache key for changes based on the operation performed (that is specified by keyDependencyType argument) and taking effect instantly corresponding to the date specified.- Parameters:
key
- The cache key which will be monitored for the specified operations.startAfter
- The time after which specified key is monitored.keyDependencyType
- Specifies operation/operations upon which key dependency is to be triggered.- Throws:
OperationFailedException
-
KeyDependency
public KeyDependency(java.util.List<java.lang.String> keys) throws OperationFailedException
Initializes a new instance of the KeyExpiration class that monitors a list of cache keys for changes based on the update or remove operation performed and taking effect instantly.- Parameters:
keys
- The list of cache keys which will be monitored for updation or removal.- Throws:
OperationFailedException
-
KeyDependency
public KeyDependency(java.util.List<java.lang.String> keys, java.util.Date startAfter) throws OperationFailedException
Initializes a new instance of the KeyExpiration class that monitors a list of cache keys for changes based on the update or remove operation performed and taking effect instantly corresponding to the date specified.- Parameters:
keys
- The list of cache keys which will be monitored for updation or removal.startAfter
- The time after which specified keys are monitored.- Throws:
OperationFailedException
-
KeyDependency
public KeyDependency(java.util.List<java.lang.String> keys, KeyDependencyType keyDependencyType) throws OperationFailedException
Initializes a new instance of the KeyExpiration class that monitors a list of cache keys for changes based on the operation performed (that is specified by keyDependencyType argument) and taking effect instantly.- Parameters:
keys
- The list of cache keys which will be monitored for updation or removal.keyDependencyType
- Specifies operation/operations upon which key dependency is to be triggered.- Throws:
OperationFailedException
-
KeyDependency
public KeyDependency(java.util.List<java.lang.String> keys, java.util.Date startAfter, KeyDependencyType keyDependencyType) throws OperationFailedException
Initializes a new instance of the KeyExpiration class that monitors a list of cache keys for changes based on the operation performed (that is specified by keyDependencyType argument) and taking effect instantly corresponding to the date specified.- Parameters:
keys
- The list of cache keys which will be monitored for the specified operations.startAfter
- The time after which specified keys are monitored.keyDependencyType
- Specifies operation/operations upon which key dependency is to be triggered.- Throws:
OperationFailedException
-
-
Method Detail
-
getCacheKeys
public java.util.Collection<java.lang.String> getCacheKeys()
Gets the list of cache keys.- Returns:
- The list of cache keys associated with the dependency.
-
getKeyDependencyType
public final KeyDependencyType getKeyDependencyType()
Enumeration specifying operation upon which key dependency is to be triggered.- Returns:
- The KeyDependencyType associated with the dependency.
-
setKeyDependencyType
public final void setKeyDependencyType(KeyDependencyType value)
Enumeration specifying operation upon which key dependency is to be triggered.- Parameters:
value
- The KeyDependencyType to be associated with the dependency.
-
getStartAfterTicks
public long getStartAfterTicks()
Gets the time after which dependency is to be started.- Returns:
- The time after which key dependency is started.
-
-