Java Code Examples for org.apache.avro.AvroRemoteException#getMessage()

The following examples show how to use org.apache.avro.AvroRemoteException#getMessage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public Product getProductByName(String productName) throws CatalogException {
    try {
        return AvroTypeFactory.getProduct(this.proxy.getProductByName(productName));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example 2
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public void addProductReferences(Product product) throws CatalogException {
    try {
        this.proxy.addProductReferences(AvroTypeFactory.getAvroProduct(product));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example 3
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public Metadata getMetadata(Product product) throws CatalogException {
    try {
        return AvroTypeFactory.getMetadata(this.proxy.getMetadata(AvroTypeFactory.getAvroProduct(product)));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example 4
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public List<Product> getTopNProducts(int n) throws CatalogException {
    List<Product> products = new ArrayList<Product>();
    try {
        for (AvroProduct p : this.proxy.getTopNProducts(n)) {
            products.add(AvroTypeFactory.getProduct(p));
        }
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
    return products;
}
 
Example 5
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public int getNumProducts(ProductType type) throws CatalogException {
    try {
        return this.proxy.getNumProducts(AvroTypeFactory.getAvroProductType(type));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example 6
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public boolean hasProduct(String productName) throws CatalogException {
    try {
        return this.proxy.hasProduct(productName);
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example 7
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public String addProductType(ProductType type) throws RepositoryManagerException {
    logger.debug("Adding product type: {}", type.toString());
    try {
        return this.proxy.addProductType(AvroTypeFactory.getAvroProductType(type));
    } catch (AvroRemoteException e) {
        throw new RepositoryManagerException(e.getMessage());
    }
}
 
Example 8
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public ProductPage getPrevPage(ProductType type, ProductPage currPage) throws CatalogException {
    logger.debug("Getting previous page for product type: {}, current page: {}", type.toString(), currPage.getPageNum());
    try {
        return AvroTypeFactory.getProductPage(this.proxy.getPrevPage(
                AvroTypeFactory.getAvroProductType(type),
                AvroTypeFactory.getAvroProductPage(currPage)
        ));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example 9
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public boolean removeFile(String filePath) throws DataTransferException {
    try {
        return this.proxy.removeFile(filePath);
    } catch (AvroRemoteException e) {
        throw new DataTransferException(e.getMessage());
    }
}
 
Example 10
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public ProductPage getLastPage(ProductType type) throws CatalogException {
    logger.debug("Getting last page for product type: {}", type.toString());
    try {
        return AvroTypeFactory.getProductPage(this.proxy.getLastPage(AvroTypeFactory.getAvroProductType(type)));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example 11
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public void transferFile(String filePath, byte[] fileData, int offset, int numBytes) throws DataTransferException {
    try {
        this.proxy.transferFile(filePath, ByteBuffer.wrap(fileData), offset, numBytes);
    } catch (AvroRemoteException e) {
        throw new DataTransferException(e.getMessage());
    }
}
 
Example 12
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public double getRefPctTransferred(Reference reference) throws DataTransferException {
    try {
        return this.proxy.getRefPctTransferred(AvroTypeFactory.getAvroReference(reference));
    } catch (AvroRemoteException e) {
        throw new DataTransferException(e.getMessage());
    }
}
 
Example 13
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public double getProductPctTransferred(Product product) throws DataTransferException {
    try {
        return this.proxy.getProductPctTransferred(AvroTypeFactory.getAvroProduct(product));
    } catch (AvroRemoteException e) {
        throw new DataTransferException(e.getMessage());
    }
}
 
Example 14
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@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());
    }

}
 
Example 15
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example 16
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public Product getProductById(String productId) throws CatalogException {
    try {
        return AvroTypeFactory.getProduct(this.proxy.getProductById(productId));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}
 
Example 17
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example 18
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public boolean moveProduct(Product product, String newPath) throws DataTransferException {
    boolean success;
    try {
        success = this.proxy.moveProduct(AvroTypeFactory.getAvroProduct(product), newPath);
    } catch (AvroRemoteException e) {
        throw new DataTransferException(e.getMessage());
    }
    return success;
}
 
Example 19
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@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());
    }
}
 
Example 20
Source File: AvroFileManagerClient.java    From oodt with Apache License 2.0 5 votes vote down vote up
@Override
public String catalogProduct(Product product) throws CatalogException {
    try {
        return this.proxy.catalogProduct(AvroTypeFactory.getAvroProduct(product));
    } catch (AvroRemoteException e) {
        throw new CatalogException(e.getMessage());
    }
}