@Override public byte[] retrieveFile(String filePath, int offset, int numBytes) throws DataTransferException { try { return this.proxy.retrieveFile(filePath, offset, numBytes).array(); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); } }
@Override public boolean hasProduct(String productName) throws CatalogException { try { return this.proxy.hasProduct(productName); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } }
@Override public List<ProductType> getProductTypes() throws RepositoryManagerException { List<ProductType> productTypes = new ArrayList<ProductType>(); try { for (AvroProductType apt : this.proxy.getProductTypes()) { productTypes.add(AvroTypeFactory.getProductType(apt)); } } catch (AvroRemoteException e) { throw new RepositoryManagerException(e.getMessage()); } return productTypes; }
@Override public List<Element> getElementsByProductType(ProductType type) throws ValidationLayerException { List<Element> products = new ArrayList<Element>(); try { for (AvroElement ap : this.proxy.getElementsByProductType(AvroTypeFactory.getAvroProductType(type))) { products.add(AvroTypeFactory.getElement(ap)); } } catch (AvroRemoteException e) { throw new ValidationLayerException(e.getMessage()); } return products; }
@Override public List<Reference> getProductReferences(Product product) throws CatalogException { List<Reference> references = new ArrayList<Reference>(); try { for (AvroReference ar : this.proxy.getProductReferences(AvroTypeFactory.getAvroProduct(product))) { references.add(AvroTypeFactory.getReference(ar)); } } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } return references; }
@Override public List<Product> getTopNProducts(int n, ProductType type) throws CatalogException { List<Product> products = new ArrayList<Product>(); try { for (AvroProduct p : this.proxy.getTopNProductsByProductType(n, AvroTypeFactory.getAvroProductType(type))) { products.add(AvroTypeFactory.getProduct(p)); } } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } return products; }
@Override public boolean removeProductTransferStatus(Product product) throws DataTransferException { boolean success; try { success = proxy.removeProductTransferStatus(AvroTypeFactory.getAvroProduct(product)); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); } return success; }
@Override public boolean isTransferComplete(Product product) throws DataTransferException { boolean success; try { success = this.proxy.isTransferComplete(AvroTypeFactory.getAvroProduct(product)); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); } return success; }
@Override public FileTransferStatus getCurrentFileTransfer() throws DataTransferException { try { return AvroTypeFactory.getFileTransferStatus(this.proxy.getCurrentFileTransfer()); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); } }
@Override public Element getElementById(String elementId) throws ValidationLayerException { try { return AvroTypeFactory.getElement(this.proxy.getElementById(elementId)); } catch (AvroRemoteException e) { throw new ValidationLayerException(e.getMessage()); } }
@Override public Product getProductByName(String productName) throws CatalogException { try { return AvroTypeFactory.getProduct(this.proxy.getProductByName(productName)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } }
@Override public boolean modifyProduct(Product product) throws CatalogException { boolean success; try { success = this.proxy.modifyProduct(AvroTypeFactory.getAvroProduct(product)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } return success; }
@Override public double getRefPctTransferred(Reference reference) throws DataTransferException { try { return this.proxy.getRefPctTransferred(AvroTypeFactory.getAvroReference(reference)); } catch (AvroRemoteException e) { throw new DataTransferException(e.getMessage()); } }
@Override public void addProductReferences(Product product) throws CatalogException { try { this.proxy.addProductReferences(AvroTypeFactory.getAvroProduct(product)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } }
@Override public Element getElementByName(String elementName) throws ValidationLayerException { try { return AvroTypeFactory.getElement(this.proxy.getElementByName(elementName)); } catch (AvroRemoteException e) { throw new ValidationLayerException(e.getMessage()); } }
@Override public boolean removeProduct(Product product) throws CatalogException { boolean success; try { success = this.proxy.removeProduct(AvroTypeFactory.getAvroProduct(product)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } return success; }
@Override public List<Product> query(Query query, ProductType type) throws CatalogException { List<Product> products = new ArrayList<Product>(); try { for (AvroProduct ap : this.proxy.query(AvroTypeFactory.getAvroQuery(query), AvroTypeFactory.getAvroProductType(type))) { products.add(AvroTypeFactory.getProduct(ap)); } } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } return products; }
@Override public Product getProductById(String productId) throws CatalogException { try { return AvroTypeFactory.getProduct(this.proxy.getProductById(productId)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } }
@Override public void addMetadata(Product product, Metadata metadata) throws CatalogException { try { this.proxy.addMetadata(AvroTypeFactory.getAvroProduct(product), AvroTypeFactory.getAvroMetadata(metadata)); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } }
@Override public boolean updateMetadata(Product product, Metadata met) throws CatalogException { try { return this.proxy.updateMetadata( AvroTypeFactory.getAvroProduct(product), AvroTypeFactory.getAvroMetadata(met) ); } catch (AvroRemoteException e) { throw new CatalogException(e.getMessage()); } }