Class RemoteLogging
- java.lang.Object
-
- adams.terminal.menu.remotecommand.AbstractRemoteCommandAction
-
- adams.terminal.menu.remotecommand.AbstractRemoteCommandActionWithGUI
-
- adams.terminal.menu.remotecommand.RemoteLogging
-
- All Implemented Interfaces:
adams.scripting.processor.RemoteCommandProcessorHandler,Comparable<AbstractRemoteCommandAction>
public class RemoteLogging extends AbstractRemoteCommandActionWithGUI
Allows remote logging.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemoteLogging.LoggingResponseHandlerUpdates the buttons accordingly and displays error messages.static classRemoteLogging.RemoteListenerRunnableWithLogRunnable that outputs the log records to a log.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PORTthe default port to use for receiving logging messages.protected com.googlecode.lanterna.gui2.Buttonm_ButtonStartthe button for starting the logging.protected com.googlecode.lanterna.gui2.Buttonm_ButtonStopthe button for stopping the logging.protected RemoteLogging.RemoteListenerRunnableWithLogm_Runnablethe runnable.protected com.googlecode.lanterna.gui2.TextBoxm_TextLocalthe local host.protected LogTextBoxm_TextLogfor outputting the logging info.protected com.googlecode.lanterna.gui2.TextBoxm_TextMaxFailuresthe maximum number of connection failures.protected com.googlecode.lanterna.gui2.TextBoxm_TextRemotethe remote host.-
Fields inherited from class adams.terminal.menu.remotecommand.AbstractRemoteCommandAction
m_CommandProcessor, m_Owner
-
-
Constructor Summary
Constructors Constructor Description RemoteLogging()Initializes the action with no owner.RemoteLogging(adams.terminal.application.AbstractTerminalApplication owner)Initializes the action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(String msg)Appends the log message.protected com.googlecode.lanterna.gui2.PanelcreatePanel()Creates the panel to display.protected LogTextBoxgetLogTextBox()Returns the LogTextBox to use.StringgetTitle()Returns the title of the action.voidlogError(String msg)Logs the error.voidlogError(String msg, Throwable t)Logs the error.voidlogMessage(String msg)Logs the message.protected voidstartListening()Starts the listening.voidstopListenerRunnable()Stops the listener runnable.protected voidstopListening()Stops the listening.voidupdateButtons()Updates the buttons.-
Methods inherited from class adams.terminal.menu.remotecommand.AbstractRemoteCommandActionWithGUI
doRun
-
Methods inherited from class adams.terminal.menu.remotecommand.AbstractRemoteCommandAction
compareTo, configureEngine, equals, getCommandProcessor, getOwner, getRunnable, initialize, postRun, preRun, sendCommand, sendCommandWithReponse, setCommandProcessor, setOwner
-
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
the default port to use for receiving logging messages.- See Also:
- Constant Field Values
-
m_TextRemote
protected com.googlecode.lanterna.gui2.TextBox m_TextRemote
the remote host.
-
m_TextMaxFailures
protected com.googlecode.lanterna.gui2.TextBox m_TextMaxFailures
the maximum number of connection failures.
-
m_TextLocal
protected com.googlecode.lanterna.gui2.TextBox m_TextLocal
the local host.
-
m_TextLog
protected LogTextBox m_TextLog
for outputting the logging info.
-
m_ButtonStart
protected com.googlecode.lanterna.gui2.Button m_ButtonStart
the button for starting the logging.
-
m_ButtonStop
protected com.googlecode.lanterna.gui2.Button m_ButtonStop
the button for stopping the logging.
-
m_Runnable
protected RemoteLogging.RemoteListenerRunnableWithLog m_Runnable
the runnable.
-
-
Method Detail
-
getTitle
public String getTitle()
Returns the title of the action.- Specified by:
getTitlein classAbstractRemoteCommandAction- Returns:
- the title
-
getLogTextBox
protected LogTextBox getLogTextBox()
Returns the LogTextBox to use.- Overrides:
getLogTextBoxin classAbstractRemoteCommandAction- Returns:
- the log to use
-
logMessage
public void logMessage(String msg)
Logs the message.- Overrides:
logMessagein classAbstractRemoteCommandAction- Parameters:
msg- the message to log
-
logError
public void logError(String msg)
Logs the error.- Overrides:
logErrorin classAbstractRemoteCommandAction- Parameters:
msg- the error message to log
-
logError
public void logError(String msg, Throwable t)
Logs the error.- Overrides:
logErrorin classAbstractRemoteCommandAction- Parameters:
msg- the error message to logt- the exception
-
startListening
protected void startListening()
Starts the listening.
-
stopListening
protected void stopListening()
Stops the listening.
-
updateButtons
public void updateButtons()
Updates the buttons.
-
append
public void append(String msg)
Appends the log message.- Parameters:
msg- the message
-
stopListenerRunnable
public void stopListenerRunnable()
Stops the listener runnable.
-
createPanel
protected com.googlecode.lanterna.gui2.Panel createPanel()
Creates the panel to display.- Specified by:
createPanelin classAbstractRemoteCommandActionWithGUI- Returns:
- the panel
-
-