List of usage examples for com.amazonaws.services.glacier.model DescribeVaultOutput getCreationDate
public String getCreationDate()
The Universal Coordinated Time (UTC) date when the vault was created.
From source file:com.vrane.metaGlacier.gui.VSplash.java
private void get_data() { say("Getting vault list from AWS"); final long beginning = System.currentTimeMillis(); List<DescribeVaultOutput> list = null; HashMap<String, String> lastCounts = new HashMap(); long afterMetadata = 0; boolean success = false; try {/*from w w w . j a va 2 s .c o m*/ list = new AllVaults().list(); } catch (Exception ex) { LGR.log(Level.SEVERE, null, ex); dispose(); JOptionPane.showMessageDialog(null, "Error getting vaults. Check your connection or AWS keys"); return; } LGR.fine("Received vault list from AWS"); final long afterAWS = System.currentTimeMillis(); if (!GlacierFrame.haveMetadataProvider()) { success = true; } else if (list.size() > 0) { say("Syncing with metadata provider"); VaultList vaultList = new VaultList(GlacierFrame.getAWSRegion()); List<VaultRO> mvlList = new ArrayList(); for (final DescribeVaultOutput dvo : list) { final VaultRO vro = new VaultRO(dvo.getVaultName(), dvo.getNumberOfArchives(), dvo.getCreationDate(), dvo.getSizeInBytes()); mvlList.add(vro); } vaultList.setList(mvlList); String error_string = null; try { success = vaultList.sync(); afterMetadata = System.currentTimeMillis(); lastCounts = vaultList.getLastArchiveCounts(); if (!success) { LGR.info("failed to sync"); } } catch (SDKException | APIException ex) { LGR.log(Level.SEVERE, null, ex); } catch (SignInException ex) { LGR.log(Level.SEVERE, null, ex); error_string = "Failed to sign-in to metadata account"; } dispose(); if (!success) { if (error_string == null) { error_string = "Error from metadata provider"; } JOptionPane.showMessageDialog(this, error_string); } } dispose(); if (!success) { return; } new VaultManageDialog(list, afterAWS - beginning, afterMetadata == 0 ? 0 : (afterMetadata - afterAWS), lastCounts); }
From source file:englishcoffeedrinker.corpse.Vault.java
License:Open Source License
/** * Creates a Vault instance from the description returned as part * of a ListVault command. Note that this won't contain a breakdown * of the archives contained with the vault as this information * isn't returned as part of a vault listing; you need to request * a vault inventory if you need to find out the details of each * archive in the vault./* ww w . j ava2 s. com*/ * @param vault */ public Vault(DescribeVaultOutput vault) { this.arn = vault.getVaultARN(); this.name = vault.getVaultName(); this.creationDate = vault.getCreationDate(); this.inventoryDate = vault.getLastInventoryDate(); this.numArchives = vault.getNumberOfArchives(); this.sizeInBytes = vault.getSizeInBytes(); //a simple vault description doesn't contain the list //of archives, you have to request a vault inventory //to get the full list, which is why you should be //maintaining a local index of your glacier vaults archives = new ArrayList<Archive>(); }
From source file:opendap.aws.glacier.NoaaResourceIngester.java
License:Open Source License
public String describeVault(DescribeVaultOutput dvo) { StringBuilder sb = new StringBuilder(); sb.append("================================================================================\n"); sb.append("Found Vault: ").append(dvo.getVaultName()).append("\n"); sb.append(" getCreationDateString(): ").append(dvo.getCreationDate()).append("\n"); sb.append(" getLastInventoryDate(): ").append(dvo.getLastInventoryDate()).append("\n"); sb.append(" getNumberOfArchives(): ").append(dvo.getNumberOfArchives()).append("\n"); sb.append(" getSizeInBytes(): ").append(dvo.getSizeInBytes()).append("\n"); sb.append(" getVaultARN(): ").append(dvo.getVaultARN()).append("\n"); sb.append(" toString(): ").append(dvo.toString()).append("\n"); sb.append(" toString(): ").append(dvo.getVaultName()).append("\n"); return sb.toString(); }