Examples of ISessionManager


Examples of com.google.enterprise.connector.dctm.dfcwrap.ISessionManager

      // Make sure advanced_configuration has a default value.
      if (!configData.containsKey(ADVANCEDCONF))
        configData.put(ADVANCEDCONF, "off");

      ISession sess = null;
      ISessionManager sessMag = null;
      boolean isCoreConfigValid = false;
      IClientX cl = null;
      try {
        cl = getClientX();
        sessMag = getSessionManager(cl, configData);

        ILoginInfo myinfo = sessMag.getIdentity(configData.get(DOCBASENAME));
        String user = myinfo.getUser();
        logger.config("login user: " + user);

        sess = getSession(configData, sessMag);

        logger.fine("test connection to the repository: " + sess);
        logger.info("DFC " + cl.getDFCVersion()
            + " connected to Content Server " + sess.getServerVersion());
        isCoreConfigValid = true;

        testWebtopUrl(configData.get(DISPLAYURL));

        // Display the form again when the advanced conf checkbox is
        // checked and a JavaScript action submitted the form.
        if (configData.get(ADVANCEDCONF).equals("on")
            && configData.get(ACTIONUPDATE).equals("redisplay")) {
          logger.config("Redisplay the configuation form");
          String form = makeValidatedForm(configData, resource, cl, sess);
          return new ConfigureResponse("", form);
        }

        checkWhereClause(configData, cl, sess, connectorFactory);
      } catch (RepositoryException e) {
        logger.log(Level.SEVERE,
            "RepositoryException thrown in validateConfig: ", e);

        if (!isCoreConfigValid) {
          // If there's a problem with the core configuration, we will
          // turn the advanced configuration off until the user fixes
          // the problem.
          configData.put(ADVANCEDCONF, "off");
          logger.config("ADVANCEDCONF reset to off");
        }

        if (cl == null) {
          // If we can't connect to DFC at all, return just an error message.
          return createErrorResponse(e, resource, ErrorStyle.VALIDATE_CONFIG);
        }

        // Return the config form with an error message.
        return createErrorResponse(configData, e, resource, cl, sess,
            ErrorStyle.VALIDATE_CONFIG);
      } finally {
        if (sess != null) {
          sessMag.release(sess);
          logger.fine("Release sessionConfig");
        }
      }

      // There's no need to persist action_update.
View Full Code Here

Examples of com.google.enterprise.connector.dctm.dfcwrap.ISessionManager

    // We use the session here to validate the username, password, and
    // docbase. We will also need it later in makeValidatedForm if the
    // advanced config is turned on.
    IClientX cl = null;
    ISessionManager sessMag = null;
    ISession sess = null;
    try {
      cl = getClientX();
      sessMag = getSessionManager(cl, configMap);
      sess = getSession(configMap, sessMag);

      for (String key : configKeys) {
        String val = configMap.get(key);
        if (val == null) {
          if (key.equals(ADVANCEDCONF)) {
            val = "off";
          } else if (key.equals(ACTIONUPDATE)) {
            val = "";
          } else if (key.equals(ROOT_OBJECT_TYPE) && val == null) {
            val = rootObjectType;
          } else if (key.equals(INCLUDED_OBJECT_TYPE)) {
            val = includedObjectType;
          } else if (key.equals(INCLUDED_META)) {
            val = includedMeta;
          } else {
            continue;
          }
          logger.config(key + " was null; set to " + val);
          configMap.put(key, val);
        }
      }

      if (logger.isLoggable(Level.CONFIG)) {
        logger.config("Before spring process: " + getMaskedMap(configMap));
      }

      result = new ConfigureResponse("",
          makeValidatedForm(configMap, resource, cl, sess));
    } catch (RepositoryException e) {
      logger.log(Level.WARNING, "Error building the configuration form", e);

      if (cl == null) {
        // If we can't connect to DFC at all, return just an error message.
        return createErrorResponse(e, resource, ErrorStyle.GET_CONFIG_FORM);
      }

      // TODO: Do we want to turn off the advanced config here, like
      // we do in validateConfig? The equivalent to !isCoreConfigValid
      // is sess == null, and if sess == null then advanced config is
      // effectively turned off, so we don't have to do anything here.

      // Return the config form with an error message.
      return createErrorResponse(configMap, e, resource, cl, sess,
          ErrorStyle.GET_CONFIG_FORM);
    } finally {
      if (sess != null) {
        sessMag.release(sess);
        logger.fine("Release sessionConfig");
      }
    }

    return result;
View Full Code Here

Examples of com.google.enterprise.connector.dctm.dfcwrap.ISessionManager

  }

  private ISessionManager getSessionManager(IClientX cl,
      Map<String, String> logMap) throws RepositoryException {
    IClient client = cl.getLocalClient();
    ISessionManager sessMag = client.newSessionManager();
    sessMag.clearIdentity(logMap.get(DOCBASENAME));
    logger.config("after clearIdentity for docbase: "
        + logMap.get(DOCBASENAME));
    ILoginInfo loginInfo = cl.getLoginInfo();
    loginInfo.setUser(logMap.get(LOGIN));
    logger.config("after setIdentity for login: " + logMap.get(LOGIN));
    loginInfo.setPassword(logMap.get(PASSWORD_KEY));
    sessMag.setIdentity(logMap.get(DOCBASENAME), loginInfo);
    logger.config("after setIdentity for docbase: " + logMap.get(DOCBASENAME));
    return sessMag;
  }
View Full Code Here

Examples of com.google.enterprise.connector.dctm.dfcwrap.ISessionManager

    try {
      localClient = dctmClientX.getLocalClient();
    } catch (RepositoryException e) {
      assertTrue(false);
    }
    ISessionManager sessionManager = localClient.newSessionManager();
    ILoginInfo ili = new MockDmLoginInfo();
    ili.setUser("mark");
    ili.setPassword("mark");
    try {
      sessionManager.setIdentity("SwordEventLog.txt", ili);
      sessionManager.getSession("SwordEventLog.txt");
    } catch (RepositoryException e) {
      assertTrue(false);
    }

    String query =
View Full Code Here

Examples of com.google.enterprise.connector.dctm.dfcwrap.ISessionManager

  protected void setUp() throws Exception {
    super.setUp();

    IClientX dctmClientX = new MockDmClientX();
    IClient localClient = dctmClientX.getLocalClient();
    ISessionManager sessionManager = localClient.newSessionManager();
    ILoginInfo ili = new MockDmLoginInfo();
    ili.setUser("mark");
    ili.setPassword("mark");
    sessionManager.setIdentity(DmInitialize.DM_DOCBASE, ili);
    ISession sess7 = sessionManager.getSession(DmInitialize.DM_DOCBASE);

    IId id = dctmClientX.getId(DmInitialize.DM_ID2);
    object = (ISysObject) sess7.getObject(id);
  }
View Full Code Here

Examples of com.google.enterprise.connector.dctm.dfcwrap.ISessionManager

  }

  public void testNewSessionManager() {
    try {
      IClient localClient = dctmClientX.getLocalClient();
      ISessionManager sessionManager = localClient.newSessionManager();
      Assert.assertNotNull(sessionManager);
      Assert.assertTrue(sessionManager instanceof MockDmSessionManager);
    } catch (RepositoryException e) {
      assertEquals(true, false);
    }
View Full Code Here

Examples of com.mountainminds.eclemma.core.ISessionManager

    setDisabledImageDescriptor(EclEmmaUIPlugin.getImageDescriptor(EclEmmaUIPlugin.DLCL_REMOVEALL));
    setEnabled(false);
  }
 
  public void run() {
    ISessionManager manager = CoverageTools.getSessionManager();
    manager.removeAllSessions();
  }
View Full Code Here

Examples of com.mountainminds.eclemma.core.ISessionManager

    setDisabledImageDescriptor(EclEmmaUIPlugin.getImageDescriptor(EclEmmaUIPlugin.DLCL_REMOVE));
    setEnabled(false);
  }
 
  public void run() {
    ISessionManager manager = CoverageTools.getSessionManager();
    ICoverageSession session = manager.getActiveSession();
    if (session != null) {
      manager.removeSession(session);
    }
  }
View Full Code Here

Examples of com.mountainminds.eclemma.core.ISessionManager

    setDisabledImageDescriptor(EclEmmaUIPlugin.getImageDescriptor(EclEmmaUIPlugin.DLCL_RELAUNCH));
    setEnabled(false);
  }
 
  public void run() {
    ISessionManager manager = CoverageTools.getSessionManager();
    ICoverageSession session = manager.getActiveSession();
    if (session != null) {
      ILaunchConfiguration config = session.getLaunchConfiguration();
      if (config != null) {
        DebugUITools.launch(config, CoverageTools.LAUNCH_MODE);
      }
View Full Code Here

Examples of com.mountainminds.eclemma.core.ISessionManager

      menu.dispose();
    }
    menu = new Menu(parent);

    ILabelProvider labelprovider = new WorkbenchLabelProvider();
    final ISessionManager manager = CoverageTools.getSessionManager();
    ICoverageSession[] sessions = manager.getSessions();
    ICoverageSession active = manager.getActiveSession();
    for (int i = 0; i < sessions.length; i++) {
      final ICoverageSession session = sessions[i];
      MenuItem item = new MenuItem(menu, SWT.RADIO);
      Object[] labelparams = new Object[] { new Integer(i + 1),
          labelprovider.getText(session) };
      item.setText(NLS.bind(UIMessages.SessionsView_selectSessionsEntryLabel,
          labelparams));
      item.setImage(labelprovider.getImage(session));
      item.setSelection(session == active);
      item.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
          manager.activateSession(session);
        }
      });
    }
    return menu;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.