Package org.opends.quicksetup.installer
Class Installer
- java.lang.Object
-
- org.opends.quicksetup.Application
-
- org.opends.quicksetup.ui.GuiApplication
-
- org.opends.quicksetup.installer.Installer
-
- All Implemented Interfaces:
Runnable,ProgressNotifier
public class Installer extends GuiApplication
This is an abstract class that is in charge of actually performing the installation. It just takes a UserData object and based on that installs OpenDJ. When there is an update during the installation it will notify the ProgressUpdateListener objects that have been added to it. The notification will send a ProgressUpdateEvent. This class is supposed to be fully independent of the graphical layout. Note that we can use freely the class org.opends.server.util.SetupUtils as it is included in quicksetup.jar.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opends.quicksetup.Application
Application.ErrorPrintStream, Application.OutputPrintStream, Application.PointAdder
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_PORT_VALUEThe maximum integer value that can be used for a port.static intMIN_PORT_VALUEThe minimum integer value that can be used for a port.static StringROOT_BACKEND_NAMEThe name of the backend created on setup.static intTHRESHOLD_CLOCK_DIFFERENCE_WARNINGThe threshold in minutes used to know whether we must display a warning informing that there is a server clock difference between two servers whose contents are being replicated.-
Fields inherited from class org.opends.quicksetup.Application
formatter, installStatus, tempLogFile
-
-
Constructor Summary
Constructors Constructor Description Installer()Creates a default instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplicationPrintStreamReceived(String message)Method that is invoked by the printstreams with the messages received on operations such as start or import.voidcancel()Signals that the application should cancel a currently running operation as soon as possible and return the environment to the state prior to running the operation.booleancanFinish(WizardStep step)Indicates whether the user is allowed to finish the wizard fromstep.booleancanGoBack(WizardStep step)Indicates whether the user is allowed to return to a previous step fromstep.booleancanGoForward(WizardStep step)Indicates whether the user is allowed to move to a new step fromstep.voidcheckAbort()Checks the value ofcanceledfield and throws an ApplicationException if true.voidcloseClicked(WizardStep cStep, QuickSetup qs)Called when the user has clicked the 'close' button.JPanelcreateFramePanel(QuickSetupDialog dlg)Creates the main panel for the wizard dialog.UserDatacreateUserData()Creates a set of user data with default values.QuickSetupStepPanelcreateWizardStepPanel(WizardStep step)Creates a wizard panel given a specific step.booleanfinishClicked(WizardStep cStep, QuickSetup qs)Called when the user has clicked the 'finish' button.voidforceToDisplay()This method is called when we detected that there is something installed we inform of this to the user and the user wants to proceed with the installation destroying the contents of the data and the configuration in the current installation.ApplicationExceptiongetApplicationException()Returns the exception from the run() method, if any.org.forgerock.i18n.LocalizableMessagegetCloseButtonToolTip()Gets the key for the close button's tool tip text.ProgressStepgetCurrentProgressStep()Gets the current step.intgetExtraDialogHeight()Gets the amount of addition pixels added to the height of the tallest panel in order to size the wizard for asthetic reasons.org.forgerock.i18n.LocalizableMessagegetFinishButtonToolTip()Gets the key for the finish button's tool tip text.WizardStepgetFinishedStep()Gets the finished step in the wizard.WizardStepgetFirstWizardStep()Returns the initial wizard step.org.forgerock.i18n.LocalizableMessagegetFrameTitle()Gets the frame title of the GUI application that will be used in some operating systems.ButtonNamegetInitialFocusButtonName()Get the name of the button that will receive initial focus.StringgetInstallationPath()Returns the installation path.StringgetInstancePath()Returns the instance path.WizardStepgetNextWizardStep(WizardStep step)Gets the next step in the wizard given a current step.LinkedHashSet<WizardStep>getOrderedSteps()Returns the list of all the steps in an ordered manner.WizardStepgetPreviousWizardStep(WizardStep step)Gets the previous step in the wizard given a current step.org.forgerock.i18n.LocalizableMessagegetQuitButtonToolTip()Gets the key for the quit button's tool tip text.IntegergetRatio(ProgressStep status)Gets an integer representing the amount of processing this application still needs to perform as a ratio out of 100.org.forgerock.i18n.LocalizableMessagegetSummary(ProgressStep status)Gets an i18n'd string representing the summary of a give ProgressStep.ApplicationTrustManagergetTrustManager()Returns the trust manager that can be used to establish secure connections.Set<? extends WizardStep>getWizardSteps()Returns the set of wizard steps used in this application's wizard.voidinitializeSuffix(ConnectionWrapper conn, int replicaServerId, DN suffixDn, boolean displayProgress, HostPort sourceServerDisplay)Initializes a suffix with the contents of a replica that has a given replication id.booleanisCancellable()Indicates whether this application is capable of cancelling the operation performed in the run method.booleanisFinished()Returns whether the installer has finished or not.booleanisSubStep(WizardStep step)Indicates whether the providedstepis a sub step or not.booleanisVisible(WizardStep step, QuickSetup qs)Indicates whether the providedstepis visible or not depending on the contents of the QuickSetup object that is provided.booleanisVisible(WizardStep step, UserData userData)Indicates whether the providedstepis visible or not depending on the contents of the UserData object that is provided.voidnextClicked(WizardStep cStep, QuickSetup qs)Called when the user has clicked the 'next' button.voidpreviousClicked(WizardStep cStep, QuickSetup qs)Called when the user has clicked the 'previous' button.voidquitClicked(WizardStep cStep, QuickSetup qs)Called when the user has clicked the 'quit' button.voidrun()Actually performs the install in this thread.voidsetWizardDialogState(QuickSetupDialog dlg, UserData userData, WizardStep step)Called when the user advances to new step in the wizard.voidupdateUserData(WizardStep cStep, QuickSetup qs)These methods validate the data provided by the user in the panels and update the userData object according to that content.voidwindowClosing(QuickSetupDialog dlg, WindowEvent evt)Called by the controller when the window is closing.-
Methods inherited from class org.opends.quicksetup.ui.GuiApplication
acceptCertificateForException, confirmCancel, finishOnLeft, getCurrentWizardStep, getFinishButtonLabel, getTab, getUserArguments, setDisplayedWizardStep, setQuickSetupDialog, setUserArguments
-
Methods inherited from class org.opends.quicksetup.Application
addProgressUpdateListener, create, getApplicationErrorStream, getApplicationOutputStream, getFormattedDone, getFormattedDoneWithLineBreak, getFormattedError, getFormattedError, getFormattedLog, getFormattedLogError, getFormattedProgress, getFormattedProgressWithLineBreak, getFormattedSuccess, getFormattedSummary, getFormattedWarning, getFormattedWithPoints, getInstallation, getLineBreak, getMessage, getProgressMessageFormatter, getRemoteConnection, getTaskSeparator, getUserData, isVerbose, notifyListeners, notifyListeners, notifyListenersDone, notifyListenersRatioChange, notifyListenersWithPoints, openTempLogFile, removeProgressUpdateListener, setCurrentInstallStatus, setInstallation, setNotifyListeners, setProgressMessageFormatter, setTempLogFile, setUserData
-
-
-
-
Field Detail
-
MIN_PORT_VALUE
public static final int MIN_PORT_VALUE
The minimum integer value that can be used for a port.- See Also:
- Constant Field Values
-
MAX_PORT_VALUE
public static final int MAX_PORT_VALUE
The maximum integer value that can be used for a port.- See Also:
- Constant Field Values
-
ROOT_BACKEND_NAME
public static final String ROOT_BACKEND_NAME
The name of the backend created on setup.- See Also:
- Constant Field Values
-
THRESHOLD_CLOCK_DIFFERENCE_WARNING
public static final int THRESHOLD_CLOCK_DIFFERENCE_WARNING
The threshold in minutes used to know whether we must display a warning informing that there is a server clock difference between two servers whose contents are being replicated.- See Also:
- Constant Field Values
-
-
Method Detail
-
run
public void run()
Actually performs the install in this thread. The thread is blocked.
-
getRatio
public Integer getRatio(ProgressStep status)
Description copied from class:ApplicationGets an integer representing the amount of processing this application still needs to perform as a ratio out of 100.- Specified by:
getRatioin classApplication- Parameters:
status- ProgressStop for which a summary is needed- Returns:
- ProgressStep representing the current step
-
getSummary
public org.forgerock.i18n.LocalizableMessage getSummary(ProgressStep status)
Description copied from class:ApplicationGets an i18n'd string representing the summary of a give ProgressStep.- Specified by:
getSummaryin classApplication- Parameters:
status- ProgressStop for which a summary is needed- Returns:
- String representing the summary
-
getApplicationException
public ApplicationException getApplicationException()
Returns the exception from the run() method, if any.- Returns:
- the ApplicationException raised during the run() method, if any. null otherwise.
-
getInstallationPath
public String getInstallationPath()
Description copied from class:ApplicationReturns the installation path.- Specified by:
getInstallationPathin classApplication- Returns:
- the installation path.
-
getInstancePath
public String getInstancePath()
Description copied from class:ApplicationReturns the instance path.- Specified by:
getInstancePathin classApplication- Returns:
- the instance path.
-
isCancellable
public boolean isCancellable()
Description copied from class:ApplicationIndicates whether this application is capable of cancelling the operation performed in the run method. A cancellable operation should leave its environment in the same state as it was prior to running the operation (files deleted, changes backed out etc.). Marking anApplicationas cancellable may control UI elements like the presense of a cancel button while the operation is being performed. Applications marked as cancellable should override thecancelmethod in such a way as to undo whatever actions have taken place in the run method up to that point.- Specified by:
isCancellablein classApplication- Returns:
- boolean where true inidcates that the operation is cancellable
-
createUserData
public UserData createUserData()
Description copied from class:ApplicationCreates a set of user data with default values.- Overrides:
createUserDatain classApplication- Returns:
- UserData empty set of UserData
-
forceToDisplay
public void forceToDisplay()
Description copied from class:GuiApplicationThis method is called when we detected that there is something installed we inform of this to the user and the user wants to proceed with the installation destroying the contents of the data and the configuration in the current installation.- Overrides:
forceToDisplayin classGuiApplication
-
canGoBack
public boolean canGoBack(WizardStep step)
Description copied from class:GuiApplicationIndicates whether the user is allowed to return to a previous step fromstep.- Overrides:
canGoBackin classGuiApplication- Parameters:
step- WizardStep for which the the return value indicates whether or not the user can return to a previous step- Returns:
- boolean where true indicates the user can return to a previous
step from
step
-
canGoForward
public boolean canGoForward(WizardStep step)
Description copied from class:GuiApplicationIndicates whether the user is allowed to move to a new step fromstep.- Overrides:
canGoForwardin classGuiApplication- Parameters:
step- WizardStep for which the the return value indicates whether or not the user can move to a new step- Returns:
- boolean where true indicates the user can move to a new
step from
step
-
canFinish
public boolean canFinish(WizardStep step)
Description copied from class:GuiApplicationIndicates whether the user is allowed to finish the wizard fromstep.- Specified by:
canFinishin classGuiApplication- Parameters:
step- WizardStep for which the the return value indicates whether or not the user can finish the wizard- Returns:
- boolean where true indicates the user can finish the wizard
-
isSubStep
public boolean isSubStep(WizardStep step)
Description copied from class:GuiApplicationIndicates whether the providedstepis a sub step or not.- Overrides:
isSubStepin classGuiApplication- Parameters:
step- WizardStep for which the return value indicates whether or not is a sub step.- Returns:
- boolean where true indicates the provided
stepis a substep.
-
isVisible
public boolean isVisible(WizardStep step, UserData userData)
Description copied from class:GuiApplicationIndicates whether the providedstepis visible or not depending on the contents of the UserData object that is provided.- Overrides:
isVisiblein classGuiApplication- Parameters:
step- WizardStep for which the return value indicates whether or not is visible.userData- the UserData to be used to determine if the step is visible or not.- Returns:
- boolean where true indicates the provided
stepis visible.
-
isVisible
public boolean isVisible(WizardStep step, QuickSetup qs)
Description copied from class:GuiApplicationIndicates whether the providedstepis visible or not depending on the contents of the QuickSetup object that is provided.- Overrides:
isVisiblein classGuiApplication- Parameters:
step- WizardStep for which the return value indicates whether or not is visible.qs- the QuickSetup to be used to determine if the step is visible or not.- Returns:
- boolean where true indicates the provided
stepis visible.
-
finishClicked
public boolean finishClicked(WizardStep cStep, QuickSetup qs)
Description copied from class:GuiApplicationCalled when the user has clicked the 'finish' button.- Specified by:
finishClickedin classGuiApplication- Parameters:
cStep- WizardStep at which the user clicked the previous buttonqs- QuickSetup controller- Returns:
- boolean that the application uses to indicate the the application should be launched. If false, the application is responsible for updating the user data for the final screen and launching the application if this is the desired behavior.
-
nextClicked
public void nextClicked(WizardStep cStep, QuickSetup qs)
Description copied from class:GuiApplicationCalled when the user has clicked the 'next' button.- Specified by:
nextClickedin classGuiApplication- Parameters:
cStep- WizardStep at which the user clicked the next buttonqs- QuickSetup controller
-
closeClicked
public void closeClicked(WizardStep cStep, QuickSetup qs)
Description copied from class:GuiApplicationCalled when the user has clicked the 'close' button.- Overrides:
closeClickedin classGuiApplication- Parameters:
cStep- WizardStep at which the user clicked the close buttonqs- QuickSetup controller
-
isFinished
public boolean isFinished()
Description copied from class:ApplicationReturns whether the installer has finished or not.- Specified by:
isFinishedin classApplication- Returns:
trueif the install is finished orfalseif not.
-
cancel
public void cancel()
Description copied from class:ApplicationSignals that the application should cancel a currently running operation as soon as possible and return the environment to the state prior to running the operation. When finished backing out changes the application should make sure thatisFinishedreturns true so that the application can complete.- Specified by:
cancelin classApplication
-
quitClicked
public void quitClicked(WizardStep cStep, QuickSetup qs)
Description copied from class:GuiApplicationCalled when the user has clicked the 'quit' button.- Overrides:
quitClickedin classGuiApplication- Parameters:
cStep- WizardStep at which the user clicked the quit buttonqs- QuickSetup controller
-
getInitialFocusButtonName
public ButtonName getInitialFocusButtonName()
Description copied from class:GuiApplicationGet the name of the button that will receive initial focus.- Specified by:
getInitialFocusButtonNamein classGuiApplication- Returns:
- ButtonName of the button to receive initial focus
-
createFramePanel
public JPanel createFramePanel(QuickSetupDialog dlg)
Description copied from class:GuiApplicationCreates the main panel for the wizard dialog.- Overrides:
createFramePanelin classGuiApplication- Parameters:
dlg- QuickSetupDialog used- Returns:
- JPanel frame panel
-
getWizardSteps
public Set<? extends WizardStep> getWizardSteps()
Description copied from class:GuiApplicationReturns the set of wizard steps used in this application's wizard.- Specified by:
getWizardStepsin classGuiApplication- Returns:
- Set of Step objects representing wizard steps
-
createWizardStepPanel
public QuickSetupStepPanel createWizardStepPanel(WizardStep step)
Description copied from class:GuiApplicationCreates a wizard panel given a specific step.- Specified by:
createWizardStepPanelin classGuiApplication- Parameters:
step- for which a panel representation should be created- Returns:
- QuickSetupStepPanel for representing the
step
-
windowClosing
public void windowClosing(QuickSetupDialog dlg, WindowEvent evt)
Description copied from class:GuiApplicationCalled by the controller when the window is closing. The application can take application specific actions here.- Specified by:
windowClosingin classGuiApplication- Parameters:
dlg- QuickSetupDialog that will be closingevt- The event from the Window indicating closing
-
getCloseButtonToolTip
public org.forgerock.i18n.LocalizableMessage getCloseButtonToolTip()
Description copied from class:GuiApplicationGets the key for the close button's tool tip text.- Overrides:
getCloseButtonToolTipin classGuiApplication- Returns:
- String key of the text in the resource bundle
-
getQuitButtonToolTip
public org.forgerock.i18n.LocalizableMessage getQuitButtonToolTip()
Description copied from class:GuiApplicationGets the key for the quit button's tool tip text.- Overrides:
getQuitButtonToolTipin classGuiApplication- Returns:
- String key of the text in the resource bundle
-
getFinishButtonToolTip
public org.forgerock.i18n.LocalizableMessage getFinishButtonToolTip()
Description copied from class:GuiApplicationGets the key for the finish button's tool tip text.- Overrides:
getFinishButtonToolTipin classGuiApplication- Returns:
- String key of the text in the resource bundle
-
getExtraDialogHeight
public int getExtraDialogHeight()
Description copied from class:GuiApplicationGets the amount of addition pixels added to the height of the tallest panel in order to size the wizard for asthetic reasons.- Overrides:
getExtraDialogHeightin classGuiApplication- Returns:
- int height to add
-
previousClicked
public void previousClicked(WizardStep cStep, QuickSetup qs)
Description copied from class:GuiApplicationCalled when the user has clicked the 'previous' button.- Specified by:
previousClickedin classGuiApplication- Parameters:
cStep- WizardStep at which the user clicked the previous buttonqs- QuickSetup controller
-
getFrameTitle
public org.forgerock.i18n.LocalizableMessage getFrameTitle()
Description copied from class:GuiApplicationGets the frame title of the GUI application that will be used in some operating systems.- Specified by:
getFrameTitlein classGuiApplication- Returns:
- internationalized String representing the frame title
-
setWizardDialogState
public void setWizardDialogState(QuickSetupDialog dlg, UserData userData, WizardStep step)
Description copied from class:GuiApplicationCalled when the user advances to new step in the wizard. Applications are expected to manipulate the QuickSetupDialog to reflect the current step.- Specified by:
setWizardDialogStatein classGuiApplication- Parameters:
dlg- QuickSetupDialog hosting the wizarduserData- UserData representing the data specified by the userstep- Step indicating the new current step
-
getCurrentProgressStep
public ProgressStep getCurrentProgressStep()
Description copied from class:ApplicationGets the current step.- Specified by:
getCurrentProgressStepin classApplication- Returns:
- ProgressStep representing the current step
-
getFirstWizardStep
public WizardStep getFirstWizardStep()
Description copied from class:GuiApplicationReturns the initial wizard step.- Specified by:
getFirstWizardStepin classGuiApplication- Returns:
- Step representing the first step to show in the wizard
-
getNextWizardStep
public WizardStep getNextWizardStep(WizardStep step)
Description copied from class:GuiApplicationGets the next step in the wizard given a current step.- Specified by:
getNextWizardStepin classGuiApplication- Parameters:
step- Step the current step- Returns:
- Step the next step
-
getOrderedSteps
public LinkedHashSet<WizardStep> getOrderedSteps()
Description copied from class:GuiApplicationReturns the list of all the steps in an ordered manner. This is required because in the case of an application with substeps the user of the other interfaces is not enough. This is a default implementation that uses the getNextWizardStep method to calculate the list that work for applications with no substeps.- Overrides:
getOrderedStepsin classGuiApplication- Returns:
- a list containing ALL the steps (including substeps) in an ordered manner.
-
getPreviousWizardStep
public WizardStep getPreviousWizardStep(WizardStep step)
Description copied from class:GuiApplicationGets the previous step in the wizard given a current step.- Specified by:
getPreviousWizardStepin classGuiApplication- Parameters:
step- Step the current step- Returns:
- Step the previous step
-
getFinishedStep
public WizardStep getFinishedStep()
Description copied from class:GuiApplicationGets the finished step in the wizard.- Specified by:
getFinishedStepin classGuiApplication- Returns:
- Step the finished step
-
getTrustManager
public ApplicationTrustManager getTrustManager()
Description copied from class:ApplicationReturns the trust manager that can be used to establish secure connections.- Overrides:
getTrustManagerin classApplication- Returns:
- the trust manager that can be used to establish secure connections.
-
checkAbort
public void checkAbort() throws ApplicationExceptionChecks the value ofcanceledfield and throws an ApplicationException if true. This indicates that the user has canceled this operation and the process of aborting should begin as soon as possible.- Overrides:
checkAbortin classApplication- Throws:
ApplicationException- thrown ifcanceled
-
updateUserData
public void updateUserData(WizardStep cStep, QuickSetup qs) throws UserDataException
These methods validate the data provided by the user in the panels and update the userData object according to that content.- Specified by:
updateUserDatain classGuiApplication- Parameters:
cStep- the current step of the wizardqs- QuickStart controller- Throws:
UserDataException- if the data provided by the user is not valid.
-
initializeSuffix
public void initializeSuffix(ConnectionWrapper conn, int replicaServerId, DN suffixDn, boolean displayProgress, HostPort sourceServerDisplay) throws ApplicationException, PeerNotFoundException
Initializes a suffix with the contents of a replica that has a given replication id.- Parameters:
conn- the connection to the server whose suffix we want to initialize.replicaServerId- the server ID of the replica we want to use to initialize the contents of the suffix.suffixDn- the dn of the suffix.displayProgress- whether we want to display progress or not.sourceServerDisplay- the string to be used to represent the server that contains the data that will be used to initialize the suffix.- Throws:
ApplicationException- if an unexpected error occurs.PeerNotFoundException- if the replication mechanism cannot find a peer.
-
applicationPrintStreamReceived
protected void applicationPrintStreamReceived(String message)
Description copied from class:ApplicationMethod that is invoked by the printstreams with the messages received on operations such as start or import. This is done so that the application can parse this messages and display them.- Overrides:
applicationPrintStreamReceivedin classApplication- Parameters:
message- the message that has been received
-
-