Package org.apache.sling.pipes
Interface PipeBuilder
-
@ProviderType public interface PipeBuilderBuilder and Runner of a pipe, based on a fluent API, for script and java usage.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PipeBuilder$(String expr)attach a sling query find pipe to the current contextPipeBuilderacls()attach an ACL pipe to the current contextPipeBuilderallow(String expr)attach an ACL pipe to the current context and sets allow acls on the resourcePipeBuilderauth(Object... conf)attach an authorizable pipe to the current contextPipeBuilderbindings(Object... bindings)Adds binding to current pipePipebuild()builds a configured pipe.Pipebuild(String path)builds a configured pipe.PipeBuilderchildren(String expr)attach a sling query children pipe to the current contextPipeBuilderclosest(String expr)attach a sling query closest pipe to the current contextPipeBuilderconf(Object... properties)Building up a set of configurations for the current pipePipeBuildercsv(String expr)attach a csv pipe to the current contextPipeBuilderdeny(String expr)attach an ACL pipe to the current context and sets deny acls on the resourcePipeBuilderecho(String path)attach a base pipe to the current contextPipeBuilderegrep(String expr)attach a Regexp pipe to the current contextPipeBuilderexpr(String value)set an expr configuration to the current pipe in the contextPipeBuildergrep(Object... conf)attach a filter pipe to the current contextPipeBuilderjson(String expr)attach a json pipe to the current contextPipeBuildermkdir(String expr)Attach a path pipe to the current contextPipeBuildermp()attach a MULTI value property pipe to the current contextPipeBuildermv(String expr)attach a move pipe to the current contextPipeBuildername(String name)sets a pipe name, important in case you want to reuse it in another expressionPipeBuildernot(String expr)attach a not pipe to the current contextPipeBuilderoutputs(String... keys)add outputs passed keyPipeBuilderparent()attach a sling query parent pipe to the current contextPipeBuilderparents(String expr)attach a sling query parents pipe to the current contextPipeBuilderpath(String value)set a path configuration to the current pipe in the contextPipeBuilderpipe(String type)attach a new pipe to the current contextPipeBuilderpkg(String expr)attach a package pipe, in filter collection mode as defaultPipeBuilderref(String expr)attach a reference pipe to the current contextPipeBuilderrm()attach a rm pipe to the current contextExecutionResultrun()builds and run configured pipeExecutionResultrun(Map<String,Object> bindings)allow execution of a pipe, with more parameterorg.apache.sling.event.jobs.JobrunAsync(Map<String,Object> bindings)run a pipe asynchronouslyExecutionResultrunParallel(int numThreads, Map<String,Object> bindings)run referenced pipes in parallelExecutionResultrunWith(Object... bindings)allow execution of a pipe, with more parameterPipeBuildershallowRef(String expr)attach a shallow reference pipe to the current contextPipeBuildersiblings(String expr)attach a sling query siblings pipe to the current contextPipeBuildertraverse()attach a traverse pipe to the current contextPipeBuilderwith(Object... params)parameterized current pipe in the contextPipeBuilderwithStrings(String... params)parameterized current pipe in the contextPipeBuilderwrite(Object... conf)attach a write pipe to the current contextPipeBuilderxpath(String expr)attach a xpath pipe to the current context
-
-
-
Method Detail
-
pipe
PipeBuilder pipe(String type)
attach a new pipe to the current context- Parameters:
type- resource type (should be registered by the plumber)- Returns:
- updated instance of PipeBuilder
-
mv
PipeBuilder mv(String expr)
attach a move pipe to the current context- Parameters:
expr- target of the resource to move- Returns:
- updated instance of PipeBuilder
-
write
PipeBuilder write(Object... conf) throws IllegalAccessException
attach a write pipe to the current context- Parameters:
conf- configuration parameters- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called with bad configuration
-
grep
PipeBuilder grep(Object... conf) throws IllegalAccessException
attach a filter pipe to the current context- Parameters:
conf- configuration parameters- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called with bad configuration
-
auth
PipeBuilder auth(Object... conf) throws IllegalAccessException
attach an authorizable pipe to the current context- Parameters:
conf- configuration key value pairs for authorizable (see pipe's doc)- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called with bad configuration
-
xpath
PipeBuilder xpath(String expr)
attach a xpath pipe to the current context- Parameters:
expr- xpath expression- Returns:
- updated instance of PipeBuilder
-
children
PipeBuilder children(String expr)
attach a sling query children pipe to the current context- Parameters:
expr- sling query expression- Returns:
- updated instance of PipeBuilder
-
siblings
PipeBuilder siblings(String expr)
attach a sling query siblings pipe to the current context- Parameters:
expr- sling query expression- Returns:
- updated instance of PipeBuilder
-
rm
PipeBuilder rm()
attach a rm pipe to the current context- Returns:
- updated instance of PipeBuilder
-
csv
PipeBuilder csv(String expr)
attach a csv pipe to the current context- Parameters:
expr- csv expr or URL or path in the resource tree- Returns:
- updated instance of PipeBuilder
-
json
PipeBuilder json(String expr)
attach a json pipe to the current context- Parameters:
expr- json expr or URL or path in the resource tree- Returns:
- updated instance of PipeBuilder
-
egrep
PipeBuilder egrep(String expr)
attach a Regexp pipe to the current context- Parameters:
expr- text expr or URL or path in the resource tree- Returns:
- updated instance of PipeBuilder
-
mkdir
PipeBuilder mkdir(String expr)
Attach a path pipe to the current context- Parameters:
expr- path to create- Returns:
- updated instance of PipeBuilder
-
echo
PipeBuilder echo(String path)
attach a base pipe to the current context- Parameters:
path- pipe path- Returns:
- updated instance of PipeBuilder
-
traverse
PipeBuilder traverse()
attach a traverse pipe to the current context- Returns:
- updated instance of PipeBuilder
-
parent
PipeBuilder parent()
attach a sling query parent pipe to the current context- Returns:
- updated instance of PipeBuilder
-
parents
PipeBuilder parents(String expr)
attach a sling query parents pipe to the current context- Parameters:
expr- expression- Returns:
- updated instance of PipeBuilder
-
closest
PipeBuilder closest(String expr)
attach a sling query closest pipe to the current context- Parameters:
expr- expression- Returns:
- updated instance of PipeBuilder
-
$
PipeBuilder $(String expr)
attach a sling query find pipe to the current context- Parameters:
expr- expression- Returns:
- updated instance of PipeBuilder
-
ref
PipeBuilder ref(String expr)
attach a reference pipe to the current context- Parameters:
expr- reference- Returns:
- updated instance of PipeBuilder
-
shallowRef
PipeBuilder shallowRef(String expr)
attach a shallow reference pipe to the current context- Parameters:
expr- reference- Returns:
- updated instance of PipeBuilder
-
pkg
PipeBuilder pkg(String expr)
attach a package pipe, in filter collection mode as default- Parameters:
expr- path of the pipe- Returns:
- updated instance of PipeBuilder
-
not
PipeBuilder not(String expr)
attach a not pipe to the current context- Parameters:
expr- reference- Returns:
- updated instance of PipeBuilder
-
mp
PipeBuilder mp()
attach a MULTI value property pipe to the current context- Returns:
- updated instance of PipeBuilder
-
acls
PipeBuilder acls() throws IllegalAccessException
attach an ACL pipe to the current context- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called with bad configuration
-
allow
PipeBuilder allow(String expr) throws IllegalAccessException
attach an ACL pipe to the current context and sets allow acls on the resource- Parameters:
expr- prinicipalName/AuthorizableId of the user to give allow privileges to- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called with bad configuration
-
deny
PipeBuilder deny(String expr) throws IllegalAccessException
attach an ACL pipe to the current context and sets deny acls on the resource- Parameters:
expr- prinicipalName/AuthorizableId of the user/group to give deny privileges to- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called with bad configuration
-
with
PipeBuilder with(Object... params) throws IllegalAccessException
parameterized current pipe in the context- Parameters:
params- key value pair of parameters- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called with wrong # of arguments
-
withStrings
PipeBuilder withStrings(String... params)
parameterized current pipe in the context- Parameters:
params- key value pair of parameters- Returns:
- updated instance of PipeBuilder
-
expr
PipeBuilder expr(String value) throws IllegalAccessException
set an expr configuration to the current pipe in the context- Parameters:
value- expression value- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called in a bad time
-
name
PipeBuilder name(String name) throws IllegalAccessException
sets a pipe name, important in case you want to reuse it in another expression- Parameters:
name- to overwrite default binding name (otherwise it will be "one", "two", ...)- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called before a pipe is configured
-
path
PipeBuilder path(String value) throws IllegalAccessException
set a path configuration to the current pipe in the context- Parameters:
value- path value- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called before a pipe is configured
-
conf
PipeBuilder conf(Object... properties) throws IllegalAccessException
Building up a set of configurations for the current pipe- Parameters:
properties- configuration key value pairs (must be an even number of arguments)- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException- in case it's called in a bad time
-
bindings
PipeBuilder bindings(Object... bindings) throws IllegalAccessException
Adds binding to current pipe- Parameters:
bindings- bindings key value- Returns:
- updated instance of PipeBuilder
- Throws:
IllegalAccessException
-
outputs
PipeBuilder outputs(String... keys)
add outputs passed key- Parameters:
keys- properties of the outputs resource to output- Returns:
- current instance of PipeBuilder
-
build
Pipe build() throws org.apache.sling.api.resource.PersistenceException
builds a configured pipe. The configuration will be placed in a balanced tree under/var/pipes- Returns:
- Created (not executed) Pipe instance.
- Throws:
org.apache.sling.api.resource.PersistenceException- error occuring when saving the pipe configuration
-
build
Pipe build(String path) throws org.apache.sling.api.resource.PersistenceException
builds a configured pipe. The configuration will be placed underpath- Parameters:
path- path under which the generated configuration should be stored- Returns:
- Created (not executed) Pipe instance
- Throws:
org.apache.sling.api.resource.PersistenceException- error occuring when saving the pipe configuration
-
run
ExecutionResult run()
builds and run configured pipe- Returns:
- set of resource path, output of the pipe execution
-
run
ExecutionResult run(Map<String,Object> bindings)
allow execution of a pipe, with more parameter- Parameters:
bindings- additional bindings- Returns:
- set of resource path, output of the pipe execution
-
runWith
ExecutionResult runWith(Object... bindings)
allow execution of a pipe, with more parameter- Parameters:
bindings- additional bindings, should be key/value format- Returns:
- set of resource path, output of the pipe execution
-
runAsync
org.apache.sling.event.jobs.Job runAsync(Map<String,Object> bindings) throws org.apache.sling.api.resource.PersistenceException
run a pipe asynchronously- Parameters:
bindings- additional bindings for the execution (can be null)- Returns:
- registered job for the pipe execution
- Throws:
org.apache.sling.api.resource.PersistenceException- in case something goes wrong in the job creation
-
runParallel
ExecutionResult runParallel(int numThreads, Map<String,Object> bindings)
run referenced pipes in parallel- Parameters:
numThreads- number of threads to use for running the contained pipesbindings- additional bindings for the execution (can be null)- Returns:
- set of resource path, merged output of pipes execution (order is arbitrary)
-
-