Search in sources :

Example 1 with DeleteVolumeResponse

use of com.zimbra.soap.admin.message.DeleteVolumeResponse in project zm-mailbox by Zimbra.

the class DeleteVolume method handle.

private DeleteVolumeResponse handle(DeleteVolumeRequest req, Map<String, Object> ctx) throws ServiceException {
    ZimbraSoapContext zsc = getZimbraSoapContext(ctx);
    checkRight(zsc, ctx, Provisioning.getInstance().getLocalServer(), Admin.R_manageVolume);
    VolumeManager mgr = VolumeManager.getInstance();
    // make sure the volume exists before doing anything heavyweight...
    mgr.getVolume(req.getId());
    StoreManager storeManager = StoreManager.getInstance();
    if (storeManager.supports(StoreManager.StoreFeature.CUSTOM_STORE_API, String.valueOf(req.getId()))) {
        throw ServiceException.INVALID_REQUEST("Operation unsupported, use zxsuite to delete this volume", null);
    }
    mgr.delete(req.getId());
    return new DeleteVolumeResponse();
}
Also used : VolumeManager(com.zimbra.cs.volume.VolumeManager) ZimbraSoapContext(com.zimbra.soap.ZimbraSoapContext) DeleteVolumeResponse(com.zimbra.soap.admin.message.DeleteVolumeResponse) StoreManager(com.zimbra.cs.store.StoreManager)

Aggregations

StoreManager (com.zimbra.cs.store.StoreManager)1 VolumeManager (com.zimbra.cs.volume.VolumeManager)1 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)1 DeleteVolumeResponse (com.zimbra.soap.admin.message.DeleteVolumeResponse)1