Search in sources :

Example 6 with AtmosResult

use of org.apache.camel.component.atmos.dto.AtmosResult in project camel by apache.

the class AtmosScheduledPollGetConsumer method poll.

/**
     * Poll from an atmos remote path and put the result in the message exchange
     * @return number of messages polled
     * @throws Exception
     */
@Override
protected int poll() throws Exception {
    Exchange exchange = endpoint.createExchange();
    AtmosResult result = AtmosAPIFacade.getInstance(configuration.getClient()).get(configuration.getRemotePath());
    result.populateExchange(exchange);
    try {
        // send message to next processor in the route
        getProcessor().process(exchange);
        // number of messages polled
        return 1;
    } finally {
        // log exception if an exception occurred and was not handled
        if (exchange.getException() != null) {
            getExceptionHandler().handleException("Error processing exchange", exchange, exchange.getException());
        }
    }
}
Also used : Exchange(org.apache.camel.Exchange) AtmosResult(org.apache.camel.component.atmos.dto.AtmosResult)

Example 7 with AtmosResult

use of org.apache.camel.component.atmos.dto.AtmosResult in project camel by apache.

the class AtmosDelProducer method process.

@Override
public void process(Exchange exchange) throws Exception {
    AtmosResult result = AtmosAPIFacade.getInstance(configuration.getClient()).del(configuration.getRemotePath());
    result.populateExchange(exchange);
}
Also used : AtmosResult(org.apache.camel.component.atmos.dto.AtmosResult)

Example 8 with AtmosResult

use of org.apache.camel.component.atmos.dto.AtmosResult in project camel by apache.

the class AtmosGetProducer method process.

@Override
public void process(Exchange exchange) throws Exception {
    AtmosResult result = AtmosAPIFacade.getInstance(configuration.getClient()).get(configuration.getRemotePath());
    result.populateExchange(exchange);
}
Also used : AtmosResult(org.apache.camel.component.atmos.dto.AtmosResult)

Example 9 with AtmosResult

use of org.apache.camel.component.atmos.dto.AtmosResult in project camel by apache.

the class AtmosPutProducer method process.

@Override
public void process(Exchange exchange) throws Exception {
    AtmosResult result = AtmosAPIFacade.getInstance(configuration.getClient()).put(configuration.getLocalPath(), configuration.getRemotePath());
    result.populateExchange(exchange);
}
Also used : AtmosResult(org.apache.camel.component.atmos.dto.AtmosResult)

Aggregations

AtmosResult (org.apache.camel.component.atmos.dto.AtmosResult)9 ObjectPath (com.emc.atmos.api.ObjectPath)3 ObjectId (com.emc.atmos.api.ObjectId)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 Exchange (org.apache.camel.Exchange)1 AtmosDelResult (org.apache.camel.component.atmos.dto.AtmosDelResult)1 AtmosFileDownloadResult (org.apache.camel.component.atmos.dto.AtmosFileDownloadResult)1 AtmosFileUploadResult (org.apache.camel.component.atmos.dto.AtmosFileUploadResult)1 AtmosMoveResult (org.apache.camel.component.atmos.dto.AtmosMoveResult)1 AtmosException (org.apache.camel.component.atmos.util.AtmosException)1 AtmosResultCode (org.apache.camel.component.atmos.util.AtmosResultCode)1