T
- Concrete type of the instance to setuppublic abstract class Setup<T extends Setup<T>> extends Object
This class is responsible for
Modifier and Type | Field and Description |
---|---|
static String |
JVM_TRUST_MANAGER_PROVIDER
The name of the JVM trust manager provider provided in the config template.
|
Modifier and Type | Method and Description |
---|---|
T |
adminPort(int adminPort)
Specifies the administration port of the instance to setup.
|
T |
checkPortAvailability(boolean checkPortAvailability)
Specifies whether the port availability should be verified during the validation phase.
|
T |
console(SetupConsole console)
Specifies the
SetupConsole which be used to print information issued during setup. |
T |
disableHttpConnectionHandler()
Disables the HTTP connection handler.
|
T |
disableHttpSecureConnectionHandler()
Disables the HTTPS connection handler.
|
T |
enableWindowsService(boolean enableWindowsService)
Specifies whether the OpenDJ windows service should be enabled.
|
T |
fullyQualifiedHostName(String fullyQualifiedHostName)
Specifies the fully qualified hostname of the server to setup.
|
T |
httpPort(int httpPort)
Specifies that the http connection handler must be enabled and listening on the provided port.
|
T |
httpSecurePort(int httpSecurePort)
Specifies that the https connection handler must be enabled and listening on the provided port.
|
T |
installDirectory(Path installPath)
Specifies the path of the OpenDJ archive to use to setup the server instance.
|
T |
installDirectory(String installDirectory)
Specifies the path of the OpenDJ archive to use to setup the server instance.
|
T |
instanceDirectory(Path instancePath)
Specifies the path of the opendj instance to setup.
|
T |
instanceDirectory(String instanceDirectory)
Specifies the path of the OpenDJ instance to setup.
|
T |
productionModeEnabled(boolean enableProductionMode)
Specifies whether the setup should use hardened configuration for production use.
|
T |
rootUserDn(Dn rootUserDn)
Specifies the user root distinguish name of the instance to setup.
|
T |
rootUserDn(String rootUserDn)
Specifies the user root distinguish name of the instance to setup.
|
T |
rootUserPassword(String rootUserPassword)
Specifies the user root password of the instance to setup.
|
T |
secureWith(Security.KeyStoreComponent keyStoreComponent)
Specifies a way to secure the instance to install.
|
void |
setup()
Main method which will setup the server instance.
|
T |
startServer(boolean startServer)
Specifies whether the server should start during the setup process.
|
public static final String JVM_TRUST_MANAGER_PROVIDER
public final T adminPort(int adminPort) throws com.forgerock.opendj.cli.ArgumentException
This method must have been called with a non null
parameter before that the setup()
method is called since the administration port is a mandatory parameter.
adminPort
- The administration port numberSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the provided port number is invalid.
This exception can be throws if the port is already in use on the running machine,
this verification can be disabled using checkPortAvailability(boolean)
.public final T checkPortAvailability(boolean checkPortAvailability)
This option is enabled by default
checkPortAvailability
- false
if the port availability performed before setup should be disabledSetup
objectpublic final T enableWindowsService(boolean enableWindowsService) throws com.forgerock.opendj.cli.ArgumentException
This option will only have effect if the running OS is windows. By default, the windows service is disabled
enableWindowsService
- true
if the windows service should be enabledSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the running operating system is not windowspublic final T fullyQualifiedHostName(String fullyQualifiedHostName) throws com.forgerock.opendj.cli.ArgumentException
This method must have been called before that the setup()
method is called since the administration port is a mandatory parameter.
fullyQualifiedHostName
- The fully qualified hostname of the server to setupSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the provided value is invalidpublic final T httpPort(int httpPort) throws com.forgerock.opendj.cli.ArgumentException
By default, the http connection handler will be disabled.
httpPort
- The http connection handler listen portSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the provided port number is invalid.
This exception can be throws if the port is already in use on the running machine,
this verification can be disabled using checkPortAvailability(boolean)
.public final T disableHttpConnectionHandler()
By default, the HTTP connection handler is disabled.
FrontEndServerSetup
httpPort(int)
public final T httpSecurePort(int httpSecurePort) throws com.forgerock.opendj.cli.ArgumentException
By default, the https connection handler will be disabled.
httpSecurePort
- The https connection handler listen portSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the provided port number is invalid.
This exception can be throws if the port is already in use on the running machine,
this verification can be disabled using checkPortAvailability(boolean)
.public final T disableHttpSecureConnectionHandler()
By default, the HTTPS connection handler is disabled.
FrontEndServerSetup
httpSecurePort(int)
public final T installDirectory(String installDirectory) throws com.forgerock.opendj.cli.ArgumentException
By default, the running directory is used
installDirectory
- Path of the OpenDJ archive to use to setup the serverSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the provided path does not reference an existing directorypublic final T installDirectory(Path installPath) throws com.forgerock.opendj.cli.ArgumentException
By default, the running directory is used
installPath
- Path of the OpenDJ archive to use to setup the serverSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the provided path does not reference an existing directorypublic final T instanceDirectory(String instanceDirectory) throws com.forgerock.opendj.cli.ArgumentException
By default, the install directory will be used
instanceDirectory
- Path of the instance to setupSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the instance path does not reference a directory or if the parent path is invalid.public final T instanceDirectory(Path instancePath) throws com.forgerock.opendj.cli.ArgumentException
By default, the install directory will be used. If the instance directory does not exists, it will be created.
instancePath
- Path of the instance to setupSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the instance path does not reference a directory or if the parent path is invalid.public final T secureWith(Security.KeyStoreComponent keyStoreComponent) throws com.forgerock.opendj.cli.ArgumentException
By default, a PKCS#12 self signed certificate will be generated.
keyStoreComponent
- The keystore to used to secure the instance to setupSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If keystore can not be loaded or if aliases are wrong or ambiguousSecurity
,
Security.selfSignedCertificate()
,
Security.jksKeyStore(String, Security.PasswordProvider)
,
Security.jceksKeyStore(String, Security.PasswordProvider)
,
Security.pkcs12KeyStore(String, Security.PasswordProvider)
,
Security.pkcs11KeyStore(Security.PasswordProvider)
public final T rootUserDn(String rootUserDn) throws com.forgerock.opendj.cli.ArgumentException
By default, "cn=Directory Manager" will be used
public final T rootUserDn(Dn rootUserDn) throws com.forgerock.opendj.cli.ArgumentException
By default, "cn=Directory Manager" will be used
public final T rootUserPassword(String rootUserPassword) throws com.forgerock.opendj.cli.ArgumentException
This method must have been called before that the setup()
method is called since the root user password is a mandatory parameter.
rootUserPassword
- The password of the user root of the instance to setupSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the provided value is not acceptable as a passwordpublic T startServer(boolean startServer) throws com.forgerock.opendj.cli.ArgumentException
This attribute is true
by default
Note that depending on the setup options chosen, this parameter may be mandatory
startServer
- false
if the server should not start during the setup processSetup
objectcom.forgerock.opendj.cli.ArgumentException
- If the provided startServer
parameter is false
and the server must be started.public final T productionModeEnabled(boolean enableProductionMode)
This attribute is false
by default.
If this mode is enabled, the LDAP Connection Handler with always use StartTLS, overwriting user's choice.
enableProductionMode
- true
if the setup should use hardened configuration for production use.Setup
objectFrontEndServerSetup.ldapPort(int, boolean)
,
FrontEndServerSetup.ldapPort(int)
,
FrontEndServerSetup.enableStartTls(boolean)
public final T console(SetupConsole console)
SetupConsole
which be used to print information issued during setup.
No console will be used by default
console
- The setup consoleSetup
objectpublic final void setup() throws SetupException
Note that this method must be called only once all parameters have been set.
SetupException
- If an error occurs while setting up the serverCopyright 2010-2020 ForgeRock AS.