Package org.duracloud.durastore.util
Class StorageProviderFactoryImpl
- java.lang.Object
-
- org.duracloud.durastore.util.ProviderFactoryBase
-
- org.duracloud.durastore.util.StorageProviderFactoryImpl
-
- All Implemented Interfaces:
StorageProviderFactory
public class StorageProviderFactoryImpl extends ProviderFactoryBase implements StorageProviderFactory
Provides access to StorageProvider implementations- Author:
- Bill Branan
-
-
Constructor Summary
Constructors Constructor Description StorageProviderFactoryImpl(StorageAccountManager storageAccountManager, StatelessStorageProvider statelessStorageProvider, UserUtil userUtil, DuraCloudRequestContextUtil contextUtil, AccountChangeNotifier notifier)StorageProviderFactoryImpl(StorageAccountManager storageAccountManager, StatelessStorageProvider statelessStorageProvider, UserUtil userUtil, DuraCloudRequestContextUtil contextUtil, AccountChangeNotifier notifier, boolean cacheStorageProvidersOnInit)StorageProviderFactoryImpl(StorageAccountManager storageAccountManager, StatelessStorageProvider statelessStorageProvider, UserUtil userUtil, DuraCloudRequestContextUtil contextUtil, AccountChangeNotifier notifier, AuditConfig auditConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexpireStorageProvider(String storageAccountId)Removes a particular storage provider from the cache, which will require that the connection be recreated on the next call.TaskQueuegetAuditQueue()List<StorageAccount>getStorageAccounts()This method returns all of the registered storage accounts.StorageProvidergetStorageProvider()Retrieves the primary storage provider for a given customer.StorageProvidergetStorageProvider(String storageAccountId)Retrieves a particular storage provider based on the storage account ID.voidinitialize(DuraStoreInitConfig initConfig, String instanceHost, String instancePort, String accountId)Initializes DuraStore with account information necessary to connect to Storage Providers.-
Methods inherited from class org.duracloud.durastore.util.ProviderFactoryBase
getAccountManager, getInitConfig, isInitialized
-
-
-
-
Constructor Detail
-
StorageProviderFactoryImpl
public StorageProviderFactoryImpl(StorageAccountManager storageAccountManager, StatelessStorageProvider statelessStorageProvider, UserUtil userUtil, DuraCloudRequestContextUtil contextUtil, AccountChangeNotifier notifier)
-
StorageProviderFactoryImpl
public StorageProviderFactoryImpl(StorageAccountManager storageAccountManager, StatelessStorageProvider statelessStorageProvider, UserUtil userUtil, DuraCloudRequestContextUtil contextUtil, AccountChangeNotifier notifier, boolean cacheStorageProvidersOnInit)
-
StorageProviderFactoryImpl
public StorageProviderFactoryImpl(StorageAccountManager storageAccountManager, StatelessStorageProvider statelessStorageProvider, UserUtil userUtil, DuraCloudRequestContextUtil contextUtil, AccountChangeNotifier notifier, AuditConfig auditConfig)
-
-
Method Detail
-
initialize
public void initialize(DuraStoreInitConfig initConfig, String instanceHost, String instancePort, String accountId) throws StorageException
Description copied from class:ProviderFactoryBaseInitializes DuraStore with account information necessary to connect to Storage Providers.- Specified by:
initializein interfaceStorageProviderFactory- Overrides:
initializein classProviderFactoryBase- Throws:
StorageException
-
getAuditQueue
public TaskQueue getAuditQueue()
- Specified by:
getAuditQueuein interfaceStorageProviderFactory
-
getStorageAccounts
public List<StorageAccount> getStorageAccounts()
This method returns all of the registered storage accounts.- Specified by:
getStorageAccountsin interfaceStorageProviderFactory- Returns:
- list of storage accounts
-
getStorageProvider
public StorageProvider getStorageProvider() throws StorageException
Retrieves the primary storage provider for a given customer.- Specified by:
getStorageProviderin interfaceStorageProviderFactory- Returns:
- Throws:
StorageException
-
getStorageProvider
public StorageProvider getStorageProvider(String storageAccountId) throws StorageException
Retrieves a particular storage provider based on the storage account ID. If no storage ID is provided use the primary storage provider account If no storage account can be found with the given ID, throw NotFoundException- Specified by:
getStorageProviderin interfaceStorageProviderFactory- Parameters:
storageAccountId- - the ID of the storage provider account- Returns:
- Throws:
StorageException
-
expireStorageProvider
public void expireStorageProvider(String storageAccountId)
Removes a particular storage provider from the cache, which will require that the connection be recreated on the next call.- Specified by:
expireStorageProviderin interfaceStorageProviderFactory- Parameters:
storageAccountId- - the ID of the storage provider account
-
-