@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=false, mayInvoke=true) public class SetupUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BUILD_ID
Build ID.
|
static String |
BUILD_JAVA_VENDOR
The java vendor of the JVM used to build.
|
static String |
BUILD_JAVA_VERSION
The java version used to generate the build.
|
static String |
BUILD_JVM_VENDOR
The vendor of the JVM used to create the build.
|
static String |
BUILD_JVM_VERSION
The version of the JVM used to create the build.
|
static String |
BUILD_NUMBER
The build number.
|
static String |
BUILD_OS
The OS used during the build.
|
static String |
BUILD_USER
The user that generated the build.
|
static String |
DEBUG_BUILD
Debug build identifier.
|
static String |
FIX_IDS
Fix IDs associated with the build.
|
static String |
HOST_NAME_FILE
The relative path where the setup stores the name of the host the user
provides.
|
static String |
INCOMPATIBILITY_EVENTS
Incompatibilities found between builds (used by the upgrade tool).
|
static String |
LAZY_JAR_URLS
Java property used to know which are the jar files that must be downloaded
lazily.
|
static String |
LIBRARIES_PATH_RELATIVE
The relative path where all the libraries (jar files) are.
|
static String |
MAJOR_VERSION
Major version.
|
static String |
MINOR_VERSION
Minor version.
|
static String |
NAME
Product name.
|
static String |
OPENDJ_JAVA_ARGS
Specific environment variable used by the scripts to set java arguments.
|
static String |
OPENDJ_JAVA_HOME
Specific environment variable used by the scripts to find java.
|
static String |
POINT_VERSION
Point version of the product.
|
static String |
REVISION
Revision in VCS.
|
static String |
URL_REPOSITORY
The VCS url repository.
|
static String |
VERSION_QUALIFIER
The version qualifier.
|
static String |
ZIP_FILE_NAME
Java property used to know which is the name of the zip file that must
be unzipped and whose contents must be extracted during the Web Start
based setup.
|
Constructor and Description |
---|
SetupUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canUseAsPort(int port)
Returns
true if the provided port is free and we can use it,
false otherwise. |
static boolean |
canUseAsPort(String hostname,
int port)
Returns
true if the provided port is free and we can use it,
false otherwise. |
static char[] |
createSelfSignedCertificatePwd()
Returns a randomly generated password for a self-signed certificate
keystore.
|
static File |
createTemplateFile(Set<String> baseDNs,
int numEntries)
Creates a MakeLDIF template file using the provided information.
|
static File |
createTemplateFile(String baseDN,
int numEntries)
Creates a MakeLDIF template file using the provided information.
|
static void |
exportCertificate(CertificateManager certManager,
String alias,
String path)
Export a certificate in a file.
|
static String |
getHostNameForCertificate(String installationRoot)
Returns the host name to be used to create self-signed certificates.
|
static String |
getScriptPath(String script)
Returns the String that can be used to launch an script using Runtime.exec.
|
static boolean |
isPrivilegedPort(int port)
Returns
true if the provided port is a privileged port,
false otherwise. |
public static final String OPENDJ_JAVA_HOME
public static final String OPENDJ_JAVA_ARGS
public static final String LAZY_JAR_URLS
public static final String ZIP_FILE_NAME
public static final String LIBRARIES_PATH_RELATIVE
public static final String HOST_NAME_FILE
public static final String NAME
public static final String BUILD_ID
public static final String MAJOR_VERSION
public static final String MINOR_VERSION
public static final String POINT_VERSION
public static final String REVISION
public static final String URL_REPOSITORY
public static final String VERSION_QUALIFIER
public static final String INCOMPATIBILITY_EVENTS
public static final String FIX_IDS
public static final String DEBUG_BUILD
public static final String BUILD_OS
public static final String BUILD_USER
public static final String BUILD_JAVA_VERSION
public static final String BUILD_JAVA_VENDOR
public static final String BUILD_JVM_VERSION
public static final String BUILD_JVM_VENDOR
public static final String BUILD_NUMBER
public SetupUtils()
public static File createTemplateFile(String baseDN, int numEntries) throws IOException
baseDN
- The base DN for the data in the template file.numEntries
- The number of user entries the template file should
create.File
object that references the created template file.IOException
- If a problem occurs while writing the template file.public static File createTemplateFile(Set<String> baseDNs, int numEntries) throws IOException
baseDNs
- The base DNs for the data in the template file.numEntries
- The number of user entries the template file should
create.File
object that references the created template file.IOException
- If a problem occurs while writing the template file.public static boolean canUseAsPort(String hostname, int port)
true
if the provided port is free and we can use it,
false
otherwise.hostname
- the host name we are analyzing. Use null
to connect to any address.port
- the port we are analyzing.true
if the provided port is free and we can use it,
false
otherwise.public static boolean canUseAsPort(int port)
true
if the provided port is free and we can use it,
false
otherwise.port
- the port we are analyzing.true
if the provided port is free and we can use it,
false
otherwise.public static boolean isPrivilegedPort(int port)
true
if the provided port is a privileged port,
false
otherwise.port
- the port we are analyzing.true
if the provided port is a privileged port,
false
otherwise.public static String getScriptPath(String script)
script
- the script namepublic static char[] createSelfSignedCertificatePwd()
public static void exportCertificate(CertificateManager certManager, String alias, String path) throws CertificateEncodingException, IOException, KeyStoreException
certManager
- Certificate manager to use.alias
- Certificate alias to export. If null
the first certificate
defined will be exported.path
- Path of the output file.CertificateEncodingException
- If the certificate manager cannot encode the certificate.IOException
- If a problem occurs while creating or writing in the output file.KeyStoreException
- If the certificate manager cannot retrieve the certificate to be
exported.public static String getHostNameForCertificate(String installationRoot) throws UnknownHostException
InetAddress
is used.installationRoot
- the path where the server is installed.UnknownHostException
- if a host name could not be used.Copyright © 2010-2016 ForgeRock AS. All Rights Reserved.