Package org.apache.sling.pipes

## Interface PipeBuilder

    @ProviderType
    public interface PipeBuilder

Builder and Runner of a pipe, based on a fluent API, for script and java usage.

### Method Summary

All Methods Instance Methods Abstract Methods
`PipeBuilder` `$​(String expr)` attach a sling query find pipe to the current context
`PipeBuilder` `acls()` attach an ACL pipe to the current context
`PipeBuilder` `allow​(String expr)` attach an ACL pipe to the current context and sets allow acls on the resource
`PipeBuilder` `auth​(Object... conf)` attach an authorizable pipe to the current context
`PipeBuilder` `bindings​(Object... bindings)` Adds binding to current pipe
`Pipe` `build()` builds a configured pipe.
`Pipe` `build​(String path)` builds a configured pipe.
`PipeBuilder` `children​(String expr)` attach a sling query children pipe to the current context
`PipeBuilder` `closest​(String expr)` attach a sling query closest pipe to the current context
`PipeBuilder` `conf​(Object... properties)` Building up a set of configurations for the current pipe
`PipeBuilder` `csv​(String expr)` attach a csv pipe to the current context
`PipeBuilder` `deny​(String expr)` attach an ACL pipe to the current context and sets deny acls on the resource
`PipeBuilder` `echo​(String path)` attach a base pipe to the current context
`PipeBuilder` `egrep​(String expr)` attach a Regexp pipe to the current context
`PipeBuilder` `expr​(String value)` set an expr configuration to the current pipe in the context
`PipeBuilder` `grep​(Object... conf)` attach a filter pipe to the current context
`PipeBuilder` `json​(String expr)` attach a json pipe to the current context
`PipeBuilder` `mkdir​(String expr)` Attach a path pipe to the current context
`PipeBuilder` `mp()` attach a MULTI value property pipe to the current context
`PipeBuilder` `mv​(String expr)` attach a move pipe to the current context
`PipeBuilder` `name​(String name)` sets a pipe name, important in case you want to reuse it in another expression
`PipeBuilder` `not​(String expr)` attach a not pipe to the current context
`PipeBuilder` `outputs​(String... keys)` add outputs passed key
`PipeBuilder` `parent()` attach a sling query parent pipe to the current context
`PipeBuilder` `parents​(String expr)` attach a sling query parents pipe to the current context
`PipeBuilder` `path​(String value)` set a path configuration to the current pipe in the context
`PipeBuilder` `pipe​(String type)` attach a new pipe to the current context
`PipeBuilder` `pkg​(String expr)` attach a package pipe, in filter collection mode as default
`PipeBuilder` `ref​(String expr)` attach a reference pipe to the current context
`PipeBuilder` `rm()` attach a rm pipe to the current context
`ExecutionResult` `run()` builds and run configured pipe
`ExecutionResult` `run​(Map<String,​Object> bindings)` allow execution of a pipe, with more parameter
`org.apache.sling.event.jobs.Job` `runAsync​(Map<String,​Object> bindings)` run a pipe asynchronously
`ExecutionResult` `runParallel​(int numThreads, Map<String,​Object> bindings)` run referenced pipes in parallel
`ExecutionResult` `runWith​(Object... bindings)` allow execution of a pipe, with more parameter
`PipeBuilder` `shallowRef​(String expr)` attach a shallow reference pipe to the current context
`PipeBuilder` `siblings​(String expr)` attach a sling query siblings pipe to the current context
`PipeBuilder` `traverse()` attach a traverse pipe to the current context
`PipeBuilder` `with​(Object... params)` parameterized current pipe in the context
`PipeBuilder` `withStrings​(String... params)` parameterized current pipe in the context
`PipeBuilder` `write​(Object... conf)` attach a write pipe to the current context
`PipeBuilder` `xpath​(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 under `path`

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 pipes
  `bindings` - additional bindings for the execution (can be null)
Returns:
  set of resource path, merged output of pipes execution (order is arbitrary)