use of org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider in project cloudstack by apache.
the class DataStoreProviderManagerImpl method getCacheDataStoreProviders.
public List<StorageProviderResponse> getCacheDataStoreProviders() {
List<StorageProviderResponse> providers = new ArrayList<StorageProviderResponse>();
for (DataStoreProvider provider : providerMap.values()) {
if (provider.getTypes().contains(DataStoreProviderType.ImageCache)) {
StorageProviderResponse response = new StorageProviderResponse();
response.setName(provider.getName());
response.setType(DataStoreProviderType.ImageCache.toString());
providers.add(response);
}
}
return providers;
}
use of org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider in project cloudstack by apache.
the class DataStoreProviderManagerImpl method getPrimaryDataStoreProviders.
public List<StorageProviderResponse> getPrimaryDataStoreProviders() {
List<StorageProviderResponse> providers = new ArrayList<StorageProviderResponse>();
for (DataStoreProvider provider : providerMap.values()) {
if (provider.getTypes().contains(DataStoreProviderType.PRIMARY)) {
StorageProviderResponse response = new StorageProviderResponse();
response.setName(provider.getName());
response.setType(DataStoreProvider.DataStoreProviderType.PRIMARY.toString());
providers.add(response);
}
}
return providers;
}
use of org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider in project cloudstack by apache.
the class PrimaryDataStoreProviderManagerImpl method getPrimaryDataStore.
@Override
public PrimaryDataStore getPrimaryDataStore(long dataStoreId) {
StoragePoolVO dataStoreVO = dataStoreDao.findByIdIncludingRemoved(dataStoreId);
if (dataStoreVO == null) {
throw new CloudRuntimeException("Unable to locate datastore with id " + dataStoreId);
}
String providerName = dataStoreVO.getStorageProviderName();
DataStoreProvider provider = providerManager.getDataStoreProvider(providerName);
PrimaryDataStoreImpl dataStore = PrimaryDataStoreImpl.createDataStore(dataStoreVO, driverMaps.get(provider.getName()), provider);
return dataStore;
}
Aggregations