public class ContextImpl extends Context
An implementation for the Context
This API is experimental and subject to change| Modifier and Type | Field and Description |
|---|---|
protected EntityProcessorWrapper |
epw |
DELTA_DUMP, FIND_DELTA, FULL_DUMP, SCOPE_DOC, SCOPE_ENTITY, SCOPE_GLOBAL, SCOPE_SOLR_CORE| Constructor and Description |
|---|
ContextImpl(EntityProcessorWrapper epw,
VariableResolver resolver,
DataSource ds,
String currProcess,
Map<String,Object> global,
ContextImpl parentContext,
DocBuilder docBuilder) |
| Modifier and Type | Method and Description |
|---|---|
String |
currentProcess()
Returns the current process FULL_DUMP, DELTA_DUMP, FIND_DELTA
|
void |
deleteDoc(String id)
delete a document by id
|
void |
deleteDocByQuery(String query)
delete documents by query
|
List<Map<String,String>> |
getAllEntityFields()
Returns all the fields put into an entity.
|
DataSource |
getDataSource()
Gets the datasource instance defined for this entity.
|
DataSource |
getDataSource(String name)
Gets a new DataSource instance with a name.
|
String |
getEntityAttribute(String name)
Get the value of any attribute put into this entity
|
EntityProcessor |
getEntityProcessor()
Returns the instance of EntityProcessor used for this entity
|
Exception |
getLastException() |
Context |
getParentContext()
Get the context instance for the parent entity.
|
Map<String,Object> |
getRequestParameters()
The request parameters passed over HTTP for this command the values in the
map are either String(for single valued parameters) or List<String> (for
multi-valued parameters)
|
String |
getResolvedEntityAttribute(String name)
Get the value of any attribute put into this entity after resolving all variables found in the attribute value
|
String |
getScript()
Returns the text specified in the script tag in the data-config.xml
|
String |
getScriptLanguage()
Returns the language of the script as specified in the script tag in data-config.xml
|
Object |
getSessionAttribute(String name,
String scope)
get a value by name in the given scope (entity, document,global)
|
SolrCore |
getSolrCore()
Exposing the actual SolrCore to the components
|
Map<String,Object> |
getStats()
Makes available some basic running statistics such as "docCount",
"deletedDocCount", "rowCount", "queryCount" and "skipDocCount"
|
VariableResolver |
getVariableResolver()
Returns the VariableResolver used in this entity which can be used to
resolve the tokens in ${<namespce.name>}
|
boolean |
isRootEntity()
Returns if the current entity is the root entity
|
String |
replaceTokens(String template)
Resolve variables in a template
|
Object |
resolve(String var)
Use this directly to resolve variable
|
void |
setLastException(Exception lastException) |
void |
setSessionAttribute(String name,
Object val,
String scope)
Store values in a certain name and scope (entity, document,global)
|
protected EntityProcessorWrapper epw
public ContextImpl(EntityProcessorWrapper epw, VariableResolver resolver, DataSource ds, String currProcess, Map<String,Object> global, ContextImpl parentContext, DocBuilder docBuilder)
public String getEntityAttribute(String name)
ContextgetEntityAttribute in class Contextname - name of the attribute eg: 'name'public String getResolvedEntityAttribute(String name)
ContextgetResolvedEntityAttribute in class Contextname - name of the attributepublic List<Map<String,String>> getAllEntityFields()
ContextgetAllEntityFields in class Contextpublic VariableResolver getVariableResolver()
ContextgetVariableResolver in class ContextVariableResolverpublic DataSource getDataSource()
ContextgetDataSource in class ContextDataSource,
Context.getDataSource(String)public DataSource getDataSource(String name)
ContextgetDataSource in class Contextname - Name of the dataSource as defined in the dataSource tagDataSourcepublic boolean isRootEntity()
ContextisRootEntity in class Contextpublic String currentProcess()
ContextcurrentProcess in class Contextpublic Map<String,Object> getRequestParameters()
ContextgetRequestParameters in class Contextpublic EntityProcessor getEntityProcessor()
ContextgetEntityProcessor in class ContextEntityProcessorpublic void setSessionAttribute(String name, Object val, String scope)
ContextsetSessionAttribute in class Contextname - the keyval - the valuescope - the scope in which the given key, value pair is to be storedpublic Object getSessionAttribute(String name, String scope)
ContextgetSessionAttribute in class Contextname - the keyscope - the scope from which the value is to be retrievedpublic Context getParentContext()
ContextgetParentContext in class Contextpublic SolrCore getSolrCore()
ContextgetSolrCore in class Contextpublic Map<String,Object> getStats()
Contextpublic String getScript()
Contextpublic String getScriptLanguage()
ContextgetScriptLanguage in class Contextpublic void deleteDoc(String id)
Contextpublic void deleteDocByQuery(String query)
ContextdeleteDocByQuery in class Contextpublic Object resolve(String var)
Contextpublic String replaceTokens(String template)
ContextreplaceTokens in class Contextpublic Exception getLastException()
public void setLastException(Exception lastException)
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.