use of com.zimbra.cs.volume.VolumeServiceException in project zm-mailbox by Zimbra.
the class CreateVolume method redo.
@Override
public void redo() throws Exception {
VolumeManager mgr = VolumeManager.getInstance();
try {
Volume vol = mgr.getVolume(id);
if (vol != null) {
mLog.info("Volume already exists id=%d", id);
return;
}
} catch (VolumeServiceException e) {
if (e.getCode() != VolumeServiceException.NO_SUCH_VOLUME) {
throw e;
}
}
try {
Volume volume = Volume.builder().setId(id).setType(type).setName(name).setPath(rootPath, false).setMboxGroupBits(mboxGroupBits).setMboxBit(mboxBits).setFileGroupBits(fileGroupBits).setFileBits(fileBits).setCompressBlobs(compressBlobs).setCompressionThreshold(compressionThreshold).build();
mgr.create(volume, getUnloggedReplay());
} catch (VolumeServiceException e) {
if (e.getCode() == VolumeServiceException.ALREADY_EXISTS) {
mLog.info("Volume already exists id=%d", id);
} else {
throw e;
}
}
}
use of com.zimbra.cs.volume.VolumeServiceException in project zm-mailbox by Zimbra.
the class DeleteVolume method redo.
@Override
public void redo() throws Exception {
VolumeManager mgr = VolumeManager.getInstance();
try {
// make sure it exists
mgr.getVolume(mId);
mgr.delete(mId, getUnloggedReplay());
} catch (VolumeServiceException e) {
if (e.getCode() != VolumeServiceException.NO_SUCH_VOLUME) {
throw e;
}
}
}
Aggregations