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

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


        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


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

        return success;
    }
View Full Code Here

      argList.add(new Integer(numBytes));

      try {
         return (byte[]) client.execute("filemgr.retrieveFile", argList);
      } catch (XmlRpcException e) {
         throw new DataTransferException(e.getMessage());
      } catch (IOException e) {
         throw new DataTransferException(e.getMessage());
      }
   }
View Full Code Here

        argList.add(new Integer(numBytes));

        try {
            client.execute("filemgr.transferFile", argList);
        } catch (XmlRpcException e) {
            throw new DataTransferException(e.getMessage());
        } catch (IOException e) {
            throw new DataTransferException(e.getMessage());
        }
    }
View Full Code Here

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

            }
            return productId;
View Full Code Here

          }
        } 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

         }
      } catch (Exception e) {
         LOG.log(Level.SEVERE, "Failed to read '" + numBytes
               + "' bytes from file '" + filePath + "' at index '" + offset
               + "' : " + e.getMessage(), e);
         throw new DataTransferException("Failed to read '" + numBytes
               + "' bytes from file '" + filePath + "' at index '" + offset
               + "' : " + e.getMessage(), e);
      } finally {
         try { is.close(); } catch (Exception e) {}
      }
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

    */
   public void transferProduct(Product product) throws DataTransferException,
         IOException {

      if (fileManagerUrl == null) {
         throw new DataTransferException(
               "No file manager url specified for remote data transfer: cannot transfer product: ["
                     + product.getProductName() + "]!");
      }

      quietNotifyTransferProduct(product);
View Full Code Here

               if (fileData.length < 1024)
                  break;
               offset += 1024;
            }
         } catch (Exception e) {
            throw new DataTransferException("", e);
         } finally {
            try {
               fOut.close();
            } catch (Exception e) {
            }
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.