java.lang.Object
uk.ac.manchester.spinnaker.spalloc.messages.Command<A>
Type Parameters:
A - The type of arguments.
Direct Known Subclasses:
CreateJobCommand, DestroyJobCommand, GetBoardAtPositionCommand, GetBoardPositionCommand, GetJobMachineInfoCommand, GetJobStateCommand, JobKeepAliveCommand, ListJobsCommand, ListMachinesCommand, NoNotifyJobCommand, NoNotifyMachineCommand, NotifyJobCommand, NotifyMachineCommand, PowerOffJobBoardsCommand, PowerOnJobBoardsCommand, VersionCommand, WhereIsJobChipCommand, WhereIsMachineBoardLogicalCommand, WhereIsMachineBoardPhysicalCommand, WhereIsMachineChipCommand

public abstract class Command<A>
extends Object
A serialisable request to spalloc. This is modelled on the calling convention used by Python.
  • Constructor Details

    • Command

      public Command​(String command)
      Create a command.
      Parameters:
      command - The command token.
  • Method Details

    • addKwArg

      protected final void addKwArg​(String key, Object value)
      Add to the keyword arguments part.
      Parameters:
      key - The keyword
      value - The argument value; will be converted to a string
    • addArg

      @SafeVarargs protected final void addArg​(A... values)
      Add to the positional arguments part.
      Parameters:
      values - The arguments to add.
    • getCommand

      public String getCommand()
      Returns:
      The command token.
    • getArgs

      public List<A> getArgs()
      Returns:
      The positional arguments to the command.
    • getKwargs

      public Map<String,​Object> getKwargs()
      Returns:
      The keyword arguments to the command.