public abstract class Installer extends GuiApplication
Application.ApplicationPrintStream, Application.ErrorPrintStream, Application.OutputPrintStream, Application.PointAdder
Modifier and Type | Field and Description |
---|---|
protected boolean |
canceled
When true indicates that the user has canceled this operation.
|
protected Set<InstallProgressStep> |
completedProgress
Set of progress steps that have been completed.
|
protected static String |
DEFAULT_CONFIG_CLASS_NAME
A static String that contains the class name of ConfigFileHandler.
|
static int |
MAX_PORT_VALUE
The maximum integer value that can be used for a port.
|
static int |
MIN_PORT_VALUE
The minimum integer value that can be used for a port.
|
static String |
ROOT_BACKEND_NAME
The name of the backend created on setup.
|
protected static String[] |
SELF_SIGNED_CERT_ALIASES
Aliases of self-signed certificates.
|
static 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.
|
formatter, installStatus, listenerDelegate
Constructor and Description |
---|
Installer()
Creates a default instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applicationPrintStreamReceived(String message)
Method that is invoked by the printstreams with the messages received
on operations such as start or import.
|
void |
cancel()
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.
|
boolean |
canFinish(WizardStep step)
Indicates whether or not the user is allowed to finish the wizard from
step . |
boolean |
canGoBack(WizardStep step)
Indicates whether or not the user is allowed to return to a previous
step from
step . |
boolean |
canGoForward(WizardStep step)
Indicates whether or not the user is allowed to move to a new
step from
step . |
void |
checkAbort()
Checks the value of
canceled field and throws an
ApplicationException if true. |
void |
closeClicked(WizardStep cStep,
QuickSetup qs)
Called when the user has clicked the 'close' button.
|
protected void |
configureReplication()
This method creates the replication configuration for the suffixes on the
the local server (and eventually in the remote servers) to synchronize
things.
|
protected void |
configureServer()
This methods configures the server based on the contents of the UserData
object provided in the constructor.
|
protected void |
createData()
This methods updates the data on the server based on the contents of the
UserData object provided in the constructor.
|
JPanel |
createFramePanel(QuickSetupDialog dlg)
Creates the main panel for the wizard dialog.
|
protected boolean |
createNotReplicatedSuffix()
Tells whether we must create a suffix that we are not going to replicate
with other servers or not.
|
protected void |
createReplicatedBackendsIfRequired()
This method configures the backends and suffixes that must be replicated.
|
UserData |
createUserData()
Creates a set of user data with default values.
|
QuickSetupStepPanel |
createWizardStepPanel(WizardStep step)
Creates a wizard panel given a specific step.
|
protected void |
enableWindowsService()
This methods enables this server as a Windows service.
|
boolean |
finishClicked(WizardStep cStep,
QuickSetup qs)
Called when the user has clicked the 'finish' button.
|
void |
forceToDisplay()
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.
|
LocalizableMessage |
getCloseButtonToolTip()
Gets the key for the close button's tool tip text.
|
protected int |
getConnectTimeout()
Returns the timeout to be used to connect in milliseconds.
|
ProgressStep |
getCurrentProgressStep()
Gets the current step.
|
int |
getExtraDialogHeight()
Gets the amount of addition pixels added to the height
of the tallest panel in order to size the wizard for
asthetic reasons.
|
LocalizableMessage |
getFinishButtonToolTip()
Gets the key for the finish button's tool tip text.
|
WizardStep |
getFinishedStep()
Gets the finished step in the wizard.
|
WizardStep |
getFirstWizardStep()
Returns the initial wizard step.
|
LocalizableMessage |
getFrameTitle()
Gets the frame title of the GUI application that will be used
in some operating systems.
|
protected String |
getHostPort(ServerDescriptor server)
Returns the host port representation of the server to be used in progress
and error messages.
|
ButtonName |
getInitialFocusButtonName()
Get the name of the button that will receive initial focus.
|
WizardStep |
getNextWizardStep(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.
|
WizardStep |
getPreviousWizardStep(WizardStep step)
Gets the previous step in the wizard given a current step.
|
LocalizableMessage |
getQuitButtonToolTip()
Gets the key for the quit button's tool tip text.
|
protected String |
getSelfSignedCertificatePwd()
Returns the self-signed certificate password used for this session.
|
protected String |
getSelfSignedKeystorePath()
Returns the keystore path to be used for generating a self-signed
certificate.
|
Set<? extends WizardStep> |
getWizardSteps()
Returns the set of wizard steps used in this application's wizard.
|
void |
initializeSuffix(InitialLdapContext ctx,
int replicaId,
String suffixDn,
boolean displayProgress,
String sourceServerDisplay)
Initializes a suffix with the contents of a replica that has a given
replication id.
|
protected void |
initializeSuffixes()
This method initialize the contents of the synchronized servers with the
contents of the first server we find.
|
protected void |
initSummaryMap(Map<ProgressStep,LocalizableMessage> hmSummary,
boolean isCli)
Updates the contents of the provided map with the localized summary
strings.
|
boolean |
isCancellable()
Indicates whether or not this application is capable of cancelling
the operation performed in the run method.
|
boolean |
isFinished()
Returns whether the installer has finished or not.
|
protected boolean |
isStartVerbose()
Returns
true if the start server must be launched in verbose
mode and false otherwise. |
boolean |
isSubStep(WizardStep step)
Indicates whether the provided
step is a sub step or not. |
boolean |
isVisible(WizardStep step,
QuickSetup qs)
Indicates whether the provided
step is visible or not
depending on the contents of the QuickSetup object that is provided. |
boolean |
isVisible(WizardStep step,
UserData userData)
Indicates whether the provided
step is visible or not
depending on the contents of the UserData object that is provided. |
protected boolean |
mustConfigureReplication()
Returns
true if we must configure replication and
false otherwise. |
protected boolean |
mustCreateAds()
Returns
true if we must create the ADS and false
otherwise. |
protected boolean |
mustInitializeSuffixes()
Returns
true if we must initialize suffixes and
false otherwise. |
protected boolean |
mustStart()
Returns
true if we must start the server and
false otherwise. |
protected boolean |
mustStop()
Returns
true if we must stop the server and false
otherwise. |
void |
nextClicked(WizardStep cStep,
QuickSetup qs)
Called when the user has clicked the 'next' button.
|
void |
previousClicked(WizardStep cStep,
QuickSetup qs)
Called when the user has clicked the 'previous' button.
|
void |
quitClicked(WizardStep cStep,
QuickSetup qs)
Called when the user has clicked the 'quit' button.
|
protected void |
setCurrentProgressStep(InstallProgressStep currentProgressStep)
Sets the current progress step of the installation process.
|
void |
setWizardDialogState(QuickSetupDialog dlg,
UserData userData,
WizardStep step)
Called when the user advances to new step in the wizard.
|
protected void |
uninstallServices()
Uninstalls installed services.
|
protected void |
updateADS()
This method updates the ADS contents (and creates the according suffixes).
|
protected void |
updateSummaryWithServerState(Map<ProgressStep,LocalizableMessage> hmSummary,
Boolean isCli)
Updates the messages in the summary with the state of the server.
|
void |
updateUserData(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.
|
void |
windowClosing(QuickSetupDialog dlg,
WindowEvent evt)
Called by the controller when the window is closing.
|
acceptCertificateForException, confirmCancel, finishOnLeft, getCurrentWizardStep, getFinishButtonLabel, getTab, getUserArguments, setDisplayedWizardStep, setQuickSetupDialog, setUserArguments
addProgressUpdateListener, create, getApplicationErrorStream, getApplicationOutputStream, getFormattedDone, getFormattedDoneWithLineBreak, getFormattedError, getFormattedError, getFormattedLog, getFormattedLogError, getFormattedProgress, getFormattedProgressWithLineBreak, getFormattedSuccess, getFormattedSummary, getFormattedWarning, getFormattedWithPoints, getInstallation, getInstallationPath, getInstancePath, getLineBreak, getMessage, getProgressMessageFormatter, getRatio, getRemoteConnection, getSummary, getTaskSeparator, getTrustManager, getUserData, isVerbose, notifyListeners, notifyListeners, notifyListenersDone, notifyListenersOfLog, notifyListenersOfLogAfterError, notifyListenersRatioChange, notifyListenersWithPoints, removeProgressUpdateListener, setCurrentInstallStatus, setInstallation, setNotifyListeners, setProgressMessageFormatter, setUserData
public static final int MIN_PORT_VALUE
public static final int MAX_PORT_VALUE
public static final String ROOT_BACKEND_NAME
protected boolean canceled
protected Set<InstallProgressStep> completedProgress
protected static final String DEFAULT_CONFIG_CLASS_NAME
protected static final String[] SELF_SIGNED_CERT_ALIASES
public static final int THRESHOLD_CLOCK_DIFFERENCE_WARNING
public Installer()
public boolean isCancellable()
Application
Application
as cancellable may control UI
elements like the presense of a cancel button while the operation
is being performed.
Applications marked as cancellable should override the
cancel
method in such a way as to undo whatever
actions have taken place in the run method up to that point.isCancellable
in class Application
public UserData createUserData()
Application
createUserData
in class Application
public void forceToDisplay()
GuiApplication
forceToDisplay
in class GuiApplication
public boolean canGoBack(WizardStep step)
GuiApplication
step
.canGoBack
in class GuiApplication
step
- WizardStep for which the the return value indicates whether
or not the user can return to a previous stepstep
public boolean canGoForward(WizardStep step)
GuiApplication
step
.canGoForward
in class GuiApplication
step
- WizardStep for which the the return value indicates whether
or not the user can move to a new stepstep
public boolean canFinish(WizardStep step)
GuiApplication
step
.canFinish
in class GuiApplication
step
- WizardStep for which the the return value indicates whether
or not the user can finish the wizardpublic boolean isSubStep(WizardStep step)
GuiApplication
step
is a sub step or not.isSubStep
in class GuiApplication
step
- WizardStep for which the return value indicates whether
or not is a sub step.step
is a
substep.public boolean isVisible(WizardStep step, UserData userData)
GuiApplication
step
is visible or not
depending on the contents of the UserData object that is provided.isVisible
in class GuiApplication
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.step
is
visible.public boolean isVisible(WizardStep step, QuickSetup qs)
GuiApplication
step
is visible or not
depending on the contents of the QuickSetup object that is provided.isVisible
in class GuiApplication
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.step
is
visible.public boolean finishClicked(WizardStep cStep, QuickSetup qs)
GuiApplication
finishClicked
in class GuiApplication
cStep
- WizardStep at which the user clicked the previous buttonqs
- QuickSetup controllerpublic void nextClicked(WizardStep cStep, QuickSetup qs)
GuiApplication
nextClicked
in class GuiApplication
cStep
- WizardStep at which the user clicked the next buttonqs
- QuickSetup controllerpublic void closeClicked(WizardStep cStep, QuickSetup qs)
GuiApplication
closeClicked
in class GuiApplication
cStep
- WizardStep at which the user clicked the close buttonqs
- QuickSetup controllerpublic boolean isFinished()
Application
isFinished
in class Application
true
if the install is finished or false
if not.public void cancel()
Application
isFinished
returns true so that the application can complete.cancel
in class Application
public void quitClicked(WizardStep cStep, QuickSetup qs)
GuiApplication
quitClicked
in class GuiApplication
cStep
- WizardStep at which the user clicked the quit buttonqs
- QuickSetup controllerpublic ButtonName getInitialFocusButtonName()
GuiApplication
getInitialFocusButtonName
in class GuiApplication
public JPanel createFramePanel(QuickSetupDialog dlg)
GuiApplication
createFramePanel
in class GuiApplication
dlg
- QuickSetupDialog usedpublic Set<? extends WizardStep> getWizardSteps()
GuiApplication
getWizardSteps
in class GuiApplication
public QuickSetupStepPanel createWizardStepPanel(WizardStep step)
GuiApplication
createWizardStepPanel
in class GuiApplication
step
- for which a panel representation should be createdstep
public void windowClosing(QuickSetupDialog dlg, WindowEvent evt)
GuiApplication
windowClosing
in class GuiApplication
dlg
- QuickSetupDialog that will be closingevt
- The event from the Window indicating closingpublic LocalizableMessage getCloseButtonToolTip()
GuiApplication
getCloseButtonToolTip
in class GuiApplication
public LocalizableMessage getQuitButtonToolTip()
GuiApplication
getQuitButtonToolTip
in class GuiApplication
public LocalizableMessage getFinishButtonToolTip()
GuiApplication
getFinishButtonToolTip
in class GuiApplication
public int getExtraDialogHeight()
GuiApplication
getExtraDialogHeight
in class GuiApplication
public void previousClicked(WizardStep cStep, QuickSetup qs)
GuiApplication
previousClicked
in class GuiApplication
cStep
- WizardStep at which the user clicked the previous buttonqs
- QuickSetup controllerpublic LocalizableMessage getFrameTitle()
GuiApplication
getFrameTitle
in class GuiApplication
public void setWizardDialogState(QuickSetupDialog dlg, UserData userData, WizardStep step)
GuiApplication
setWizardDialogState
in class GuiApplication
dlg
- QuickSetupDialog hosting the wizarduserData
- UserData representing the data specified by the userstep
- Step indicating the new current steppublic ProgressStep getCurrentProgressStep()
Application
getCurrentProgressStep
in class Application
public WizardStep getFirstWizardStep()
GuiApplication
getFirstWizardStep
in class GuiApplication
public WizardStep getNextWizardStep(WizardStep step)
GuiApplication
getNextWizardStep
in class GuiApplication
step
- Step the current steppublic LinkedHashSet<WizardStep> getOrderedSteps()
GuiApplication
getOrderedSteps
in class GuiApplication
public WizardStep getPreviousWizardStep(WizardStep step)
GuiApplication
getPreviousWizardStep
in class GuiApplication
step
- Step the current steppublic WizardStep getFinishedStep()
GuiApplication
getFinishedStep
in class GuiApplication
protected void uninstallServices()
protected void configureServer() throws ApplicationException
ApplicationException
- if something goes wrong.protected void createReplicatedBackendsIfRequired() throws ApplicationException
ApplicationException
- if something goes wrong.protected void configureReplication() throws ApplicationException
ApplicationException
- if something goes wrong.protected void enableWindowsService() throws ApplicationException
ApplicationException
- if something goes wrong.protected void initSummaryMap(Map<ProgressStep,LocalizableMessage> hmSummary, boolean isCli)
hmSummary
- the Map to be updated.isCli
- a boolean to indicate if the install is using CLI or GUIprotected void updateSummaryWithServerState(Map<ProgressStep,LocalizableMessage> hmSummary, Boolean isCli)
hmSummary
- the Map containing the messages.isCli
- a boolean to indicate if the install is using CLI or GUIpublic void checkAbort() throws ApplicationException
canceled
field 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.checkAbort
in class Application
ApplicationException
- thrown if canceled
public void updateUserData(WizardStep cStep, QuickSetup qs) throws UserDataException
updateUserData
in class GuiApplication
cStep
- the current step of the wizardqs
- QuickStart controllerUserDataException
- if the data provided by the user is not valid.protected void setCurrentProgressStep(InstallProgressStep currentProgressStep)
currentProgressStep
- the current progress step of the installation process.protected void createData() throws ApplicationException
ApplicationException
- if something goes wrong.protected void initializeSuffixes() throws ApplicationException
ApplicationException
- if something goes wrong.protected void updateADS() throws ApplicationException
ApplicationException
- if something goes wrong.protected boolean createNotReplicatedSuffix()
true
if we must create a new suffix and
false
otherwise.protected boolean mustConfigureReplication()
true
if we must configure replication and
false
otherwise.true
if we must configure replication and
false
otherwise.protected boolean mustCreateAds()
true
if we must create the ADS and false
otherwise.true
if we must create the ADS and false
otherwise.protected boolean mustStart()
true
if we must start the server and
false
otherwise.true
if we must start the server and
false
otherwise.protected boolean isStartVerbose()
true
if the start server must be launched in verbose
mode and false
otherwise. The verbose flag is not enough
because in the case where many entries have been imported, the startup
phase can take long.true
if the start server must be launched in verbose
mode and false
otherwise.protected boolean mustStop()
true
if we must stop the server and false
otherwise. The server might be stopped if the user asked not to start it at
the end of the installation and it was started temporarily to update its
configuration.true
if we must stop the server and false
otherwise.protected boolean mustInitializeSuffixes()
true
if we must initialize suffixes and
false
otherwise.true
if we must initialize suffixes and
false
otherwise.protected String getSelfSignedKeystorePath()
protected String getSelfSignedCertificatePwd()
createSelfSignedCertificatePwd()
the first time
this method is called.public void initializeSuffix(InitialLdapContext ctx, int replicaId, String suffixDn, boolean displayProgress, String sourceServerDisplay) throws ApplicationException, PeerNotFoundException
ctx
- the connection to the server whose suffix we want to initialize.replicaId
- the replication 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.ApplicationException
- if an unexpected error occurs.PeerNotFoundException
- if the replication mechanism cannot find a peer.protected String getHostPort(ServerDescriptor server)
server
- the ServerDescriptor.protected void applicationPrintStreamReceived(String message)
Application
applicationPrintStreamReceived
in class Application
message
- the message that has been receivedprotected int getConnectTimeout()
0
if there is no timeout.Copyright © 2010-2016 ForgeRock AS. All Rights Reserved.