Skip to content

Commit 2c689ad

Browse files
committed
add more implementation in volume project
1 parent d836b14 commit 2c689ad

20 files changed

Lines changed: 402 additions & 111 deletions

File tree

engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/VolumeEntity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ public interface VolumeEntity extends CloudStackEntity {
7676

7777
long getSize();
7878

79-
String getTemplatePath();
80-
String getTemplateUuid();
8179
VolumeDiskType getDiskType();
80+
8281
VolumeType getType();
82+
8383
StorageEntity getDataStore();
84-
void setPath(String path);
84+
8585
boolean createVolumeFromTemplate(long dataStoreId, VolumeDiskType diskType, TemplateEntity template);
8686
}

engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreInfo.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ public interface PrimaryDataStoreInfo {
3333
public long getAvailableCapacity();
3434
public List<EndPoint> getEndPoints();
3535
public long getId();
36+
public String getUuid();
3637
}

engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeInfo.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,7 @@ public interface VolumeInfo {
3838
public long getId();
3939
public Volume.State getCurrentState();
4040
public Volume.State getDesiredState();
41-
public Date getCreatedData();
41+
public Date getCreatedDate();
42+
public Date getUpdatedDate();
43+
public String getOwner();
4244
}

engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import org.apache.cloudstack.engine.subsystem.api.storage.type.VolumeTypeHelper;
4545
import org.apache.cloudstack.storage.command.CreateVolumeAnswer;
4646
import org.apache.cloudstack.storage.command.CreateVolumeFromBaseImageCommand;
47-
import org.apache.cloudstack.storage.datastore.DefaultPrimaryDataStoreImpl;
47+
import org.apache.cloudstack.storage.datastore.DefaultPrimaryDataStore;
4848
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
4949
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreVO;
5050
import org.apache.cloudstack.storage.datastore.lifecycle.PrimaryDataStoreLifeCycle;
@@ -293,7 +293,7 @@ public void testStaticBean() {
293293
DefaultPrimaryDatastoreProviderImpl provider = ComponentInject.inject(DefaultPrimaryDatastoreProviderImpl.class);
294294
//assertNotNull(provider.dataStoreDao);
295295

296-
DefaultPrimaryDataStoreImpl dpdsi = new DefaultPrimaryDataStoreImpl(null, null, null);
296+
DefaultPrimaryDataStore dpdsi = new DefaultPrimaryDataStore(null, null, null);
297297
ComponentInject.inject(dpdsi);
298298
//assertNotNull(dpdsi.volumeDao);
299299
}

engine/storage/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,5 @@
6565
<build>
6666
<defaultGoal>install</defaultGoal>
6767
<sourceDirectory>src</sourceDirectory>
68-
<testSourceDirectory>test</testSourceDirectory>
6968
</build>
7069
</project>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.storage.command;
20+
21+
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
22+
23+
import com.cloud.agent.api.Command;
24+
25+
public class DeleteVolume extends Command {
26+
27+
public DeleteVolume(VolumeInfo volume) {
28+
29+
}
30+
31+
protected DeleteVolume() {
32+
33+
}
34+
@Override
35+
public boolean executeInSequence() {
36+
// TODO Auto-generated method stub
37+
return false;
38+
}
39+
40+
}

engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ public interface PrimaryDataStore extends PrimaryDataStoreInfo {
3232

3333
List<VolumeInfo> getVolumes();
3434

35-
boolean deleteVolume(long id);
35+
boolean deleteVolume(VolumeInfo volume);
3636

3737
VolumeInfo createVolume(VolumeInfo vo, VolumeDiskType diskType);
3838

3939
VolumeInfo createVoluemFromBaseImage(VolumeInfo volume, TemplateOnPrimaryDataStoreInfo templateStore);
4040

4141
List<EndPoint> getEndPoints();
4242

43-
PrimaryDataStoreInfo getDataStoreInfo();
44-
4543
boolean exists(VolumeInfo vi);
4644

4745
boolean templateExists(TemplateInfo template);
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.storage.datastore;
20+
21+
import java.lang.reflect.Method;
22+
import java.util.Date;
23+
import java.util.List;
24+
import java.util.Map;
25+
26+
import org.apache.cloudstack.engine.datacenter.entity.api.StorageEntity;
27+
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
28+
29+
import com.cloud.storage.StoragePoolStatus;
30+
import com.cloud.storage.Storage.StoragePoolType;
31+
32+
public class PrimaryDataStoreEntityImpl implements StorageEntity {
33+
private PrimaryDataStoreInfo dataStore;
34+
35+
public PrimaryDataStoreEntityImpl(PrimaryDataStoreInfo dataStore) {
36+
this.dataStore = dataStore;
37+
}
38+
39+
@Override
40+
public boolean enable() {
41+
// TODO Auto-generated method stub
42+
return false;
43+
}
44+
45+
@Override
46+
public boolean disable() {
47+
// TODO Auto-generated method stub
48+
return false;
49+
}
50+
51+
@Override
52+
public boolean deactivate() {
53+
// TODO Auto-generated method stub
54+
return false;
55+
}
56+
57+
@Override
58+
public boolean reactivate() {
59+
// TODO Auto-generated method stub
60+
return false;
61+
}
62+
63+
@Override
64+
public String getUuid() {
65+
return this.dataStore.getUuid();
66+
}
67+
68+
@Override
69+
public long getId() {
70+
return this.dataStore.getId();
71+
}
72+
73+
@Override
74+
public String getCurrentState() {
75+
return null;
76+
}
77+
78+
@Override
79+
public String getDesiredState() {
80+
// TODO Auto-generated method stub
81+
return null;
82+
}
83+
84+
@Override
85+
public Date getCreatedTime() {
86+
// TODO Auto-generated method stub
87+
return null;
88+
}
89+
90+
@Override
91+
public Date getLastUpdatedTime() {
92+
// TODO Auto-generated method stub
93+
return null;
94+
}
95+
96+
@Override
97+
public String getOwner() {
98+
// TODO Auto-generated method stub
99+
return null;
100+
}
101+
102+
@Override
103+
public Map<String, String> getDetails(String source) {
104+
// TODO Auto-generated method stub
105+
return null;
106+
}
107+
108+
@Override
109+
public List<String> getDetailSources() {
110+
// TODO Auto-generated method stub
111+
return null;
112+
}
113+
114+
@Override
115+
public void addDetail(String source, String name, String value) {
116+
// TODO Auto-generated method stub
117+
118+
}
119+
120+
@Override
121+
public void delDetail(String source, String name, String value) {
122+
// TODO Auto-generated method stub
123+
124+
}
125+
126+
@Override
127+
public void updateDetail(String source, String name, String value) {
128+
// TODO Auto-generated method stub
129+
130+
}
131+
132+
@Override
133+
public List<Method> getApplicableActions() {
134+
// TODO Auto-generated method stub
135+
return null;
136+
}
137+
138+
@Override
139+
public State getState() {
140+
// TODO Auto-generated method stub
141+
return null;
142+
}
143+
144+
@Override
145+
public String getName() {
146+
// TODO Auto-generated method stub
147+
return null;
148+
}
149+
150+
@Override
151+
public StoragePoolType getPoolType() {
152+
// TODO Auto-generated method stub
153+
return null;
154+
}
155+
156+
@Override
157+
public Date getCreated() {
158+
// TODO Auto-generated method stub
159+
return null;
160+
}
161+
162+
@Override
163+
public Date getUpdateTime() {
164+
// TODO Auto-generated method stub
165+
return null;
166+
}
167+
168+
@Override
169+
public long getDataCenterId() {
170+
// TODO Auto-generated method stub
171+
return 0;
172+
}
173+
174+
@Override
175+
public long getCapacityBytes() {
176+
// TODO Auto-generated method stub
177+
return 0;
178+
}
179+
180+
@Override
181+
public long getAvailableBytes() {
182+
// TODO Auto-generated method stub
183+
return 0;
184+
}
185+
186+
@Override
187+
public Long getClusterId() {
188+
// TODO Auto-generated method stub
189+
return null;
190+
}
191+
192+
@Override
193+
public String getHostAddress() {
194+
// TODO Auto-generated method stub
195+
return null;
196+
}
197+
198+
@Override
199+
public String getPath() {
200+
// TODO Auto-generated method stub
201+
return null;
202+
}
203+
204+
@Override
205+
public String getUserInfo() {
206+
// TODO Auto-generated method stub
207+
return null;
208+
}
209+
210+
@Override
211+
public boolean isShared() {
212+
// TODO Auto-generated method stub
213+
return false;
214+
}
215+
216+
@Override
217+
public boolean isLocal() {
218+
// TODO Auto-generated method stub
219+
return false;
220+
}
221+
222+
@Override
223+
public StoragePoolStatus getStatus() {
224+
// TODO Auto-generated method stub
225+
return null;
226+
}
227+
228+
@Override
229+
public int getPort() {
230+
// TODO Auto-generated method stub
231+
return 0;
232+
}
233+
234+
@Override
235+
public Long getPodId() {
236+
// TODO Auto-generated method stub
237+
return null;
238+
}
239+
240+
@Override
241+
public String getStorageProvider() {
242+
// TODO Auto-generated method stub
243+
return null;
244+
}
245+
246+
@Override
247+
public String getStorageType() {
248+
// TODO Auto-generated method stub
249+
return null;
250+
}
251+
252+
}

0 commit comments

Comments
 (0)