Package com.google.enterprise.connector.notes.client

Examples of com.google.enterprise.connector.notes.client.NotesDocument


    int count = 0;
    for (String unid : groupUnids) {
      if (count++ % NCCONST.GC_INVOCATION_INTERVAL == 0) {
        Util.invokeGC();
      }
      NotesDocument groupDoc = getDocumentByUnid(directoryDatabase, unid);
      if (groupDoc == null) {
        LOGGER.log(Level.FINEST, "Group document [{0}] is not found", unid);
      } else {
        String groupName = null;
        try {
          groupName = groupDoc.getItemValueString(NCCONST.GITM_LISTNAME);
          if (Strings.isNullOrEmpty(groupName)) {
            continue;
          }
          // Only process groups
          if (!isAccessControlGroup(groupDoc)) {
View Full Code Here


        LinkedHashMap<String, Long> subdomains =
            notesDomainNames.getSubDomainNames(member.toLowerCase().substring(1));
        nestedGroups.addAll(subdomains.keySet());
        continue;
      }
      NotesDocument memberDoc = peopleGroupsView.getDocumentByKey(member);
      if (memberDoc == null) {
        continue;
      }
      try {
        if (!isAccessControlGroup(memberDoc)) {
View Full Code Here

    for (String unid : userUnids) {
      if (count++ % NCCONST.GC_INVOCATION_INTERVAL == 0) {
        Util.invokeGC();
      }

      NotesDocument doc = getDocumentByUnid(directoryDatabase, unid);
      if (doc == null) {
        LOGGER.log(Level.FINEST,
            "Document [{0}] is not found in {1} database",
            new Object[] {unid, getDatabaseFilePath(directoryDatabase)});
      } else {
        try {
          Vector fullNames = doc.getItemValue(NCCONST.PITM_FULLNAME);
          if (fullNames.size() == 0) {
            continue;
          }
          // Create domains/OUs as groups in H2 if not existed and
          // update domain cache
View Full Code Here

          NCCONST.DIRVIEW_SERVERACCESS);
      serverAccessView.refresh();

      int count = 0;
      for (String unid : userUnids) {
        NotesDocument personDoc = getDocumentByUnid(directoryDatabase, unid);
        if (personDoc == null) {
          LOGGER.log(Level.FINEST, "Person document [{0}] is not found", unid);
        } else {
          String notesName = null;
          try {
            if (count++ % NCCONST.GC_INVOCATION_INTERVAL == 0) {
              Util.invokeGC();
            }
            if (!personDoc.getItemValueString(NCCONST.ITMFORM).contentEquals(
                    NCCONST.DIRFORM_PERSON)) {
              continue;
            }
            // The first value in this field is the Notes name; other
            // names may be present.
            Vector nameVector = personDoc.getItemValue(NCCONST.PITM_FULLNAME);
            if (nameVector.size() == 0) {
              continue;
            }
            String storedName = nameVector.firstElement().toString();
            notesName = notesSession.createName(storedName)
View Full Code Here

    try {
      nvnAccess = serverAccessView.createViewNavFromCategory(userName);
      for (nveAccessEntry = nvnAccess.getFirst();
           nveAccessEntry != null;
           nveAccessEntry = getNextViewEntry(nvnAccess, nveAccessEntry)) {
        NotesDocument accessdoc = null;
        try {
          accessdoc = nveAccessEntry.getDocument();
          String groupName =
              accessdoc.getItemValueString(NCCONST.GITM_LISTNAME);
          PreparedStatement pstmt = null;
          try {
            pstmt = conn.prepareStatement("select groupId from "
                + groupTableName + " where groupName = ?");
            pstmt.setString(1, groupName.toLowerCase());
View Full Code Here

  void updateRoles() {
    final String METHOD = "updateRoles";
    LOGGER.entering(CLASS_NAME, METHOD);

    NotesView connectorCrawlDatabaseView = null;
    NotesDocument connectorCrawlDatabaseDoc = null;
    try {
      connectorCrawlDatabaseView =
          connectorDatabase.getView(NCCONST.VIEWDATABASES);

      if (connectorCrawlDatabaseView == null) {
        return;
      }

      connectorCrawlDatabaseView.refresh();

      Set<String> replicaIds = new LinkedHashSet<String>();
      for (connectorCrawlDatabaseDoc =
               connectorCrawlDatabaseView.getFirstDocument();
           connectorCrawlDatabaseDoc != null;
           connectorCrawlDatabaseDoc = getNextDocument(
               connectorCrawlDatabaseView, connectorCrawlDatabaseDoc)) {
        NotesDatabase crawlDatabase = null;
        String databaseName = null;
        try {
          databaseName = connectorCrawlDatabaseDoc.getItemValueString(
              NCCONST.DITM_DBNAME);
          String replicaId = connectorCrawlDatabaseDoc.getItemValueString(
              NCCONST.DITM_REPLICAID);
          LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
              "Updating roles for database: " + databaseName);
          replicaIds.add(replicaId);

          // TODO: is there anything that would cause us to skip
          // checking roles for this database? Or remove all
          // role-related records for this database?

          crawlDatabase = notesSession.getDatabase(null, null);
          crawlDatabase.openByReplicaID(
              connectorCrawlDatabaseDoc.getItemValueString(NCCONST.DITM_SERVER),
              replicaId);
          if (!crawlDatabase.isOpen()) {
            LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
                "Database could not be opened: " + databaseName);
            continue;
View Full Code Here

        try {
          String abbrevFormula = String.format("@Name([ABBREVIATE];\"%s\")",
              fullName);
          String key = notesSession.evaluate(abbrevFormula).elementAt(0)
              .toString();
          NotesDocument notesUserDoc = usersView.getDocumentByKey(key);
          if (notesUserDoc == null) {
            // This person or group no longer exists. Remove them
            LOGGER.logp(Level.INFO, CLASS_NAME, METHOD,
                "User no longer exists in source directory"
                + " and will be deleted: " + key);
View Full Code Here

        try {
          if (Util.isCanonical(groupName)) {
            NotesName notesGroupName = notesSession.createName(groupName);
            groupName = notesGroupName.getAbbreviated();
          }
          NotesDocument notesGroupDoc = groupView.getDocumentByKey(groupName);
          if (notesGroupDoc == null) {
            // This group no longer exists.
            LOGGER.logp(Level.INFO, CLASS_NAME, METHOD,
                "Group no longer exists in source directory"
                + " and will be deleted: " + groupName);
View Full Code Here

    boolean isReset = false;
    NotesSession nSession = null;
    NotesDatabase dbConfig = null;
    NotesView vwConfig = null;
    NotesDocument docConfig = null;
    NotesDateTime dtTarget = null;
    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);
      docConfig = vwConfig.getFirstDocument();
      if (docConfig == null) {
        LOGGER.logp(Level.SEVERE, CLASS_NAME, METHOD,
            "System configuration document not found.");
        return false;
      }
      docConfig.replaceItemValue(NCCONST.SITM_LASTCACHEUPDATE, dtTarget);
      docConfig.save(true);
      isReset = true;
    } catch (RepositoryException e) {
      LOGGER.log(Level.SEVERE, CLASS_NAME, e);
    } finally {
      Util.recycle(dtTarget);
View Full Code Here

    final String METHOD = "setLastCacheUpdate";
    LOGGER.entering(CLASS_NAME, METHOD);

    NotesDateTime now = null;
    NotesView systemView = null;
    NotesDocument systemDoc = null;
    try {
      now = notesSession.createDateTime("1/1/1900");
      now.setNow();
      systemView = connectorDatabase.getView(NCCONST.VIEWSYSTEMSETUP);
      systemDoc = systemView.getFirstDocument();
      if (systemDoc == null) {
        LOGGER.logp(Level.SEVERE, CLASS_NAME, METHOD,
            "System configuration document not found.");
        return;
      }
      systemDoc.replaceItemValue(NCCONST.SITM_LASTCACHEUPDATE, now);
      systemDoc.save(true);
      LOGGER.logp(Level.INFO, CLASS_NAME, METHOD,
          "Directory Cache last update time set to " + now.toString());
    } catch (RepositoryException e) {
      LOGGER.log(Level.SEVERE, CLASS_NAME, e);
    } finally {
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.notes.client.NotesDocument

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.