Package org.mycore.webcli.container
Class MCRWebCLIContainer
java.lang.Object
org.mycore.webcli.container.MCRWebCLIContainer
Is a wrapper class around command execution. Commands will be
queued
and executed in a
seperate thread.- Since:
- 2.0
- Author:
- Thomas Scheffler (yagee), Michel Buechner (mcrmibue)
-
Constructor Summary
ConstructorDescriptionMCRWebCLIContainer
(jakarta.websocket.Session session) Will instantiate this container with a list of supported commands. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommand
(String cmd) Adds thiscmd
to the current command queue.void
changeWebSocketSession
(jakarta.websocket.Session webSocketSession) void
static com.google.gson.JsonObject
protected static void
boolean
Returns the status of the command execution thread.void
setContinueIfOneFails
(boolean con) void
setContinueIfOneFails
(boolean con, boolean sendMessage) void
void
void
-
Constructor Details
-
MCRWebCLIContainer
public MCRWebCLIContainer(jakarta.websocket.Session session) Will instantiate this container with a list of supported commands.- Parameters:
session
- the current Session(Websocket) of the user using the gui.
-
-
Method Details
-
getWebsocketLock
-
addCommand
Adds thiscmd
to the current command queue. The thread executing the commands will be started automatically if the queue was previously empty.- Parameters:
cmd
- a valid String representation of aknown
MCRCommand
-
isRunning
public boolean isRunning()Returns the status of the command execution thread.- Returns:
- true if the thread is running
-
getKnownCommands
public static com.google.gson.JsonObject getKnownCommands() -
initializeCommands
protected static void initializeCommands() -
changeWebSocketSession
public void changeWebSocketSession(jakarta.websocket.Session webSocketSession) -
webSocketClosed
public void webSocketClosed() -
stopLogging
public void stopLogging() -
startLogging
public void startLogging() -
setContinueIfOneFails
public void setContinueIfOneFails(boolean con) -
setContinueIfOneFails
public void setContinueIfOneFails(boolean con, boolean sendMessage) -
clearCommandList
public void clearCommandList()
-