de.stefan1200.jts3servermod

## Class FunctionExceptionLog

- java.lang.Object
- - de.stefan1200.jts3servermod.FunctionExceptionLog

-     public class FunctionExceptionLog
      extends Object

  The FunctionExceptionLog class can save exceptions of the type TS3ServerQueryException. If wanted, it can also save an id (like a client database id) to this exception. The TS3ServerQueryException can occur very often until the problem was solved (maybe a missing permission of the bot on the Teamspeak 3 server). If the exception occur again, you can check if this exception was already thrown (for this id) and prevent writing an error message to the log file again.
  Example, fel is a class member variable:

       private FunctionExceptionLog fel = new FunctionExceptionLog();

       ************ more class content ***************

       try
       {
              queryLib.kickClient(clientID, false, kickMSG);
              fel.clearException(Integer.parseInt(clientInfo.get("client_database_id")));
       }
       catch (TS3ServerQueryException sqe)
       {
              if (!fel.existsException(sqe, Integer.parseInt(clientInfo.get("client_database_id"))))
              {
                      fel.addException(sqe, Integer.parseInt(clientInfo.get("client_database_id")));
                      modClass.addLogEntry(configPrefix, JTS3ServerMod_Interface.ERROR_LEVEL_ERROR, "An error occurred while kicking client \"" + clientInfo.get("client_nickname") + "\" (db id: " + clientInfo.get("client_database_id") + ")!", false);
                      modClass.addLogEntry(configPrefix, sqe, false);
              }
       }

  The author of the JTS3ServerMod is not responsible for any damage or data loss!
  E-Mail:
  info@stefan1200.de
  Homepage:
  http://www.stefan1200.de
  Author:
    Stefan Martens
  See Also:
    `TS3ServerQueryException`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FunctionExceptionLog()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addException(TS3ServerQueryException exception)` Add the TS3ServerQueryException to the list.
    `void` | `addException(TS3ServerQueryException exception, int targetID)` Add the TS3ServerQueryException to the list, tied to an id (like a client database id).
    `void` | `clearAllExceptions()` Clears all saved TS3ServerQueryExceptions.
    `void` | `clearException(int targetID)` Clears the TS3ServerQueryException of the given id (like a client database id).
    `boolean` | `existsException(TS3ServerQueryException exception)` Check if this exception was already saved.
    `boolean` | `existsException(TS3ServerQueryException exception, int targetID)` Check if this exception was already saved.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FunctionExceptionLog

          public FunctionExceptionLog()

  - ### Method Detail

    - #### addException

          public void addException(TS3ServerQueryException exception)

      Add the TS3ServerQueryException to the list.
      Parameters:
        `exception` - The TS3ServerQueryException you want to add

    - #### addException

          public void addException(TS3ServerQueryException exception,
                                   int targetID)

      Add the TS3ServerQueryException to the list, tied to an id (like a client database id).
      Parameters:
        `exception` - The TS3ServerQueryException you want to add.
        `targetID` - An id (like a client database id) for the exception.

    - #### clearAllExceptions

          public void clearAllExceptions()

      Clears all saved TS3ServerQueryExceptions.

    - #### clearException

          public void clearException(int targetID)

      Clears the TS3ServerQueryException of the given id (like a client database id).
      Parameters:
        `targetID` - An id (like a client database id) of the exception.

    - #### existsException

          public boolean existsException(TS3ServerQueryException exception)

      Check if this exception was already saved. The error id and failed permission id of the TS3ServerQueryException will be compared.
      Parameters:
        `exception` - The TS3ServerQueryException
      Returns:
        `true`, if this exception was already saved, `false` if not.

    - #### existsException

          public boolean existsException(TS3ServerQueryException exception,
                                         int targetID)

      Check if this exception was already saved. The error id and failed permission id of the TS3ServerQueryException will be compared. The target id has to match also.
      Parameters:
        `exception` - The TS3ServerQueryException
        `targetID` - An id (like a client database id) of the exception.
      Returns:
        `true`, if this exception was already saved, `false` if not.