Class BaseCommand

java.lang.Object
ai.wanaku.cli.main.commands.BaseCommand
All Implemented Interfaces:
Callable<Integer>
Direct Known Subclasses:
AbstractTargets, Capabilities, CapabilitiesBase, CapabilitiesCreate, CapabilitiesList, CapabilitiesShow, Forwards, ForwardsAdd, ForwardsList, ForwardsRemove, NamespaceList, Namespaces, Resources, Resources, ResourcesExpose, ResourcesList, ResourcesRemove, Start, StartBase, Targets, Tools, Tools, ToolsAdd, ToolsEdit, ToolSet, ToolSetAdd, ToolsGenerate, ToolsImport, ToolsList, ToolsRemove

public abstract class BaseCommand extends Object implements Callable<Integer>
  • Field Details

  • Constructor Details

    • BaseCommand

      public BaseCommand()
  • Method Details

    • initService

      protected static <T> T initService(Class<T> clazz, String host)
      Initializes and configures the REST client for communicating with the Wanaku service.

      Creates a properly configured Quarkus REST client builder with the specified host URL. The client is configured with appropriate timeouts and error handling for reliable communication with the Wanaku API endpoints.

      Type Parameters:
      T - the type of the service interface
      Parameters:
      clazz - the Class object representing the service interface
      host - the base URL of the Wanaku service API (must be a valid URI)
      Returns:
      a configured Service instance ready for API calls
      Throws:
      IllegalArgumentException - if the host URL is invalid or malformed
      NullPointerException - if host is null
    • call

      public Integer call() throws Exception
      Specified by:
      call in interface Callable<Integer>
      Throws:
      Exception
    • doCall

      public abstract Integer doCall(org.jline.terminal.Terminal terminal, WanakuPrinter printer) throws Exception
      Throws:
      Exception