public void deleteArchive(AWSCredentials awsCredentials, String region, String vault, String archiveId) { try { runtimeCredentialsProvider.setAwsCredentials(awsCredentials); amazonGlacier.setRegion(Region.getRegion(Regions.fromName(region))); amazonGlacier.deleteArchive(new DeleteArchiveRequest(vault, archiveId)); } catch (AmazonClientException e) { throw new OmakaseRuntimeException(e); } }
public void deleteArchive(String archiveId){ _log.warn("deleteArchive() - Removing {}", archiveId); AmazonGlacierClient client = new AmazonGlacierClient(getCredentials()); DeleteArchiveRequest dar = new DeleteArchiveRequest(getVaultName(),archiveId); client.deleteArchive(dar); }
/** * Delete an archive from AWS. * Also mark any metadata object as deleted; metadata marked as such will be * deleted after 24 hours. Because AWS inventory list is not realtime, this * application does not delete metadata object immediately because otherwise * it is reinserted when the archive lists are synchronized soon after * deletion. To delete it manually in your custom application, see metadata * API or SDK. * * @return true on successful deletion */ public boolean delete(){ DeleteArchiveRequest request = new DeleteArchiveRequest() .withVaultName(vaultName) .withArchiveId(archiveId); final MArchive ma = new MArchive(new Vault(vaultName), archiveId); if (!isInAWSInventory()) { /* This code path should not be reached because delete button should * be greyed out for this case */ deleteError = "Cannot delete because it is not in AWS"; return false; } try{ GlacierFrame.getClient().deleteArchive(request); } catch (Exception e) { LGR.log(Level.SEVERE, null, e); deleteError = "AWS Error in deleting"; return false; } if (!GlacierFrame.haveMetadataProvider()) { return true; } try { return ma.markDeleted(); } catch (SDKException | APIException | SignInException ex){ LGR.log(Level.SEVERE, null, ex); } deleteError = "Error in deleting from Metadata Provider"; return false; }
@Override public void delete(DeleteArchiveRequest request) { delete(request, null); }
@Override public void delete(DeleteArchiveRequest request, ResultCapture<Void> extractor) { resource.performAction("Delete", request, extractor); }
@Override public void delete(ResultCapture<Void> extractor) { DeleteArchiveRequest request = new DeleteArchiveRequest(); delete(request, extractor); }
/** * Performs the <code>Delete</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>AccountId</code></b> * - mapped from the <code>AccountId</code> identifier. * </li> * <li> * <b><code>VaultName</code></b> * - mapped from the <code>VaultName</code> identifier. * </li> * <li> * <b><code>ArchiveId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @see DeleteArchiveRequest */ void delete(DeleteArchiveRequest request);
/** * Performs the <code>Delete</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>AccountId</code></b> * - mapped from the <code>AccountId</code> identifier. * </li> * <li> * <b><code>VaultName</code></b> * - mapped from the <code>VaultName</code> identifier. * </li> * <li> * <b><code>ArchiveId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @see DeleteArchiveRequest */ void delete(DeleteArchiveRequest request, ResultCapture<Void> extractor);