| | |
| | | private Long historicalOperationId; |
| | | |
| | | /** |
| | | * SVN rev number of the current build. |
| | | * Information on the current build. |
| | | */ |
| | | private Integer currentVersion = null; |
| | | private BuildInformation currentVersion = null; |
| | | |
| | | /** |
| | | * Information on the staged build. |
| | | */ |
| | | private BuildInformation stagedVersion = null; |
| | | |
| | | /** |
| | | * New OpenDS bits. |
| | | */ |
| | | private Installation stagedInstallation = null; |
| | | |
| | | /** |
| | | * SVN rev number of the build in the stage directory. |
| | | */ |
| | | private Integer stagedVersion = null; |
| | | |
| | | private RemoteBuildManager remoteBuildManager = null; |
| | | |
| | | /** Set to true if the user decides to close the window while running. */ |
| | |
| | | LOG.log(Level.INFO, "recording upgrade history"); |
| | | setCurrentProgressStep(UpgradeProgressStep.RECORDING_HISTORY); |
| | | writeHistoricalRecord(historicalOperationId, |
| | | getCurrentVersion(), |
| | | getStagedVersion(), |
| | | getCurrentBuildInformation(), |
| | | getStagedBuildInformation(), |
| | | status, |
| | | note); |
| | | notifyListeners(formatter.getFormattedDone() + |
| | |
| | | } |
| | | |
| | | private Long writeInitialHistoricalRecord( |
| | | Integer fromVersion, |
| | | Integer toVersion) |
| | | BuildInformation fromVersion, |
| | | BuildInformation toVersion) |
| | | throws ApplicationException { |
| | | Long id; |
| | | try { |
| | |
| | | |
| | | private void writeHistoricalRecord( |
| | | Long id, |
| | | Integer from, |
| | | Integer to, |
| | | BuildInformation from, |
| | | BuildInformation to, |
| | | HistoricalRecord.Status status, |
| | | String note) |
| | | throws ApplicationException { |
| | |
| | | |
| | | private void initialize() throws ApplicationException { |
| | | try { |
| | | Integer fromVersion = getCurrentVersion(); |
| | | Integer toVersion = getStagedVersion(); |
| | | BuildInformation fromVersion = getCurrentBuildInformation(); |
| | | BuildInformation toVersion = getStagedBuildInformation(); |
| | | this.historicalOperationId = |
| | | writeInitialHistoricalRecord(fromVersion, toVersion); |
| | | |
| | |
| | | return new File(getUpgradeBackupDirectory(), "schema.custom.diff"); |
| | | } |
| | | |
| | | private Integer getCurrentVersion() { |
| | | private BuildInformation getCurrentBuildInformation() { |
| | | if (this.currentVersion == null) { |
| | | try { |
| | | currentVersion = getInstallation().getSvnRev(); |
| | | currentVersion = getInstallation().getBuildInformation(); |
| | | } catch (ApplicationException e) { |
| | | LOG.log(Level.INFO, "error trying to determine current version", e); |
| | | } |
| | |
| | | return currentVersion; |
| | | } |
| | | |
| | | private Integer getStagedVersion() { |
| | | private BuildInformation getStagedBuildInformation() { |
| | | if (stagedVersion == null) { |
| | | try { |
| | | stagedVersion = getStagedInstallation().getSvnRev(); |
| | | stagedVersion = getStagedInstallation().getBuildInformation(); |
| | | } catch (Exception e) { |
| | | LOG.log(Level.INFO, "error", e); |
| | | } |