use of com.zimbra.soap.admin.message.GetVolumeResponse 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.GetVolumeResponse 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());
}
}
use of com.zimbra.soap.admin.message.GetVolumeResponse in project zm-mailbox by Zimbra.
the class GetVolume method handle.
private GetVolumeResponse handle(GetVolumeRequest req, Map<String, Object> ctx) throws ServiceException {
ZimbraSoapContext zsc = getZimbraSoapContext(ctx);
checkRight(zsc, ctx, Provisioning.getInstance().getLocalServer(), Admin.R_manageVolume);
Volume vol = VolumeManager.getInstance().getVolume(req.getId());
GetVolumeResponse resp = new GetVolumeResponse(vol.toJAXB());
return resp;
}
Aggregations