Class ExistsInCache
- java.lang.Object
-
- com.adaptris.core.services.conditional.conditions.ExistsInCache
-
- All Implemented Interfaces:
ComponentLifecycle
,Condition
@ComponentProfile(summary="Check the cache for a key", tag="condition,cache", since="3.9.1", recommended=CacheConnection.class) public class ExistsInCache extends java.lang.Object implements Condition
Condition that checks whether a key exists in aCache
In the adapter configuration file this class is aliased as exists-in-cache which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Constructor Summary
Constructors Constructor Description ExistsInCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the component.boolean
evaluate(AdaptrisMessage msg)
AdaptrisConnection
getConnection()
java.lang.String
getKey()
void
init()
Initialises the component.void
setConnection(AdaptrisConnection connection)
Set the connection to theCache
instance.void
setKey(java.lang.String key)
Specify the key to check for in the cache.void
start()
Starts the component.void
stop()
Stop the componentExistsInCache
withConnection(AdaptrisConnection c)
ExistsInCache
withKey(java.lang.String key)
-
-
-
Method Detail
-
init
public void init() throws CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
init
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Specified by:
start
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences- Specified by:
stop
in interfaceComponentLifecycle
-
close
public void close()
Description copied from interface:ComponentLifecycle
Closes the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeException
may cause unintended consequences- Specified by:
close
in interfaceComponentLifecycle
-
evaluate
public boolean evaluate(AdaptrisMessage msg) throws CoreException
- Specified by:
evaluate
in interfaceCondition
- Throws:
CoreException
-
getConnection
public AdaptrisConnection getConnection()
-
setConnection
public void setConnection(AdaptrisConnection connection)
Set the connection to theCache
instance.- Parameters:
connection
- the connection.
-
getKey
public java.lang.String getKey()
-
setKey
public void setKey(java.lang.String key)
Specify the key to check for in the cache.- Parameters:
key
- the key.
-
withConnection
public ExistsInCache withConnection(AdaptrisConnection c)
-
withKey
public ExistsInCache withKey(java.lang.String key)
-
-