Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.RepositoryException


      LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
          "All data in " + indexedTableName + " and " + readersTableName +
          " tables are purged");
    } catch (SQLException e) {
      LOGGER.logp(Level.FINE, CLASS_NAME, METHOD, "Failed to clear all data");
      throw new RepositoryException(e);
    }
    LOGGER.exiting(CLASS_NAME, METHOD);
    return isClear;
  }
View Full Code Here


      LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
          indexedTableName + " and " + readersTableName +
          " tables were dropped");
    } catch (SQLException e) {
      LOGGER.logp(Level.FINE, CLASS_NAME, METHOD, "Failed to drop tables");
      throw new RepositoryException(e);
    }
    LOGGER.exiting(CLASS_NAME, METHOD);
    return isDropped;
  }
View Full Code Here

        try {
          //Obtain database connection
          databaseConnection = ncs.getNotesDocumentManager()
            .getDatabaseConnection();
          if (databaseConnection == null) {
            throw new RepositoryException(
                "Database connection is not initialized");
          }

          //Otherwise our checkpoint should be the UNID of the
          //current document in the doclist
View Full Code Here

      conn = connectionPool.getConnection();
      originalTransactionIsolation = conn.getTransactionIsolation();
      originalAutoCommit = conn.getAutoCommit();
      conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
    } catch (SQLException e) {
      throw new RepositoryException(
          "Failure obtaining database connection for user cache", e);
    }
    return true;
  }
View Full Code Here

              + " values (?, ?)");
          pstmt.setLong(1, groupid);
          for (String childGroupName : nestedGroups) {
            long childGroupId = verifyGroupExists(childGroupName, true);
            if (childGroupId == -1L) {
              throw new RepositoryException("Missing group record for "
                  + "child group: " + childGroupName);
            }
            pstmt.setLong(2, childGroupId);
            pstmt.executeUpdate();
          }
View Full Code Here

      origAutoCommit = conn.getAutoCommit();
      conn.setAutoCommit(true);
    } catch (SQLException e) {
      LOGGER.logp(Level.SEVERE, CLASS_NAME, METHOD,
          "Failed to connect to H2 database");
      throw new RepositoryException(e);
    }
    // Loop thru each person's OU and add to notesDomainNames cache
    for (String ou : personOUs) {
      verifyDomainExists(ou, createIfNotExists);
    }
View Full Code Here

          + "(groupname, pseudogroup) values (?, false)",
          Statement.RETURN_GENERATED_KEYS);
      pstmt.setString(1, groupName.toLowerCase());
      int rows = pstmt.executeUpdate();
      if (rows == 0) {
        throw new RepositoryException(
            "Failed to create group record for " + groupName);
      }
      generatedKeys = pstmt.getGeneratedKeys();
      if (generatedKeys.next()) {
        LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
            Util.buildString("New ", groupName, " group is added to cache"));
        return generatedKeys.getLong(1);
      } else {
        throw new RepositoryException(
            "Failed to retrieve key for " + groupName);
      }
    } catch (Exception e) {
      LOGGER.logp(Level.WARNING, CLASS_NAME, METHOD,
          "Failed group lookup/creation: " + groupName, e);
View Full Code Here

        }
      }
    } catch (SQLException e) {
      LOGGER.logp(Level.WARNING, CLASS_NAME, METHOD,
          "Failure getting parent groups for " + groupId, e);
      throw new RepositoryException(e);
    } finally {
      Util.close(pstmt);
      LOGGER.exiting(CLASS_NAME, METHOD);
    }
  }
View Full Code Here

      } else if (pvi != null) {
        userLookupSql = "select * from " + userTableName
            + " where gsaname = ?";
        key = pvi;
      } else {
        throw new RepositoryException("Attempted user lookup without a key");
      }
      if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.logp(Level.FINEST, CLASS_NAME, METHOD,
            "Looking up user with SQL: [" + userLookupSql + "] and key: "
            + key);
      }
      PreparedStatement pstmt = conn.prepareStatement(userLookupSql,
          ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
      ResultSet rs = null;
      ResultSet generatedKeys = null;
      try {
        pstmt.setString(1, key.toLowerCase());
        rs = pstmt.executeQuery();
        if (rs.next()) {
          // See if we need to update the pvi
          if (pvi != null && !pvi.equals(rs.getString("gsaname"))) {
            rs.updateString("gsaname", pvi.toLowerCase());
            rs.updateRow();
          }
          LOGGER.logp(Level.FINEST, CLASS_NAME, METHOD,
              Util.buildString("Found user ", key, " from cache"));
          return rs.getLong("userid");
        }
        if (!createIfNotExists) {
          return -1L;
        }
        Util.close(pstmt);
        rs = null;
        pstmt = conn.prepareStatement(
            "insert into " + userTableName
            + "(notesname, gsaname) values (?, ?)",
            Statement.RETURN_GENERATED_KEYS);
        pstmt.setString(1, notesName.toLowerCase());
        pstmt.setString(2, pvi.toLowerCase());
        int rows = pstmt.executeUpdate();
        if (rows == 0) {
          throw new RepositoryException(
              "Failed to create user record for " + notesName);
        }
        generatedKeys = pstmt.getGeneratedKeys();
        if (generatedKeys.next()) {
          LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
              Util.buildString("New user ", notesName.toLowerCase(),
                  " [", pvi.toLowerCase(), "] is added to cache"));
          return generatedKeys.getLong(1);
        } else {
          throw new RepositoryException(
              "Failed to retrieve key for " + notesName);
        }
      } finally {
        Util.close(generatedKeys);
        Util.close(rs);
View Full Code Here

          long roleId = verifyRoleExists(roleName, databaseReplicaId, true);
          if (roleId != -1L) {
            pstmt.setLong(2, roleId);
            pstmt.executeUpdate();
          } else {
            throw new RepositoryException("Failed to update user role: "
                + databaseReplicaId + "/" + roleName + " for user "
                + notesName);
          }
        }
      } finally {
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.RepositoryException

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.