private S3StorageProvider getS3StorageProvider() { if (!storageAccountManager.isInitialized()) { throw new DuraCloudRuntimeException("storageAccountManager is not initialized!!!"); } final StorageAccount account = storageAccountManager.getPrimaryStorageAccount(); return new S3StorageProvider(account.getUsername(), account.getPassword(), account.getOptions()); } }
/** * {@inheritDoc} */ public Map<String, ContentStore> getContentStores(int maxRetries) throws ContentStoreException { log.debug("getContentStores()"); StorageAccountManager acctManager = getStorageAccounts(); Map<String, StorageAccount> accounts = acctManager.getStorageAccounts(); Map<String, ContentStore> contentStores = new HashMap<String, ContentStore>(); Iterator<String> acctIDs = accounts.keySet().iterator(); while (acctIDs.hasNext()) { String acctID = acctIDs.next(); StorageAccount acct = accounts.get(acctID); contentStores.put(acctID, newContentStoreImpl(acct, maxRetries)); } return contentStores; }
/** * {@inheritDoc} */ public ContentStore getPrimaryContentStore(int maxRetries) throws ContentStoreException { StorageAccountManager acctManager = getStorageAccounts(); StorageAccount acct = acctManager.getPrimaryStorageAccount(); return newContentStoreImpl(acct, maxRetries); }
binding.createStorageAccountsFromXml(xmlStream); StorageAccountManager storageAccountManager = new StorageAccountManager(); storageAccountManager.initialize(accts); return storageAccountManager; } else {
/** * {@inheritDoc} */ public ContentStore getContentStore(String storeID, int maxRetries) throws ContentStoreException { StorageAccountManager acctManager = getStorageAccounts(); StorageAccount acct = acctManager.getStorageAccount(storeID); if (acct == null) { throw new ContentStoreException("Content store with id = '" + storeID + "' not found."); } return newContentStoreImpl(acct, maxRetries); }