Class GroovyAction
- java.lang.Object
-
- com.funnelback.publicui.search.model.curator.action.GroovyAction
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.funnelback.publicui.search.model.curator.config.Action
Action.Phase
-
-
Field Summary
Fields Modifier and Type Field Description private GroovyActionInterfacecachedActionImplementationprivate longcachedActionImplementationLastModifiedprivate 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 GroovyAction()GroovyAction(java.lang.String classFile, java.util.Map<java.lang.String,java.lang.Object> properties)Convenience constructor to create a new GroovyAction with a script and properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)voidconfigure(Configurer configurer)Configure this action (expected to autowire in any dependencies)booleanequals(java.lang.Object o)private GroovyActionInterfacegetActionImplementation()Returns the GroovyTriggerInterface implementation for this trigger.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).inthashCode()voidperformAction(SearchTransaction searchTransaction, Action.Phase phase)Performs the desired action (by calling performAction on an instance of the specified Groovy class).booleanrunsInPhase(Action.Phase phase)Checks whether the desired action should be run in the given phase (by calling runsInPhase on an instance of the specified Groovy class).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 theGroovyActionInterfaceinterface.
-
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).
-
cachedActionImplementation
private GroovyActionInterface cachedActionImplementation
-
cachedActionImplementationLastModified
private long cachedActionImplementationLastModified
-
-
Method Detail
-
getActionImplementation
private GroovyActionInterface getActionImplementation()
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).
-
performAction
public void performAction(SearchTransaction searchTransaction, Action.Phase phase)
Performs the desired action (by calling performAction on an instance of the specified Groovy class).- Specified by:
performActionin interfaceAction- Parameters:
searchTransaction- Current search transactionphase- The phase being processed (Some actions may wish to behave differently depending on the current phase of processing).
-
runsInPhase
public boolean runsInPhase(Action.Phase phase)
Checks whether the desired action should be run in the given phase (by calling runsInPhase on an instance of the specified Groovy class).- Specified by:
runsInPhasein interfaceAction- Parameters:
phase- The phase being processed (Some actions may wish to behave differently depending on the current phase of processing).- Returns:
- true if this action should be run in the given phase, otherwise return false.
-
configure
public void configure(Configurer configurer)
Configure this action (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 theGroovyActionInterfaceinterface.
-
setClassFile
public void setClassFile(java.lang.String classFile)
File specifying the Groovy class which implements the desired action. This class is expected to implement theGroovyActionInterfaceinterface.
-
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).
-
-