|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.solr.handler.dataimport.Context
org.apache.solr.handler.dataimport.ContextImpl
public class ContextImpl
An implementation for the Context
This API is experimental and subject to change
| Field Summary | |
|---|---|
protected EntityProcessorWrapper |
epw
|
| Fields inherited from class org.apache.solr.handler.dataimport.Context |
|---|
DELTA_DUMP, FIND_DELTA, FULL_DUMP, SCOPE_DOC, SCOPE_ENTITY, SCOPE_GLOBAL, SCOPE_SOLR_CORE |
| Constructor Summary | |
|---|---|
ContextImpl(EntityProcessorWrapper epw,
VariableResolverImpl resolver,
DataSource ds,
String currProcess,
Map<String,Object> global,
ContextImpl parentContext,
DocBuilder docBuilder)
|
|
| Method Summary | |
|---|---|
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 |
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 ${ |
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 |
setSessionAttribute(String name,
Object val,
String scope)
Store values in a certain name and scope (entity, document,global) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected EntityProcessorWrapper epw
| Constructor Detail |
|---|
public ContextImpl(EntityProcessorWrapper epw,
VariableResolverImpl resolver,
DataSource ds,
String currProcess,
Map<String,Object> global,
ContextImpl parentContext,
DocBuilder docBuilder)
| Method Detail |
|---|
public String getEntityAttribute(String name)
Context
getEntityAttribute in class Contextname - name of the attribute eg: 'name'
public String getResolvedEntityAttribute(String name)
Context
getResolvedEntityAttribute in class Contextname - name of the attribute
public List<Map<String,String>> getAllEntityFields()
Context
getAllEntityFields in class Contextpublic VariableResolver getVariableResolver()
Context
getVariableResolver in class ContextVariableResolverpublic DataSource getDataSource()
Context
getDataSource in class ContextDataSource,
Context.getDataSource(String)public DataSource getDataSource(String name)
Context
getDataSource in class Contextname - Name of the dataSource as defined in the dataSource tag
DataSourcepublic boolean isRootEntity()
Context
isRootEntity in class Contextpublic String currentProcess()
Context
currentProcess in class Contextpublic Map<String,Object> getRequestParameters()
Context
getRequestParameters in class Contextpublic EntityProcessor getEntityProcessor()
Context
getEntityProcessor in class ContextEntityProcessor
public void setSessionAttribute(String name,
Object val,
String scope)
Context
setSessionAttribute in class Contextname - the keyval - the valuescope - the scope in which the given key, value pair is to be stored
public Object getSessionAttribute(String name,
String scope)
Context
getSessionAttribute in class Contextname - the keyscope - the scope from which the value is to be retrieved
public Context getParentContext()
Context
getParentContext in class Contextpublic SolrCore getSolrCore()
Context
getSolrCore in class Contextpublic Map<String,Object> getStats()
Context
getStats in class Contextpublic String getScript()
Context
getScript in class Contextpublic String getScriptLanguage()
Context
getScriptLanguage in class Contextpublic void deleteDoc(String id)
Context
deleteDoc in class Contextpublic void deleteDocByQuery(String query)
Context
deleteDocByQuery in class Contextpublic Object resolve(String var)
Context
resolve in class Contextvar - the variable name
public String replaceTokens(String template)
Context
replaceTokens in class Context
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||