Problem Domain:
I am working on a new revision of a Java application that connects via SSH to a proprietary, Linux-based platform's Command Line Interface (CLI). Everything on the platform that I would want to do or know is only available via CLI commands and stdout.
One of the commands available retrieves information from an internal database (not using SQL) with the following command arguments: query, sub-query, result format, and sorting preference.
Solution Being Considered:
I would like to expose an API that encapsulates the low-level details of the SSH/CLI behavior and achieve the following:
- Eliminate the current error-prone method of embedded query strings (currently very prone to typos).
- Make the API intuitive as the current query and command formats are not commonly understood.
- Provide consistent error and result responses.
I am considering creating query builder and response classes at the lowest level that implement the SSH/CLI behavior; then creating a layer above that to allow retrieval of attributes from the platform by attribute-category (as compared with database tables).
Question:
I have been digging through my Gang of Four book and other resources to find any sensible approaches that might be a starting point; also looking at information on Syntax Trees.
Before I find myself implementing "SQL for proprietary platform" I wanted to see if anyone has any advice, similar experience, resources, or other input on solutions to this problem. Any thoughts on implementation, available frameworks, CLI processing, or other resources would be appreciated.
As always, thank you for your time and making Stack Overflow great.
Thank you,
-bn