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

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


    }
  }

  public static void resetDatabases(NotesConnectorSession ncs) {
    final String METHOD = "resetDatabases";
    NotesSession ns = null;
    LOGGER.entering(CLASS_NAME, METHOD);
    try {
      ns = ncs.createNotesSession();
      NotesDatabase cdb = ns.getDatabase(
          ncs.getServer(), ncs.getDatabase());

      // Reset the last update date for each configured database
      NotesView srcdbView = cdb.getView(NCCONST.VIEWDATABASES);
      srcdbView.refresh();
View Full Code Here


  public boolean resetLastCacheUpdate() {
    final String METHOD = "resetLastCacheUpdate";
    LOGGER.entering(CLASS_NAME, METHOD);

    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,
View Full Code Here

    final String METHOD = "NotesConnectorSession";
    server = Server;
    database = Database;
    password = Password;
    connector = Connector;
    NotesSession ns = null;
    boolean configValidated = false;
    LOGGER.entering(CLASS_NAME, METHOD);
    LOGGER.logp(Level.FINEST, CLASS_NAME, METHOD,
        "NotesConnectorSession being created.");

    try {
      // Create and recycle sessions as we need them to avoid memory leaks
      // Init the thread and try to login to validate credentials are correct
      npn = connectorNpn;
      ns = createNotesSession();

      LOGGER.logp(Level.CONFIG, CLASS_NAME, METHOD,
          "Connector platform is " + ns.getPlatform());
      LOGGER.logp(Level.CONFIG, CLASS_NAME, METHOD,
          "Connector config database on server: " + server);
      LOGGER.logp(Level.CONFIG, CLASS_NAME, METHOD,
          "Connector config database path: " + database);
      LOGGER.logp(Level.CONFIG, CLASS_NAME, METHOD,
          "Connector local data directory: " +
          ns.getEnvironmentString(NCCONST.INIDIRECTORY, true));
      LOGGER.logp(Level.CONFIG, CLASS_NAME, METHOD,
          "Connector kittype: " +
          ns.getEnvironmentString(NCCONST.INIKITTYPE, true));
      LOGGER.logp(Level.CONFIG, CLASS_NAME, METHOD,
          "Connector keyfilename: " +
          ns.getEnvironmentString(NCCONST.INIKEYFILENAME, true));
      LOGGER.logp(Level.CONFIG, CLASS_NAME, METHOD,
          "Connector user: " +
          ns.getCommonUserName());
      LOGGER.logp(Level.CONFIG, CLASS_NAME, METHOD,
          "Connector serverkeyfilename: " +
          ns.getEnvironmentString(NCCONST.INISERVERKEYFILENAME, true));
      LOGGER.logp(Level.CONFIG, CLASS_NAME, METHOD,
          "Connector debug_outfile: " +
          ns.getEnvironmentString(NCCONST.INIDEBUGOUTFILE, true));

      NotesDatabase db = ns.getDatabase(server, database);
      configValidated = loadConfig(ns,db);

      db.recycle();
      notesDocManager = new NotesDocumentManager(this);
    } catch (Exception e) {
View Full Code Here

  }

  public NotesSession createNotesSession() throws RepositoryException {
    final String METHOD = "createNotesSession";
    LOGGER.entering(CLASS_NAME, METHOD);
    NotesSession ns = null;
    try {
      // Create and recycle sessions as we need them to avoid memory leaks
      // Init the thread and try to login to validate credentials are correct
      connector.getSessionFactory().getNotesThread().sinitThread();
      ns = connector.getSessionFactory().createSessionWithFullAccess(password);
View Full Code Here

      }
      LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
          user.getNotesName() + " user is authenticated");

      // Find the user in Notes.
      NotesSession notesSession = connectorSession.createNotesSession();
      NotesDatabase notesDirectory = null;
      NotesView notesUsersView = null;
      NotesDocument notesUserDoc = null;
      boolean hasValidPassword = false;
      try {
        notesDirectory = notesSession.getDatabase(
            connectorSession.getServer(), connectorSession.getDirectory());
        notesUsersView = notesDirectory.getView(NCCONST.DIRVIEW_USERS);
        notesUserDoc =
            notesUsersView.getDocumentByKey(user.getNotesName(), true);
        if (notesUserDoc == null) {
          LOGGER.logp(Level.FINE, CLASS_NAME, METHOD,
              "Username not found in Notes directory");
          return new AuthenticationResponse(false, null);
        }
        if (id.getPassword() != null) {
          String hashedPassword =
              notesUserDoc.getItemValueString("HTTPPassword");
          hasValidPassword =
              notesSession.verifyPassword(id.getPassword(), hashedPassword);
        }
      } finally {
        Util.recycle(notesUserDoc);
        Util.recycle(notesUsersView);
        Util.recycle(notesDirectory);
View Full Code Here

TOP

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

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.