Class Resource

java.lang.Object
com.viam.sdk.core.resource.Resource
Direct Known Subclasses:
Component, Service

public abstract class Resource extends Object
The base requirements for a Resource
  • Constructor Details

  • Method Details

    • named

      protected static Common.ResourceName named(Subtype subtype, String name)
    • getSubtype

      public Subtype getSubtype()
    • getName

      public Common.ResourceName getName()
      Get the ResourceName of the Resource
      Returns:
      Resource's ResourceName
    • doCommand

      public com.google.protobuf.Struct doCommand(Map<String,com.google.protobuf.Value> command)
      Send/Receive arbitrary commands to the Resource
      Parameters:
      command - the command to execute
      Returns:
      result of the executed command
    • createStatus

      public Robot.Status createStatus()
      Create a generic Status for the Resource
      Returns:
      a Status
    • close

      public void close()
      Safely shutdown the Resource and prevent further use. This function must be idempotent.