Package org.apache.manifoldcf.core.interfaces

Examples of org.apache.manifoldcf.core.interfaces.ManifoldCFException


          cl.getCredentialsProvider().setCredentials(new AuthScope(url.getHost(), url.getPort() > 0 ? url.getPort() : 80, AuthScope.ANY_REALM), credentials);
          cl.addRequestInterceptor(new PreemptiveAuth(credentials), 0);
        } catch (MalformedURLException ex) {
          client = null;
          sessionExpirationTime = -1L;
          throw new ManifoldCFException("getClient exception: " + ex.getMessage(), ex);
        }
      }
      HttpConnectionParams.setConnectionTimeout(cl.getParams(), connectionTimeoutMillis);
      HttpConnectionParams.setSoTimeout(cl.getParams(), socketTimeoutMillis);
      sessionExpirationTime = System.currentTimeMillis() + 300000L;
View Full Code Here


        Throwable thr = checkThread.getException();
        return "Check exception: " + thr.getMessage();
      }
      return checkThread.getResult();
    } catch (InterruptedException ex) {
      throw new ManifoldCFException(ex.getMessage(), ex, ManifoldCFException.INTERRUPTED);
    }
  }
View Full Code Here

    StringBuilder url = new StringBuilder(genericEntryPoint);
    try {
      url.append("?").append(ACTION_PARAM_NAME).append("=").append(ACTION_AUTH);
      url.append("&username=").append(URLEncoder.encode(userName, "UTF-8"));
    } catch (UnsupportedEncodingException ex) {
      throw new ManifoldCFException("getAuthorizationResponseUncached error: " + ex.getMessage(), ex);
    }

    try {
      FetchTokensThread t = new FetchTokensThread(client, url.toString());
      t.start();
      t.join();
      if (t.getException() != null) {
        return unreachableResponse;
      }
      Auth auth = t.getAuthResponse();
      if (auth == null) {
        return userNotFoundResponse;
      }
      if (!auth.exists) {
        return userNotFoundResponse;
      }
      if (auth.tokens == null) {
        return new AuthorizationResponse(new String[]{}, AuthorizationResponse.RESPONSE_OK);
      }

      String[] tokens = new String[auth.tokens.size()];
      int k = 0;
      while (k < tokens.length) {
        tokens[k] = (String) auth.tokens.get(k);
        k++;
      }

      return new AuthorizationResponse(tokens, AuthorizationResponse.RESPONSE_OK);
    } catch (InterruptedException ex) {
      throw new ManifoldCFException(ex.getMessage(), ex, ManifoldCFException.INTERRUPTED);
    }
  }
View Full Code Here

        HttpGet method = new HttpGet(url.toString());

        HttpResponse response = client.execute(method);
        try {
          if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
            exception = new ManifoldCFException("FetchTokensThread error - interface returned incorrect return code for: " + url + " - " + response.getStatusLine().toString());
            return;
          }
          JAXBContext context;
          context = JAXBContext.newInstance(Auth.class);
          Unmarshaller m = context.createUnmarshaller();
View Full Code Here

  }

  protected static void handleJSONException(JSONException e)
    throws ManifoldCFException, ServiceInterruption {
    Logging.agents.error("FileSystem: JSONException: "+e.getMessage(),e);
    throw new ManifoldCFException(e.getMessage(),e);
  }
View Full Code Here

  }

  protected static void handleURISyntaxException(URISyntaxException e)
    throws ManifoldCFException, ServiceInterruption {
    Logging.agents.error("FileSystem: URISyntaxException: "+e.getMessage(),e);
    throw new ManifoldCFException(e.getMessage(),e);
  }
View Full Code Here

  }

  protected static void handleSecurityException(SecurityException e)
    throws ManifoldCFException, ServiceInterruption {
    Logging.agents.error("FileSystem: SecurityException: "+e.getMessage(),e);
    throw new ManifoldCFException(e.getMessage(),e);
  }
View Full Code Here

  }

  protected static void handleFileNotFoundException(FileNotFoundException e)
    throws ManifoldCFException, ServiceInterruption {
    Logging.agents.error("FileSystem: Path is illegal: "+e.getMessage(),e);
    throw new ManifoldCFException(e.getMessage(),e);
  }
View Full Code Here

  /** Handle IOException */
  protected static void handleIOException(IOException e)
    throws ManifoldCFException, ServiceInterruption
  {
    if (!(e instanceof java.net.SocketTimeoutException) && (e instanceof InterruptedIOException)) {
      throw new ManifoldCFException("Interrupted: " + e.getMessage(), e, ManifoldCFException.INTERRUPTED);
    }
    long currentTime = System.currentTimeMillis();
    Logging.agents.warn("FileSystem: IO exception: "+e.getMessage(),e);
    throw new ServiceInterruption("IO exception: "+e.getMessage(), e, currentTime + 300000L, currentTime + 3 * 60 * 60000L,-1,false);
  }
View Full Code Here

          set.add(line);
        }
      }
      return set;
    } catch (IOException e) {
      throw new ManifoldCFException(e);
    } finally {
      if (br != null) {
        IOUtils.closeQuietly(br);
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.manifoldcf.core.interfaces.ManifoldCFException

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.