Package nl.rrd.wool.model.command
Class WoolInputTimeCommand
- java.lang.Object
-
- nl.rrd.wool.model.command.WoolCommand
-
- nl.rrd.wool.model.command.WoolAttributesCommand
-
- nl.rrd.wool.model.command.WoolInputCommand
-
- nl.rrd.wool.model.command.WoolInputTimeCommand
-
- All Implemented Interfaces:
Cloneable
public class WoolInputTimeCommand extends WoolInputCommand
-
-
Field Summary
Fields Modifier and Type Field Description static StringTIME_NOW-
Fields inherited from class nl.rrd.wool.model.command.WoolInputCommand
TYPE_NUMERIC, TYPE_SET, TYPE_TEXT, TYPE_TIME
-
-
Constructor Summary
Constructors Constructor Description WoolInputTimeCommand(String variableName)WoolInputTimeCommand(WoolInputTimeCommand other)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WoolInputTimeCommandclone()Returns a deep copy of this command.voidexecuteBodyCommand(Map<String,Object> variables, WoolNodeBody processedBody)This method is called if this command occurs in a statement body.intgetGranularityMinutes()WoolVariableStringgetMaxTime()WoolVariableStringgetMinTime()Map<String,?>getParameters()Returns the parameters for this input command to send to the client.voidgetReadVariableNames(Set<String> varNames)Retrieves all variable names that are read in this command and adds them to the specified set.WoolVariableStringgetStartTime()StringgetStatementLog(WoolVariableStore varStore)Returns the string to use in the user statement log in place of this input command.StringgetVariableName()voidgetWriteVariableNames(Set<String> varNames)Retrieves all variable names that are written in this command and adds them to the specified set.static WoolInputTimeCommandparse(WoolBodyToken cmdStartToken, Map<String,WoolBodyToken> attrs)voidsetGranularityMinutes(int granularityMinutes)voidsetMaxTime(WoolVariableString maxTime)voidsetMinTime(WoolVariableString minTime)voidsetStartTime(WoolVariableString startTime)voidsetVariableName(String variableName)StringtoString()-
Methods inherited from class nl.rrd.wool.model.command.WoolInputCommand
findReplyById, getNodePointers, getType, parse, setType
-
Methods inherited from class nl.rrd.wool.model.command.WoolAttributesCommand
parseAttributesCommand, readAttr, readIntAttr, readPlainTextAttr, readVariableAttr
-
-
-
-
Field Detail
-
TIME_NOW
public static final String TIME_NOW
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WoolInputTimeCommand
public WoolInputTimeCommand(String variableName)
-
WoolInputTimeCommand
public WoolInputTimeCommand(WoolInputTimeCommand other)
-
-
Method Detail
-
getVariableName
public String getVariableName()
-
setVariableName
public void setVariableName(String variableName)
-
getGranularityMinutes
public int getGranularityMinutes()
-
setGranularityMinutes
public void setGranularityMinutes(int granularityMinutes)
-
getStartTime
public WoolVariableString getStartTime()
-
setStartTime
public void setStartTime(WoolVariableString startTime)
-
getMinTime
public WoolVariableString getMinTime()
-
setMinTime
public void setMinTime(WoolVariableString minTime)
-
getMaxTime
public WoolVariableString getMaxTime()
-
setMaxTime
public void setMaxTime(WoolVariableString maxTime)
-
getParameters
public Map<String,?> getParameters()
Description copied from class:WoolInputCommandReturns the parameters for this input command to send to the client. This is a map from parameter names to values. A value can be any JSON type. This method should only be called on a command that has already been executed withexecuteBodyCommand(). This means that any variables in parameter values have already been resolved.- Specified by:
getParametersin classWoolInputCommand- Returns:
- the parameters for this input command to send to the client
-
getStatementLog
public String getStatementLog(WoolVariableStore varStore)
Description copied from class:WoolInputCommandReturns the string to use in the user statement log in place of this input command. It can use variable values from the specified variable store. This method should only be called on a command that has already been executed withexecuteBodyCommand(). This means that any variables in parameter values have already been resolved.- Specified by:
getStatementLogin classWoolInputCommand- Parameters:
varStore- the variable store- Returns:
- the statement log
-
getReadVariableNames
public void getReadVariableNames(Set<String> varNames)
Description copied from class:WoolCommandRetrieves all variable names that are read in this command and adds them to the specified set.- Specified by:
getReadVariableNamesin classWoolCommand- Parameters:
varNames- the set to which the variable names are added
-
getWriteVariableNames
public void getWriteVariableNames(Set<String> varNames)
Description copied from class:WoolCommandRetrieves all variable names that are written in this command and adds them to the specified set.- Specified by:
getWriteVariableNamesin classWoolCommand- Parameters:
varNames- the set to which the variable names are added
-
executeBodyCommand
public void executeBodyCommand(Map<String,Object> variables, WoolNodeBody processedBody) throws EvaluationException
Description copied from class:WoolCommandThis method is called if this command occurs in a statement body. It executes the command with respect to the specified variable map. Any body content that should be sent to the client, is added to "processedBody". This content can be text or client commands, with all variables resolved.- Specified by:
executeBodyCommandin classWoolCommand- Parameters:
variables- the variable mapprocessedBody- the processed body- Throws:
EvaluationException- if an expression cannot be evaluated
-
clone
public WoolInputTimeCommand clone()
Description copied from class:WoolCommandReturns a deep copy of this command.- Specified by:
clonein classWoolCommand- Returns:
- a deep copy of this command
-
parse
public static WoolInputTimeCommand parse(WoolBodyToken cmdStartToken, Map<String,WoolBodyToken> attrs) throws LineNumberParseException
- Throws:
LineNumberParseException
-
-