Class DefaultCommandListener

  • All Implemented Interfaces:
    CommandListener

    public class DefaultCommandListener
    extends Object
    implements CommandListener
    A default listener implementation that just logs command failures.
    • Constructor Detail

      • DefaultCommandListener

        public DefaultCommandListener()
    • Method Detail

      • commandStarted

        public void commandStarted​(Element element,
                                   com.mks.api.Command command)
                            throws CoreException
        Notification ignored by implementation.
        Specified by:
        commandStarted in interface CommandListener
        Parameters:
        element - the element on which a command is executed.
        command - the command to execute.
        Throws:
        CoreException - never thrown by default implementation.
      • commandCompleted

        public void commandCompleted​(Element element,
                                     com.mks.api.Command command,
                                     com.mks.api.response.Response response)
                              throws CoreException
        Notification ignored by implementation.
        Specified by:
        commandCompleted in interface CommandListener
        Parameters:
        element - the element on which a command is executed.
        command - the executed command.
        response - the response obtained for the command execution.
        Throws:
        CoreException - never thrown by default implementation.
      • commandFailed

        public void commandFailed​(Element element,
                                  com.mks.api.Command command,
                                  CoreException error)
                           throws CoreException
        Logs the command failure and re-throw the exception. The logger used is the one assigned when reading the Integrity model.
        Specified by:
        commandFailed in interface CommandListener
        Parameters:
        element - the element on which a command is executed.
        command - the executed command.
        error - the error that occurred during execution.
        Throws:
        CoreException - always re-throws the exception received as argument.