You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2013/01/15 03:04:54 UTC
[28/44] Revert "Merge remote-tracking branch 'origin/javelin' into
javelin"
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
deleted file mode 100644
index 49a9410..0000000
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.snapshot;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.disktype.DiskFormat;
-import org.apache.cloudstack.storage.snapshot.db.SnapshotVO;
-
-public class SnapshotObject implements SnapshotInfo {
- private SnapshotVO snapshot;
- private DataStore store;
-
- public SnapshotObject(SnapshotVO snapshot, DataStore store) {
- this.snapshot = snapshot;
- this.store = store;
- }
-
- public DataStore getStore() {
- return this.store;
- }
- @Override
- public String getName() {
- return this.snapshot.getName();
- }
-
- @Override
- public SnapshotInfo getParent() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public SnapshotInfo getChild() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public VolumeInfo getBaseVolume() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public long getId() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public String getUri() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public DataStore getDataStore() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public long getSize() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public DataObjectType getType() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public DiskFormat getFormat() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
index 971e9a5..80b1918 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
@@ -1,3 +1,19 @@
+// 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.snapshot;
import org.apache.cloudstack.engine.cloud.entity.api.SnapshotEntity;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotDao2.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotDao2.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotDao2.java
deleted file mode 100644
index d531ede..0000000
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotDao2.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.snapshot.db;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface SnapshotDao2 extends GenericDao<SnapshotVO, Long> {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotDao2Impl.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotDao2Impl.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotDao2Impl.java
deleted file mode 100644
index 5e36e10..0000000
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotDao2Impl.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.snapshot.db;
-
-import com.cloud.utils.db.GenericDaoBase;
-
-public class SnapshotDao2Impl extends GenericDaoBase<SnapshotVO, Long> implements SnapshotDao2 {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotVO.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotVO.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotVO.java
deleted file mode 100644
index b0834be..0000000
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/db/SnapshotVO.java
+++ /dev/null
@@ -1,296 +0,0 @@
-// 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.snapshot.db;
-
-import java.util.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.Snapshot.Status;
-import com.cloud.storage.Snapshot.Type;
-import com.cloud.utils.db.GenericDao;
-import com.google.gson.annotations.Expose;
-
-@Entity
-@Table(name="snapshots")
-public class SnapshotVO {
- @Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
- private final long id = -1;
-
- @Column(name="data_center_id")
- long dataCenterId;
-
- @Column(name="account_id")
- long accountId;
-
- @Column(name="domain_id")
- long domainId;
-
- @Column(name="volume_id")
- Long volumeId;
-
- @Column(name="disk_offering_id")
- Long diskOfferingId;
-
- @Expose
- @Column(name="path")
- String path;
-
- @Expose
- @Column(name="name")
- String name;
-
- @Expose
- @Column(name="status", updatable = true, nullable=false)
- @Enumerated(value=EnumType.STRING)
- private Status status;
-
- @Column(name="snapshot_type")
- short snapshotType;
-
- @Column(name="type_description")
- String typeDescription;
-
- @Column(name="size")
- long size;
-
- @Column(name=GenericDao.CREATED_COLUMN)
- Date created;
-
- @Column(name=GenericDao.REMOVED_COLUMN)
- Date removed;
-
- @Column(name="backup_snap_id")
- String backupSnapshotId;
-
- @Column(name="swift_id")
- Long swiftId;
-
- @Column(name="s3_id")
- Long s3Id;
-
- @Column(name="sechost_id")
- Long secHostId;
-
- @Column(name="prev_snap_id")
- long prevSnapshotId;
-
- @Column(name="hypervisor_type")
- @Enumerated(value=EnumType.STRING)
- HypervisorType hypervisorType;
-
- @Expose
- @Column(name="version")
- String version;
-
- @Column(name="uuid")
- String uuid;
-
- public SnapshotVO() {
- this.uuid = UUID.randomUUID().toString();
- }
-
- public SnapshotVO(long dcId, long accountId, long domainId, Long volumeId, Long diskOfferingId, String path, String name, short snapshotType, String typeDescription, long size, HypervisorType hypervisorType ) {
- this.dataCenterId = dcId;
- this.accountId = accountId;
- this.domainId = domainId;
- this.volumeId = volumeId;
- this.diskOfferingId = diskOfferingId;
- this.path = path;
- this.name = name;
- this.snapshotType = snapshotType;
- this.typeDescription = typeDescription;
- this.size = size;
- this.status = Status.Creating;
- this.prevSnapshotId = 0;
- this.hypervisorType = hypervisorType;
- this.version = "2.2";
- this.uuid = UUID.randomUUID().toString();
- }
-
- public long getId() {
- return id;
- }
-
- public long getDataCenterId() {
- return dataCenterId;
- }
-
-
- public long getAccountId() {
- return accountId;
- }
-
-
- public long getDomainId() {
- return domainId;
- }
-
- public long getVolumeId() {
- return volumeId;
- }
-
- public long getDiskOfferingId() {
- return diskOfferingId;
- }
-
- public void setVolumeId(Long volumeId) {
- this.volumeId = volumeId;
- }
-
- public String getPath() {
- return path;
- }
-
- public void setPath(String path) {
- this.path = path;
- }
-
- public String getName() {
- return name;
- }
-
- public short getsnapshotType() {
- return snapshotType;
- }
-
- public Type getType() {
- if (snapshotType < 0 || snapshotType >= Type.values().length) {
- return null;
- }
- return Type.values()[snapshotType];
- }
-
- public Long getSwiftId() {
- return swiftId;
- }
-
- public void setSwiftId(Long swiftId) {
- this.swiftId = swiftId;
- }
-
- public Long getSecHostId() {
- return secHostId;
- }
-
- public void setSecHostId(Long secHostId) {
- this.secHostId = secHostId;
- }
-
- public HypervisorType getHypervisorType() {
- return hypervisorType;
- }
-
- public void setSnapshotType(short snapshotType) {
- this.snapshotType = snapshotType;
- }
-
- public boolean isRecursive(){
- if ( snapshotType >= Type.HOURLY.ordinal() && snapshotType <= Type.MONTHLY.ordinal() ) {
- return true;
- }
- return false;
- }
-
- public long getSize() {
- return size;
- }
-
- public String getTypeDescription() {
- return typeDescription;
- }
- public void setTypeDescription(String typeDescription) {
- this.typeDescription = typeDescription;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public Date getCreated() {
- return created;
- }
-
- public Date getRemoved() {
- return removed;
- }
-
- public Status getStatus() {
- return status;
- }
-
- public void setStatus(Status status) {
- this.status = status;
- }
-
- public String getBackupSnapshotId(){
- return backupSnapshotId;
- }
-
- public long getPrevSnapshotId(){
- return prevSnapshotId;
- }
-
- public void setBackupSnapshotId(String backUpSnapshotId){
- this.backupSnapshotId = backUpSnapshotId;
- }
-
- public void setPrevSnapshotId(long prevSnapshotId){
- this.prevSnapshotId = prevSnapshotId;
- }
-
- public static Type getSnapshotType(String snapshotType) {
- for ( Type type : Type.values()) {
- if ( type.equals(snapshotType)) {
- return type;
- }
- }
- return null;
- }
-
- public String getUuid() {
- return this.uuid;
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- public Long getS3Id() {
- return s3Id;
- }
-
- public void setS3Id(Long s3Id) {
- this.s3Id = s3Id;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/HypervisorBasedSnapshot.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/HypervisorBasedSnapshot.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/HypervisorBasedSnapshot.java
index 7df413f..7f18200 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/HypervisorBasedSnapshot.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/HypervisorBasedSnapshot.java
@@ -1,3 +1,19 @@
+// 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.snapshot.strategy;
import org.apache.cloudstack.storage.snapshot.SnapshotInfo;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/StorageBasedSnapshot.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/StorageBasedSnapshot.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/StorageBasedSnapshot.java
index 42807d6..fa9c5ae 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/StorageBasedSnapshot.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/StorageBasedSnapshot.java
@@ -1,3 +1,19 @@
+// 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.snapshot.strategy;
import org.apache.cloudstack.storage.snapshot.SnapshotInfo;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/EndPoint.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/EndPoint.java b/engine/storage/src/org/apache/cloudstack/storage/EndPoint.java
new file mode 100644
index 0000000..cdc6626
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/EndPoint.java
@@ -0,0 +1,27 @@
+// 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;
+
+import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+
+public interface EndPoint {
+ public Answer sendMessage(Command cmd);
+ public void sendMessageAsync(Command cmd, AsyncCompletionCallback<Answer> callback);
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/HypervisorHostEndPoint.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/HypervisorHostEndPoint.java b/engine/storage/src/org/apache/cloudstack/storage/HypervisorHostEndPoint.java
index c4ebfb2..a2e9ea9 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/HypervisorHostEndPoint.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/HypervisorHostEndPoint.java
@@ -20,7 +20,6 @@ package org.apache.cloudstack.storage;
import javax.inject.Inject;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
import org.apache.log4j.Logger;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/backup/SnapshotOnBackupStoreInfo.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/backup/SnapshotOnBackupStoreInfo.java b/engine/storage/src/org/apache/cloudstack/storage/backup/SnapshotOnBackupStoreInfo.java
index d01f2b4..5f5ce2f 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/backup/SnapshotOnBackupStoreInfo.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/backup/SnapshotOnBackupStoreInfo.java
@@ -1,3 +1,19 @@
+// 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.backup;
import org.apache.cloudstack.storage.backup.datastore.BackupStoreInfo;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/backup/datastore/BackupStoreInfo.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/backup/datastore/BackupStoreInfo.java b/engine/storage/src/org/apache/cloudstack/storage/backup/datastore/BackupStoreInfo.java
index 2c126cf..ca1454a 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/backup/datastore/BackupStoreInfo.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/backup/datastore/BackupStoreInfo.java
@@ -1,3 +1,19 @@
+// 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.backup.datastore;
import org.apache.cloudstack.storage.backup.SnapshotOnBackupStoreInfo;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java b/engine/storage/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java
index 8aaca94..b0b3299 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/command/AttachPrimaryDataStoreCmd.java
@@ -18,15 +18,17 @@
*/
package org.apache.cloudstack.storage.command;
+import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
+
import com.cloud.agent.api.Command;
public class AttachPrimaryDataStoreCmd extends Command implements StorageSubSystemCommand {
- private final String dataStore;
- public AttachPrimaryDataStoreCmd(String uri) {
- this.dataStore = uri;
+ private final PrimaryDataStoreTO dataStore;
+ public AttachPrimaryDataStoreCmd(PrimaryDataStoreTO dataStore) {
+ this.dataStore = dataStore;
}
- public String getDataStore() {
+ public PrimaryDataStoreTO getDataStore() {
return this.dataStore;
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/command/CommandResult.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/command/CommandResult.java b/engine/storage/src/org/apache/cloudstack/storage/command/CommandResult.java
new file mode 100644
index 0000000..d152863
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/command/CommandResult.java
@@ -0,0 +1,49 @@
+/*
+ * 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.command;
+
+public class CommandResult {
+ private boolean success;
+ private String result;
+
+ public CommandResult() {
+ this.success = true;
+ this.result = "";
+ }
+
+ public boolean isSuccess() {
+ return this.success;
+ }
+
+ public void setSucess(boolean success) {
+ this.success = success;
+ }
+
+ public String getResult() {
+ return this.result;
+ }
+
+ public void setResult(String result) {
+ this.result = result;
+ if (result != null) {
+ this.success = false;
+ }
+ }
+}
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/command/CopyCmd.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/command/CopyCmd.java b/engine/storage/src/org/apache/cloudstack/storage/command/CopyCmd.java
index 42eaa2f..dcb81ba 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/command/CopyCmd.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/command/CopyCmd.java
@@ -1,3 +1,19 @@
+// 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.command;
import org.apache.cloudstack.storage.to.ImageOnPrimayDataStoreTO;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java b/engine/storage/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java
deleted file mode 100644
index d9781bb..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/command/CopyCmdAnswer.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.apache.cloudstack.storage.command;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.Command;
-
-public class CopyCmdAnswer extends Answer {
- private final String path;
-
- public CopyCmdAnswer(Command cmd, String path) {
- super(cmd);
- this.path = path;
- }
-
- public String getPath() {
- return this.path;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/command/CopyTemplateToPrimaryStorageAnswer.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/command/CopyTemplateToPrimaryStorageAnswer.java b/engine/storage/src/org/apache/cloudstack/storage/command/CopyTemplateToPrimaryStorageAnswer.java
new file mode 100644
index 0000000..9fd9317
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/command/CopyTemplateToPrimaryStorageAnswer.java
@@ -0,0 +1,33 @@
+// 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.command;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.agent.api.Command;
+
+public class CopyTemplateToPrimaryStorageAnswer extends Answer {
+ private final String path;
+
+ public CopyTemplateToPrimaryStorageAnswer(Command cmd, String path) {
+ super(cmd);
+ this.path = path;
+ }
+
+ public String getPath() {
+ return this.path;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java b/engine/storage/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java
index 5a64e33..c9808d9 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java
@@ -1,3 +1,19 @@
+// 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.command;
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/command/CreateVolumeCommand.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/command/CreateVolumeCommand.java b/engine/storage/src/org/apache/cloudstack/storage/command/CreateVolumeCommand.java
index db643fe..c44970e 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/command/CreateVolumeCommand.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/command/CreateVolumeCommand.java
@@ -18,14 +18,16 @@
*/
package org.apache.cloudstack.storage.command;
+import org.apache.cloudstack.storage.to.VolumeTO;
+
import com.cloud.agent.api.Command;
public class CreateVolumeCommand extends Command implements StorageSubSystemCommand {
- protected String volumeUri;
+ protected VolumeTO volumeTO;
- public CreateVolumeCommand(String volumeUri) {
+ public CreateVolumeCommand(VolumeTO volumeTO) {
super();
- this.volumeUri = volumeUri;
+ this.volumeTO = volumeTO;
}
protected CreateVolumeCommand() {
@@ -38,8 +40,8 @@ public class CreateVolumeCommand extends Command implements StorageSubSystemComm
return false;
}
- public String getVolume() {
- return this.volumeUri;
+ public VolumeTO getVolume() {
+ return this.volumeTO;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/command/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/command/DeleteCommand.java b/engine/storage/src/org/apache/cloudstack/storage/command/DeleteCommand.java
deleted file mode 100644
index 5d948d1..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/command/DeleteCommand.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.command;
-
-import org.apache.cloudstack.storage.to.VolumeTO;
-
-import com.cloud.agent.api.Command;
-
-public class DeleteCommand extends Command implements StorageSubSystemCommand {
- private String uri;
- public DeleteCommand(String uri) {
- this.uri = uri;
- }
-
- protected DeleteCommand() {
-
- }
- @Override
- public boolean executeInSequence() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public String getUri() {
- return this.uri;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/command/DeleteVolumeCommand.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/command/DeleteVolumeCommand.java b/engine/storage/src/org/apache/cloudstack/storage/command/DeleteVolumeCommand.java
new file mode 100644
index 0000000..a30a83b
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/command/DeleteVolumeCommand.java
@@ -0,0 +1,44 @@
+/*
+ * 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.command;
+
+import org.apache.cloudstack.storage.to.VolumeTO;
+
+import com.cloud.agent.api.Command;
+
+public class DeleteVolumeCommand extends Command implements StorageSubSystemCommand {
+ private VolumeTO volume;
+ public DeleteVolumeCommand(VolumeTO volume) {
+ this.volume = volume;
+ }
+
+ protected DeleteVolumeCommand() {
+
+ }
+ @Override
+ public boolean executeInSequence() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public VolumeTO getVolume() {
+ return this.volume;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStore.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStore.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStore.java
new file mode 100644
index 0000000..90e0cb6
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStore.java
@@ -0,0 +1,33 @@
+// 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;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
+import org.apache.cloudstack.storage.EndPoint;
+import org.apache.cloudstack.storage.image.TemplateInfo;
+import org.apache.cloudstack.storage.snapshot.SnapshotInfo;
+
+public interface DataStore {
+ String grantAccess(VolumeInfo volume, EndPoint ep);
+ boolean revokeAccess(VolumeInfo volume, EndPoint ep);
+ String grantAccess(TemplateInfo template, EndPoint ep);
+ boolean revokeAccess(TemplateInfo template, EndPoint ep);
+ String grantAccess(SnapshotInfo snapshot, EndPoint ep);
+ boolean revokeAccess(SnapshotInfo snapshot, EndPoint ep);
+ String getRole();
+ long getId();
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManager.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManager.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManager.java
deleted file mode 100644
index 829be50..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManager.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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;
-
-import java.util.Map;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
-
-public interface DataStoreManager {
- public DataStore getDataStore(long storeId, DataStoreRole role);
- public DataStore registerDataStore(Map<String, String> params, String providerUuid);
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
deleted file mode 100644
index 6e7df92..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
-import org.apache.cloudstack.storage.image.datastore.ImageDataStoreManager;
-import org.springframework.stereotype.Component;
-
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@Component
-public class DataStoreManagerImpl implements DataStoreManager {
- @Inject
- PrimaryDataStoreProviderManager primaryStorMgr;
- @Inject
- ImageDataStoreManager imageDataStoreMgr;
- @Override
- public DataStore getDataStore(long storeId, DataStoreRole role) {
- if (role == DataStoreRole.Primary) {
- return primaryStorMgr.getPrimaryDataStore(storeId);
- } else if (role == DataStoreRole.Image) {
- return imageDataStoreMgr.getImageDataStore(storeId);
- }
- throw new CloudRuntimeException("un recognized type" + role);
- }
- @Override
- public DataStore registerDataStore(Map<String, String> params,
- String providerUuid) {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreStatus.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreStatus.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreStatus.java
deleted file mode 100644
index 23551e4..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreStatus.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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;
-
-public enum DataStoreStatus {
- Initial, Initialized, Creating, Attaching, Up, PrepareForMaintenance, ErrorInMaintenance, CancelMaintenance, Maintenance, Removed;
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/DefaultDatastoreLifeCyle.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DefaultDatastoreLifeCyle.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/DefaultDatastoreLifeCyle.java
deleted file mode 100644
index 910c071..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DefaultDatastoreLifeCyle.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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;
-
-import java.util.ArrayList;
-import java.util.List;
-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.DataStoreLifeCycle;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
-import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
-import org.apache.cloudstack.storage.image.datastore.ImageDataStoreHelper;
-import org.apache.cloudstack.storage.volume.datastore.PrimaryDataStoreHelper;
-import org.springframework.stereotype.Component;
-
-import edu.emory.mathcs.backport.java.util.Arrays;
-
-public class DefaultDatastoreLifeCyle implements DataStoreLifeCycle {
- @Inject
- PrimaryDataStoreHelper primaryStoreHelper;
- @Inject
- ImageDataStoreHelper imageStoreHelper;
- @Override
- public boolean initialize(DataStore store, Map<String, String> dsInfos) {
- String roles = dsInfos.get("roles");
- List<String> roleArry = Arrays.asList(roles.split(";"));
- List<DataStoreRole> storeRoles = new ArrayList<DataStoreRole>();
- for (String role : roleArry) {
- storeRoles.add(DataStoreRole.getRole(role));
- }
-
- if (storeRoles.contains(DataStoreRole.Primary)) {
- primaryStoreHelper.createPrimaryDataStore(dsInfos);
- }
-
- if (storeRoles.contains(DataStoreRole.Image)) {
- imageStoreHelper.createImageDataStore(dsInfos);
- }
-
- //TODO: add more roles
-
- return true;
- }
-
- @Override
- public boolean attachCluster(DataStore dataStore, ClusterScope scope) {
- if (dataStore.getRole() == DataStoreRole.Primary) {
- primaryStoreHelper.attachCluster(dataStore);
- }
- // TODO Auto-generated method stub
- return true;
- }
-
- @Override
- public boolean attachZone(DataStore dataStore, ZoneScope scope) {
- 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() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean cancelMaintain() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean deleteDataStore() {
- // TODO Auto-generated method stub
- return false;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java
index d7ffc17..2c2738f 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java
@@ -1,23 +1,33 @@
+// 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;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
import org.apache.cloudstack.storage.db.ObjectInDataStoreVO;
import org.apache.cloudstack.storage.image.TemplateInfo;
import org.apache.cloudstack.storage.snapshot.SnapshotInfo;
import org.apache.cloudstack.storage.volume.ObjectInDataStoreStateMachine;
-import org.apache.cloudstack.storage.volume.ObjectInDataStoreStateMachine.Event;
-
-import com.cloud.utils.fsm.NoTransitionException;
public interface ObjectInDataStoreManager {
public TemplateInfo create(TemplateInfo template, DataStore dataStore);
- public VolumeInfo create(VolumeInfo volume, DataStore dataStore);
- public SnapshotInfo create(SnapshotInfo snapshot, DataStore dataStore);
- public ObjectInDataStoreVO findObject(long objectId, DataObjectType type,
- long dataStoreId, DataStoreRole role);
- public boolean update(DataObject vo, Event event) throws NoTransitionException;
+ public ObjectInDataStoreVO create(VolumeInfo volume, DataStore dataStore);
+ public ObjectInDataStoreVO create(SnapshotInfo snapshot, DataStore dataStore);
+ public TemplateInfo findTemplate(TemplateInfo template, DataStore dataStore);
+ public VolumeInfo findVolume(VolumeInfo volume, DataStore dataStore);
+ public SnapshotInfo findSnapshot(SnapshotInfo snapshot, DataStore dataStore);
+ public boolean update(TemplateInfo vo, ObjectInDataStoreStateMachine.Event event);
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
index 9e27183..0607e1a 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
@@ -1,107 +1,83 @@
+// 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;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectType;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
+import javax.inject.Inject;
+
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
import org.apache.cloudstack.storage.db.ObjectInDataStoreDao;
import org.apache.cloudstack.storage.db.ObjectInDataStoreVO;
-import org.apache.cloudstack.storage.image.ImageDataFactory;
import org.apache.cloudstack.storage.image.TemplateInfo;
import org.apache.cloudstack.storage.snapshot.SnapshotInfo;
-import org.apache.cloudstack.storage.volume.ObjectInDataStoreStateMachine;
import org.apache.cloudstack.storage.volume.ObjectInDataStoreStateMachine.Event;
-import org.apache.cloudstack.storage.volume.ObjectInDataStoreStateMachine.State;
import org.springframework.stereotype.Component;
-import com.cloud.utils.component.Inject;
-import com.cloud.utils.db.SearchCriteria.Op;
-import com.cloud.utils.db.SearchCriteria2;
-import com.cloud.utils.db.SearchCriteriaService;
-import com.cloud.utils.exception.CloudRuntimeException;
-import com.cloud.utils.fsm.NoTransitionException;
-import com.cloud.utils.fsm.StateMachine2;
+
@Component
public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager {
@Inject
ObjectInDataStoreDao objectDataStoreDao;
- @Inject
- ImageDataFactory imageFactory;
- @Inject
- VolumeDataFactory volumeFactory;
- protected StateMachine2<State, Event, ObjectInDataStoreVO> stateMachines;
- public ObjectInDataStoreManagerImpl() {
- stateMachines = new StateMachine2<State, Event, ObjectInDataStoreVO>();
- stateMachines.addTransition(State.Allocated, Event.CreateRequested, State.Creating);
- stateMachines.addTransition(State.Creating, Event.OperationSuccessed, State.Created);
- stateMachines.addTransition(State.Creating, Event.OperationFailed, State.Failed);
- stateMachines.addTransition(State.Failed, Event.CreateRequested, State.Creating);
- stateMachines.addTransition(State.Ready, Event.DestroyRequested, State.Destroying);
- stateMachines.addTransition(State.Destroying, Event.OperationSuccessed, State.Destroyed);
- stateMachines.addTransition(State.Destroying, Event.OperationFailed, State.Destroying);
- stateMachines.addTransition(State.Destroying, Event.DestroyRequested, State.Destroying);
- stateMachines.addTransition(State.Created, Event.CopyingRequested, State.Copying);
- stateMachines.addTransition(State.Copying, Event.OperationFailed, State.Created);
- stateMachines.addTransition(State.Copying, Event.OperationSuccessed, State.Ready);
- stateMachines.addTransition(State.Allocated, Event.CreateOnlyRequested, State.Creating2);
- stateMachines.addTransition(State.Creating2, Event.OperationFailed, State.Failed);
- stateMachines.addTransition(State.Creating2, Event.OperationSuccessed, State.Ready);
- }
-
@Override
public TemplateInfo create(TemplateInfo template, DataStore dataStore) {
ObjectInDataStoreVO vo = new ObjectInDataStoreVO();
vo.setDataStoreId(dataStore.getId());
- vo.setDataStoreRole(dataStore.getRole());
+ vo.setDataStoreType(dataStore.getRole());
vo.setObjectId(template.getId());
- vo.setObjectType(template.getType());
+ vo.setObjectType("template");
vo = objectDataStoreDao.persist(vo);
-
- return imageFactory.getTemplate(template.getId(), dataStore);
+ TemplateInDataStore tmpl = new TemplateInDataStore(template, dataStore, vo);
+ return tmpl;
}
@Override
- public VolumeInfo create(VolumeInfo volume, DataStore dataStore) {
- ObjectInDataStoreVO vo = new ObjectInDataStoreVO();
- vo.setDataStoreId(dataStore.getId());
- vo.setDataStoreRole(dataStore.getRole());
- vo.setObjectId(volume.getId());
- vo.setObjectType(volume.getType());
- vo = objectDataStoreDao.persist(vo);
-
- return volumeFactory.getVolume(volume.getId(), dataStore);
+ public ObjectInDataStoreVO create(VolumeInfo volume, DataStore dataStore) {
+ // TODO Auto-generated method stub
+ return null;
}
@Override
- public SnapshotInfo create(SnapshotInfo snapshot, DataStore dataStore) {
+ public ObjectInDataStoreVO create(SnapshotInfo snapshot, DataStore dataStore) {
// TODO Auto-generated method stub
return null;
}
-
+
@Override
- public ObjectInDataStoreVO findObject(long objectId, DataObjectType type, long dataStoreId, DataStoreRole role) {
- SearchCriteriaService<ObjectInDataStoreVO, ObjectInDataStoreVO> sc = SearchCriteria2.create(ObjectInDataStoreVO.class);
- sc.addAnd(sc.getEntity().getObjectId(), Op.EQ, objectId);
- sc.addAnd(sc.getEntity().getDataStoreId(), Op.EQ, dataStoreId);
- sc.addAnd(sc.getEntity().getObjectType(), Op.EQ, type);
- sc.addAnd(sc.getEntity().getDataStoreRole(), Op.EQ, role);
- sc.addAnd(sc.getEntity().getState(), Op.NIN, ObjectInDataStoreStateMachine.State.Destroyed,
- ObjectInDataStoreStateMachine.State.Failed);
- ObjectInDataStoreVO objectStoreVO = sc.find();
- return objectStoreVO;
+ public TemplateInfo findTemplate(TemplateInfo template, DataStore dataStore) {
+ // TODO Auto-generated method stub
+ return null;
}
@Override
- public boolean update(DataObject data, Event event) throws NoTransitionException {
- ObjectInDataStoreVO obj = this.findObject(data.getId(), data.getType(),
- data.getDataStore().getId(), data.getDataStore().getRole());
- if (obj == null) {
- throw new CloudRuntimeException("can't find mapping in ObjectInDataStore table for: " + data);
- }
+ public VolumeInfo findVolume(VolumeInfo volume, DataStore dataStore) {
+ // TODO Auto-generated method stub
+ return null;
+ }
- return this.stateMachines.transitTo(obj, event, null, objectDataStoreDao);
+ @Override
+ public SnapshotInfo findSnapshot(SnapshotInfo snapshot, DataStore dataStore) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean update(TemplateInfo vo, Event event) {
+ // TODO Auto-generated method stub
+ return false;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java
index a6ba9bc..cf4f879 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java
@@ -20,17 +20,15 @@ package org.apache.cloudstack.storage.datastore;
import java.util.List;
-import org.apache.cloudstack.engine.subsystem.api.storage.CommandResult;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.disktype.DiskFormat;
+import org.apache.cloudstack.engine.subsystem.api.storage.disktype.VolumeDiskType;
import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
+import org.apache.cloudstack.storage.EndPoint;
+import org.apache.cloudstack.storage.command.CommandResult;
import org.apache.cloudstack.storage.image.TemplateInfo;
-import org.apache.cloudstack.storage.snapshot.SnapshotInfo;
-import org.apache.cloudstack.storage.volume.PrimaryDataStoreDriver;
+import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
+import org.apache.cloudstack.storage.to.VolumeTO;
import org.apache.cloudstack.storage.volume.TemplateOnPrimaryDataStoreInfo;
public interface PrimaryDataStore extends DataStore, PrimaryDataStoreInfo {
@@ -38,28 +36,27 @@ public interface PrimaryDataStore extends DataStore, PrimaryDataStoreInfo {
List<VolumeInfo> getVolumes();
-/* void deleteVolumeAsync(VolumeInfo volume, AsyncCompletionCallback<CommandResult> callback);
+ void deleteVolumeAsync(VolumeInfo volume, AsyncCompletionCallback<CommandResult> callback);
void createVolumeAsync(VolumeInfo vo, VolumeDiskType diskType, AsyncCompletionCallback<CommandResult> callback);
+ VolumeInfo createVoluemFromBaseImage(VolumeInfo volume, TemplateOnPrimaryDataStoreInfo templateStore);
+
void createVoluemFromBaseImageAsync(VolumeInfo volume, TemplateInfo templateStore, AsyncCompletionCallback<CommandResult> callback);
- */
+
+ List<EndPoint> getEndPoints();
- boolean exists(DataObject data);
+ boolean exists(VolumeInfo vi);
- TemplateInfo getTemplate(long templateId);
-
- SnapshotInfo getSnapshot(long snapshotId);
+ boolean templateExists(TemplateInfo template);
+ TemplateOnPrimaryDataStoreInfo getTemplate(TemplateInfo template);
- DiskFormat getDefaultDiskType();
+ boolean installTemplate(TemplateOnPrimaryDataStoreInfo template);
-/* void takeSnapshot(SnapshotInfo snapshot,
- AsyncCompletionCallback<CommandResult> callback);
+ VolumeDiskType getDefaultDiskType();
- void revertSnapshot(SnapshotInfo snapshot,
- AsyncCompletionCallback<CommandResult> callback);
+ PrimaryDataStoreTO getDataStoreTO();
- void deleteSnapshot(SnapshotInfo snapshot,
- AsyncCompletionCallback<CommandResult> callback);*/
+ VolumeTO getVolumeTO(VolumeInfo volume);
}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreProviderManager.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreProviderManager.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreProviderManager.java
deleted file mode 100644
index a60ec7a..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStoreProviderManager.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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;
-
-import org.apache.cloudstack.storage.volume.PrimaryDataStoreDriver;
-
-
-public interface PrimaryDataStoreProviderManager {
- public PrimaryDataStore getPrimaryDataStore(long dataStoreId);
-
- boolean registerDriver(String uuid, PrimaryDataStoreDriver driver);
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java
new file mode 100644
index 0000000..03c0a07
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/TemplateInDataStore.java
@@ -0,0 +1,58 @@
+// 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;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.disktype.VolumeDiskType;
+import org.apache.cloudstack.storage.db.ObjectInDataStoreVO;
+import org.apache.cloudstack.storage.image.TemplateInfo;
+import org.apache.cloudstack.storage.image.store.ImageDataStoreInfo;
+
+public class TemplateInDataStore implements TemplateInfo {
+ public TemplateInDataStore(TemplateInfo template, DataStore dataStore, ObjectInDataStoreVO obj) {
+
+ }
+ @Override
+ public ImageDataStoreInfo getDataStore() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public long getId() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public VolumeDiskType getDiskType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getPath() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getUuid() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/VolumeDataFactory.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/VolumeDataFactory.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/VolumeDataFactory.java
deleted file mode 100644
index 0cffc05..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/VolumeDataFactory.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
-
-public interface VolumeDataFactory {
- VolumeInfo getVolume(long volumeId, DataStore store);
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderDao.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderDao.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderDao.java
deleted file mode 100644
index dca83ce..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderDao.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.db;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface DataStoreProviderDao extends GenericDao<DataStoreProviderVO, Long> {
- public DataStoreProviderVO findByName(String name);
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderDaoImpl.java
deleted file mode 100644
index ccb6b48..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderDaoImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.db;
-
-import org.springframework.stereotype.Component;
-
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchCriteria2;
-import com.cloud.utils.db.SearchCriteriaService;
-import com.cloud.utils.db.SearchCriteria.Op;
-
-@Component
-class DataStoreProviderDaoImpl extends GenericDaoBase<DataStoreProviderVO, Long> implements DataStoreProviderDao {
-
- @Override
- public DataStoreProviderVO findByName(String name) {
- SearchCriteriaService<DataStoreProviderVO, DataStoreProviderVO> sc = SearchCriteria2.create(DataStoreProviderVO.class);
- sc.addAnd(sc.getEntity().getName(), Op.EQ, name);
- return sc.find();
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderVO.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderVO.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderVO.java
deleted file mode 100644
index dcdafdd..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderVO.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.db;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
-
-@Entity
-@Table(name = "data_store_provider")
-public class DataStoreProviderVO {
- @Id
- @TableGenerator(name = "data_store_provider_sq", table = "sequence", pkColumnName = "name", valueColumnName = "value", pkColumnValue = "data_store_provider_seq", allocationSize = 1)
- @Column(name = "id", updatable = false, nullable = false)
- private long id;
-
- @Column(name = "name", nullable = false)
- private String name;
-
- @Column(name = "uuid", nullable = false)
- private String uuid;
-
- public long getId() {
- return id;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- public String getUuid() {
- return this.uuid;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/110465b5/engine/storage/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
deleted file mode 100644
index 24a5c79..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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.db;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.cloudstack.storage.datastore.DataStoreStatus;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface PrimaryDataStoreDao extends GenericDao<PrimaryDataStoreVO, Long> {
-
- /**
- * @param datacenterId
- * -- the id of the datacenter (availability zone)
- */
- List<PrimaryDataStoreVO> listByDataCenterId(long datacenterId);
-
- /**
- * @param datacenterId
- * -- the id of the datacenter (availability zone)
- */
- List<PrimaryDataStoreVO> listBy(long datacenterId, long podId, Long clusterId);
-
- /**
- * Set capacity of storage pool in bytes
- *
- * @param id
- * pool id.
- * @param capacity
- * capacity in bytes
- */
- void updateCapacity(long id, long capacity);
-
- /**
- * Set available bytes of storage pool in bytes
- *
- * @param id
- * pool id.
- * @param available
- * available capacity in bytes
- */
- void updateAvailable(long id, long available);
-
- PrimaryDataStoreVO persist(PrimaryDataStoreVO pool, Map<String, String> details);
-
- /**
- * Find pool by name.
- *
- * @param name
- * name of pool.
- * @return the single StoragePoolVO
- */
- List<PrimaryDataStoreVO> findPoolByName(String name);
-
- /**
- * Find pools by the pod that matches the details.
- *
- * @param podId
- * pod id to find the pools in.
- * @param details
- * details to match. All must match for the pool to be returned.
- * @return List of StoragePoolVO
- */
- List<PrimaryDataStoreVO> findPoolsByDetails(long dcId, long podId, Long clusterId, Map<String, String> details);
-
- List<PrimaryDataStoreVO> findPoolsByTags(long dcId, long podId, Long clusterId, String[] tags, Boolean shared);
-
- /**
- * Find pool by UUID.
- *
- * @param uuid
- * uuid of pool.
- * @return the single StoragePoolVO
- */
- PrimaryDataStoreVO findPoolByUUID(String uuid);
-
- List<PrimaryDataStoreVO> listByStorageHost(String hostFqdnOrIp);
-
- PrimaryDataStoreVO findPoolByHostPath(long dcId, Long podId, String host, String path, String uuid);
-
- List<PrimaryDataStoreVO> listPoolByHostPath(String host, String path);
-
- void updateDetails(long poolId, Map<String, String> details);
-
- Map<String, String> getDetails(long poolId);
-
- List<String> searchForStoragePoolDetails(long poolId, String value);
-
- List<PrimaryDataStoreVO> findIfDuplicatePoolsExistByUUID(String uuid);
-
- List<PrimaryDataStoreVO> listByStatus(DataStoreStatus status);
-
- long countPoolsByStatus(DataStoreStatus... statuses);
-
- List<PrimaryDataStoreVO> listByStatusInZone(long dcId, DataStoreStatus status);
-
- List<PrimaryDataStoreVO> listPoolsByCluster(long clusterId);
-}
\ No newline at end of file