Example usage for com.amazonaws.services.glacier AmazonGlacierAsyncClient initiateJob

List of usage examples for com.amazonaws.services.glacier AmazonGlacierAsyncClient initiateJob

Introduction

In this page you can find the example usage for com.amazonaws.services.glacier AmazonGlacierAsyncClient initiateJob.

Prototype

InitiateJobResult initiateJob(InitiateJobRequest initiateJobRequest);

Source Link

Document

This operation initiates a job of the specified type, which can be a select, an archival retrieval, or a vault retrieval.

Usage

From source file:opendap.aws.glacier.Download.java

License:Open Source License

protected boolean startJob(JobParameters jobParameters) throws IOException {

    _log.debug("startJob() - BEGIN ");

    if (_started)
        throw new IOException("Glacier inventory retrieval job has already been started!");

    AmazonGlacierAsyncClient client = new AmazonGlacierAsyncClient(getCredentials());
    client.setEndpoint(getEndpointUrl());

    InitiateJobRequest ijb = new InitiateJobRequest(getVaultName(), jobParameters);
    try {/*www . j  a  va  2s. co  m*/

        _startDate = new Date();

        _initiateJobResult = client.initiateJob(ijb);

        _log.debug("startJob() - Glacier downloadJobOutput job started. jobId: {}",
                _initiateJobResult.getJobId());

        _started = true;

    } catch (Exception e) {
        _log.error("startJob() - Download failed to start! msg: {}", e.getMessage());
    }

    _log.debug("startJob() - END ");

    return _started;

}