public static class RollbackSnapshotRsp extends AgentResponse { @Validation long size; public long getSize() { return size; } public void setSize(long size) { this.size = size; } }
private String validate(Object obj, Field f) { try { f.setAccessible(true); Object value = f.get(obj); Validation at = f.getAnnotation(Validation.class); if (at.notNull() && value == null) { return error(obj, f, "field can not be null"); } if (at.notZero() && TypeUtils.isTypeOf(value, Integer.TYPE, Integer.class, Long.TYPE, Long.class)) { if (value != null) { long intValue = Long.valueOf(value.toString()); if (intValue == 0) { return error(obj, f, "field can not be zero"); } } } return null; } catch (Exception e) { throw new CloudRuntimeException(e); } }
public static class RevertVolumeFromSnapshotRsp extends AgentRsp { @Validation public String newVolumeInstallPath; @Validation protected long size; }
public static class ReinitImageRsp extends AgentResponse { @Validation private String newVolumeInstallPath; public String getNewVolumeInstallPath() { return newVolumeInstallPath; } public void setNewVolumeInstallPath(String newVolumeInstallPath) { this.newVolumeInstallPath = newVolumeInstallPath; } }
public static class ReInitImageRsp extends NfsPrimaryStorageAgentResponse { @Validation private String newVolumeInstallPath; public String getNewVolumeInstallPath() { return newVolumeInstallPath; } public void setNewVolumeInstallPath(String newVolumeInstallPath) { this.newVolumeInstallPath = newVolumeInstallPath; } }
public static class ReInitImageRsp extends AgentRsp { @Validation public String newVolumeInstallPath; }
public static class RevertVolumeFromSnapshotResponse extends NfsPrimaryStorageAgentResponse { @Validation private String newVolumeInstallPath; @Validation private long size; public String getNewVolumeInstallPath() { return newVolumeInstallPath; } public void setNewVolumeInstallPath(String newVolumeInstallPath) { this.newVolumeInstallPath = newVolumeInstallPath; } public long getSize() { return size; } public void setSize(long size) { this.size = size; } }
public static class RevertVolumeFromSnapshotRsp extends AgentResponse { @Validation private String newVolumeInstallPath; @Validation private long size; public String getNewVolumeInstallPath() { return newVolumeInstallPath; } public void setNewVolumeInstallPath(String newVolumeInstallPath) { this.newVolumeInstallPath = newVolumeInstallPath; } public long getSize() { return size; } public void setSize(long size) { this.size = size; } }
public static class TakeSnapshotResponse extends AgentResponse { @Validation private String newVolumeInstallPath; @Validation private String snapshotInstallPath; @Validation(notZero = true) private long size; public long getSize() { return size; } public void setSize(long size) { this.size = size; } public String getSnapshotInstallPath() { return snapshotInstallPath; } public void setSnapshotInstallPath(String snapshotInstallPath) { this.snapshotInstallPath = snapshotInstallPath; } public String getNewVolumeInstallPath() { return newVolumeInstallPath; } public void setNewVolumeInstallPath(String newVolumeInstallPath) { this.newVolumeInstallPath = newVolumeInstallPath; } }