use of com.zimbra.soap.admin.message.ModifyVolumeResponse in project zm-mailbox by Zimbra.
the class ModifyVolume method handle.
private ModifyVolumeResponse handle(ModifyVolumeRequest req, Map<String, Object> ctx) throws ServiceException {
ZimbraSoapContext zsc = getZimbraSoapContext(ctx);
checkRight(zsc, ctx, Provisioning.getInstance().getLocalServer(), Admin.R_manageVolume);
VolumeManager mgr = VolumeManager.getInstance();
Volume.Builder builder = Volume.builder(mgr.getVolume(req.getId()));
VolumeInfo vol = req.getVolume();
if (vol == null) {
throw ServiceException.INVALID_REQUEST("must specify a volume Element", null);
}
if (vol.getType() > 0) {
builder.setType(vol.getType());
}
if (vol.getName() != null) {
builder.setName(vol.getName());
}
if (vol.getRootPath() != null) {
builder.setPath(vol.getRootPath(), true);
}
if (vol.getCompressBlobs() != null) {
builder.setCompressBlobs(vol.getCompressBlobs());
}
if (vol.getCompressionThreshold() > 0) {
builder.setCompressionThreshold(vol.getCompressionThreshold());
}
mgr.update(builder.build());
return new ModifyVolumeResponse();
}
Aggregations