Class BaseCommand

java.lang.Object
dev.agenor.tools.cli.commands.BaseCommand
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
ConfigCommand, HealthCommand, ListCommand, LogsCommand, StartCommand, StatusCommand, StopCommand

public abstract class BaseCommand extends Object implements Runnable
Base command providing common API client functionality.
  • Field Details

    • apiUrl

      protected String apiUrl
    • verbose

      protected boolean verbose
    • mapper

      protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
    • httpClient

      protected static final HttpClient httpClient
    • table

      protected TableFormatter table
  • Constructor Details

    • BaseCommand

      public BaseCommand()
  • Method Details

    • getApiUrl

      protected String getApiUrl()
    • isVerbose

      protected boolean isVerbose()
    • apiGet

      protected com.fasterxml.jackson.databind.JsonNode apiGet(String endpoint) throws Exception
      Throws:
      Exception
    • extractData

      protected com.fasterxml.jackson.databind.JsonNode extractData(com.fasterxml.jackson.databind.JsonNode response)
      Extract data field from API response wrapper.
    • apiPost

      protected com.fasterxml.jackson.databind.JsonNode apiPost(String endpoint) throws Exception
      Throws:
      Exception
    • printError

      protected void printError(String message)
    • printSuccess

      protected void printSuccess(String message)