diff --git a/src/com/platform/controller/VolumeController.java b/src/com/platform/controller/VolumeController.java index a7144e33..b3f348a7 100644 --- a/src/com/platform/controller/VolumeController.java +++ b/src/com/platform/controller/VolumeController.java @@ -52,7 +52,7 @@ public class VolumeController extends BaseController{ @ResponseBody public String volumeDelete(HttpServletRequest res, HttpServletResponse req, @RequestBody VolumeEntity entity) throws Exception { - Configs.CONSOLE_LOGGER.error("/oracle/delete"); + Configs.CONSOLE_LOGGER.error("/volume/delete"); int rest = volumeService.delete(entity); if (rest == 1) { req.setStatus(200); diff --git a/src/com/platform/entities/VolumeEntity.java b/src/com/platform/entities/VolumeEntity.java index b562e9c1..2bac8a04 100644 --- a/src/com/platform/entities/VolumeEntity.java +++ b/src/com/platform/entities/VolumeEntity.java @@ -25,10 +25,10 @@ import java.util.List; public class VolumeEntity { /** volume总大小 */ - private double allSize; + private Double allSize; /** volume已使用大小 */ - private double usedSize; + private Double usedSize; /** volume名称 */ private String name; @@ -37,7 +37,7 @@ public class VolumeEntity { private String path; /** * exist,正常返回状态Started,Stopped,Created */ - private boolean status; + private Boolean status; private String type; @@ -50,28 +50,28 @@ public class VolumeEntity { /** * @return the allSize */ - public double getAllSize() { + public Double getAllSize() { return allSize; } /** * @param allSize the allSize to set */ - public void setAllSize(double allSize) { + public void setAllSize(Double allSize) { this.allSize = allSize; } /** * @return the usedSize */ - public double getUsedSize() { + public Double getUsedSize() { return usedSize; } /** * @param usedSize the usedSize to set */ - public void setUsedSize(double usedSize) { + public void setUsedSize(Double usedSize) { this.usedSize = usedSize; } @@ -107,14 +107,14 @@ public class VolumeEntity { /** * @return the status */ - public boolean isStatus() { + public Boolean isStatus() { return status; } /** * @param status the status to set */ - public void setStatus(boolean status) { + public void setStatus(Boolean status) { this.status = status; } diff --git a/src/com/platform/entities/VolumeForm.java b/src/com/platform/entities/VolumeForm.java index 5baab4fe..96002795 100644 --- a/src/com/platform/entities/VolumeForm.java +++ b/src/com/platform/entities/VolumeForm.java @@ -1,23 +1,124 @@ package com.platform.entities; +import java.util.ArrayList; import java.util.List; public class VolumeForm { +// +// List volumes; +// +// /** +// * @return the volumes +// */ +// public List getVolumes() { +// return volumes; +// } +// +// /** +// * @param volumes the volumes to set +// */ +// public void setVolumes(List volumes) { +// this.volumes = volumes; +// } + /** volume名称 */ + private String name; - List volumes; + /** 挂载点 */ + private String path; + + /** * exist,正常返回状态Started,Stopped,Created */ + private boolean status; + + private String type; + + /** volume树形目录 */ + private List folder = new ArrayList(); + + /** volume的 块 */ + private List brick = new ArrayList(); + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the path + */ + public String getPath() { + return path; + } + + /** + * @param path the path to set + */ + public void setPath(String path) { + this.path = path; + } + + /** + * @return the status + */ + public boolean isStatus() { + return status; + } + + /** + * @param status the status to set + */ + public void setStatus(boolean status) { + this.status = status; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the folder + */ + public List getFolder() { + return folder; + } + + /** + * @param folder the folder to set + */ + public void setFolder(List folder) { + this.folder = folder; + } /** - * @return the volumes + * @return the brick */ - public List getVolumes() { - return volumes; + public List getBrick() { + return brick; } /** - * @param volumes the volumes to set + * @param brick the brick to set */ - public void setVolumes(List volumes) { - this.volumes = volumes; + public void setBrick(List brick) { + this.brick = brick; } } diff --git a/src/com/platform/service/impl/GfsServiceImpl.java b/src/com/platform/service/impl/GfsServiceImpl.java index b4088827..670d756a 100644 --- a/src/com/platform/service/impl/GfsServiceImpl.java +++ b/src/com/platform/service/impl/GfsServiceImpl.java @@ -128,8 +128,8 @@ public class GfsServiceImpl implements IGfsService { if (null != path && path.size() > 0) { volume.setPath(path.get(0)); } - volume.setAllSize(volumeInfo.getVolumeAvailableSize(volumeName)); - volume.setUsedSize(volumeInfo.getVolumeUseSize(volumeName)); + volume.setAllSize((double) volumeInfo.getVolumeAvailableSize(volumeName)); + volume.setUsedSize((double) volumeInfo.getVolumeUseSize(volumeName)); // volume.setBrick(brick); if (null != volume.getPath()) { List list = new ArrayList(); diff --git a/src/com/platform/utils/ThreadVolume.java b/src/com/platform/utils/ThreadVolume.java index 640600d8..da84dca8 100644 --- a/src/com/platform/utils/ThreadVolume.java +++ b/src/com/platform/utils/ThreadVolume.java @@ -94,9 +94,9 @@ public class ThreadVolume extends Thread { if (null == volume.getPath()) { volume.setPath(""); } - volume.setAllSize(volumeInfo + volume.setAllSize((double) (volumeInfo .getVolumeAvailableSize(volumeName) - + volumeInfo.getVolumeUseSize(volumeName)); + + volumeInfo.getVolumeUseSize(volumeName))); // 状态Started,Stopped,Created String status = volumeInfo.getVolumeStatus(volumeName); if ("Started".equals(status)) { @@ -104,7 +104,7 @@ public class ThreadVolume extends Thread { } else { volume.setStatus(false); } - volume.setUsedSize(volumeInfo.getVolumeUseSize(volumeName)); + volume.setUsedSize((double) volumeInfo.getVolumeUseSize(volumeName)); volume.setType(volumeInfo.getVolumeType(volumeName)); // TODO 查询brick-- // 返回 ip:path