| | |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | | |
| | | import org.opends.quicksetup.BuildInformation; |
| | | |
| | | import java.util.StringTokenizer; |
| | | import java.util.EnumSet; |
| | | import java.util.Set; |
| | |
| | | static public HistoricalRecord fromString(String s) |
| | | throws IllegalArgumentException { |
| | | Long operationid = null; |
| | | Integer fromInt = null; |
| | | Integer toInt = null; |
| | | BuildInformation from = null; |
| | | BuildInformation to = null; |
| | | Status outcome = null; |
| | | Date date = null; |
| | | String note = null; |
| | |
| | | |
| | | token = st.nextToken(); |
| | | String fromString = token.substring(FROM.length()); |
| | | fromInt = new Integer(fromString); |
| | | from = BuildInformation.fromBuildString(fromString); |
| | | |
| | | token = st.nextToken(); |
| | | String toString = token.substring(TO.length()); |
| | | toInt = new Integer(toString); |
| | | to = BuildInformation.fromBuildString(fromString); |
| | | |
| | | token = st.nextToken(); |
| | | String outcomeString = token.substring(STATUS.length()); |
| | |
| | | LOG.log(Level.INFO, "error creating historical log record", e); |
| | | creationError = e; |
| | | } |
| | | return new HistoricalRecord(operationid, date, fromInt, |
| | | toInt, outcome, note, creationError); |
| | | return new HistoricalRecord(operationid, date, from, |
| | | to, outcome, note, creationError); |
| | | } |
| | | |
| | | private Long operationId; |
| | | |
| | | private Integer from; |
| | | private BuildInformation from; |
| | | |
| | | private Integer to; |
| | | private BuildInformation to; |
| | | |
| | | private Status status; |
| | | |
| | |
| | | * @param status of the upgrade |
| | | * @param note containing details of status; can be null |
| | | */ |
| | | public HistoricalRecord(Integer from, |
| | | Integer to, Status status, String note) { |
| | | public HistoricalRecord(BuildInformation from, |
| | | BuildInformation to, |
| | | Status status, String note) { |
| | | this.from = from; |
| | | this.to = to; |
| | | this.status = status; |
| | |
| | | * @param status of the upgrade |
| | | * @param note containing details of status; can be null |
| | | */ |
| | | public HistoricalRecord(Long operationId, Integer from, |
| | | Integer to, Status status, String note) { |
| | | public HistoricalRecord(Long operationId, |
| | | BuildInformation from, |
| | | BuildInformation to, |
| | | Status status, String note) { |
| | | this.from = from; |
| | | this.to = to; |
| | | this.status = status; |
| | |
| | | * @param creationError Exception that occurred while this record was |
| | | * being created |
| | | */ |
| | | private HistoricalRecord(Long operationId, Date date, Integer from, |
| | | Integer to, Status status, String note, |
| | | private HistoricalRecord(Long operationId, Date date, BuildInformation from, |
| | | BuildInformation to, Status status, String note, |
| | | Exception creationError) { |
| | | this.operationId = operationId; |
| | | this.from = from; |
| | |
| | | * Gets the Integer representing the SVN rev ID of the current installation. |
| | | * @return Integer version ID |
| | | */ |
| | | public Integer getFromVersion() { |
| | | public BuildInformation getFromVersion() { |
| | | return this.from; |
| | | } |
| | | |
| | |
| | | * upgraded to. |
| | | * @return Integer version ID |
| | | */ |
| | | public Integer getToVersion() { |
| | | public BuildInformation getToVersion() { |
| | | return this.to; |
| | | } |
| | | |
| | |
| | | .append(new SimpleDateFormat(DATE_FORMAT).format(date)) |
| | | .append(SEPARATOR) |
| | | .append(FROM) |
| | | .append(from) |
| | | .append(from.getBuildString()) |
| | | .append(SEPARATOR) |
| | | .append(TO) |
| | | .append(to) |
| | | .append(to.getBuildString()) |
| | | .append(SEPARATOR) |
| | | .append(STATUS) |
| | | .append(status); |