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_CLEANUP_ERROR
An error occurred cleaning up the service.
|
static int |
SERVICE_CLEANUP_MARKED_FOR_DELETION
The service is marked for deletion.
|
static int |
SERVICE_CLEANUP_SUCCESS
The service cleanup worked.
|
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_ERROR
An error occurred enabling the service.
|
static int |
SERVICE_ENABLE_SUCCESS
The service was successfully enabled.
|
static int |
SERVICE_MARKED_FOR_DELETION
The service is marked for deletion.
|
static int |
SERVICE_NAME_ALREADY_IN_USE
The service name was already in use.
|
static int |
SERVICE_NOT_FOUND
The service could not be found.
|
static int |
SERVICE_STATE_DISABLED
The service is disabled.
|
static int |
SERVICE_STATE_ENABLED
The service is enabled.
|
static int |
SERVICE_STATE_ERROR
An error occurred checking the service state.
|
| Constructor and Description |
|---|
ConfigureWindowsService() |
| Modifier and Type | Method and Description |
|---|---|
static int |
cleanupService(String serviceName,
PrintStream out,
PrintStream err)
Cleans up a service for a given service name.
|
static int |
configureWindowsService(String[] args,
OutputStream outStream,
OutputStream errStream)
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 int |
enableService(PrintStream out,
PrintStream err,
String serviceName,
String serviceDescription)
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.
|
static int |
serviceState(PrintStream out,
PrintStream err)
Checks if OpenDJ is enabled as a windows service and if it is write the
serviceName in the output stream (if it is not null).
|
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_NAME_ALREADY_IN_USE
public static final int SERVICE_ENABLE_ERROR
public static final int SERVICE_DISABLE_SUCCESS
public static final int SERVICE_ALREADY_DISABLED
public static final int SERVICE_MARKED_FOR_DELETION
public static final int SERVICE_DISABLE_ERROR
public static final int SERVICE_STATE_ENABLED
public static final int SERVICE_STATE_DISABLED
public static final int SERVICE_STATE_ERROR
public static final int SERVICE_CLEANUP_SUCCESS
public static final int SERVICE_NOT_FOUND
public static final int SERVICE_CLEANUP_ERROR
public static final int SERVICE_CLEANUP_MARKED_FOR_DELETION
public ConfigureWindowsService()
public static void main(String[] args)
args - The command-line arguments provided to this program.public static int configureWindowsService(String[] args, OutputStream outStream, OutputStream errStream)
args - The command-line arguments provided to this program.outStream - the stream used to write the standard output.errStream - the stream used to write the error output.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 enableService(PrintStream out, PrintStream err, String serviceName, String serviceDescription)
out - the stream used to write the standard output.err - the stream used to write the error output.serviceName - the name of the service as it will appear in the registry.serviceDescription - the description of the service as it will appear in the registry.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 cleanupService(String serviceName, PrintStream out, PrintStream err)
serviceName - the service name to be cleaned up.out - the stream used to write the standard output.err - the stream used to write the error output.SERVICE_CLEANUP_SUCCESS,
SERVICE_NOT_FOUND,
SERVICE_MARKED_FOR_DELETION or
SERVICE_CLEANUP_ERROR depending on whether the service
could be found 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 int serviceState(PrintStream out, PrintStream err)
out - the stream used to write the standard output.err - the stream used to write the error output.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-2015 ForgeRock AS. All Rights Reserved.