Search in sources :

Example 1 with SetCurrentVolumeRequest

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

the class VolumeCLI method setCurrentVolume.

private void setCurrentVolume() throws ParseException, SoapFaultException, IOException, ServiceException {
    if (id == null) {
        throw new ParseException("id is missing");
    }
    auth(auth);
    GetVolumeResponse resp = JaxbUtil.elementToJaxb(getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(new GetVolumeRequest(Short.valueOf(id)))));
    VolumeInfo vol = resp.getVolume();
    SetCurrentVolumeRequest req = new SetCurrentVolumeRequest(vol.getId(), vol.getType());
    getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(req));
    System.out.println("Volume " + id + " is now the current " + toTypeName(vol.getType()) + " volume.");
}
Also used : GetVolumeRequest(com.zimbra.soap.admin.message.GetVolumeRequest) GetVolumeResponse(com.zimbra.soap.admin.message.GetVolumeResponse) SetCurrentVolumeRequest(com.zimbra.soap.admin.message.SetCurrentVolumeRequest) VolumeInfo(com.zimbra.soap.admin.type.VolumeInfo) ParseException(org.apache.commons.cli.ParseException)

Example 2 with SetCurrentVolumeRequest

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

the class VolumeCLI method unsetCurrentSecondaryMessageVolume.

private void unsetCurrentSecondaryMessageVolume() throws SoapFaultException, IOException, ServiceException {
    SetCurrentVolumeRequest req = new SetCurrentVolumeRequest(Volume.ID_NONE, Volume.TYPE_MESSAGE_SECONDARY);
    auth(auth);
    getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(req));
    System.out.println("Turned off the current secondary message volume.");
}
Also used : SetCurrentVolumeRequest(com.zimbra.soap.admin.message.SetCurrentVolumeRequest)

Aggregations

SetCurrentVolumeRequest (com.zimbra.soap.admin.message.SetCurrentVolumeRequest)2 GetVolumeRequest (com.zimbra.soap.admin.message.GetVolumeRequest)1 GetVolumeResponse (com.zimbra.soap.admin.message.GetVolumeResponse)1 VolumeInfo (com.zimbra.soap.admin.type.VolumeInfo)1 ParseException (org.apache.commons.cli.ParseException)1