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 GroovyTriggerInterfacecachedTriggerImplementationprivate longcachedTriggerImplementationLastModifiedprivate java.lang.StringclassFileFile specifying the Groovy class which implements the desired action.private java.util.Map<java.lang.String,java.lang.Object>propertiesAny 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 booleanactivatesOn(SearchTransaction searchTransaction)Check the given searchTransaction to see if the trigger activates on this request.protected booleancanEqual(java.lang.Object other)voidconfigure(Configurer configurer)Configure this trigger (expected to autowire in any dependencies)booleanequals(java.lang.Object o)java.lang.StringgetClassFile()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).GroovyTriggerInterfacegetTriggerImplementation()Returns the GroovyTriggerInterface implementation for this trigger.inthashCode()voidsetClassFile(java.lang.String classFile)File specifying the Groovy class which implements the desired action.voidsetProperties(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.StringtoString()
-
-
-
Field Detail
-
classFile
private java.lang.String classFile
File specifying the Groovy class which implements the desired action. This class is expected to implement theGroovyTriggerInterfaceinterface.
-
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:
activatesOnin 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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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 theGroovyTriggerInterfaceinterface.
-
setClassFile
public void setClassFile(java.lang.String classFile)
File specifying the Groovy class which implements the desired action. This class is expected to implement theGroovyTriggerInterfaceinterface.
-
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).
-
-