Package com.google.enterprise.connector.otex.client

Examples of com.google.enterprise.connector.otex.client.Client


  public void testNullConstructorArgs_publicContentUsername()
      throws RepositoryException {
    LivelinkConnector connector =
        getConnector("publicContentUsername", "anonymous");
    ClientFactory clientFactory = connector.getClientFactory();
    Client client = clientFactory.createClient();
    Checkpoint checkpoint = new Checkpoint();

    DocumentList list = new LivelinkDocumentList(connector,
        client, null, null, null, null, null, checkpoint, null);
    Document next = list.nextDocument();
View Full Code Here


  @Override
  public synchronized void setConnector(Connector connector)
      throws RepositoryException {
    this.connector = (LivelinkConnector) connector;
    this.clientFactory = this.connector.getClientFactory();
    Client client = clientFactory.createClient();
    this.sqlQueries = new SqlQueries(this.connector.isSqlServer());
    this.undeleteVolumeId = getExcludedVolumeId(402, "UNDELETE", client);
    this.workflowVolumeId = getExcludedVolumeId(161, "WORKFLOW", client);
    this.showHiddenItems = this.connector.getShowHiddenItems().contains("all");
    this.tryLowercaseUsernames = this.connector.isTryLowercaseUsernames();
View Full Code Here

    ListNodes call on the class object or something.
  */
  private <T> void addAuthorizedDocids(Iterator<String> iterator,
      String username, Collection<T> authorized, Creator<T> creator)
      throws RepositoryException {
    Client client = clientFactory.createClient();
    client.ImpersonateUserEx(username, connector.getDomainName());

    String docids;
    while ((docids = getDocids(iterator)) != null) {
      String ancestorNodes;
      String startNodes = connector.getIncludedLocationNodes();
View Full Code Here

   * @return a TraversalManager
   * @throws RepositoryException
   */
  @Override
  public TraversalManager getTraversalManager() throws RepositoryException {
    Client traversalClient = clientFactory.createClient();

    // Get the current username to compare to the configured
    // traversalUsername and publicContentUsername.
    String username = getCurrentUsername(traversalClient);

    // If there is a separately specified traversal user (different
    // than our current user), then impersonate that traversal user
    // when building the list of documents to index.
    String currentUsername;
    Client sysadminClient;
    String traversalUsername = connector.getTraversalUsername();
    if (impersonateUser(traversalClient, username, traversalUsername)) {
      currentUsername = traversalUsername;
      sysadminClient = clientFactory.createClient();
    } else {
View Full Code Here

   * @throws RepositoryException
   */
  @Override
  public synchronized Retriever getRetriever() throws RepositoryException {
    if (retriever == null) {
      Client traversalClient = clientFactory.createClient();
      String username = getCurrentUsername(traversalClient);
      String traversalUsername = connector.getTraversalUsername();
      impersonateUser(traversalClient, username, traversalUsername);
      retriever = new LivelinkRetriever(connector, traversalClient,
          connector.getContentHandler(traversalClient));
View Full Code Here

     *     authentication
     */
    private AuthenticationResponse authenticate(String username,
        String password) throws RepositoryLoginException, RepositoryException {
        try {
            Client client = clientFactory.createClient(username, password);

            // Verify connectivity by calling GetServerInfo, just like
            // LivelinkConnector.login does.
            // TODO: We will want to use GetCookieInfo when we need to
            // return the client data. Until then, GetServerInfo is
            // faster.
            ClientValue serverInfo = client.GetServerInfo();
            if (LOGGER.isLoggable(Level.FINE))
              LOGGER.fine("AUTHENTICATED: " + username + ": " +
                serverInfo.hasValue());
            return new AuthenticationResponse(serverInfo.hasValue(), null);
        } catch (RepositoryException e) {
View Full Code Here

    // Several birds with one stone. Getting the server info
    // verifies connectivity with the server, and we use the
    // results to set the character encoding for future clients
    // and confirm the availability of the overview action.
    Client client = clientFactory.createClient();
    ClientValue serverInfo = client.GetServerInfo();

    // Get the server version, which is a string like "9.5.0".
    String serverVersion = serverInfo.toString("ServerVersion");
    if (LOGGER.isLoggable(Level.INFO))
      LOGGER.info("LIVELINK SERVER VERSION: " + serverVersion);
    String[] versions = serverVersion.split("\\.");
    int majorVersion;
    int minorVersion;
    if (versions.length >= 2) {
      majorVersion = Integer.parseInt(versions[0]);
      minorVersion = Integer.parseInt(versions[1]);
    } else {
      if (LOGGER.isLoggable(Level.WARNING)) {
        LOGGER.warning(
            "Unable to parse Livelink server version; assuming 9.5.");
      }
      majorVersion = 9;
      minorVersion = 5;
    }

    // The connector requires Livelink 9.5 or later.
    if ((majorVersion < 9) || (majorVersion == 9 && minorVersion < 5)) {
      throw new LivelinkException(
          "Livelink 9.5 or later is required.", LOGGER,
          "unsupportedVersion", new String[] { "9.5" });
    }

    // Check for Livelink 9.5 or earlier; change overview action
    // if needed. We only check for the default entry, because if
    // the map has been customized, perhaps the user knows what
    // they are doing. If a user has a Livelink 9.5 with an custom
    // overview action, they can configure that in the
    // displayPatterns and we won't see it. We are leaving the
    // modified entry in the map rather than removing it and
    // relying on the default action because there are lots and
    // lots of documents, and this avoids a map lookup miss in
    // getDisplayUrl for every one of them.
    if (majorVersion == 9 && minorVersion <= 5) {
      Integer docSubType = new Integer(144);
      Object action = displayActions.get(docSubType);
      if ("overview".equals(action))
        displayActions.put(docSubType, "properties");
    }

    // Set the character encodings in the client factories if needed.
    int serverEncoding = serverInfo.toInteger("CharacterEncoding");
    if (serverEncoding == Client.CHARACTER_ENCODING_UTF8) {
      LOGGER.config("ENCODING: UTF-8");
      clientFactory.setEncoding("UTF-8");
      if (authenticationClientFactory != null)
        authenticationClientFactory.setEncoding("UTF-8");
    }

    // Check that our user has System Administration rights, get
    // the database type, and check the DTreeAncestors table (in
    // that order, because we need SA rights for the database type
    // queries, and we need the database type for the
    // DTreeAncestors queries).
    ClientValue userInfo = client.GetUserInfo(username);
    int privs = userInfo.toInteger("UserPrivileges");
    if ((privs & Client.PRIV_PERM_BYPASS) != Client.PRIV_PERM_BYPASS) {
      LOGGER.info("USER PRIVILEGES: " + privs);
      throw new ConfigurationException("User " + username +
          " does not have Livelink System Administration rights.",
View Full Code Here

    conn.setIncludedLocationNodes("6");
    conn.login();
    conn.setUseDTreeAncestors(useDTreeAncestors);
    conn.setSqlWhereCondition(sqlWhereCondition);

    Client client = new MockClient();
    return new LivelinkTraversalManager(conn, client, "Admin", client,
        conn.getContentHandler(client));
  }
View Full Code Here

        "com.google.enterprise.connector.otex.client.mock.MockClientFactory");
    connector.setGoogleFeedHost("localhost");
    connector.setGroupFeedSchedule("0 1 * * *");

    ClientFactory clientFactory = connector.getClientFactory();
    Client client = clientFactory.createClient();
    return new GroupLister(connector, new GroupAdaptor(connector, client));
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.otex.client.Client

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.