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
ConstructorsConstructorDescriptionStorageProviderFactoryImpl(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
Modifier and TypeMethodDescriptionvoidexpireStorageProvider(String storageAccountId) Removes a particular storage provider from the cache, which will require that the connection be recreated on the next call.This method returns all of the registered storage accounts.Retrieves the primary storage provider for a given customer.getStorageProvider(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 Details
-
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 Details
-
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
- Specified by:
getAuditQueuein interfaceStorageProviderFactory
-
getStorageAccounts
This method returns all of the registered storage accounts.- Specified by:
getStorageAccountsin interfaceStorageProviderFactory- Returns:
- list of storage accounts
-
getStorageProvider
Retrieves the primary storage provider for a given customer.- Specified by:
getStorageProviderin interfaceStorageProviderFactory- Returns:
- Throws:
StorageException
-
getStorageProvider
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
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
-