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

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


     *            Whether or not the import tool should ensure that the product
     *            from the source does not exist in the dest.
     */
    public ExpImpCatalog(URL sUrl, URL dUrl, boolean unique) {
        try {
            sourceClient = new XmlRpcFileManagerClient(sUrl);
        } catch (ConnectionException e) {
            LOG.log(Level.WARNING, "Unable to connect to source filemgr: ["
                    + sUrl + "]");
            throw new RuntimeException(e);
        }

        try {
            destClient = new XmlRpcFileManagerClient(dUrl);
        } catch (ConnectionException e) {
            LOG.log(Level.WARNING, "Unable to connect to dest filemgr: ["
                    + dUrl + "]");
            throw new RuntimeException(e);
        }
View Full Code Here


    /* whether or not we should commit our deletions */
    private boolean commit = true;

    public DeleteProduct(String fileManagerUrl, boolean commit) {
        try {
            client = new XmlRpcFileManagerClient(new URL(fileManagerUrl));
        } catch (Exception e) {
            LOG.log(Level.SEVERE,
                    "Unable to create file manager client: Message: "
                            + e.getMessage() + ": errors to follow");
        }
View Full Code Here

   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      try {
         XmlRpcFileManagerClient fmClient = getClient();
         dt.setFileManagerUrl(fmClient.getFileManagerUrl());
         Product product = null;
         if (productId != null) {
            product = fmClient.getProductById(productId);
         } else if (productName != null) {
            product = fmClient.getProductByName(productName);
         } else {
              throw new Exception("Must specify either productId or productName");
         }
         if (product != null) {
            product.setProductReferences(fmClient.getProductReferences(product));
            dt.retrieveProduct(product, destination);
         } else {
            throw new Exception("Product was not found");
         }
      } catch (Exception e) {
View Full Code Here

      Validate.notNull(getUrl(), "Must specify url");

      if (client != null) {
         return client;
      } else {
         return new XmlRpcFileManagerClient(new URL(getUrl()), false);
      }
   }
View Full Code Here

   @Override
   public void execute(ActionMessagePrinter printer)
         throws CmdLineActionException {
      Product p = null;
      try {
         XmlRpcFileManagerClient client = getClient();
         p = getProductToDelete();
         List<Reference> refs = client.getProductReferences(p);
         if (refs == null) {
            throw new Exception("FileManager returned null References");
         }
         for (Reference ref : refs) {
            if (!client.removeFile(new File(new URI(ref.getDataStoreReference()))
                  .getAbsolutePath())) {
               throw new Exception("Failed to delete file '"
                     + ref.getDataStoreReference() + "'");
            }
         }
         if (client.removeProduct(p)) {
            printer.println("Successfully deleted product '"
                  + p.getProductName() + "'");
         } else {
            throw new Exception("Delete product returned false");
         }
View Full Code Here

    /* our log stream */
    private static final Logger LOG = Logger.getLogger(QueryTool.class.getName());

    public QueryTool(URL fmUrl) throws InstantiationException {
        try {
            client = new XmlRpcFileManagerClient(fmUrl);
        } catch (ConnectionException e) {
            throw new InstantiationException(e.getMessage());
        }
    }
View Full Code Here

    private static String performSqlQuery(String query, String sortBy, String outputFormat, String delimiter, String filemgrUrl)
            throws MalformedURLException, CatalogException, ConnectionException, QueryFormulationException {
        ComplexQuery complexQuery = SqlParser.parseSqlQuery(query);
        complexQuery.setSortByMetKey(sortBy);
        complexQuery.setToStringResultFormat(outputFormat);
        List<QueryResult> results = new XmlRpcFileManagerClient(new URL(filemgrUrl)).complexQuery(complexQuery);
        StringBuffer returnString = new StringBuffer("");
        for (QueryResult qr : results)
            returnString.append(qr.toString() + delimiter);
        return returnString.substring(0, returnString.length() - delimiter.length());
    }
View Full Code Here

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

         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 first ProductPage");
         }
         ProductPage currentPage = new ProductPage();
         currentPage.setPageNum(currentPageNum);
         currentPage.setPageSize(firstPage.getPageSize());
         currentPage.setTotalPages(firstPage.getTotalPages());
         ProductPage prevPage = client.getPrevPage(type, currentPage);
         if (prevPage == null) {
            throw new Exception("FileManager returned null previous ProductPage");
         }
         printer.println("Page: [num=" + prevPage.getPageNum()
               + ", totalPages=" + prevPage.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);
         this.fileManagerUrl = url;
         LOG.log(Level.INFO, "Remote Data Transfer to: ["
               + client.getFileManagerUrl().toString() + "] enabled");
      } catch (ConnectionException e) {
         LOG.log(Level.WARNING, "Connection exception for filemgr: [" + url
View Full Code Here

        }

        fClient = null;

        try {
            fClient = 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

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.