Move previous AncientImageDataStore provider and DefaultImageDataStore

provider code into plugins.
This commit is contained in:
Min Chen 2013-03-29 16:35:13 -07:00
parent b0cbe260f9
commit a5416797ab
19 changed files with 377 additions and 61 deletions

View File

@ -121,7 +121,7 @@ public class StorageAllocatorTest {
cluster = clusterDao.persist(cluster);
clusterId = cluster.getId();
DataStoreProvider provider = providerMgr.getDataStoreProvider("ancient primary data store provider");
DataStoreProvider provider = providerMgr.getDataStoreProvider("cloudstack primary data store provider");
storage = new StoragePoolVO();
storage.setDataCenterId(dcId);
storage.setPodId(podId);
@ -164,7 +164,7 @@ public class StorageAllocatorTest {
try {
createDb();
DataStoreProvider provider = providerMgr.getDataStoreProvider("ancient primary data store provider");
DataStoreProvider provider = providerMgr.getDataStoreProvider("cloudstack primary data store provider");
storage = new StoragePoolVO();
storage.setDataCenterId(dcId);
storage.setPodId(podId);

View File

@ -262,7 +262,7 @@ public class volumeServiceTest extends CloudStackTestNGBase {
@Test
public void testCreatePrimaryStorage() {
DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("default primary data store provider");
DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("sample primary data store provider");
Map<String, Object> params = new HashMap<String, Object>();
URI uri = null;
try {
@ -290,7 +290,7 @@ public class volumeServiceTest extends CloudStackTestNGBase {
}
private DataStore createImageStore() {
DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("default image data store");
DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("sample image data store provider");
Map<String, Object> params = new HashMap<String, Object>();
String name = UUID.randomUUID().toString();
params.put("name", name);
@ -310,7 +310,7 @@ public class volumeServiceTest extends CloudStackTestNGBase {
public DataStore createPrimaryDataStore() {
try {
DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("default primary data store provider");
DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("sample primary data store provider");
Map<String, Object> params = new HashMap<String, Object>();
URI uri = new URI(this.getPrimaryStorageUrl());
params.put("url", this.getPrimaryStorageUrl());
@ -331,7 +331,7 @@ public class volumeServiceTest extends CloudStackTestNGBase {
lifeCycle.attachCluster(store, scope);
/*
PrimaryDataStoreProvider provider = primaryDataStoreProviderMgr.getDataStoreProvider("default primary data store provider");
PrimaryDataStoreProvider provider = primaryDataStoreProviderMgr.getDataStoreProvider("sample primary data store provider");
primaryDataStoreProviderMgr.configure("primary data store mgr", new HashMap<String, Object>());
List<PrimaryDataStoreVO> ds = primaryStoreDao.findPoolByName(this.primaryName);

View File

@ -129,7 +129,7 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
@Override
public DataStoreProvider getDefaultPrimaryDataStoreProvider() {
return this.getDataStoreProvider("ancient primary data store provider");
return this.getDataStoreProvider("cloudstack primary data store provider");
}
@Override

View File

@ -79,12 +79,12 @@ public class ConfiguratorTest {
@Test
public void getProvider() {
// assertNotNull(providerMgr.getDataStoreProvider("default primary data store provider"));
// assertNotNull(providerMgr.getDataStoreProvider("sample primary data store provider"));
}
@Test
public void createDataStore() {
/*PrimaryDataStoreProvider provider = providerMgr.getDataStoreProvider("default primary data store provider");
/*PrimaryDataStoreProvider provider = providerMgr.getDataStoreProvider("sample primary data store provider");
Map<String, String> params = new HashMap<String, String>();
params.put("url", "nfs://localhost/mnt");
params.put("clusterId", "1");

View File

@ -58,8 +58,11 @@
<module>user-authenticators/sha256salted</module>
<module>network-elements/dns-notifier</module>
<module>storage/image/s3</module>
<module>storage/image/default</module>
<module>storage/image/sample</module>
<module>storage/volume/solidfire</module>
<module>storage/volume/default</module>
<module>storage/volume/sample</module>
<module>alert-handlers/snmp-alerts</module>
<module>alert-handlers/syslog-alerts</module>
</modules>

View File

@ -0,0 +1,56 @@
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
you under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-plugin-storage-image-default</artifactId>
<name>Apache CloudStack Plugin - Storage Image default provider</name>
<parent>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloudstack-plugins</artifactId>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-engine-storage-image</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${cs.mysql.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.storage.image.driver;
package org.apache.cloudstack.storage.datastore.driver;
import java.util.List;
import java.util.Set;
@ -64,9 +64,9 @@ import com.cloud.storage.snapshot.SnapshotManager;
import com.cloud.storage.swift.SwiftManager;
import com.cloud.utils.exception.CloudRuntimeException;
public class AncientImageDataStoreDriverImpl implements ImageDataStoreDriver {
public class CloudStackImageDataStoreDriverImpl implements ImageDataStoreDriver {
private static final Logger s_logger = Logger
.getLogger(AncientImageDataStoreDriverImpl.class);
.getLogger(CloudStackImageDataStoreDriverImpl.class);
@Inject
VMTemplateZoneDao templateZoneDao;
@Inject

View File

@ -0,0 +1,108 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.storage.datastore.lifecycle;
import java.util.Map;
import javax.inject.Inject;
import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.HostScope;
import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
import org.apache.cloudstack.storage.image.datastore.ImageDataStoreHelper;
import org.apache.cloudstack.storage.image.datastore.ImageDataStoreManager;
import org.apache.cloudstack.storage.image.db.ImageDataStoreDao;
import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;
import org.apache.cloudstack.storage.image.store.lifecycle.ImageDataStoreLifeCycle;
import com.cloud.agent.api.StoragePoolInfo;
public class CloudStackImageDataStoreLifeCycle implements ImageDataStoreLifeCycle {
@Inject
protected ImageDataStoreDao imageStoreDao;
@Inject
ImageDataStoreHelper imageStoreHelper;
@Inject
ImageDataStoreManager imageStoreMgr;
public CloudStackImageDataStoreLifeCycle() {
}
@Override
public DataStore initialize(Map<String, Object> dsInfos) {
ImageDataStoreVO ids = imageStoreHelper.createImageDataStore(dsInfos);
return imageStoreMgr.getImageDataStore(ids.getId());
}
@Override
public boolean attachCluster(DataStore store, ClusterScope scope) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean attachHost(DataStore store, HostScope scope,
StoragePoolInfo existingInfo) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean attachZone(DataStore dataStore, ZoneScope scope) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean dettach() {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean unmanaged() {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean maintain(DataStore store) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean cancelMaintain(DataStore store) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean deleteDataStore(DataStore store) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.storage.image.store;
package org.apache.cloudstack.storage.datastore.provider;
import java.util.HashMap;
import java.util.HashSet;
@ -31,20 +31,20 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
import org.apache.cloudstack.engine.subsystem.api.storage.ImageDataStoreProvider;
import org.apache.cloudstack.engine.subsystem.api.storage.ScopeType;
import org.apache.cloudstack.storage.datastore.driver.CloudStackImageDataStoreDriverImpl;
import org.apache.cloudstack.storage.datastore.lifecycle.CloudStackImageDataStoreLifeCycle;
import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
import org.apache.cloudstack.storage.image.datastore.ImageDataStoreHelper;
import org.apache.cloudstack.storage.image.datastore.ImageDataStoreManager;
import org.apache.cloudstack.storage.image.driver.AncientImageDataStoreDriverImpl;
import org.apache.cloudstack.storage.image.store.lifecycle.DefaultImageDataStoreLifeCycle;
import org.apache.cloudstack.storage.image.store.lifecycle.ImageDataStoreLifeCycle;
import org.springframework.stereotype.Component;
import com.cloud.utils.component.ComponentContext;
@Component
public class AncientImageDataStoreProvider implements ImageDataStoreProvider {
public class CloudStackImageDataStoreProvider implements ImageDataStoreProvider {
private final String name = "ancient image data store";
private final String name = "cloudstack image data store provider";
protected ImageDataStoreLifeCycle lifeCycle;
protected ImageDataStoreDriver driver;
@Inject
@ -64,8 +64,8 @@ public class AncientImageDataStoreProvider implements ImageDataStoreProvider {
@Override
public boolean configure(Map<String, Object> params) {
lifeCycle = ComponentContext.inject(DefaultImageDataStoreLifeCycle.class);
driver = ComponentContext.inject(AncientImageDataStoreDriverImpl.class);
lifeCycle = ComponentContext.inject(CloudStackImageDataStoreLifeCycle.class);
driver = ComponentContext.inject(CloudStackImageDataStoreDriverImpl.class);
storeMgr.registerDriver(this.getName(), driver);

View File

@ -0,0 +1,56 @@
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
you under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-plugin-storage-image-sample</artifactId>
<name>Apache CloudStack Plugin - Storage Image sample provider</name>
<parent>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloudstack-plugins</artifactId>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-engine-storage-image</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${cs.mysql.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.storage.image.driver;
package org.apache.cloudstack.storage.datastore.driver;
import java.util.Set;
@ -38,12 +38,12 @@ import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
import com.cloud.storage.dao.VMTemplateDao;
//http-read-only based image store
public class DefaultImageDataStoreDriverImpl implements ImageDataStoreDriver {
public class SampleImageDataStoreDriverImpl implements ImageDataStoreDriver {
@Inject
EndPointSelector selector;
@Inject
VMTemplateDao imageDataDao;
public DefaultImageDataStoreDriverImpl() {
public SampleImageDataStoreDriverImpl() {
}
@Override

View File

@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.storage.image.store.lifecycle;
package org.apache.cloudstack.storage.datastore.lifecycle;
import java.util.Map;
@ -28,17 +28,18 @@ import org.apache.cloudstack.storage.image.datastore.ImageDataStoreHelper;
import org.apache.cloudstack.storage.image.datastore.ImageDataStoreManager;
import org.apache.cloudstack.storage.image.db.ImageDataStoreDao;
import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;
import org.apache.cloudstack.storage.image.store.lifecycle.ImageDataStoreLifeCycle;
import com.cloud.agent.api.StoragePoolInfo;
public class DefaultImageDataStoreLifeCycle implements ImageDataStoreLifeCycle {
public class SampleImageDataStoreLifeCycle implements ImageDataStoreLifeCycle {
@Inject
protected ImageDataStoreDao imageStoreDao;
@Inject
ImageDataStoreHelper imageStoreHelper;
@Inject
ImageDataStoreManager imageStoreMgr;
public DefaultImageDataStoreLifeCycle() {
public SampleImageDataStoreLifeCycle() {
}

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.storage.image.store;
package org.apache.cloudstack.storage.datastore.provider;
import java.util.HashSet;
import java.util.Map;
@ -28,16 +28,16 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
import org.apache.cloudstack.engine.subsystem.api.storage.ImageDataStoreProvider;
import org.apache.cloudstack.storage.datastore.driver.SampleImageDataStoreDriverImpl;
import org.apache.cloudstack.storage.datastore.lifecycle.SampleImageDataStoreLifeCycle;
import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
import org.apache.cloudstack.storage.image.datastore.ImageDataStoreManager;
import org.apache.cloudstack.storage.image.driver.DefaultImageDataStoreDriverImpl;
import org.apache.cloudstack.storage.image.store.lifecycle.DefaultImageDataStoreLifeCycle;
import org.apache.cloudstack.storage.image.store.lifecycle.ImageDataStoreLifeCycle;
import com.cloud.utils.component.ComponentContext;
public class DefaultImageDataStoreProvider implements ImageDataStoreProvider {
private final String name = "default image data store";
public class SampleImageDataStoreProvider implements ImageDataStoreProvider {
private final String name = "sample image data store provider";
protected ImageDataStoreLifeCycle lifeCycle;
protected ImageDataStoreDriver driver;
@Inject
@ -56,8 +56,8 @@ public class DefaultImageDataStoreProvider implements ImageDataStoreProvider {
@Override
public boolean configure(Map<String, Object> params) {
lifeCycle = ComponentContext.inject(DefaultImageDataStoreLifeCycle.class);
driver = ComponentContext.inject(DefaultImageDataStoreDriverImpl.class);
lifeCycle = ComponentContext.inject(SampleImageDataStoreLifeCycle.class);
driver = ComponentContext.inject(SampleImageDataStoreDriverImpl.class);
storeMgr.registerDriver(this.getName(), driver);
return true;

View File

@ -34,7 +34,7 @@ import com.cloud.utils.component.ComponentContext;
public class CloudStackPrimaryDataStoreProviderImpl implements
PrimaryDataStoreProvider {
private final String providerName = "ancient primary data store provider";
private final String providerName = "cloudstack primary data store provider";
protected PrimaryDataStoreDriver driver;
protected HypervisorHostListener listener;
protected DataStoreLifeCycle lifecyle;

View File

@ -0,0 +1,56 @@
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
you under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cloud-plugin-storage-volume-sample</artifactId>
<name>Apache CloudStack Plugin - Storage Volume sample provider</name>
<parent>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloudstack-plugins</artifactId>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-engine-storage-volume</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${cs.mysql.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -46,15 +46,15 @@ import com.cloud.utils.storage.encoding.DecodedDataObject;
import com.cloud.utils.storage.encoding.Decoder;
public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver {
private static final Logger s_logger = Logger.getLogger(DefaultPrimaryDataStoreDriverImpl.class);
public class SamplePrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver {
private static final Logger s_logger = Logger.getLogger(SamplePrimaryDataStoreDriverImpl.class);
@Inject
EndPointSelector selector;
@Inject
StoragePoolHostDao storeHostDao;
@Inject
DataObjectManager dataObjMgr;
public DefaultPrimaryDataStoreDriverImpl() {
public SamplePrimaryDataStoreDriverImpl() {
}
@ -74,7 +74,7 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
}
public Void createAsyncCallback(AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl, Answer> callback, CreateVolumeContext<CreateCmdResult> context) {
public Void createAsyncCallback(AsyncCallbackDispatcher<SamplePrimaryDataStoreDriverImpl, Answer> callback, CreateVolumeContext<CreateCmdResult> context) {
CreateCmdResult result = null;
CreateObjectAnswer volAnswer = (CreateObjectAnswer) callback.getResult();
if (volAnswer.getResult()) {
@ -94,13 +94,13 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
EndPoint ep = selector.select(vo);
AsyncRpcConext<CommandResult> context = new AsyncRpcConext<CommandResult>(callback);
AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl, Answer> caller = AsyncCallbackDispatcher.create(this);
AsyncCallbackDispatcher<SamplePrimaryDataStoreDriverImpl, Answer> caller = AsyncCallbackDispatcher.create(this);
caller.setCallback(caller.getTarget().deleteCallback(null, null))
.setContext(context);
ep.sendMessageAsync(cmd, caller);
}
public Void deleteCallback(AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl, Answer> callback, AsyncRpcConext<CommandResult> context) {
public Void deleteCallback(AsyncCallbackDispatcher<SamplePrimaryDataStoreDriverImpl, Answer> callback, AsyncRpcConext<CommandResult> context) {
CommandResult result = new CommandResult();
Answer answer = callback.getResult();
if (!answer.getResult()) {
@ -165,7 +165,7 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
CreateObjectCommand createCmd = new CreateObjectCommand(vol.getUri());
CreateVolumeContext<CreateCmdResult> context = new CreateVolumeContext<CreateCmdResult>(callback, vol);
AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl, Answer> caller = AsyncCallbackDispatcher.create(this);
AsyncCallbackDispatcher<SamplePrimaryDataStoreDriverImpl, Answer> caller = AsyncCallbackDispatcher.create(this);
caller.setContext(context)
.setCallback(caller.getTarget().createAsyncCallback(null, null));

View File

@ -43,7 +43,7 @@ import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.StoragePoolStatus;
public class DefaultPrimaryDataStoreLifeCycleImpl implements PrimaryDataStoreLifeCycle {
public class SamplePrimaryDataStoreLifeCycleImpl implements PrimaryDataStoreLifeCycle {
@Inject
EndPointSelector selector;
@Inject
@ -54,7 +54,7 @@ public class DefaultPrimaryDataStoreLifeCycleImpl implements PrimaryDataStoreLif
PrimaryDataStoreHelper primaryStoreHelper;
@Inject
PrimaryDataStoreProviderManager providerMgr;
public DefaultPrimaryDataStoreLifeCycleImpl() {
public SamplePrimaryDataStoreLifeCycleImpl() {
}
@Override

View File

@ -29,14 +29,14 @@ import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreProvider;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider.DataStoreProviderType;
import org.apache.cloudstack.storage.datastore.PrimaryDataStoreProviderManager;
import org.apache.cloudstack.storage.datastore.driver.DefaultPrimaryDataStoreDriverImpl;
import org.apache.cloudstack.storage.datastore.lifecycle.DefaultPrimaryDataStoreLifeCycleImpl;
import org.apache.cloudstack.storage.datastore.driver.SamplePrimaryDataStoreDriverImpl;
import org.apache.cloudstack.storage.datastore.lifecycle.SamplePrimaryDataStoreLifeCycleImpl;
import com.cloud.utils.component.ComponentContext;
public class DefaultPrimaryDatastoreProviderImpl implements PrimaryDataStoreProvider {
private final String providerName = "default primary data store provider";
public class SamplePrimaryDatastoreProviderImpl implements PrimaryDataStoreProvider {
private final String providerName = "sample primary data store provider";
protected PrimaryDataStoreDriver driver;
protected HypervisorHostListener listener;
@Inject
@ -57,8 +57,8 @@ public class DefaultPrimaryDatastoreProviderImpl implements PrimaryDataStoreProv
@Override
public boolean configure(Map<String, Object> params) {
lifecyle = ComponentContext.inject(DefaultPrimaryDataStoreLifeCycleImpl.class);
driver = ComponentContext.inject(DefaultPrimaryDataStoreDriverImpl.class);
lifecyle = ComponentContext.inject(SamplePrimaryDataStoreLifeCycleImpl.class);
driver = ComponentContext.inject(SamplePrimaryDataStoreDriverImpl.class);
listener = ComponentContext.inject(DefaultHostListener.class);
return true;
}

View File

@ -16,12 +16,18 @@
// under the License.
package org.apache.cloudstack.storage.datastore.provider;
import java.util.Map;
import java.util.Set;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreProvider;
import org.springframework.stereotype.Component;
@Component
public class SolidfirePrimaryDataStoreProvider extends
DefaultPrimaryDatastoreProviderImpl {
private final String name = "Solidfre Primary Data Store Provider";
public class SolidfirePrimaryDataStoreProvider implements PrimaryDataStoreProvider {
private final String name = "Solidfire Primary Data Store Provider";
public SolidfirePrimaryDataStoreProvider() {
@ -35,5 +41,35 @@ public class SolidfirePrimaryDataStoreProvider extends
return name;
}
@Override
public DataStoreLifeCycle getDataStoreLifeCycle() {
// TODO Auto-generated method stub
return null;
}
@Override
public DataStoreDriver getDataStoreDriver() {
// TODO Auto-generated method stub
return null;
}
@Override
public HypervisorHostListener getHostListener() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean configure(Map<String, Object> params) {
// TODO Auto-generated method stub
return false;
}
@Override
public Set<DataStoreProviderType> getTypes() {
// TODO Auto-generated method stub
return null;
}
}