Class SimplePlugin

All Implemented Interfaces:
MBeanService, Runnable
Direct Known Subclasses:
ECpdsPlugin, ECproxyPlugin

public abstract class SimplePlugin extends ServerPlugin
The Class SimplePlugin.
  • Constructor Details

    • SimplePlugin

      public SimplePlugin(String ref, Map<String,String> params, Socket socket) throws IOException
      Instantiates a new simple plugin.
      Parameters:
      ref - the ref
      params - the params
      socket - the socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • SimplePlugin

      public SimplePlugin(String ref, Map<String,String> params)
      Instantiates a new simple plugin.
      Parameters:
      ref - the ref
      params - the params
  • Method Details

    • setSeparators

      protected void setSeparators(String separators)
      Sets the separators.
      Parameters:
      separators - the new separators
    • setLoop

      protected void setLoop(boolean loop)
      Sets the loop.
      Parameters:
      loop - the new loop
    • refuseConnection

      public void refuseConnection(Socket socket, int connectionsCount) throws IOException
      Refuse connection. Refuse connection.
      Specified by:
      refuseConnection in class ServerPlugin
      Parameters:
      socket - the socket
      connectionsCount - the connections count
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • startConnection

      public void startConnection(Socket socket) throws IOException
      Start connection. Start connection.
      Specified by:
      startConnection in class ServerPlugin
      Parameters:
      socket - the socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • invoke

      public void invoke(String command, String[] parameters) throws Exception
      Invoke.
      Parameters:
      command - the command
      parameters - the parameters
      Throws:
      Exception - the exception
    • releaseConnection

      public void releaseConnection(Socket socket, boolean close)
      Release connection. Release connection.
      Overrides:
      releaseConnection in class ServerPlugin
      Parameters:
      socket - the socket
      close - the close
    • parseCommand

      public String parseCommand(String command)
      Parses the command.
      Parameters:
      command - the command
      Returns:
      the string
    • readLine

      protected String readLine() throws IOException
      Read line.
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • optsReq

      public void optsReq(String[] parameters) throws SimplePlugin.ParameterException
      Opts req.
      Parameters:
      parameters - the parameters
      Throws:
      SimplePlugin.ParameterException - the parameter exception
    • getOpts

      public String getOpts(String name)
      Gets the opts.
      Parameters:
      name - the name
      Returns:
      the opts
    • getOpts

      public boolean getOpts(String name, boolean defaultValue)
      Gets the opts.
      Parameters:
      name - the name
      defaultValue - the default value
      Returns:
      the opts
    • print

      protected void print(String message) throws IOException
      Prints the.
      Parameters:
      message - the message
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • println

      protected void println(String message) throws IOException
      Println.
      Parameters:
      message - the message
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • error

      protected void error(String message)
      Error.
      Parameters:
      message - the message
    • send

      protected void send(String message) throws IOException
      Sends the.
      Parameters:
      message - the message
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • wait

      protected void wait(String message) throws IOException
      Wait.
      Parameters:
      message - the message
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • send

      protected void send(long message) throws IOException
      Sends the.
      Parameters:
      message - the message
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getInputStream

      protected InputStream getInputStream()
      Gets the input stream.
      Returns:
      the input stream
    • getOutputStream

      protected OutputStream getOutputStream()
      Gets the output stream.
      Returns:
      the output stream
    • getParameter

      protected static String getParameter(String[] parameters) throws SimplePlugin.ParameterException
      Gets the parameter.
      Parameters:
      parameters - the parameters
      Returns:
      the parameter
      Throws:
      SimplePlugin.ParameterException - the parameter exception
    • getParameter

      protected static String[] getParameter(String param)
      Gets the parameter.
      Parameters:
      param - the param
      Returns:
      the parameter