I guess the modern professional way would be to run the Java code as a Function /Lambda in a server environment. This should obviously be behind an API gateway.You are as dense as the code that you write
Do you do hello world examples for a living?
import x.y.AbstractConsoleChatPlugin; public class ConsoleChat extends AbstractConsoleChatPlugin { public void onInput(String input){ if("exit".equalsIgnoreCase(input)){ consoleOut("Good bye"); } } public void onKeyPress(char key){ if(key == 'S') consoleOut("You pressed 'S'!"); } }
Your code is the kinda code that results in massive security holes in the end because you all gung-ho writing direct console string manipulation. And the fact that you write console type applications using Java shows no skill in selecting propper language for a solution. A bash script would have made much better sense.
But you are right - this does require bash. So we need to create a docker image based on alpine/curl with a bash script to call the api and direct input and output to the it.
Obviously we then require a key vault.
Basic modern architecture to be WebScale.