Search in sources :

Example 1 with GetCurrentVolumesResponse

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

the class GetCurrentVolumes method handle.

private GetCurrentVolumesResponse handle(@SuppressWarnings("unused") GetCurrentVolumesRequest req, Map<String, Object> ctx) throws ServiceException {
    ZimbraSoapContext zsc = getZimbraSoapContext(ctx);
    checkRight(zsc, ctx, Provisioning.getInstance().getLocalServer(), Admin.R_manageVolume);
    GetCurrentVolumesResponse resp = new GetCurrentVolumesResponse();
    VolumeManager mgr = VolumeManager.getInstance();
    Volume msgVol = mgr.getCurrentMessageVolume();
    if (msgVol != null) {
        resp.addVolume(new GetCurrentVolumesResponse.CurrentVolumeInfo(msgVol.getId(), msgVol.getType()));
    }
    Volume secondaryMsgVol = mgr.getCurrentSecondaryMessageVolume();
    if (secondaryMsgVol != null) {
        resp.addVolume(new GetCurrentVolumesResponse.CurrentVolumeInfo(secondaryMsgVol.getId(), secondaryMsgVol.getType()));
    }
    Volume indexVol = mgr.getCurrentIndexVolume();
    if (indexVol != null) {
        resp.addVolume(new GetCurrentVolumesResponse.CurrentVolumeInfo(indexVol.getId(), indexVol.getType()));
    }
    return resp;
}
Also used : VolumeManager(com.zimbra.cs.volume.VolumeManager) Volume(com.zimbra.cs.volume.Volume) ZimbraSoapContext(com.zimbra.soap.ZimbraSoapContext) GetCurrentVolumesResponse(com.zimbra.soap.admin.message.GetCurrentVolumesResponse)

Aggregations

Volume (com.zimbra.cs.volume.Volume)1 VolumeManager (com.zimbra.cs.volume.VolumeManager)1 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)1 GetCurrentVolumesResponse (com.zimbra.soap.admin.message.GetCurrentVolumesResponse)1