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 GroovyActionInterface
cachedActionImplementation
private long
cachedActionImplementationLastModified
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 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 boolean
canEqual(java.lang.Object other)
void
configure(Configurer configurer)
Configure this action (expected to autowire in any dependencies)boolean
equals(java.lang.Object o)
private GroovyActionInterface
getActionImplementation()
Returns the GroovyTriggerInterface implementation for this trigger.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).int
hashCode()
void
performAction(SearchTransaction searchTransaction, Action.Phase phase)
Performs the desired action (by calling performAction on an instance of the specified Groovy class).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).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 theGroovyActionInterface
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).
-
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:
performAction
in 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:
runsInPhase
in 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:
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 theGroovyActionInterface
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 theGroovyActionInterface
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).
-
-