public static ResourceType fromStorageProviderType(StorageProviderType type) { return new ResourceType(type.toString()); }
for(StorageProviderType type : StorageProviderType.values()) { Credential cred = null; try { type)); } catch (Exception e) { if(type.equals(StorageProviderType.TEST_RETRY) || type.equals(StorageProviderType.TEST_VERIFY_CREATE) || type.equals(StorageProviderType.TEST_VERIFY_DELETE)) { cred = new Credential("", ""); } else { if(type.equals(StorageProviderType.AMAZON_S3)) { xml.append(" isPrimary='1'"); xml.append("<id>"+acctId+"</id>"); xml.append("<storageProviderType>"); xml.append(type.name()); xml.append("</storageProviderType>"); xml.append("<storageProviderCredential>");
/** * This method returns a ResourceType from the arg type id. * Allowable types are the names from the two enums: * - StorageProviderType * - DuraCloudUserType * * @param type id for ResourceType * @return ResourceType corresponding to the arg type id. * @throws UnknownResourceTypeException if arg type id not recognized. */ public static ResourceType fromString(String type) { // check if arg is a StorageProviderType for (StorageProviderType pType : StorageProviderType.values()) { if (pType.toString().equalsIgnoreCase(type) || pType.name().equalsIgnoreCase(type)) { return new ResourceType(type); } } // check if arg is a DuraCloudUserType for (DuraCloudUserType uType : DuraCloudUserType.values()) { if (uType.toString().equalsIgnoreCase(type) || uType.name().equalsIgnoreCase(type)) { return new ResourceType(type); } } throw new UnknownResourceTypeException(type); }
/** * {@inheritDoc} */ @Override public String getStorageProviderType() { return type.name(); }
/** * Creates a StorageProvider * * @param credentials * @return */ public StorageProvider create(StorageProviderCredentials credentials) { StorageProviderType storageProviderType = credentials.getProviderType(); if (storageProviderType.equals(StorageProviderType.AMAZON_S3)) { return new S3StorageProvider(credentials.getAccessKey(), credentials.getSecretKey(), credentials.getOptions()); } else if (storageProviderType.equals(StorageProviderType.AMAZON_GLACIER)) { return new GlacierStorageProvider(credentials.getAccessKey(), credentials.getSecretKey(), credentials.getOptions()); } else if (storageProviderType.equals(StorageProviderType.DPN)) { return new DpnStorageProvider(credentials.getAccessKey(), credentials.getSecretKey()); } else if (storageProviderType.equals(StorageProviderType.CHRONOPOLIS)) { return new ChronopolisStorageProvider(credentials.getAccessKey(), credentials.getSecretKey()); } throw new RuntimeException(storageProviderType + " is not a supported storage provider type"); }
/** * This method returns the union of StorageProviderTypes and * DuraCloudUserTypes. * * @return list of types union */ public static List<ResourceType> values() { List<ResourceType> types = new ArrayList<ResourceType>(); for (StorageProviderType type : StorageProviderType.values()) { types.add(new ResourceType(type.toString())); } for (DuraCloudUserType type : DuraCloudUserType.values()) { types.add(new ResourceType(type.toString())); } return types; }
/** * Creates a StorageProvider which captures events and passes them to the * audit queue. * * @param credentials needed to connect to storage provider * @param accountSubdomain subdomain of the storage provider account * @param auditQueue used to capture changes to stored content * @return */ public StorageProvider createWithAudit(StorageProviderCredentials credentials, String accountSubdomain, TaskQueue auditQueue) { UserUtil userUtil = new SimpleUserUtil(); StorageProvider storageprovider = create(credentials); StorageProvider auditProvider = new AuditStorageProvider(storageprovider, accountSubdomain, credentials.getProviderId(), credentials.getProviderType().getName(), userUtil, auditQueue); return auditProvider; }
acct.setType(StorageProviderType.fromString(value));
public String getName() { return name(); } }
protected void queueContentDeleteAuditTasks(final String spaceId, final String userId) { final String storeType = unwrappedSnapshotProvider.getStorageProviderType().name();