Package ai.wanaku.cli.main.commands
Class BaseCommand
java.lang.Object
ai.wanaku.cli.main.commands.BaseCommand
- 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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()abstract IntegerdoCall(org.jline.terminal.Terminal terminal, WanakuPrinter printer) protected static <T> TinitService(Class<T> clazz, String host) Initializes and configures the REST client for communicating with the Wanaku service.
-
Field Details
-
EXIT_OK
public static final int EXIT_OK- See Also:
-
EXIT_ERROR
public static final int EXIT_ERROR- See Also:
-
-
Constructor Details
-
BaseCommand
public BaseCommand()
-
-
Method Details
-
initService
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 interfacehost- 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 malformedNullPointerException- if host is null
-
call
-
doCall
public abstract Integer doCall(org.jline.terminal.Terminal terminal, WanakuPrinter printer) throws Exception - Throws:
Exception
-