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.0
Author:
matt
See Also:
  • Constructor Details

    • BasicInstruction

      public BasicInstruction(String topic, Instant instructionDate, String instructorId, InstructionStatus status)
      Constructor.
      Parameters:
      topic - the instruction topic
      instructionDate - the instruction date
      instructorId - the instructor ID
      status - the status, or null
    • BasicInstruction

      public BasicInstruction(Long id, String topic, Instant instructionDate, String instructorId, InstructionStatus status)
      Constructor.
      Parameters:
      id - the local instruction ID
      topic - the instruction topic
      instructionDate - the instruction date
      instructorId - the instructor ID
      status - the status, or null
    • BasicInstruction

      public BasicInstruction(Instruction other, Long id, InstructionStatus status)
      Copy constructor.
      Parameters:
      other - the instruction to copy
      id - if provided, the local ID to use
      status - if provided, the new status to use
      Since:
      1.2
    • BasicInstruction

      public BasicInstruction(Instruction other, InstructionStatus status)
      Copy constructor.
      Parameters:
      other - the instruction to copy
      status - if provided, the new status to use
      Since:
      1.2
  • Method Details

    • from

      public static BasicInstruction from(net.solarnetwork.domain.Instruction instr, String instructorId)
      Create a new BasicInstruction from a common instruction.
      Parameters:
      instr - the common instruction
      instructorId - the instructor ID
      Returns:
      the new instruction, or null if instr is null
    • toString

      public String toString()
      Overrides:
      toString in class net.solarnetwork.domain.BasicInstruction
    • getInstructorId

      public String getInstructorId()
      Description copied from interface: Instruction
      Get the unique ID for the sender of the instruction, for example the DN of the sender's certificate.
      Specified by:
      getInstructorId in interface Instruction
      Returns:
      the instructor ID
    • getStatus

      public InstructionStatus getStatus()
      Description copied from interface: Instruction
      Get the instruction state.
      Specified by:
      getStatus in interface net.solarnetwork.domain.Instruction
      Specified by:
      getStatus in interface Instruction
      Overrides:
      getStatus in class net.solarnetwork.domain.BasicInstruction
      Returns:
      the state, or null if none available