Package com.google.enterprise.connector.spi

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


          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 group "
                + groupName);
          }
        }
      } finally {
View Full Code Here


            Statement.RETURN_GENERATED_KEYS);
        pstmt.setString(1, roleName.toLowerCase());
        pstmt.setString(2, databaseReplicaId);
        int rows = pstmt.executeUpdate();
        if (rows == 0) {
          throw new RepositoryException(
              "Failed to create role record for " + roleName);
        }
        generatedKeys = pstmt.getGeneratedKeys();
        if (generatedKeys.next()) {
          return generatedKeys.getLong(1);
        } else {
          throw new RepositoryException(
              "Failed to retrieve key for " + roleName);
        }
      } finally {
        Util.close(generatedKeys);
        Util.close(pstmt);
View Full Code Here

    try {
      nSession = connectorSession.createNotesSession();
      dbConfig = nSession.getDatabase(
              connectorSession.getServer(), connectorSession.getDatabase());
      if (!dbConfig.isOpen()) {
        throw new RepositoryException(
            "GSA Configuration database is not opened");
      }
      dtTarget = nSession.createDateTime("1/1/1970");
      dtTarget.setAnyTime();
      vwConfig = dbConfig.getView(NCCONST.VIEWSYSTEMSETUP);
View Full Code Here

          + "idx_parentgroupid_groupchildren and idx_childgroupid_groupchildren"
          + " on " + groupChildrenTableName);
    } catch (Exception e) {
      LOGGER.logp(Level.SEVERE, CLASS_NAME, METHOD,
          "Failed to initialize user cache", e);
      throw new RepositoryException("Failed to initialize user cache", e);
    } finally {
      if (conn != null) {
        jdbcDatabase.getConnectionPool().releaseConnection(conn);
      }
    }
View Full Code Here

     } catch (FileNotFoundException fnfe){
       // this is OK, even expected on first run
       LOGGER.info(fnfe.toString());
     } catch (IOException ioe) {
       LOGGER.severe(ioe.toString());
       throw new RepositoryException(ioe);
     }
   }
View Full Code Here

   private void storeProperties() throws RepositoryException {
     try {
       properties.store(new FileOutputStream(propertiesFilename), null);
     } catch (IOException ioe) {
       LOGGER.severe(ioe.toString());
       throw new RepositoryException(ioe);
     }
   }
View Full Code Here

    URL feedUrl = null;
    try {
      feedUrl = new URL(urlString);
    } catch (MalformedURLException murle) {
      LOGGER.severe(murle.toString());
      throw new RepositoryException(murle);
    }
   
    DateTime ifModifiedSince = null;
    if (checkpoint != null) {
      String dateString = checkpoint.substring(0, checkpoint.indexOf("!"));
      try {
        ifModifiedSince = DateTime.parseDateTime(dateString);
      } catch (NumberFormatException nfe) {
        LOGGER.info("Got " + nfe.toString() + " while parsing date part of"
            + "checkpoint.  Continuing as if no date was specified.");
      }
    }
    // If ifModifiedSince is null at this point service.query() will treat it
    // as if no threshold was specified (equivalent to the 2-arg form).
   
    DateTime fetchTime = DateTime.now();
    Query query = new Query(feedUrl);
    query.setMaxResults(MAX_RESULTS);
    if (ifModifiedSince != null) {
      // The use of ifModifiedSince here filters out entries that were
      // modified before the given date.  Logically, we only care about those
      // entries that were modified recently.
      query.setUpdatedMin(ifModifiedSince);
    }
   
    Feed feed = null;
    try {
      feed = (Feed) service.query(query, Feed.class, ifModifiedSince);
    } catch (NotModifiedException nme) {
      // excellent! no work to do
      return new LinkedList();
    } catch (ServiceException se) {
      LOGGER.severe(se.toString());
      throw new RepositoryException(se);
    } catch (IOException ioe) {
      LOGGER.severe(ioe.toString());
      throw new RepositoryException(ioe);
    }
    List entries = feed.getEntries();
    Collections.sort(entries, comparator);
    Entry lastEntry = (Entry) entries.get(entries.size() - 1);
    lastEntryId = lastEntry.getId();
View Full Code Here

          makeProperty(otherContent.getBytes() ));
     
    } else {
      if (LOGGER.isLoggable(Level.SEVERE))
        LOGGER.severe("Unhandled content: " + content);
      throw new RepositoryException();
    }
   
    // Extract additional properties to be sent as meta data.
    // (not defined by SpiConstants)
View Full Code Here

    throws RepositoryException {
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    try {
      MediaSource.Output.writeTo(source, stream);
    } catch (IOException ioe) {
      throw new RepositoryException(ioe);
    }
    List list = new LinkedList();
    list.add(Value.getBinaryValue(stream.toByteArray()));
    return new SimpleProperty(list);
  }
View Full Code Here

    // MockDmSession we create.
    MockRepositoryEventList mrel = null;
    try {
      mrel = new MockRepositoryEventList(db);
    } catch (RuntimeException e) {
      throw new RepositoryException(e);
    }

    MockJcrRepository repo = new MockJcrRepository(new MockRepository(mrel));
    Credentials creds = null;
    if (iLI != null) {
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.