Package org.apache.oodt.cas.filemgr.structs.exceptions

Examples of org.apache.oodt.cas.filemgr.structs.exceptions.DataTransferException


          }
        } catch (Exception e) {
          LOG.log(Level.SEVERE,
              "ingestProduct: DataTransferException when transfering Product: "
                  + p.getProductName() + ": Message: " + e.getMessage());
          throw new DataTransferException(e);
        }
      }

      // that's it!
      return p.getProductId();
View Full Code Here


        if (p.getProductStructure().equals(Product.STRUCTURE_FLAT)) {
            // we just need to get its first reference
            if (p.getProductReferences() == null
                    || (p.getProductReferences() != null && p
                            .getProductReferences().size() != 1)) {
                throw new DataTransferException(
                        "Flat products must have a single reference: cannot move");
            }

            // okay, it's fine to move it
            // first, we need to update the data store ref
            Reference r = (Reference) p.getProductReferences().get(0);
            if (r.getDataStoreReference().equals(
                    new File(newPath).toURI().toString())) {
                throw new DataTransferException("cannot move product: ["
                        + p.getProductName() + "] to same location: ["
                        + r.getDataStoreReference() + "]");
            }

            // create a copy of the current data store path: we'll need it to
            // do the data transfer
            Reference copyRef = new Reference(r);

            // update the copyRef to have the data store ref as the orig ref
            // the the newLoc as the new ref
            copyRef.setOrigReference(r.getDataStoreReference());
            copyRef.setDataStoreReference(new File(newPath).toURI().toString());

            p.getProductReferences().clear();
            p.getProductReferences().add(copyRef);

            // now transfer it
            try {
                this.dataTransfer.transferProduct(p);
            } catch (IOException e) {
                throw new DataTransferException(e.getMessage());
            }

            // now delete the original copy
            try {
                if (!new File(new URI(copyRef.getOrigReference())).delete()) {
                    LOG.log(Level.WARNING, "Deletion of original file: ["
                            + r.getDataStoreReference()
                            + "] on product move returned false");
                }
            } catch (URISyntaxException e) {
                throw new DataTransferException(
                        "URI Syntax exception trying to remove original product ref: Message: "
                                + e.getMessage());
            }

            // now save the updated reference
            try {
                this.catalog.modifyProduct(p);
                return true;
            } catch (CatalogException e) {
                throw new DataTransferException(e.getMessage());
            }
        } else
            throw new UnsupportedOperationException(
                    "Moving of heirarhical products not supported yet");
    }
View Full Code Here

        try {
            success = ((Boolean) client.execute("filemgr.transferringProduct",
                    argList)).booleanValue();
        } catch (XmlRpcException e) {
            throw new DataTransferException(e.getMessage());
        } catch (IOException e) {
            throw new DataTransferException(e.getMessage());
        }

        return success;
    }
View Full Code Here

        try {
            success = ((Boolean) client.execute(
                    "filemgr.removeProductTransferStatus", argList))
                    .booleanValue();
        } catch (XmlRpcException e) {
            throw new DataTransferException(e.getMessage());
        } catch (IOException e) {
            throw new DataTransferException(e.getMessage());
        }

        return success;
    }
View Full Code Here

        try {
            success = ((Boolean) client.execute("filemgr.isTransferComplete",
                    argList)).booleanValue();
        } catch (XmlRpcException e) {
            throw new DataTransferException(e.getMessage());
        } catch (IOException e) {
            throw new DataTransferException(e.getMessage());
        }

        return success;
    }
View Full Code Here

        try {
            success = ((Boolean) client.execute("filemgr.moveProduct", argList))
                    .booleanValue();
        } catch (XmlRpcException e) {
            throw new DataTransferException(e.getMessage());
        } catch (IOException e) {
            throw new DataTransferException(e.getMessage());
        }

        return success;
    }
View Full Code Here

        try {
            statusHash = (Hashtable<String, Object>) client.execute(
                    "filemgr.getCurrentFileTransfer", argList);
        } catch (XmlRpcException e) {
            throw new DataTransferException(e.getMessage());
        } catch (IOException e) {
            throw new DataTransferException(e.getMessage());
        }

        if (statusHash != null) {
            status = XmlRpcStructFactory
                    .getFileTransferStatusFromXmlRpc(statusHash);
View Full Code Here

        try {
            statusVector = (Vector<Hashtable<String, Object>>) client.execute(
                    "filemgr.getCurrentFileTransfers", argList);
        } catch (XmlRpcException e) {
            throw new DataTransferException(e.getMessage());
        } catch (IOException e) {
            throw new DataTransferException(e.getMessage());
        }

        if (statusVector != null) {
            statuses = XmlRpcStructFactory
                    .getFileTransferStatusesFromXmlRpc(statusVector);
View Full Code Here

        try {
            pct = (Double) client.execute("filemgr.getProductPctTransferred",
                    argList);
        } catch (XmlRpcException e) {
            throw new DataTransferException(e.getMessage());
        } catch (IOException e) {
            throw new DataTransferException(e.getMessage());
        }

        if (pct != null) {
            return pct.doubleValue();
        }
View Full Code Here

        try {
            pct = (Double) client.execute("filemgr.getRefPctTransferred",
                    argList);
        } catch (XmlRpcException e) {
            throw new DataTransferException(e.getMessage());
        } catch (IOException e) {
            throw new DataTransferException(e.getMessage());
        }

        if (pct != null) {
            return pct.doubleValue();
        }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.filemgr.structs.exceptions.DataTransferException

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.