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 class
RemoteLogging.LoggingResponseHandler
Updates the buttons accordingly and displays error messages.static class
RemoteLogging.RemoteListenerRunnableWithLog
Runnable that outputs the log records to a log.
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PORT
the default port to use for receiving logging messages.protected com.googlecode.lanterna.gui2.Button
m_ButtonStart
the button for starting the logging.protected com.googlecode.lanterna.gui2.Button
m_ButtonStop
the button for stopping the logging.protected RemoteLogging.RemoteListenerRunnableWithLog
m_Runnable
the runnable.protected com.googlecode.lanterna.gui2.TextBox
m_TextLocal
the local host.protected LogTextBox
m_TextLog
for outputting the logging info.protected com.googlecode.lanterna.gui2.TextBox
m_TextMaxFailures
the maximum number of connection failures.protected com.googlecode.lanterna.gui2.TextBox
m_TextRemote
the 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 void
append(String msg)
Appends the log message.protected com.googlecode.lanterna.gui2.Panel
createPanel()
Creates the panel to display.protected LogTextBox
getLogTextBox()
Returns the LogTextBox to use.String
getTitle()
Returns the title of the action.void
logError(String msg)
Logs the error.void
logError(String msg, Throwable t)
Logs the error.void
logMessage(String msg)
Logs the message.protected void
startListening()
Starts the listening.void
stopListenerRunnable()
Stops the listener runnable.protected void
stopListening()
Stops the listening.void
updateButtons()
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:
getTitle
in classAbstractRemoteCommandAction
- Returns:
- the title
-
getLogTextBox
protected LogTextBox getLogTextBox()
Returns the LogTextBox to use.- Overrides:
getLogTextBox
in classAbstractRemoteCommandAction
- Returns:
- the log to use
-
logMessage
public void logMessage(String msg)
Logs the message.- Overrides:
logMessage
in classAbstractRemoteCommandAction
- Parameters:
msg
- the message to log
-
logError
public void logError(String msg)
Logs the error.- Overrides:
logError
in classAbstractRemoteCommandAction
- Parameters:
msg
- the error message to log
-
logError
public void logError(String msg, Throwable t)
Logs the error.- Overrides:
logError
in 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:
createPanel
in classAbstractRemoteCommandActionWithGUI
- Returns:
- the panel
-
-