Class AbstractSimulatedActuator<C>

java.lang.Object
org.episteme.core.device.AbstractDevice
org.episteme.core.device.AbstractActuator<C>
org.episteme.core.device.sim.AbstractSimulatedActuator<C>
Type Parameters:
C - the type of command accepted by the actuator
All Implemented Interfaces:
Serializable, AutoCloseable, Actuator<C>, Device, Commented, ComprehensiveIdentification, Identified<Identification>, Named
Direct Known Subclasses:
SimulatedBallotCaster, SimulatedCentrifuge

public abstract class AbstractSimulatedActuator<C> extends AbstractActuator<C>
Abstract base implementation for simulated actuators.
Since:
1.2
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Field Details

  • Constructor Details

    • AbstractSimulatedActuator

      protected AbstractSimulatedActuator(String name)
    • AbstractSimulatedActuator

      protected AbstractSimulatedActuator(Identification identification)
  • Method Details

    • connect

      public void connect() throws IOException
      Description copied from interface: Device
      Connects to the device.
      Throws:
      IOException - if the connection fails
    • disconnect

      public void disconnect() throws IOException
      Description copied from interface: Device
      Disconnects from the device.
      Throws:
      IOException - if the disconnection fails
    • isConnected

      public boolean isConnected()
      Description copied from interface: Device
      Checks if the device is currently connected.
      Returns:
      true if connected, false otherwise
    • getCapabilities

      public Map<String,Boolean> getCapabilities()
      Description copied from interface: Device
      Returns a map of capabilities and their status (active/inactive).
      Returns:
      the capabilities map
    • getReadings

      public Map<String,String> getReadings()
      Description copied from interface: Device
      Returns the current status readings (Power, Uptime, etc.).
      Returns:
      the readings map
    • addCustomReadings

      protected void addCustomReadings(Map<String,String> readings)
      Subclasses can override to add custom readings.
    • getStatus

      public String getStatus()
      Description copied from interface: Device
      Returns the current status of the device as a string.
      Specified by:
      getStatus in interface Device
      Overrides:
      getStatus in class AbstractDevice
      Returns:
      the status string
    • getFormattedInfo

      public String getFormattedInfo()
    • close

      public void close() throws Exception
      Throws:
      Exception