Package marauroa.server.db

Examples of marauroa.server.db.DBTransaction


     *         tries in the defined time frame.
     * @throws SQLException
     *             if there is any database problem.
     */
    public boolean isBlocked() throws SQLException {
      DBTransaction transaction = TransactionPool.get().beginWork();
      boolean res = true;
      try {
        LoginEventDAO loginEventDAO = DAORegister.get().get(LoginEventDAO.class);
        res = loginEventDAO.isAccountBlocked(transaction, username)
          || loginEventDAO.isAddressBlocked(transaction, address.getHostAddress());
View Full Code Here


     * </ul>
     * @return a string indicating the status of the account.
     * @throws SQLException
     */
    public String getStatus() throws SQLException {
      DBTransaction transaction = TransactionPool.get().beginWork();
      String res = null;
      try {
        if (DAORegister.get().get(AccountDAO.class).hasPlayer(transaction, username)) {
          res = DAORegister.get().get(AccountDAO.class).getAccountBanMessage(transaction, username);
        }
View Full Code Here

      throw new DatabaseConnectionException(e);
    }
  }
 
  private void initializeDatabaseSchema() {
    final DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      new JDBCSQLHelper(transaction).runDBScript("marauroa/server/marauroa_init.sql");
      new UpdateScript().update(transaction);
      TransactionPool.get().commit(transaction);
    } catch (SQLException e) {
View Full Code Here

   * adds an statistics sample to the database log
   *
   * @param var Variables
   */
  public void addStatisticsEvent(Variables var) {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      addStatisticsEvent(transaction, var);
      TransactionPool.get().commit(transaction);
    } catch (SQLException e) {
      logger.error(e, e);
View Full Code Here

   * @param correctLogin true, if the login was successful; false otherwise
   * @throws SQLException in case of an database error
   */
  @Deprecated
  public void addLoginEvent(String username, InetAddress source, boolean correctLogin) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      addLoginEvent(transaction, username, source, null, null, correctLogin);
    } finally {
      TransactionPool.get().commit(transaction);
    }
View Full Code Here

   * @param correctLogin true, if the login was successful; false otherwise
   * @throws SQLException in case of an database error
   */
  @Deprecated
  public void addLoginEvent(String username, InetAddress source, String seed, boolean correctLogin) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      addLoginEvent(transaction, username, source, null, seed, correctLogin);
    } finally {
      TransactionPool.get().commit(transaction);
    }
View Full Code Here

   * @param seed seed
   * @param correctLogin true, if the login was successful; false otherwise
   * @throws SQLException in case of an database error
   */
  public void addLoginEvent(String username, InetAddress source, String service, String seed, boolean correctLogin) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      addLoginEvent(transaction, username, source, service, seed, correctLogin);
    } finally {
      TransactionPool.get().commit(transaction);
    }
View Full Code Here

   * @param events number of events
   * @return list of login attempts
   * @throws SQLException in case of an database error
   */
  public List<String> getLoginEvents(String username, int events) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      List<String> res = getLoginEvents(transaction, username, events);
      return res;
    } finally {
      TransactionPool.get().commit(transaction);
View Full Code Here

   * @param username username
   * @return true, if this account is blocked; false otherwise
   * @throws SQLException in case of an database error
   */
  public boolean isAccountBlocked(String username) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      boolean res = isAccountBlocked(transaction, username);
      return res;
    } finally {
      TransactionPool.get().commit(transaction);
View Full Code Here

   * @param address ip-address
   * @return true, if this address is blocked; false otherwise
   * @throws SQLException in case of an database error
   */
  public boolean isAddressBlocked(String address) throws SQLException {
    DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      boolean res = isAddressBlocked(transaction, address);
      return res;
    } finally {
      TransactionPool.get().commit(transaction);
View Full Code Here

TOP

Related Classes of marauroa.server.db.DBTransaction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.