public class ConfigureWindowsService extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LAUNCHER_OPTION
Option to be used when calling the launchers.
|
static int |
SERVICE_ALREADY_DISABLED
The service was already disabled.
|
static int |
SERVICE_ALREADY_ENABLED
The service was already enabled.
|
static int |
SERVICE_DISABLE_ERROR
An error occurred disabling the service.
|
static int |
SERVICE_DISABLE_SUCCESS
The service was successfully disabled.
|
static int |
SERVICE_ENABLE_SUCCESS
The service was successfully enabled.
|
static int |
SERVICE_STATE_ENABLED
The service is enabled.
|
Constructor and Description |
---|
ConfigureWindowsService() |
Modifier and Type | Method and Description |
---|---|
static int |
configureWindowsService(OutputStream outStream,
OutputStream errStream,
String... args)
Configures the Windows service for this instance on this machine.
|
static int |
disableService(PrintStream out,
PrintStream err)
Disables OpenDJ to run as a windows service.
|
static int |
enableService(PrintStream out,
PrintStream err)
Enables OpenDJ to run as a windows service.
|
static String |
getLauncherAdministratorBinaryFullPath()
Returns the full path of the executable that has a manifest requiring
administrator privileges used by this class to perform operations related
to the service.
|
static String |
getLauncherBinaryFullPath()
Returns the full path of the executable that has a manifest requiring
administrator privileges used by this class to perform operations related
to the service.
|
static void |
main(String[] args)
Configures the Windows service for this instance on this machine.
|
static int |
serviceState()
Checks if OpenDJ is enabled as a windows service.
|
public static final String LAUNCHER_OPTION
public static final int SERVICE_ENABLE_SUCCESS
public static final int SERVICE_ALREADY_ENABLED
public static final int SERVICE_DISABLE_SUCCESS
public static final int SERVICE_ALREADY_DISABLED
public static final int SERVICE_DISABLE_ERROR
public static final int SERVICE_STATE_ENABLED
public ConfigureWindowsService()
public static void main(String[] args)
args
- The command-line arguments provided to this program.public static int configureWindowsService(OutputStream outStream, OutputStream errStream, String... args)
outStream
- the stream used to write the standard output.errStream
- the stream used to write the error output.args
- The command-line arguments provided to this program.public static int enableService(PrintStream out, PrintStream err)
out
- the stream used to write the standard output.err
- the stream used to write the error output.SERVICE_ENABLE_SUCCESS
,
SERVICE_ENABLE_ERROR
,
SERVICE_NAME_ALREADY_IN_USE
or
SERVICE_ALREADY_ENABLED
depending on whether the
service could be enabled or not.public static int disableService(PrintStream out, PrintStream err)
out
- the stream used to write the standard output.err
- the stream used to write the error output.SERVICE_DISABLE_SUCCESS
,
SERVICE_DISABLE_ERROR
,
SERVICE_MARKED_FOR_DELETION
or
SERVICE_ALREADY_DISABLED
depending on whether the
service could be disabled or not.public static int serviceState()
SERVICE_STATE_ENABLED
,
SERVICE_STATE_DISABLED
or
SERVICE_STATE_ERROR
depending on the state of the
service.public static String getLauncherAdministratorBinaryFullPath()
public static String getLauncherBinaryFullPath()
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.