Java 类com.amazonaws.services.glacier.model.InitiateJobRequest 实例源码

项目:omakase    文件:GlacierClient.java   
public void restore(AWSCredentials awsCredentials, String region, String vault, String archiveId, String snsTopic, String correlationId) {
    try {
        runtimeCredentialsProvider.setAwsCredentials(awsCredentials);
        amazonGlacier.setRegion(Region.getRegion(Regions.fromName(region)));

        JobParameters jobParameters = new JobParameters();
        jobParameters.setType(ARCHIVE_RETRIEVAL);
        jobParameters.setArchiveId(archiveId);
        jobParameters.setSNSTopic(snsTopic);
        jobParameters.setDescription(correlationId);
        InitiateJobResult result = amazonGlacier.initiateJob(new InitiateJobRequest(vault, jobParameters));

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Created restore job " + result.getJobId() + " for archive " + archiveId + " in region/vault" + region + "/" + vault);
        }
    } catch (AmazonClientException e) {
        throw new OmakaseRuntimeException(e);
    }
}
项目:meta-glacier    文件:Vault.java   
/**
 * Start a job to get the inventory of a vault.
 *
 * @param sns_topic_string region appropriate SNS topic string
 * @return job id string if successful; null on error
 */
public String makeVaultInventoryJob(final String sns_topic_string){
    final JobParameters jp = new JobParameters()
            .withType("inventory-retrieval")
            .withSNSTopic(sns_topic_string);
    final InitiateJobRequest initJobRequest = new InitiateJobRequest()
        .withVaultName(name)
        .withJobParameters(jp);
    InitiateJobResult JobResult = null;

    try{
        JobResult = GlacierFrame
                 .getClient(region).initiateJob(initJobRequest);
    } catch(Exception e){
        LGR.log(Level.SEVERE, null, e);           
        return null;
    }
    return JobResult.getJobId();
}
项目:simple-glacier-client    文件:ArchiveInventory.java   
private String sendInventoryRetrievalJobRequest(String format, String description, int interval) {

    log.info("Description: " + description);
    log.info("Interval: " + interval);

    // craete an inventory retrival request
    JobParameters params = new JobParameters().withType("inventory-retrieval").withFormat(format).withDescription(description);
    InitiateJobRequest request = new InitiateJobRequest(account, vault, params);

    // Initiate job and start polling for its completion
    InitiateJobResult initiateJobResult = this.awsClient.initiateJob(request);

    String jobId = initiateJobResult.getJobId();
    this.log.info("Initiated job 'inventory-retrieval'. jobId=" + jobId);

    // wait for the job to complete
    GlacierJobDescription jobDescription = retreiveJobResultByJobId(jobId);
    while (jobDescription == null || ! jobDescription.isCompleted()) {

        // log
        this.log.info("Job not completed! Will try again in " + interval + " minutes");

        // wait before accessing again (remember: AWS are counting API calls!!)
        try {
            TimeUnit.MINUTES.sleep(interval);
        } catch (InterruptedException ie) {}

        // re-check job status
        jobDescription = retreiveJobResultByJobId(jobId);
    }

    return jobId;
}
项目:aws-sdk-java-resources    文件:VaultImpl.java   
@Override
public Job initiateInventoryRetrieval(InitiateJobRequest request,
        ResultCapture<InitiateJobResult> extractor) {

    ActionResult result =
            resource.performAction("InitiateInventoryRetrieval", request,
            extractor);

    if (result == null) return null;
    return new JobImpl(result.getResource());
}
项目:aws-sdk-java-resources    文件:VaultImpl.java   
@Override
public Job initiateInventoryRetrieval(ResultCapture<InitiateJobResult>
        extractor) {

    InitiateJobRequest request = new InitiateJobRequest();
    return initiateInventoryRetrieval(request, extractor);
}
项目:aws-sdk-java-resources    文件:ArchiveImpl.java   
@Override
public Job initiateArchiveRetreival(InitiateJobRequest request,
        ResultCapture<InitiateJobResult> extractor) {

    ActionResult result = resource.performAction("InitiateArchiveRetreival",
            request, extractor);

    if (result == null) return null;
    return new JobImpl(result.getResource());
}
项目:aws-sdk-java-resources    文件:ArchiveImpl.java   
@Override
public Job initiateArchiveRetreival(ResultCapture<InitiateJobResult>
        extractor) {

    InitiateJobRequest request = new InitiateJobRequest();
    return initiateArchiveRetreival(request, extractor);
}
项目:aws-sdk-java-resources    文件:VaultImpl.java   
@Override
public Job initiateInventoryRetrieval(InitiateJobRequest request) {
    return initiateInventoryRetrieval(request, null);
}
项目:aws-sdk-java-resources    文件:ArchiveImpl.java   
@Override
public Job initiateArchiveRetreival(InitiateJobRequest request) {
    return initiateArchiveRetreival(request, null);
}
项目:aws-sdk-java-resources    文件:Archive.java   
/**
 * Performs the <code>InitiateArchiveRetreival</code> action.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Archive</code> resource, and any conflicting parameter value set in
 * the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>VaultName</code></b>
 *         - mapped from the <code>Name</code> identifier.
 *   </li>
 *   <li>
 *     <b><code>AccountId</code></b>
 *         - mapped from the <code>AccountId</code> identifier.
 *   </li>
 *   <li>
 *     <b><code>JobParameters.ArchiveId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 *   <li>
 *     <b><code>JobParameters.Type</code></b>
 *         - constant value <code>archive-retrieval</code>.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The <code>Job</code> resource object associated with the result
 *         of this action.
 * @see InitiateJobRequest
 */
Job initiateArchiveRetreival(InitiateJobRequest request);
项目:aws-sdk-java-resources    文件:Archive.java   
/**
 * Performs the <code>InitiateArchiveRetreival</code> action and use a
 * ResultCapture to retrieve the low-level client response.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Archive</code> resource, and any conflicting parameter value set in
 * the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>VaultName</code></b>
 *         - mapped from the <code>Name</code> identifier.
 *   </li>
 *   <li>
 *     <b><code>AccountId</code></b>
 *         - mapped from the <code>AccountId</code> identifier.
 *   </li>
 *   <li>
 *     <b><code>JobParameters.ArchiveId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 *   <li>
 *     <b><code>JobParameters.Type</code></b>
 *         - constant value <code>archive-retrieval</code>.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The <code>Job</code> resource object associated with the result
 *         of this action.
 * @see InitiateJobRequest
 */
Job initiateArchiveRetreival(InitiateJobRequest request,
        ResultCapture<InitiateJobResult> extractor);
项目:aws-sdk-java-resources    文件:Vault.java   
/**
 * Performs the <code>InitiateInventoryRetrieval</code> action.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Vault</code> resource, and any conflicting parameter value set in
 * the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>VaultName</code></b>
 *         - mapped from the <code>Name</code> identifier.
 *   </li>
 *   <li>
 *     <b><code>AccountId</code></b>
 *         - mapped from the <code>AccountId</code> identifier.
 *   </li>
 *   <li>
 *     <b><code>JobParameters.Type</code></b>
 *         - constant value <code>inventory-retrieval</code>.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The <code>Job</code> resource object associated with the result
 *         of this action.
 * @see InitiateJobRequest
 */
com.amazonaws.resources.glacier.Job initiateInventoryRetrieval(
        InitiateJobRequest request);
项目:aws-sdk-java-resources    文件:Vault.java   
/**
 * Performs the <code>InitiateInventoryRetrieval</code> action and use a
 * ResultCapture to retrieve the low-level client response.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Vault</code> resource, and any conflicting parameter value set in
 * the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>VaultName</code></b>
 *         - mapped from the <code>Name</code> identifier.
 *   </li>
 *   <li>
 *     <b><code>AccountId</code></b>
 *         - mapped from the <code>AccountId</code> identifier.
 *   </li>
 *   <li>
 *     <b><code>JobParameters.Type</code></b>
 *         - constant value <code>inventory-retrieval</code>.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The <code>Job</code> resource object associated with the result
 *         of this action.
 * @see InitiateJobRequest
 */
com.amazonaws.resources.glacier.Job initiateInventoryRetrieval(
        InitiateJobRequest request, ResultCapture<InitiateJobResult>
        extractor);