public static class OakMachine.Builder extends Object
OakMachine
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
OakMachine |
build()
Construct a
OakMachine from the OakMachine.Builder state. |
OakMachine.Builder |
withEnablePreInstallHooks(boolean enablePreInstallHooks)
Set to
true to enable pre-install package install hooks for the scan. |
OakMachine.Builder |
withErrorListener(ErrorListener errorListener)
Set the single
ErrorListener for the scan. |
OakMachine.Builder |
withInitStage(InitStage... initStage)
Add a single instance of
InitStage (or more) to the scan. |
OakMachine.Builder |
withInitStages(List<InitStage> initStages)
Add a list of
InitStage s to the scan. |
OakMachine.Builder |
withInstallHookClassLoader(ClassLoader classLoader)
Provide a classloader to
ImportOptions.setHookClassLoader(ClassLoader) . |
OakMachine.Builder |
withInstallHookPolicy(InstallHookPolicy installHookPolicy)
Specify an InstallHookPolicy for the scan.
|
OakMachine.Builder |
withInstallHookProcessorFactory(org.apache.jackrabbit.vault.packaging.InstallHookProcessorFactory installHookProcessorFactory)
Provide an
InstallHookProcessorFactory . |
OakMachine.Builder |
withJcrCustomizer(OakMachine.JcrCustomizer jcrCustomizer)
Provide a function to customize the
Jcr builder prior to the scan. |
OakMachine.Builder |
withNodeStoreSupplier(Supplier<org.apache.jackrabbit.oak.spi.state.NodeStore> nodeStoreSupplier)
Specify a supplier that will produce a
NodeStore for the scan. |
OakMachine.Builder |
withPackagingService(org.apache.jackrabbit.vault.packaging.Packaging packagingService)
Provide a
Packaging service for use in retrieving a JcrPackageManager for an admin session. |
OakMachine.Builder |
withPreInstallPackage(File... preInstallPackage)
Deprecated.
1.3.1 pre-install packages are now handled as URIs
|
OakMachine.Builder |
withPreInstallPackages(List<File> preInstallPackages)
Deprecated.
1.3.1 pre-install packages are now handled as URIs
|
OakMachine.Builder |
withPreInstallUrl(URL... preInstallPackage)
Provide a list of package files to install before each scan.
|
OakMachine.Builder |
withPreInstallUrls(@NotNull List<URL> preInstallPackages)
Provide a list of package files to install before each scan.
|
OakMachine.Builder |
withProgressCheck(net.adamcin.oakpal.api.ProgressCheck... progressCheck)
Set a single instance of
ProgressCheck for the scan. |
OakMachine.Builder |
withProgressChecks(List<? extends net.adamcin.oakpal.api.ProgressCheck> progressChecks)
Set the list of
ProgressCheck s for the scan. |
OakMachine.Builder |
withProgressChecks(net.adamcin.oakpal.api.ProgressCheck... progressCheck)
Deprecated.
1.4.0 use
withProgressCheck(ProgressCheck...) instead. |
OakMachine.Builder |
withRepoInitProcesser(OakMachine.RepoInitProcessor repoInitProcesser)
Provide a RepoInitProcessor.
|
OakMachine.Builder |
withRunModes(Set<String> runModes)
Provide a set of simulated sling run modes.
|
OakMachine.Builder |
withSlingSimulator(SlingSimulatorBackend slingSimulator)
Provide a sling simulator
|
OakMachine.Builder |
withSubpackageSilencer(OakMachine.SubpackageSilencer subpackageSilencer)
Provide a predicate taking the subpackage PackageId as the first argument and the parent PackageId as the
second argument, returning true if events for the subpackage and any of ITS subpackages should be silenced
during the scan.
|
public OakMachine.Builder withPackagingService(org.apache.jackrabbit.vault.packaging.Packaging packagingService)
Packaging
service for use in retrieving a JcrPackageManager
for an admin session.
Currently only supported when using this in an OSGi context.
packagingService
- a specific service to use, configured with alternative package registries.public OakMachine.Builder withInitStage(InitStage... initStage)
InitStage
(or more) to the scan.initStage
- the init stagepublic OakMachine.Builder withInitStages(List<InitStage> initStages)
InitStage
s to the scan.initStages
- the list of init stagespublic OakMachine.Builder withProgressCheck(@NotNull net.adamcin.oakpal.api.ProgressCheck... progressCheck)
ProgressCheck
for the scan.progressCheck
- the progress checks@Deprecated public OakMachine.Builder withProgressChecks(net.adamcin.oakpal.api.ProgressCheck... progressCheck)
withProgressCheck(ProgressCheck...)
instead.ProgressCheck
for the scan.progressCheck
- the progress checkspublic OakMachine.Builder withProgressChecks(List<? extends net.adamcin.oakpal.api.ProgressCheck> progressChecks)
ProgressCheck
s for the scan.progressChecks
- the list of packageListenerspublic OakMachine.Builder withErrorListener(ErrorListener errorListener)
ErrorListener
for the scan.errorListener
- the error handler@Deprecated public OakMachine.Builder withPreInstallPackage(File... preInstallPackage)
ProgressCheck
, but errors raised are passed to
the ErrorListener
.preInstallPackage
- the list of pre-install package files@Deprecated public OakMachine.Builder withPreInstallPackages(List<File> preInstallPackages)
ProgressCheck
, but errors raised are passed to
the ErrorListener
.preInstallPackages
- the list of pre-install package filespublic OakMachine.Builder withPreInstallUrl(@NotNull URL... preInstallPackage)
ProgressCheck
, but errors raised are passed to
the ErrorListener
.preInstallPackage
- the list of pre-install package filespublic OakMachine.Builder withPreInstallUrls(@NotNull @NotNull List<URL> preInstallPackages)
ProgressCheck
, but errors raised are passed to
the ErrorListener
.preInstallPackages
- the list of pre-install package filespublic OakMachine.Builder withJcrCustomizer(OakMachine.JcrCustomizer jcrCustomizer)
Jcr
builder prior to the scan.jcrCustomizer
- the Jcr builder customization functionpublic OakMachine.Builder withInstallHookProcessorFactory(org.apache.jackrabbit.vault.packaging.InstallHookProcessorFactory installHookProcessorFactory)
InstallHookProcessorFactory
.installHookProcessorFactory
- the factorypublic OakMachine.Builder withInstallHookClassLoader(ClassLoader classLoader)
ImportOptions.setHookClassLoader(ClassLoader)
.classLoader
- the classloader to use for loading hookspublic OakMachine.Builder withEnablePreInstallHooks(boolean enablePreInstallHooks)
true
to enable pre-install package install hooks for the scan.enablePreInstallHooks
- true to enable pre-install package install hookspublic OakMachine.Builder withInstallHookPolicy(InstallHookPolicy installHookPolicy)
installHookPolicy
- the InstallHookPolicy to enforcepublic OakMachine.Builder withNodeStoreSupplier(Supplier<org.apache.jackrabbit.oak.spi.state.NodeStore> nodeStoreSupplier)
NodeStore
for the scan. By default,
MemoryNodeStore.MemoryNodeStore()
will be used (e.g. MemoryNodeStore::new
).
Note: OakMachine will call Supplier.get()
for every execution of OakMachine.scanPackage(File...)
.
Beyond the call to this supplier function, it is the client's responsibility to manage the external
NodeStore's state between scans when using the same OakMachine
instance.
nodeStoreSupplier
- the NodeStorepublic OakMachine.Builder withSubpackageSilencer(OakMachine.SubpackageSilencer subpackageSilencer)
subpackageSilencer
- a predicate taking the subpackage PackageId as the first argument and the parent
PackageId as the second argument, returning true if events for the subpackage and
any of ITS subpackages should be silenced during the scan.public OakMachine.Builder withRepoInitProcesser(OakMachine.RepoInitProcessor repoInitProcesser)
repoInitProcesser
- the repoinit processorpublic OakMachine.Builder withSlingSimulator(SlingSimulatorBackend slingSimulator)
slingSimulator
- the sling simulator backendpublic OakMachine.Builder withRunModes(Set<String> runModes)
runModes
- the set of sling run modespublic OakMachine build()
OakMachine
from the OakMachine.Builder
state.OakMachine
Copyright © 2017–2020. All rights reserved.