001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2006-2008 Sun Microsystems, Inc.
025 *      Portions Copyright 2014 ForgeRock AS
026 */
027
028package org.opends.quicksetup.event;
029
030import org.forgerock.i18n.LocalizableMessage;
031import org.opends.quicksetup.ProgressStep;
032
033/**
034 * The event that is generated when there is a change during the installation
035 * process (we get a new log message when starting the server, or we finished
036 * configuring the server for instance).
037 *
038 * In the current implementation this events are generated by the Installer
039 * objects and are notified to the objects implementing
040 * ProgressUpdateListener (QuickSetup object).
041 *
042 */
043public class ProgressUpdateEvent {
044  private ProgressStep step;
045
046  private Integer progressRatio;
047
048  private LocalizableMessage currentPhaseSummary;
049
050  private LocalizableMessage newLogs;
051
052  /**
053   * Constructor of the ProgressUpdateEvent.
054   * @param step the ProgressStep object describing in which step
055   * of the installation we are (configuring server, starting server, etc.)
056   * @param progressRatio the integer that specifies which percentage of
057 * the whole installation has been completed.
058   * @param currentPhaseSummary the localized summary message for the
059* current installation progress.
060   * @param newLogs the new log messages that we have for the installation.
061   */
062  public ProgressUpdateEvent(ProgressStep step,
063      Integer progressRatio, LocalizableMessage currentPhaseSummary, LocalizableMessage newLogs)
064  {
065    this.step = step;
066    this.progressRatio = progressRatio;
067    this.currentPhaseSummary = currentPhaseSummary;
068    this.newLogs = newLogs;
069  }
070
071  /**
072   * Gets a localized message summary describing the install progress
073   * status.
074   * @return the localized message summary describing the progress status.
075   */
076  public LocalizableMessage getCurrentPhaseSummary()
077  {
078    return currentPhaseSummary;
079  }
080
081  /**
082   * Gets the new logs for the install progress.
083   * @return the new logs for the current install progress.
084   */
085  public LocalizableMessage getNewLogs()
086  {
087    return newLogs;
088  }
089
090  /**
091   * Gets the progress ratio for the install progress.
092   * @return the progress ratio for the install progress.
093   */
094  public Integer getProgressRatio()
095  {
096    return progressRatio;
097  }
098
099  /**
100   * Gets the current progress step.
101   * @return the current progress step.
102   */
103  public ProgressStep getProgressStep()
104  {
105    return step;
106  }
107}