/*
* 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-2008 Sun Microsystems, Inc.
* Portions Copyright 2012-2015 ForgeRock AS.
*/
/**
* This class is used to know which is the status of the install.
* It is required to do an installation after the user has unzipped the zip file.
* The main goal of the class is to help identifying whether there is already
* something installed or not.
*
* This class assumes that we are running in the case of an offline install.
*/
public class CurrentInstallStatus
{
private boolean isInstalled;
private boolean canOverwriteCurrentInstall;
/** The constructor of a CurrentInstallStatus object. */
public CurrentInstallStatus()
{
{
}
if (dbFilesExist())
{
canOverwriteCurrentInstall = true;
}
if (configExists())
{
canOverwriteCurrentInstall = false;
isInstalled = true;
}
{
}
else if (isInstalled)
{
{
buf = new LocalizableMessageBuilder();
{
}
}
else
{
{
}
}
}
if (!isInstalled)
{
}
}
/**
* Indicates whether there is something installed or not.
*
* @return <CODE>true</CODE> if there is something installed under the
* binaries that we are running, or <CODE>false</CODE> if not.
*/
public boolean isInstalled()
{
return isInstalled;
}
/**
* Indicates can overwrite current install.
*
* @return <CODE>true</CODE> if there is something installed under the
* binaries that we are running and we can overwrite it and
* <CODE>false</CODE> if not.
*/
public boolean canOverwriteCurrentInstall()
{
return canOverwriteCurrentInstall;
}
/**
* Provides a localized message to be displayed to the user in HTML format
* informing of the installation status.
*
* @return an String in HTML format describing the status of the installation.
*/
{
return installationMsg;
}
private int getPort()
{
try {
} catch (IOException ioe) {
return -1;
}
}
/**
* Indicates whether there are database files under this installation.
*
* @return <CODE>true</CODE> if there are database files, or
* <CODE>false</CODE> if not.
*/
private boolean dbFilesExist()
{
}
/**
* Indicates whether there are config files under this installation.
*
* @return <CODE>true</CODE> if there are configuration files, or
* <CODE>false</CODE> if not.
*/
private boolean configExists()
{
}
}