use of io.stackgres.apiweb.dto.cluster.ClusterDbOpsStatus in project stackgres by ongres.
the class ClusterTransformer method getDbOpsStatus.
private ClusterDbOpsStatus getDbOpsStatus(StackGresClusterDbOpsStatus source) {
if (source == null) {
return null;
}
ClusterDbOpsStatus transformation = new ClusterDbOpsStatus();
if (source.getRestart() != null) {
ClusterDbOpsRestartStatus transformationRestart = new ClusterDbOpsRestartStatus();
transformationRestart.setInitialInstances(source.getRestart().getInitialInstances());
transformationRestart.setPrimaryInstance(source.getRestart().getPrimaryInstance());
transformation.setRestart(transformationRestart);
}
if (source.getMinorVersionUpgrade() != null) {
ClusterDbOpsMinorVersionUpgradeStatus transformationMinorVersionUpgrade = new ClusterDbOpsMinorVersionUpgradeStatus();
transformationMinorVersionUpgrade.setInitialInstances(source.getMinorVersionUpgrade().getInitialInstances());
transformationMinorVersionUpgrade.setPrimaryInstance(source.getMinorVersionUpgrade().getPrimaryInstance());
transformation.setMinorVersionUpgrade(transformationMinorVersionUpgrade);
}
if (source.getSecurityUpgrade() != null) {
ClusterDbOpsSecurityUpgradeStatus transformationSecurityUpgrade = new ClusterDbOpsSecurityUpgradeStatus();
transformationSecurityUpgrade.setInitialInstances(source.getSecurityUpgrade().getInitialInstances());
transformationSecurityUpgrade.setPrimaryInstance(source.getSecurityUpgrade().getPrimaryInstance());
transformation.setSecurityUpgrade(transformationSecurityUpgrade);
}
if (source.getMajorVersionUpgrade() != null) {
ClusterDbOpsMajorVersionUpgradeStatus transformationMajorVersionUpgrade = new ClusterDbOpsMajorVersionUpgradeStatus();
transformationMajorVersionUpgrade.setInitialInstances(source.getMajorVersionUpgrade().getInitialInstances());
transformationMajorVersionUpgrade.setPrimaryInstance(source.getMajorVersionUpgrade().getPrimaryInstance());
transformationMajorVersionUpgrade.setSourcePostgresVersion(source.getMajorVersionUpgrade().getSourcePostgresVersion());
transformationMajorVersionUpgrade.setTargetPostgresVersion(source.getMajorVersionUpgrade().getTargetPostgresVersion());
transformationMajorVersionUpgrade.setCheck(source.getMajorVersionUpgrade().getCheck());
transformationMajorVersionUpgrade.setLink(source.getMajorVersionUpgrade().getLink());
transformationMajorVersionUpgrade.setClone(source.getMajorVersionUpgrade().getClone());
transformationMajorVersionUpgrade.setLocale(source.getMajorVersionUpgrade().getLocale());
transformationMajorVersionUpgrade.setEncoding(source.getMajorVersionUpgrade().getEncoding());
transformationMajorVersionUpgrade.setDataChecksum(source.getMajorVersionUpgrade().getDataChecksum());
transformation.setMajorVersionUpgrade(transformationMajorVersionUpgrade);
}
return transformation;
}
Aggregations