InstallReviewPanel.java revision 6292beaede500c125091a84263ed7cda454ba299
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS.
*/
/**
* This is the panel that contains the Review Panel.
*
*/
public class InstallReviewPanel extends ReviewPanel {
private static final long serialVersionUID = -7356174829193265699L;
private JPanel bottomComponent;
private JCheckBox startCheckBox;
private JCheckBox enableWindowsServiceCheckBox;
private JLabel warningLabel;
private final LocalizableMessage DISPLAY_EQUIVALENT_COMMAND = INFO_REVIEW_DISPLAY_EQUIVALENT_COMMAND.get();
private JComponent cardLayoutPanel;
private JEditorPane equivalentCommandPane;
private UserData lastUserData;
/**
* Constructor of the panel.
*
* @param application
* Application represented by this panel the fields of the panel.
*/
{
super(application);
}
/** {@inheritDoc} */
{
setFieldValue(FieldName.SECURITY_OPTIONS, Utils.getSecurityOptionsString(userData.getSecurityOptions(), false));
{
}
final boolean standalone = userData.getReplicationOptions().getType() == DataReplicationOptions.Type.STANDALONE;
if (!standalone)
{
}
}
/**
* Creates and returns the instructions panel.
*
* @return the instructions panel.
*/
protected Component createInstructionsPanel()
{
instructionsPanel.setOpaque(false);
final LocalizableMessage[] values = {
};
{
{
}
});
return instructionsPanel;
}
/** {@inheritDoc} */
protected boolean requiresScroll()
{
return false;
}
/** {@inheritDoc} */
protected Component createInputPanel()
{
}
return panel;
}
/** {@inheritDoc} */
{
{
return getStartCheckBox().isSelected();
}
{
return getEnableWindowsServiceCheckBox().isSelected();
}
return null;
}
/** {@inheritDoc} */
protected LocalizableMessage getInstructions()
{
return INFO_REVIEW_PANEL_INSTRUCTIONS.get();
}
/** {@inheritDoc} */
protected LocalizableMessage getTitle()
{
return INFO_REVIEW_PANEL_TITLE.get();
}
private void updateInputPanel()
{
}
/** Create the components and populate the Maps. */
private void populateLabelAndFieldsMap()
{
{
}
}
{
}
{
}
{
}
{
final Map<ServerDescriptor, AuthenticationData> remotePorts = userInstallData.getRemoteWithNoReplicationPort();
&& !remotePorts.isEmpty())
{
final AuthenticationData authData = userInstallData.getReplicationOptions().getAuthenticationData();
final String serverToConnectDisplay = authData == null ? "" : authData.getHostName() + ":" + authData.getPort();
String s;
{
}
else
{
}
{
{
}
else
{
}
if (repPort.useSecureConnection())
{
}
else
{
}
}
{
}
}
else
{
}
}
{
final boolean defaultServer = userData.getDefaultJavaArguments(UserData.SERVER_SCRIPT_NAME).equals(serverArguments);
final boolean defaultImport = userData.getDefaultJavaArguments(UserData.IMPORT_SCRIPT_NAME).equals(importArguments);
if (defaultServer && defaultImport)
{
}
else if (defaultServer)
{
}
else if (defaultImport)
{
}
return INFO_USE_CUSTOM_SERVER_RUNTIME.get(serverArguments.getStringArguments()) + Constants.LINE_SEPARATOR
}
/**
* Returns and creates the fields panel.
*
* @return the fields panel.
*/
protected JPanel createFieldsPanel()
{
fieldsPanel.setOpaque(false);
cardLayoutPanel.setOpaque(false);
final JComponent p = createReadOnlyPanel();
scroll = new JScrollPane();
return fieldsPanel;
}
private JComponent createReadOnlyPanel()
{
new FieldName[] {
}
));
boolean isFirst = true;
{
isFirst = false;
}
return panel;
}
{
equivalentCommandPane.setOpaque(false);
return equivalentCommandPane;
}
/** {@inheritDoc} */
protected JComponent getBottomComponent()
{
if (bottomComponent == null)
{
bottomComponent.setOpaque(false);
if (isWindows())
{
}
}
return bottomComponent;
}
private JLabel getWarningLabel()
{
if (warningLabel == null)
{
}
return warningLabel;
}
private JCheckBox getStartCheckBox()
{
if (startCheckBox == null)
{
{
{
}
});
}
return startCheckBox;
}
private JCheckBox getEnableWindowsServiceCheckBox()
{
if (enableWindowsServiceCheckBox == null)
{
{
{
if (isWindows())
{
}
}
});
}
return enableWindowsServiceCheckBox;
}
/**
* Depending on whether we want to replicate or not, we do have to start the
* server temporarily to update its configuration and initialize data.
*/
private void checkStartWarningLabel()
{
if (visible)
{
}
}
{
{
}
{
{
sb.append(formatter.getFormattedProgress(INFO_INSTALL_ENABLE_REPLICATION_EQUIVALENT_COMMAND_LINE.get()));
}
{
sb.append(formatter.getFormattedProgress(INFO_INSTALL_ENABLE_REPLICATION_EQUIVALENT_COMMAND_LINES.get()));
}
{
}
{
sb.append(formatter.getFormattedProgress(INFO_INSTALL_INITIALIZE_REPLICATION_EQUIVALENT_COMMAND_LINE.get()));
}
{
sb.append(formatter.getFormattedProgress(INFO_INSTALL_INITIALIZE_REPLICATION_EQUIVALENT_COMMAND_LINES.get()));
}
final List<List<String>> dsReplicationCmdLines = getDsReplicationEquivalentCommandLines("initialize", userData);
{
}
}
else if (userData.getReplicationOptions().getType() == DataReplicationOptions.Type.FIRST_IN_TOPOLOGY)
{
.append(formatter.getFormattedProgress(INFO_INSTALL_ENABLE_REPLICATION_EQUIVALENT_COMMAND_LINES.get()));
{
}
}
&& !userData.getStartServer())
{
}
}
private void appendText(final StringBuilder sb, final HtmlProgressMessageFormatter formatter, CharSequence text)
{
}
{
final boolean defaultServer =
final boolean defaultImport =
if (!defaultServer)
{
}
if (!defaultImport)
{
}
{
}
{
}
}
{
return scriptName + ".java-args";
}
private String getJavaPropertiesFilePath()
{
return getPath(getPath(path, Installation.CONFIG_PATH_RELATIVE), Installation.DEFAULT_JAVA_PROPERTIES_FILE);
}
}