Examples of LLValue


Examples of com.opentext.api.LLValue

  private void connect()
    throws ManifoldCFException
  {
    try
    {
      LLValue configuration;

      if (useHttp)
      {
        boolean useNTLM;
        String userNameAndDomain;

        if (httpNtlmDomain != null && httpNtlmUser != null)
        {
          useNTLM = true;
          userNameAndDomain = httpNtlmDomain + "\\" + httpNtlmUser;
        }
        else
        {
          useNTLM = false;
          userNameAndDomain = httpNtlmUser;
        }
        configuration = new LLValue();
        configuration.setAssoc();
        configuration.add("Encoding","UTF-8");
        configuration.add("LivelinkCGI", httpCgiPath);
        if (userNameAndDomain != null)
        {
          configuration.add("HTTPUserName", userNameAndDomain);
          configuration.add("HTTPPassword", httpNtlmPassword);
        }
        if (useNTLM)
          configuration.add("EnableNTLM", LLValue.LL_TRUE);
        else
          configuration.add("EnableNTLM", LLValue.LL_FALSE);

        if (useSSL)
        {
          configuration.add("HTTPS", LLValue.LL_TRUE);
          // Create the place to put the certs
          createCertFolder();
          if (keystore != null)
          {
            // Now, write the certs themselves
            String[] aliases = keystore.getContents();
            for (String alias : aliases)
            {
              java.security.cert.Certificate cert = keystore.getCertificate(alias);
              byte[] certData = cert.getEncoded();
              File fileName = new File(certFolder,ManifoldCF.safeFileName(alias) + ".cer");
              OutputStream fos = new FileOutputStream(fileName);
              try
              {
                Writer osw = new OutputStreamWriter(fos,"utf-8");
                try
                {
                  String certBase64 = new Base64().encodeByteArray(certData);
                  osw.write("-----BEGIN CERTIFICATE-----\n");
                  int index = 0;
                  while (true)
                  {
                    if (certBase64.length() - index > 64)
                    {
                      osw.write(certBase64.substring(index,index+64) + "\n");
                      index += 64;
                    }
                    else
                    {
                      osw.write(certBase64.substring(index) + "\n");
                      break;
                    }
                  }
                  osw.write("-----END CERTIFICATE-----\n");
                }
                finally
                {
                  osw.flush();
                }
              }
              finally
              {
                fos.flush();
                fos.close();
              }
            }
          }
          LLValue rootCACertList = new LLValue();
          LLSession.GetCARootCerts(certFolder.toString(),rootCACertList);
          configuration.add("CARootCerts", rootCACertList);
        }
      }
      else
View Full Code Here

Examples of com.opentext.api.LLValue

  private void connect()
    throws ManifoldCFException
  {
    try
    {
      LLValue configuration;

      if (useHttp)
      {
        boolean useNTLM;
        String userNameAndDomain;

        if (httpNtlmDomain != null && httpNtlmUser != null)
        {
          useNTLM = true;
          userNameAndDomain = httpNtlmDomain + "\\" + httpNtlmUser;
        }
        else
        {
          useNTLM = false;
          userNameAndDomain = httpNtlmUser;
        }
        configuration = new LLValue();
        configuration.setAssoc();
        configuration.add("Encoding","UTF-8");
        configuration.add("LivelinkCGI", httpCgiPath);
        if (userNameAndDomain != null)
        {
          configuration.add("HTTPUserName", userNameAndDomain);
          configuration.add("HTTPPassword", httpNtlmPassword);
        }
        if (useNTLM)
          configuration.add("EnableNTLM", LLValue.LL_TRUE);
        else
          configuration.add("EnableNTLM", LLValue.LL_FALSE);

        if (useSSL)
        {
          configuration.add("HTTPS", LLValue.LL_TRUE);
          // Create the place to put the certs
          createCertFolder();
          if (keystore != null)
          {
            // Now, write the certs themselves
            String[] aliases = keystore.getContents();
            for (String alias : aliases)
            {
              java.security.cert.Certificate cert = keystore.getCertificate(alias);
              byte[] certData = cert.getEncoded();
              File fileName = new File(certFolder,ManifoldCF.safeFileName(alias) + ".cer");
              OutputStream fos = new FileOutputStream(fileName);
              try
              {
                Writer osw = new OutputStreamWriter(fos,StandardCharsets.UTF_8);
                try
                {
                  String certBase64 = new Base64().encodeByteArray(certData);
                  osw.write("-----BEGIN CERTIFICATE-----\n");
                  int index = 0;
                  while (true)
                  {
                    if (certBase64.length() - index > 64)
                    {
                      osw.write(certBase64.substring(index,index+64) + "\n");
                      index += 64;
                    }
                    else
                    {
                      osw.write(certBase64.substring(index) + "\n");
                      break;
                    }
                  }
                  osw.write("-----END CERTIFICATE-----\n");
                }
                finally
                {
                  osw.flush();
                }
              }
              finally
              {
                fos.flush();
                fos.close();
              }
            }
          }
          LLValue rootCACertList = new LLValue();
          LLSession.GetCARootCerts(certFolder.toString(),rootCACertList);
          configuration.add("CARootCerts", rootCACertList);
        }
      }
      else
View Full Code Here

Examples of com.opentext.api.LLValue

   * multiple threads, but this is also a very fast, rarely executed
   * operation, so there's no need to cut corners.
   */
  private synchronized void setConfig(String name, String value) {
    if (config == null)
      config = (new LLValue()).setAssocNotSet();
    config.add(name, value);
  }
View Full Code Here

Examples of com.opentext.api.LLValue

   * @param name the feature name
   * @param value the feature value
   */
  private synchronized void setConfig(String name, int value) {
    if (config == null)
      config = (new LLValue()).setAssocNotSet();
    config.add(name, value);
  }
View Full Code Here

Examples of com.opentext.api.LLValue

   * @param name the feature name
   * @param value the feature value
   */
  private synchronized void setConfig(String name, LLValue value) {
    if (config == null)
      config = (new LLValue()).setAssocNotSet();
    config.add(name, value);
  }
View Full Code Here

Examples of com.opentext.api.LLValue

   * XXX: We are intentionally shadowing the username and password fields
   * in this method to prevent their accidental use.
   */
  public Client createClient(String username, String password) {
    // Copy the config.
    LLValue localConfig = null;
    if (config != null) {
      localConfig = new LLValue().setAssocNotSet();
      LLNameEnumeration names = config.enumerateNames();
      while (names.hasMoreElements()) {
        String name = names.nextElement().toString();
        if ("HTTPUserName".equals(name) || "HTTPPassword".equals(name)) {
          continue;
        }
        localConfig.add(name, config.toValue(name));
      }
    }

    // Add the web credentials if needed.
    if (localConfig != null && useUsernamePasswordWithWebServer) {
      localConfig.add("HTTPUserName", username);
      localConfig.add("HTTPPassword", password);
    }

    logProperties(username, password, localConfig);
    LLSession session = new LLSession(server, port, connection,
        username, password, localConfig);
View Full Code Here

Examples of com.opentext.api.LLValue

     * Factory method creates a ClientValue with an underlying Assoc.
     */
    @Override
    public ClientValue createAssoc() throws RepositoryException {
        try {
            return new LapiClientValue(new LLValue().setAssoc());
        } catch (LLIllegalOperationException e) {
            throw new IllegalArgumentException(e);
        } catch (RuntimeException e) {
            throw new LivelinkException(e, LOGGER);
        }
View Full Code Here

Examples of com.opentext.api.LLValue

     * Factory method creates a ClientValue with an underlying List.
     */
    @Override
    public ClientValue createList() throws RepositoryException {
        try {
            return new LapiClientValue(new LLValue().setList());
        } catch (LLIllegalOperationException e) {
            throw new IllegalArgumentException(e);
        } catch (RuntimeException e) {
            throw new LivelinkException(e, LOGGER);
        }
View Full Code Here

Examples of com.opentext.api.LLValue

  }

  /** {@inheritDoc} */
  @Override
  public synchronized ClientValue GetServerInfo() throws RepositoryException {
    LLValue value = new LLValue();
    try {
      if (documents.GetServerInfo(value) != 0)
        throw new LapiException(session, LOGGER);
    } catch (RuntimeException e) {
      throw getLivelinkException(e);
View Full Code Here

Examples of com.opentext.api.LLValue

  }

  /** {@inheritDoc} */
  @Override
  public synchronized int GetCurrentUserID() throws RepositoryException {
    LLValue id = new LLValue();
    try {
      if (users.GetCurrentUserID(id) != 0)
        throw new LapiException(session, LOGGER);
    } catch (RuntimeException e) {
      throw getLivelinkException(e);
    }
    return id.toInteger();
  }
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.