public class BasePipe extends Object implements Pipe
Modifier and Type | Field and Description |
---|---|
protected String |
afterHook |
protected String |
beforeHook |
protected List<BindingProvider> |
bindingProviders |
protected PipeBindings |
bindings |
protected String |
distributionAgent |
static String |
DRYRUN_EXPR |
static String |
DRYRUN_KEY |
static Iterator<org.apache.sling.api.resource.Resource> |
EMPTY_ITERATOR
Empty resource iterator
|
protected static List<String> |
IGNORED_NODES |
protected static List<String> |
IGNORED_PROPERTIES |
protected SuperPipe |
parent |
protected Plumber |
plumber |
static String |
PN_AFTERHOOK |
static String |
PN_BEFOREHOOK |
static String |
PN_STATUS |
static String |
PN_STATUS_MODIFIED |
protected org.apache.sling.api.resource.ValueMap |
properties |
static String |
READ_ONLY |
protected org.apache.sling.api.resource.ResourceResolver |
resolver |
protected org.apache.sling.api.resource.Resource |
resource |
static String |
RESOURCE_TYPE |
static String |
RT_PREFIX |
static String |
SLASH |
static String |
STATUS_FINISHED |
static String |
STATUS_STARTED |
Constructor and Description |
---|
BasePipe(@NotNull Plumber plumber,
@NotNull org.apache.sling.api.resource.Resource resource,
@Nullable PipeBindings upperBindings)
Pipe Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
after()
to be executed before output is retrieved
|
void |
before()
to be executed before output is retrieved
|
protected Iterator<org.apache.sling.api.resource.Resource> |
computeOutput() |
PipeBindings |
getBindings()
returns the pipe's bindings
|
protected String |
getComputedPath() |
org.apache.sling.api.resource.Resource |
getConfiguration()
Get configuration node
|
String |
getDistributionAgent()
Get Distribution agent
|
String |
getExpr()
Get pipe's expression, instanciated or not
|
@Nullable org.apache.sling.api.resource.Resource |
getInput()
Get pipe current's resource *before* next execution, meaning either the
configured resource, either previous' pipe output resource
|
String |
getName()
Return the name of that pipe
|
Iterator<org.apache.sling.api.resource.Resource> |
getOutput()
default execution, just returns current resource
|
Object |
getOutputBinding()
returns the binding output used in container pipe's expression
|
SuperPipe |
getParent() |
String |
getPath()
Get pipe's path, instanciated or not
|
protected Pipe |
getPreviousPipe()
Retrieves previous pipe if contained by a parent, or referrer's
|
protected org.apache.sling.api.resource.Resource |
getPreviousResource() |
String |
getRawExpression() |
protected String |
getRawPath() |
org.apache.sling.api.resource.Resource |
getResource()
get the pipe configuration resource
|
boolean |
isDryRun()
returns true if that pipe is set not to write content
|
protected boolean |
isRootPath(String path) |
boolean |
modifiesContent()
returns true if that pipe modifies content during its execution
|
protected void |
provideAdditionalBindings()
will execute in parallel binding providers if any, and updated Pipe bindings with returned values
|
void |
setParent(SuperPipe parent)
sets the parent pipe this pipe is referred by
|
String |
toString() |
public static final String SLASH
public static final String RT_PREFIX
public static final String RESOURCE_TYPE
public static final String DRYRUN_KEY
public static final String DRYRUN_EXPR
public static final String READ_ONLY
public static final String PN_STATUS
public static final String PN_STATUS_MODIFIED
public static final String PN_BEFOREHOOK
public static final String PN_AFTERHOOK
public static final String STATUS_STARTED
public static final String STATUS_FINISHED
protected org.apache.sling.api.resource.ResourceResolver resolver
protected org.apache.sling.api.resource.ValueMap properties
protected org.apache.sling.api.resource.Resource resource
protected SuperPipe parent
protected String distributionAgent
protected PipeBindings bindings
protected List<BindingProvider> bindingProviders
protected String beforeHook
protected String afterHook
protected Plumber plumber
public static final Iterator<org.apache.sling.api.resource.Resource> EMPTY_ITERATOR
public BasePipe(@NotNull @NotNull Plumber plumber, @NotNull @NotNull org.apache.sling.api.resource.Resource resource, @Nullable @Nullable PipeBindings upperBindings)
plumber
- plumberresource
- configuration resourceupperBindings
- already set bindings, can be nullpublic SuperPipe getParent()
public void setParent(SuperPipe parent)
Pipe
public org.apache.sling.api.resource.Resource getResource()
Pipe
getResource
in interface Pipe
public boolean isDryRun()
Pipe
public boolean modifiesContent()
Pipe
modifiesContent
in interface Pipe
public String getName()
Pipe
public String getRawExpression()
public String getExpr()
protected String getRawPath()
public String getPath()
protected String getComputedPath()
protected boolean isRootPath(String path)
path
- path to be checkedprotected Pipe getPreviousPipe()
protected org.apache.sling.api.resource.Resource getPreviousResource()
@Nullable public @Nullable org.apache.sling.api.resource.Resource getInput()
Pipe
public Object getOutputBinding()
Pipe
getOutputBinding
in interface Pipe
public PipeBindings getBindings()
Pipe
getBindings
in interface Pipe
protected void provideAdditionalBindings() throws InterruptedException, ExecutionException
InterruptedException
- can happen while a binding provider is executedExecutionException
- can happen when a binding provider is executedpublic Iterator<org.apache.sling.api.resource.Resource> getOutput()
public void before()
Pipe
public void after()
Pipe
protected Iterator<org.apache.sling.api.resource.Resource> computeOutput()
public org.apache.sling.api.resource.Resource getConfiguration()
public String getDistributionAgent()
Pipe
getDistributionAgent
in interface Pipe
Copyright © 2007–2022 The Apache Software Foundation. All rights reserved.