Interface AcInstallationService
-
@ProviderType public interface AcInstallationService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description InstallationLogapply()Deprecated.useapply(InstallationOptions)insteadInstallationLogapply(InstallationOptions options)Applies the configuration.InstallationLogapply(String configurationRootPath)Deprecated.useapply(InstallationOptions)insteadInstallationLogapply(String[] restrictedToPaths)Deprecated.useapply(InstallationOptions)insteadInstallationLogapply(String configurationRootPath, String[] restrictedToPaths)Deprecated.useapply(InstallationOptions)insteadInstallationLogapply(String configurationRootPath, String[] restrictedToPaths, boolean skipIfConfigUnchanged)Deprecated.useapply(InstallationOptions)insteaddefault StringapplyAsynchronously(InstallationOptions options)Deprecated, for removal: This API element is subject to removal in a future version.useapplyAsynchronously(InstallationOptions, boolean)instead, this method is just a shortcut toapplyAsynchronously(InstallationOptions, boolean)with last argument set tofalse.StringapplyAsynchronously(InstallationOptions options, boolean isVerboseLoggingEnabled)Applies the configuration asynchronously.booleanattachLogListener(String jobId, BiConsumer<InstallationLogLevel,String> listener, Consumer<Boolean> finishListener)Deprecated, for removal: This API element is subject to removal in a future version.usepollLog(String, int, BiConsumer, Duration, Duration)instead, this one is no longer functional.booleanisRunning(String jobId)Checks if the asynchronous installation job with the given ID is running.booleanpollLog(String jobId, int offset, BiConsumer<Optional<Integer>,String> logConsumer, Duration timeOut, Duration pollInterval)Polls the log of an asynchronous installation job with the given ID until the job finishes or the timeout is reached.StringpurgeACL(String path)purges all acls of the node specified by path (no deletion of acls of subnodes)StringpurgeACLs(String path)Purges all acls of the node specified by path and all acls of all subnodesStringpurgeAuthorizables(String[] authorizableIds)Purges authorizable(s) and all respective aces from the system
-
-
-
Method Detail
-
applyAsynchronously
@Deprecated(since="4.0.0", forRemoval=true) default String applyAsynchronously(InstallationOptions options)
Deprecated, for removal: This API element is subject to removal in a future version.useapplyAsynchronously(InstallationOptions, boolean)instead, this method is just a shortcut toapplyAsynchronously(InstallationOptions, boolean)with last argument set tofalse.Applies the configuration asynchronously. Almost immediately returns a string with the ID of the started job. Only one execution at a time is allowed.- Parameters:
options- the installation options which further specify the installation- Returns:
- the job id
- Throws:
IllegalStateException- if another asynchronous installation is currently running- Since:
- 3.6.0
- See Also:
pollLog(String, int, BiConsumer, Duration, Duration)
-
applyAsynchronously
String applyAsynchronously(InstallationOptions options, boolean isVerboseLoggingEnabled)
Applies the configuration asynchronously. Almost immediately returns a string with the ID of the started job. Only one execution at a time is allowed.- Parameters:
options- the installation options which further specify the installationisVerboseLoggingEnabled- iftrue, the log will contain more details, otherwise it will be more concise- Returns:
- the job id
- Throws:
IllegalStateException- if another asynchronous installation is currently running- Since:
- 4.0.0
- See Also:
pollLog(String, int, BiConsumer, Duration, Duration)
-
attachLogListener
@Deprecated(since="4.0.0", forRemoval=true) boolean attachLogListener(String jobId, BiConsumer<InstallationLogLevel,String> listener, Consumer<Boolean> finishListener)
Deprecated, for removal: This API element is subject to removal in a future version.usepollLog(String, int, BiConsumer, Duration, Duration)instead, this one is no longer functional.Attaches the log listener callback to an installation triggered previously viaapplyAsynchronously(InstallationOptions).- Parameters:
jobId- the job id returned byapplyAsynchronously(InstallationOptions)listener- the listener to attach, receives the level and the message per each log messagefinishListener- the listener to attach, receives a boolean status indicating success or failure once the installation was finished- Returns:
trueif the listeners were attached successfully (i.e. an installation with the given executionId was triggered before and is still ongoing),falseotherwise- Since:
- 3.6.0
- See Also:
applyAsynchronously(InstallationOptions)
-
pollLog
boolean pollLog(String jobId, int offset, BiConsumer<Optional<Integer>,String> logConsumer, Duration timeOut, Duration pollInterval)
Polls the log of an asynchronous installation job with the given ID until the job finishes or the timeout is reached. This method is blocking. It may be called multiple times in case a previous execution returnedfalsedue to a timeout or temporary error. In that case make sure to set theoffsetparameter to the last known offset of the log messages.- Parameters:
jobId- the job id returned byapplyAsynchronously(InstallationOptions)offset- the offset of the last log message received, or0to start from the beginninglogConsumer- is called for each log message (may contain new lines), the first parameter is the optional offset of the log message (for deduplication), the second parameter is the log message itselftimeOut- the maximum time to wait for the job to finish, if the job does not finish within this time, the method returnsfalsepollInterval- the interval between polls of the log, if the job is still running, the method will wait for this duration before polling again- Returns:
trueif the logs were either polled successfully or the given job id is no longer running or invalid,falseif the job ran into a timeout or a temporary error
-
isRunning
boolean isRunning(String jobId)
Checks if the asynchronous installation job with the given ID is running.- Parameters:
jobId-- Returns:
trueif the job with the given ID is running,falseotherwise- Since:
- 3.6.1
-
apply
@Deprecated InstallationLog apply()
Deprecated.useapply(InstallationOptions)insteadApplies the full configuration as stored at the path configured at PID biz.netcentric.cq.tools.actool.impl.AcInstallationServiceImpl to the repository.- Returns:
- the installation log
-
apply
@Deprecated InstallationLog apply(String configurationRootPath)
Deprecated.useapply(InstallationOptions)insteadApplies the configuration as stored at the given configurationRootPath to the repository.- Parameters:
configurationRootPath- the root path for configuration files- Returns:
- the installation log
-
apply
@Deprecated InstallationLog apply(String[] restrictedToPaths)
Deprecated.useapply(InstallationOptions)insteadApplies parts of the configuration (based on given paths)- Parameters:
restrictedToPaths- only apply ACLs to root paths as given- Returns:
- the installation log
-
apply
@Deprecated InstallationLog apply(String configurationRootPath, String[] restrictedToPaths)
Deprecated.useapply(InstallationOptions)insteadApplies the configuration as stored at the given configurationRootPath to the repository, but only apply ACEs to given restrictedToPaths.- Parameters:
restrictedToPaths- only apply ACLs to root paths as givenconfigurationRootPath- the root path for configuration files- Returns:
- the installation log
-
apply
@Deprecated InstallationLog apply(String configurationRootPath, String[] restrictedToPaths, boolean skipIfConfigUnchanged)
Deprecated.useapply(InstallationOptions)insteadApplies the configuration as stored at the given configurationRootPath to the repository, but only apply ACEs to given restrictedToPaths.- Parameters:
restrictedToPaths- only apply ACLs to root paths as givenconfigurationRootPath- the root path for configuration filesskipIfConfigUnchanged- will check if the config is unchanged compared to last execution with same parameters- Returns:
- the installation log
-
apply
InstallationLog apply(InstallationOptions options)
Applies the configuration.- Parameters:
options- the installation options which further specify the installation- Returns:
- the installation log
- Since:
- 3.6.0
-
purgeACL
String purgeACL(String path)
purges all acls of the node specified by path (no deletion of acls of subnodes)- Parameters:
path- the path from which to purge the ACL- Returns:
- status message
-
purgeACLs
String purgeACLs(String path)
Purges all acls of the node specified by path and all acls of all subnodes- Parameters:
path- the path from which to purge the ACL (including those of all subnodes)- Returns:
- status message
-
-