Class AbstractDBCommand

java.lang.Object
marauroa.server.db.command.AbstractDBCommand
All Implemented Interfaces:
DBCommand
Direct Known Subclasses:
AbstractLogItemEventCommand, BanAccountCommand, DBCommandWithCallback, DeletePendingAchievementDetailsCommand, DumpSpeakerNPCsCommand, DumpZonesCommand, GetCharacterCreationDateCommand, GetPostmanMessagesCommand, LogGameEventCommand, LogKillEventCommand, LogStatisticsCommand, LogTradeEventCommand, QueryCanonicalCharacterNamesCommand, ReadAchievementsForPlayerCommand, ReadCharactersFromHallOfFameCommand, ReadGroupQuestCommand, ReadHallOfFamePointsCommand, ReadPendingAchievementDetailsCommand, SetCharacterStatusCommand, SetOnlineStatusCommand, StoreCharacterCommand, StoreMessageCommand, StoreZoneCommand, UpdateGroupQuestCommand, UpdateSearchIndexCommand, WriteHallOfFamePointsCommand, WriteReachedAchievementCommand

public abstract class AbstractDBCommand extends Object implements DBCommand
An abstract asynchronous database command.
Author:
hendrik, madmetzger
  • Constructor Details

    • AbstractDBCommand

      public AbstractDBCommand()
  • Method Details

    • getException

      public Exception getException()
      gets the exception in case one was thrown during processing.
      Specified by:
      getException in interface DBCommand
      Returns:
      RuntimeException or null in case no exception was thrown.
    • getEnqueueTime

      public Timestamp getEnqueueTime()
      gets the timestamp when this command was added to the queue
      Specified by:
      getEnqueueTime in interface DBCommand
      Returns:
      Timestamp
    • setException

      public void setException(Exception exception)
      remembers an exception
      Specified by:
      setException in interface DBCommand
      Parameters:
      exception - RuntimeException
    • setEnqueueTime

      public void setEnqueueTime(Timestamp enqueueTime)
      sets the timestamp when this command was added to the queue
      Specified by:
      setEnqueueTime in interface DBCommand
      Parameters:
      enqueueTime - Timestamp
    • execute

      public abstract void execute(DBTransaction transaction) throws SQLException, IOException
      processes the database request.
      Specified by:
      execute in interface DBCommand
      Parameters:
      transaction - DBTransaction
      Throws:
      SQLException - in case of an database error
      IOException - in case of an input/output error