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 |
protected static String |
DRYRUN_EXPR |
static String |
DRYRUN_KEY |
protected Boolean |
dryRunObject |
static Iterator<org.apache.sling.api.resource.Resource> |
EMPTY_ITERATOR
Empty resource iterator
|
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(Plumber plumber,
org.apache.sling.api.resource.Resource resource,
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
|
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 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 static final String DRYRUN_EXPR
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 Boolean dryRunObject
protected Plumber plumber
public static final Iterator<org.apache.sling.api.resource.Resource> EMPTY_ITERATOR
public BasePipe(Plumber plumber, org.apache.sling.api.resource.Resource resource, PipeBindings upperBindings) throws Exception
plumber
- plumberresource
- configuration resourceupperBindings
- already set bindings, can be nullException
- in case configuration is not workingpublic 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() throws ScriptException
ScriptException
- in case computed expression goes wrongprotected String getRawPath()
public String getPath() throws ScriptException
ScriptException
- in case computed path goes wrongprotected String getComputedPath() throws ScriptException
ScriptException
- in case computed path goes wrongprotected boolean isRootPath(String path)
path
- path to be checkedprotected Pipe getPreviousPipe()
protected org.apache.sling.api.resource.Resource getPreviousResource()
public org.apache.sling.api.resource.Resource getInput() throws ScriptException
Pipe
getInput
in interface Pipe
ScriptException
- in case computed input goes wrongpublic Object getOutputBinding()
Pipe
getOutputBinding
in interface Pipe
public PipeBindings getBindings()
Pipe
getBindings
in interface Pipe
protected void provideAdditionalBindings()
public Iterator<org.apache.sling.api.resource.Resource> getOutput()
public void before() throws Exception
Pipe
public void after() throws Exception
Pipe
protected Iterator<org.apache.sling.api.resource.Resource> computeOutput() throws Exception
ScriptException
- if any exception has occuredException
public org.apache.sling.api.resource.Resource getConfiguration()
public String getDistributionAgent()
Pipe
getDistributionAgent
in interface Pipe
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.