Class GroovyTrigger
- java.lang.Object
-
- com.funnelback.publicui.search.model.curator.trigger.GroovyTrigger
-
- All Implemented Interfaces:
Trigger
@Component public class GroovyTrigger extends java.lang.Object implements Trigger
A trigger which activates only when the current query contains all the words given as triggers.
The query may contain other words without affecting the trigger, and the order of the words within the query is not considered important.
-
-
Field Summary
Fields Modifier and Type Field Description private GroovyTriggerInterface
cachedTriggerImplementation
private long
cachedTriggerImplementationLastModified
private java.lang.String
classFile
File specifying the Groovy class which implements the desired action.private java.util.Map<java.lang.String,java.lang.Object>
properties
Any properties associated with the action (passed to the performAction and runsInPhase methods).
-
Constructor Summary
Constructors Constructor Description GroovyTrigger()
GroovyTrigger(java.lang.String classFile, java.util.Map<java.lang.String,java.lang.Object> properties)
Convenience constructor to create a new GroovyTrigger with a script and properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
activatesOn(SearchTransaction searchTransaction)
Check the given searchTransaction to see if the trigger activates on this request.protected boolean
canEqual(java.lang.Object other)
void
configure(Configurer configurer)
Configure this trigger (expected to autowire in any dependencies)boolean
equals(java.lang.Object o)
java.lang.String
getClassFile()
File specifying the Groovy class which implements the desired action.java.util.Map<java.lang.String,java.lang.Object>
getProperties()
Any properties associated with the action (passed to the performAction and runsInPhase methods).GroovyTriggerInterface
getTriggerImplementation()
Returns the GroovyTriggerInterface implementation for this trigger.int
hashCode()
void
setClassFile(java.lang.String classFile)
File specifying the Groovy class which implements the desired action.void
setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Any properties associated with the action (passed to the performAction and runsInPhase methods).java.lang.String
toString()
-
-
-
Field Detail
-
classFile
private java.lang.String classFile
File specifying the Groovy class which implements the desired action. This class is expected to implement theGroovyTriggerInterface
interface.
-
properties
private java.util.Map<java.lang.String,java.lang.Object> properties
Any properties associated with the action (passed to the performAction and runsInPhase methods).
-
cachedTriggerImplementation
private GroovyTriggerInterface cachedTriggerImplementation
-
cachedTriggerImplementationLastModified
private long cachedTriggerImplementationLastModified
-
-
Method Detail
-
getTriggerImplementation
public GroovyTriggerInterface getTriggerImplementation()
Returns the GroovyTriggerInterface implementation for this trigger. The returned implementation is cached, however the original file has a modification timestamp check performed on every request (and the implementation refreshed if the file is changed).
-
activatesOn
public boolean activatesOn(SearchTransaction searchTransaction)
Check the given searchTransaction to see if the trigger activates on this request.- Specified by:
activatesOn
in interfaceTrigger
- Parameters:
searchTransaction
- Current search transaction- Returns:
- true if this trigger should activate on the given searchTransaction, and false otherwise.
-
configure
public void configure(Configurer configurer)
Configure this trigger (expected to autowire in any dependencies)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getClassFile
public java.lang.String getClassFile()
File specifying the Groovy class which implements the desired action. This class is expected to implement theGroovyTriggerInterface
interface.
-
setClassFile
public void setClassFile(java.lang.String classFile)
File specifying the Groovy class which implements the desired action. This class is expected to implement theGroovyTriggerInterface
interface.
-
getProperties
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Any properties associated with the action (passed to the performAction and runsInPhase methods).
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Any properties associated with the action (passed to the performAction and runsInPhase methods).
-
-