Modifier and Type | Method and Description |
---|---|
static Path |
createBaseEntryTempFileToImport(List<org.forgerock.opendj.ldap.Dn> baseDns)
Creates a template LDIF file with provided entries.
|
static boolean |
serverAlreadyInstalled(Path instancePath)
Returns
true if there is already an OpenDJ instance set up in the provided Path . |
static org.forgerock.opendj.ldap.Dn |
validateDn(org.forgerock.opendj.ldap.Dn dn,
LocalizableMessageDescriptor.Arg0 emptyDnMsg)
Validates that the provided base DN represented is not empty and returns it.
|
static void |
validateInstanceLocFileNotPresent(Path installPath)
Ensures that there is no existing instance.loc file.
|
static int |
validateReplicationServer(HostPort rs,
org.forgerock.util.Options options,
String password)
Validates that the provided connection is bind to a replication server part of an existing topology and returns
the replication port of the server.
|
public static void validateInstanceLocFileNotPresent(Path installPath) throws SetupException
Creation of the instance.loc file is the setup tool responsibility, if an instance.loc file exists it means that either the setup has already been ran or that the user wants to use old setup tool behavior (see OPENDJ-3588).
installPath
- The install path of the server to setupSetupException
- If an existing instance.loc has been foundpublic static boolean serverAlreadyInstalled(Path instancePath)
true
if there is already an OpenDJ instance set up in the provided Path
.
A path is considered as OpenDJ instance if either a config or a db directory (or both) is present.
instancePath
- The instance path to testtrue
if there is already an OpenDJ instance set up in the provided Path
public static org.forgerock.opendj.ldap.Dn validateDn(org.forgerock.opendj.ldap.Dn dn, LocalizableMessageDescriptor.Arg0 emptyDnMsg) throws com.forgerock.opendj.cli.ArgumentException
dn
- The base DN to validate.emptyDnMsg
- The error message to throw with the ArgumentException
if the resolved base DN is empty.Dn
com.forgerock.opendj.cli.ArgumentException
- If the provided Dn
is emptypublic static Path createBaseEntryTempFileToImport(List<org.forgerock.opendj.ldap.Dn> baseDns) throws SetupException
baseDns
- The base DNs of entries to create in the LDIF file.Path
to the created temporary file.SetupException
- If an error occurs while creating the template file.public static int validateReplicationServer(HostPort rs, org.forgerock.util.Options options, String password) throws SetupException
rs
- The host name and administration port of the RS to validate.options
- The options to use to create the ConnectionFactory
for connecting to the RS.password
- The replication global administrator password.SetupException
- If the RS is not part of an existing topology.Copyright © 2010–2017 ForgeRock AS. All rights reserved.