Package org.apache.oodt.cas.filemgr.system

Examples of org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient


    private final static String PRODUCT_NAME = "CAS.ProductName";

    public MetadataDumper(String fmUrlStr) throws InstantiationException {
        try {
            this.fmClient = new XmlRpcFileManagerClient(new URL(fmUrlStr));
        } catch (MalformedURLException e) {
            LOG.log(Level.SEVERE, "malformed file manager url: [" + fmUrlStr
                    + "]", e);
            throw new InstantiationException(e.getMessage());
        } catch (ConnectionException e) {
View Full Code Here


         throws CmdLineActionException {
      try {
         Validate.notNull(productId, "Must specify productid");
         Validate.notNull(productTypeName, "Must specify productTypeName");

         XmlRpcFileManagerClient client = getClient();

         Product product = new Product();
         // TODO(bfoster): Not sure why ProductType is needed here.
         ProductType pt = client.getProductTypeByName(productTypeName);
         if (pt == null) {
            throw new Exception("FileManager returned null ProductType");
         }
         product.setProductType(pt);
         product.setProductId(productId);

         printer.println("Product: [id=" + productId + ", transferPct="
               + client.getProductPctTransferred(product) + "]");
      } catch (Exception e) {
         throw new CmdLineActionException("Failed to get percent transferred"
               + " for product id '" + productId + "' and ProductType name '"
               + productTypeName + "' : " + e.getMessage(), e);
      }
View Full Code Here

    }
  }

  private void getFileManager(String fileManagerUrl) {
    try {
      this.fm = new XmlRpcFileManagerClient(new URL(fileManagerUrl));
    } catch (MalformedURLException e) {
      LOG.log(Level.SEVERE,
          "Unable to initialize file manager url in RSS Servlet: [url="
              + fileManagerUrl + "], Message: " + e.getMessage());
    } catch (ConnectionException e) {
View Full Code Here

   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      try {
         Validate.notNull(productTypeName, "Must specify productTypeName");

         XmlRpcFileManagerClient client = getClient();
         ProductType type = client.getProductTypeByName(productTypeName);
         if (type == null) {
            throw new Exception("FileManager returned null ProductType");
         }
         ProductPage firstPage = client.getFirstPage(type);
         if (firstPage == null) {
            throw new Exception("FileManager returned null product page");
         }
         printer.println("Page: [num=" + firstPage.getPageNum()
               + ", totalPages=" + firstPage.getTotalPages() + ", pageSize="
View Full Code Here

    * org.apache.oodt.cas.filemgr.datatransfer.DataTransfer#setFileManagerUrl
    * (java.net.URL)
    */
   public void setFileManagerUrl(URL url) {
      try {
         client = new XmlRpcFileManagerClient(url);
         LOG.log(Level.INFO, "Local Data Transfer to: ["
               + client.getFileManagerUrl().toString() + "] enabled");
      } catch (ConnectionException e) {
         e.printStackTrace();
      }
View Full Code Here

        url = new URL("http://localhost:9000");
      }

      // Attempt to connect the client to the file manager and if successful
      // store the client as a context attribute for other objects to access.
      XmlRpcFileManagerClient client = new XmlRpcFileManagerClient(url);
      context.setAttribute("client", client);
    }
    catch (MalformedURLException e)
    {
      String message = "Encountered a malformed URL for the file manager.";
View Full Code Here

  public InPlaceDataTransferer() {}

  public void setFileManagerUrl(URL url) {
    try {
      client = new XmlRpcFileManagerClient(url);
      LOG.log(Level.INFO, "In Place Data Transfer to: [" + client.getFileManagerUrl().toString()
          + "] enabled");
    } catch (ConnectionException e) {
      LOG.log(Level.WARNING, "Connection exception for filemgr: [" + url + "]");
    }
View Full Code Here

   *           When an error occurs communicating with the Solr server instance.
   */
  public void indexProductTypes(boolean delete) {
    LOG.info("Indexing product types...");
    try {
      XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL(
          this.fmUrl));
      LOG.info("Retrieving list of product types.");
      List<ProductType> types = fmClient.getProductTypes();
      for (ProductType type : types) {
        if (!config.getIgnoreTypes().contains(type.getName().trim())) {
          Metadata metadata = new Metadata();
          metadata.addMetadata("id", type.getProductTypeId());
          metadata.addMetadata("CAS.ProductTypeId", type.getProductTypeId());
View Full Code Here

   *           When an error occurs communicating with the Solr server instance.
   */
  public void indexAll(boolean delete) {
    LOG.info("Indexing products...");
    try {
      XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL(
          this.fmUrl));
      LOG.info("Retrieving list of product types.");
      List<ProductType> types = fmClient.getProductTypes();
      for (ProductType type : types) {
        if (!config.getIgnoreTypes().contains(type.getName().trim())) {
          LOG.info("Paging through products for product type: "
              + type.getName());
          for (ProductPage page = safeFirstPage(fmClient, type); page != null && !page
              .isLastPage(); page = fmClient.getNextPage(type, page)) {
            for (Product product : page.getPageProducts()) {
              try {
                this.indexProduct(product.getProductId(), fmClient
                    .getMetadata(product), type.getTypeMetadata());
              } catch (Exception e) {
                LOG.severe("Could not index " + product.getProductId() + ": "
                    + e.getMessage());
              }
View Full Code Here

   */
  public void indexProduct(String productId)
      throws SolrServerException {
    LOG.info("Attempting to index product: " + productId);
    try {
      XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL(
          this.fmUrl));
      Product product = fmClient.getProductById(productId);
      Metadata productMetadata = fmClient.getMetadata(product);
      indexProduct(product.getProductId(), productMetadata, product
          .getProductType().getTypeMetadata());
    } catch (MalformedURLException e) {
      LOG.severe("File Manager URL is malformed: " + e.getMessage());
    } catch (ConnectionException e) {
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient

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.