public final class EngineRequestBuilder extends Object
This class builds EngineRequest
objects.
Constructor and Description |
---|
EngineRequestBuilder(EngineRequest request)
Builds a new instance with the
EngineRequestBuilder wrapped inside the given request . |
EngineRequestBuilder(String wId,
NutsHeap h,
Context ctx)
Builds a new instance with mandatory workflow ID and
NutsHeap . |
Modifier and Type | Method and Description |
---|---|
EngineRequestBuilder |
bestEffort()
Enables best effort for this request.
|
EngineRequest |
build()
Builds a bew instance.
|
EngineRequestBuilder |
chain(NutType nutType,
NodeEngine nodeEngine)
|
EngineRequestBuilder |
chains(Map<NutType,? extends NodeEngine> c)
|
EngineRequestBuilder |
contextPath(String cp)
Sets the context path.
|
EngineRequestBuilder |
disableBestEffort()
Disables best effort for this request.
|
EngineRequestBuilder |
excludeFromSprite(Set<String> efs)
Excludes any nut with a name in the given set from sprite computation.
|
NodeEngine |
getChainFor(NutType nutType)
Gets the chains which can treat nuts of the given
NutType . |
String |
getContextPath()
Gets the context path.
|
NutsHeap |
getHeap()
Returns the heap.
|
List<ConvertibleNut> |
getNuts()
Gets the nuts.
|
String |
getPrefixCreatedNut()
Returns the prefix created nut
|
ProcessContext |
getProcessContext()
Gets the process context.
|
UrlProviderFactory |
getUrlProviderFactory()
Gets the
UrlProviderFactory . |
String |
getWorkflowId()
Gets the workflow ID.
|
EngineRequestBuilder |
heap(NutsHeap h)
Sets the
NutsHeap . |
boolean |
isBestEffort()
Indicates if this request requires best effort.
|
EngineRequestBuilder |
nuts(List<? extends Nut> n)
Sets the nuts.
|
EngineRequestBuilder |
prefixCreatedNut(String pcn)
Sets the prefix of created nut.
|
EngineRequestBuilder |
processContext(ProcessContext pc)
Sets the process context.
|
boolean |
shouldSkip(EngineType engineType)
Indicates if an engine of the given type should skip its treatment when this request is submitted.
|
EngineRequestBuilder |
skip(EngineType... toSkip)
Sets the skipped
EngineType . |
EngineRequestBuilder |
staticsServedByWuicServlet()
Indicates that result will be served by WUIC servlet.
|
EngineRequestBuilder |
urlProviderFactory(UrlProviderFactory upf)
Sets the
UrlProviderFactory . |
EngineRequestBuilder |
workflowId(String wId)
Sets the workflow ID.
|
EngineRequestBuilder |
workflowKey(String wk)
Sets the workflow key.
|
public EngineRequestBuilder(String wId, NutsHeap h, Context ctx)
Builds a new instance with mandatory workflow ID and NutsHeap
.
wId
- the workflow idh
- the heappublic EngineRequestBuilder(EngineRequest request)
Builds a new instance with the EngineRequestBuilder
wrapped inside the given request
.
request
- the requestpublic EngineRequestBuilder disableBestEffort()
Disables best effort for this request.
public EngineRequestBuilder bestEffort()
Enables best effort for this request.
public EngineRequestBuilder nuts(List<? extends Nut> n)
Sets the nuts. Each nut will be wrapped in a PipedConvertibleNut
to be exposed as ConvertibleNut
.
n
- the nutspublic EngineRequestBuilder workflowKey(String wk)
Sets the workflow key.
wk
- the keypublic EngineRequestBuilder workflowId(String wId)
Sets the workflow ID.
wId
- the workflow IDpublic EngineRequestBuilder prefixCreatedNut(String pcn)
Sets the prefix of created nut.
pcn
- the prefixpublic EngineRequestBuilder urlProviderFactory(UrlProviderFactory upf)
Sets the UrlProviderFactory
.
upf
- the factorypublic EngineRequestBuilder skip(EngineType... toSkip)
Sets the skipped EngineType
.
toSkip
- the skipped typespublic EngineRequestBuilder contextPath(String cp)
Sets the context path.
cp
- the context pathpublic EngineRequestBuilder heap(NutsHeap h)
Sets the NutsHeap
.
h
- the heappublic EngineRequestBuilder excludeFromSprite(Set<String> efs)
Excludes any nut with a name in the given set from sprite computation.
efs
- the setpublic EngineRequestBuilder chains(Map<NutType,? extends NodeEngine> c)
c
- the chainspublic EngineRequestBuilder chain(NutType nutType, NodeEngine nodeEngine)
nutType
- the typenodeEngine
- the chain's rootpublic EngineRequestBuilder processContext(ProcessContext pc)
Sets the process context.
pc
- the process contextpublic EngineRequestBuilder staticsServedByWuicServlet()
Indicates that result will be served by WUIC servlet.
public EngineRequest build()
Builds a bew instance. Default state is applied here if some attributes have not been initialized.
EngineRequest
public String getPrefixCreatedNut()
Returns the prefix created nut
public List<ConvertibleNut> getNuts()
Gets the nuts.
public String getContextPath()
Gets the context path.
public NutsHeap getHeap()
Returns the heap.
public String getWorkflowId()
Gets the workflow ID.
public NodeEngine getChainFor(NutType nutType)
Gets the chains which can treat nuts of the given NutType
.
nutType
- the nut typepublic boolean shouldSkip(EngineType engineType)
Indicates if an engine of the given type should skip its treatment when this request is submitted.
engineType
- the EngineType
true
if treatment should be skipped, false
otherwise.public UrlProviderFactory getUrlProviderFactory()
Gets the UrlProviderFactory
.
public boolean isBestEffort()
Indicates if this request requires best effort.
true
in case of best effort, false
otherwisepublic ProcessContext getProcessContext()
Gets the process context.
Copyright © 2012-2015. All Rights Reserved.