Package net.solarnetwork.node.reactor
Class BasicInstruction
java.lang.Object
net.solarnetwork.domain.BasicInstruction
net.solarnetwork.node.reactor.BasicInstruction
- All Implemented Interfaces:
Serializable,net.solarnetwork.domain.Instruction,Instruction
public class BasicInstruction
extends net.solarnetwork.domain.BasicInstruction
implements Instruction, Serializable
Basic implementation of
Instruction.- Version:
- 2.1
- Author:
- matt
- See Also:
-
Field Summary
Fields inherited from interface net.solarnetwork.node.reactor.Instruction
LOCAL_INSTRUCTION_ID, PARAM_EXECUTION_DATE, PARAM_PARENT_INSTRUCTION_ID, PARAM_PARENT_INSTRUCTOR_ID -
Constructor Summary
ConstructorsConstructorDescriptionBasicInstruction(Long id, String topic, Instant instructionDate, String instructorId, InstructionStatus status) Constructor.BasicInstruction(String topic, Instant instructionDate, String instructorId, InstructionStatus status) Constructor.BasicInstruction(Instruction other, Long id, InstructionStatus status) Copy constructor.BasicInstruction(Instruction other, InstructionStatus status) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyParameters(net.solarnetwork.domain.Instruction instr, BasicInstruction dest) Copy the parameters from one instruction to another.static BasicInstructionCreate a newBasicInstructionfrom a common instruction.Get the unique ID for the sender of the instruction, for example the DN of the sender's certificate.Get the instruction state.toString()Methods inherited from class net.solarnetwork.domain.BasicInstruction
addParameter, getAllParameterValues, getId, getInstructionDate, getParameterMultiMap, getParameterNames, getParameterValue, getTopic, isParameterAvailable, putParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.solarnetwork.domain.Instruction
getAllParameterValues, getId, getInstructionDate, getInstructionState, getParameterMap, getParameterMultiMap, getParameterNames, getParameterValue, getTopic, isParameterAvailableMethods inherited from interface net.solarnetwork.node.reactor.Instruction
getExecutionDate, getIdentifier, isLocal, timestampParameterValue
-
Constructor Details
-
BasicInstruction
public BasicInstruction(String topic, Instant instructionDate, String instructorId, InstructionStatus status) Constructor.- Parameters:
topic- the instruction topicinstructionDate- the instruction dateinstructorId- the instructor IDstatus- the status, or null
-
BasicInstruction
public BasicInstruction(Long id, String topic, Instant instructionDate, String instructorId, InstructionStatus status) Constructor.- Parameters:
id- the local instruction IDtopic- the instruction topicinstructionDate- the instruction dateinstructorId- the instructor IDstatus- the status, or null
-
BasicInstruction
Copy constructor.- Parameters:
other- the instruction to copyid- if provided, the local ID to usestatus- if provided, the new status to use- Since:
- 1.2
-
BasicInstruction
Copy constructor.- Parameters:
other- the instruction to copystatus- if provided, the new status to use- Since:
- 1.2
-
-
Method Details
-
from
Create a newBasicInstructionfrom a common instruction.- Parameters:
instr- the common instructioninstructorId- the instructor ID- Returns:
- the new instruction, or null if
instris null
-
copyParameters
Copy the parameters from one instruction to another.- Parameters:
instr- the input instruction to copy fromdest- the destination instruction to copy to- Since:
- 2.1
-
toString
- Overrides:
toStringin classnet.solarnetwork.domain.BasicInstruction
-
getInstructorId
Description copied from interface:InstructionGet the unique ID for the sender of the instruction, for example the DN of the sender's certificate.- Specified by:
getInstructorIdin interfaceInstruction- Returns:
- the instructor ID
-
getStatus
Description copied from interface:InstructionGet the instruction state.- Specified by:
getStatusin interfacenet.solarnetwork.domain.Instruction- Specified by:
getStatusin interfaceInstruction- Overrides:
getStatusin classnet.solarnetwork.domain.BasicInstruction- Returns:
- the state, or null if none available
-