Class MCRWebCLIContainer

java.lang.Object
org.mycore.webcli.container.MCRWebCLIContainer

public class MCRWebCLIContainer extends Object
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 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

      public ReentrantLock getWebsocketLock()
    • addCommand

      public void addCommand(String cmd)
      Adds this cmd 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 a known 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()