use of com.zimbra.soap.admin.message.GetVolumeRequest in project zm-mailbox by Zimbra.
the class VolumeCLI method setCurrentVolume.
private void setCurrentVolume() throws ParseException, SoapFaultException, IOException, ServiceException, NumberFormatException, HttpException {
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.");
}
use of com.zimbra.soap.admin.message.GetVolumeRequest in project zm-mailbox by Zimbra.
the class VolumeCLI method getVolume.
private void getVolume() throws IOException, ServiceException, HttpException {
if (id == null) {
GetAllVolumesRequest req = new GetAllVolumesRequest();
auth(auth);
GetAllVolumesResponse resp = JaxbUtil.elementToJaxb(getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(req)));
for (VolumeInfo vol : resp.getVolumes()) {
print(vol);
}
} else {
GetVolumeRequest req = new GetVolumeRequest(Short.parseShort(id));
auth(auth);
GetVolumeResponse resp = JaxbUtil.elementToJaxb(getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(req)));
print(resp.getVolume());
}
}
Aggregations