Package com.google.enterprise.connector.dctm.dfcwrap

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


   * Sets current session as well. Per DFC javadoc, if session does
   * not exist, a new one is created.
   */
  @Override
  public ISession getSession(String docbase) throws RepositoryException {
    ISession session;
    if (!sessMgerSessions.containsKey(docbase))
      session = newSession(docbase);
    else {
      session = sessMgerSessions.get(docbase);
      allSessions.put(session, new Throwable("Session allocated from pool"));
View Full Code Here


  }

  @Override
  public ISession getSession() {
    MockDmSessionManager mockDm = new MockDmSessionManager();
    ISession session = null;
    try {
      session = mockDm.getSession(mockDm.getDocbaseName());
    } catch (RepositoryException e) {
      e.printStackTrace();
    }
View Full Code Here

        DmInitialize.DM_DOCBASE, "", DmInitialize.included_meta,
        sessionManager);
  }

  public void testGetPropertyNames() throws RepositoryException {
    ISession session = sessionManager.getSession(DmInitialize.DM_DOCBASE);
    IId id = dctmClientX.getId(DmInitialize.DM_ID1);

    ISysObject object = (ISysObject) session.getObject(id);

    ITime lastModifDate = object.getTime("r_modify_date");

    DctmSysobjectDocument dctmSpm = new DctmSysobjectDocument(
        traversalManager, session, DmInitialize.DM_ID1, null, lastModifDate,
View Full Code Here

    assertEquals(8, dctmSpm.getPropertyNames().size());
  }

  public void testFindProperty() throws RepositoryException {
    ISession session = sessionManager.getSession(DmInitialize.DM_DOCBASE);
    IId id = dctmClientX.getId(DmInitialize.DM_ID2);
    ISysObject object = (ISysObject) session.getObject(id);
    ITime lastModifDate = object.getTime("r_modify_date");

    DctmSysobjectDocument dctmSpm = new DctmSysobjectDocument(
        traversalManager, session, DmInitialize.DM_ID2, null, lastModifDate,
        SpiConstants.ActionType.ADD, null);
View Full Code Here

    dctmLoginInfo.setPassword(connector.getPassword());
    String docbase = connector.getDocbase();
    sessionManager.setIdentity(connector.getDocbase(), dctmLoginInfo);
    logger.fine("Session Manager set the identity for " + connector.getLogin());

    ISession session = sessionManager.newSession(docbase);
    logger.info("DFC " + this.clientX.getDFCVersion()
        + " connected to Content Server " + session.getServerVersion());
    sessionManager.release(session);
    logger.info("Tested a new session for the docbase " + docbase);
  }
View Full Code Here

    sessionManager.setIdentity(docbase, loginInfo);
  }

  public void testNewSession() throws RepositoryLoginException,
      RepositoryException {
    ISession session = null;
    try {
      session = sessionManager.newSession(docbase);
      Assert.assertNotNull(session);
      Assert.assertTrue(session instanceof DmSession);
    } finally {
View Full Code Here

    Assert.assertTrue(query instanceof DmQuery);
    query.setDQL(DmInitialize.DM_QUERY_STRING_ENABLE);
  }

  public void testExecute() throws RepositoryException {
    ISession session = sessionManager.getSession(DmInitialize.DM_DOCBASE);
    try {
      Assert.assertNotNull(query);
      Assert.assertTrue(query instanceof DmQuery);
      query.setDQL(DmInitialize.DM_QUERY_STRING_ENABLE);
      ICollection collec = query.execute(session, IQuery.READ_QUERY);
View Full Code Here

    IQuery query = buildQuery(docids);

    List<AuthorizationResponse> authorized;
    ISessionManager sessionManagerUser = getSessionManagerUser(username);
    ISession sessionUser = sessionManagerUser.getSession(docbase);
    try {
      authorized = getAuthorizedDocids(docids, query, sessionUser);
    } finally {
      sessionManagerUser.release(sessionUser);
      logger.finest("user session released");
View Full Code Here

      sessionManagerUser = sessionManager;
    } else {
      if (logger.isLoggable(Level.FINE))
        logger.fine("Creating new session manager for " + username);
      String ticket;
      ISession session = sessionManager.getSession(docbase);
      try {
        ticket = session.getLoginTicketEx(username, "docbase", 0, false, null);
      } finally {
        sessionManager.release(session);
      }

      sessionManagerUser = clientX.getLocalClient().newSessionManager();
View Full Code Here

    IClient localClient = dctmClientX.getLocalClient();

    ISessionManager sessionManager = localClient.newSessionManager();

    ISession session = null;

    ILoginInfo loginInfo = dctmClientX.getLoginInfo();
    loginInfo.setUser(DmInitialize.DM_LOGIN_OK1);
    loginInfo.setPassword(DmInitialize.DM_PWD_OK1);
    sessionManager.setIdentity(DmInitialize.DM_DOCBASE, loginInfo);
    try {
      session = sessionManager.newSession(DmInitialize.DM_DOCBASE);
      IId id = dctmClientX.getId(DmInitialize.DM_ID1);
      ISysObject object = (ISysObject) session.getObject(id);
      dctmForm = (DmFormat) object.getFormat();
    } finally {
      if (session != null) {
        sessionManager.release(session);
      }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.dctm.dfcwrap.ISession

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.