/** * {@inheritDoc} */ public ContentStore getContentStore(String storeID) throws ContentStoreException { return getContentStore(storeID, -1); // Use default retries }
/** * {@inheritDoc} */ public Map<String, ContentStore> getContentStores() throws ContentStoreException { return getContentStores(-1); // Use default retries }
/** * {@inheritDoc} */ public ContentStore getPrimaryContentStore() throws ContentStoreException { return getPrimaryContentStore(-1); // Use default retries }
private static DataSource getDataSource(CommandLine cmd) throws ContentStoreException { String host = cmd.getOptionValue("host"); String port = "443"; if (cmd.hasOption("port")) { port = cmd.getOptionValue("port"); } String username = cmd.getOptionValue("username"); String password = cmd.getOptionValue("password"); ContentStoreManager mgr = new ContentStoreManagerImpl(host, port); mgr.login(getCredentials(username, password)); ContentStore contentStore; if (cmd.hasOption("store-id")) { contentStore = mgr.getContentStore(cmd.getOptionValue("store-id")); } else { contentStore = mgr.getPrimaryContentStore(); } return new DuraStoreDataSource(contentStore); }
protected ContentStore newContentStoreImpl(StorageAccount acct, int maxRetries) { return new ContentStoreImpl(baseURL, acct.getType(), acct.getId(), isWritable(acct), getRestHelper(), maxRetries); }
private ContentStore newAnonymousContentStoreImpl() { return new ContentStoreImpl(baseURL, StorageProviderType.UNKNOWN, null, false, getRestHelper()); }
/** * {@inheritDoc} */ public ContentStore getPrimaryContentStoreAsAnonymous() throws ContentStoreException { return getPrimaryContentStoreAsAnonymous(-1); }
String storeId) { ContentStoreManager storeManager = new ContentStoreManagerImpl(host, String.valueOf(port), context); storeManager.login(new Credential(username, password));
protected ContentStore newContentStoreImpl(StorageAccount acct) { return new ContentStoreImpl(baseURL, acct.getType(), acct.getId(), isWritable(acct), getRestHelper()); }
private ContentStore newAnonymousContentStoreImpl(int maxRetries) { return new ContentStoreImpl(baseURL, StorageProviderType.UNKNOWN, null, false, getRestHelper(), maxRetries); }
String host = vals[0]; String port = vals[1]; ContentStoreManager mgr = new ContentStoreManagerImpl(host, port);
String error = "Error retrieving content stores. "; try { response = getRestHelper().get(url); if (response.getStatusCode() == HttpStatus.SC_OK) { String storesXML = response.getResponseBody();
@Override public ContentStore getPrimaryContentStore() throws ContentStoreException { log.debug("enter: getPrimaryContentStore()"); if (null == this.primaryContentStore) { log.debug("populating cache."); this.primaryContentStore = super.getPrimaryContentStore(); } return this.primaryContentStore; }
@Override public Map<String, ContentStore> getContentStores() throws ContentStoreException { log.debug("enter: getContentStores()"); if (null == contentStores) { log.debug("populating cache."); this.contentStores = super.getContentStores(); } return this.contentStores; }
protected ContentStore getContentStore() { ContentStoreManager storeManager = new ContentStoreManagerImpl(syncOptConfig.getHost(), String.valueOf(syncOptConfig.getPort()), syncOptConfig.getContext()); Credential credential = new Credential(syncOptConfig.getUsername(), syncOptConfig.getPassword()); storeManager.login(credential); try { return storeManager.getPrimaryContentStore(); } catch (ContentStoreException e) { throw new RuntimeException("Unable to create ContentStore due to" + e.getMessage()); } }
if (dataset.getLockFor(Reason.pidRegister) == null) { ContentStoreManager storeManager = new ContentStoreManagerImpl(host, port, dpnContext); Credential credential = new Credential(System.getProperty("duracloud.username"), System.getProperty("duracloud.password"));