Class SshPlugin

All Implemented Interfaces:
MBeanService, Runnable

public final class SshPlugin extends PluginThread
The Class SshPlugin.
  • Constructor Details

    • SshPlugin

      public SshPlugin(String ref, Map<String,String> params) throws org.apache.sshd.common.SshException
      Instantiates a new ssh2 plugin.
      Parameters:
      ref - the ref
      params - the params
      Throws:
      org.apache.sshd.common.SshException - the ssh exception
  • Method Details

    • getPluginName

      public String getPluginName()
      Gets the plugin name.
      Specified by:
      getPluginName in class PluginThread
      Returns:
      the plugin name
    • getVersion

      public String getVersion()
      Gets the version.
      Specified by:
      getVersion in class PluginThread
      Returns:
      the version
    • getListeningPorts

      public List<Integer> getListeningPorts()
      Gets the port(s) this plugin is actually listening on, read directly from the plugin's own live state (as opposed to re-deriving it from configuration by plugin ref/name, which is fragile and breaks whenever a plugin's configuration section name differs from what a caller assumes). Subclasses that open one or more network listeners should override this to return their actual bound port(s); the default returns an empty list, meaning "no listening port to report" (e.g. a plugin with no network listener of its own). Returns this plugin's own listening port, read directly from this plugin's own configuration - only while actually started (the server field is only non-null once running).
      Overrides:
      getListeningPorts in class PluginThread
      Returns:
      the listening port(s), or an empty list if none/not applicable
    • start

      public boolean start()
      Start.
      Specified by:
      start in class PluginThread
      Returns:
      true, if successful
    • stop

      public void stop()
      Stop.
      Specified by:
      stop in class PluginThread
    • getAttribute

      public Object getAttribute(String attributeName) throws AttributeNotFoundException, MBeanException
      Gets the attribute.
      Specified by:
      getAttribute in interface MBeanService
      Overrides:
      getAttribute in class PluginThread
      Parameters:
      attributeName - the attribute name
      Returns:
      the attribute
      Throws:
      AttributeNotFoundException - the attribute not found exception
      MBeanException - the MBean exception
    • getMBeanInfo

      public MBeanInfo getMBeanInfo()
      Gets the MBean info.
      Specified by:
      getMBeanInfo in interface MBeanService
      Overrides:
      getMBeanInfo in class PluginThread
      Returns:
      the MBean info