|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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,
VariableResolver 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 ${<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 |
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, VariableResolver resolver, DataSource ds, String currProcess, Map<String,Object> global, ContextImpl parentContext, DocBuilder docBuilder)
Method Detail |
---|
public String getEntityAttribute(String name)
Context
getEntityAttribute
in class Context
name
- name of the attribute eg: 'name'
public String getResolvedEntityAttribute(String name)
Context
getResolvedEntityAttribute
in class Context
name
- name of the attribute
public List<Map<String,String>> getAllEntityFields()
Context
getAllEntityFields
in class Context
public VariableResolver getVariableResolver()
Context
getVariableResolver
in class Context
VariableResolver
public DataSource getDataSource()
Context
getDataSource
in class Context
DataSource
,
Context.getDataSource(String)
public DataSource getDataSource(String name)
Context
getDataSource
in class Context
name
- Name of the dataSource as defined in the dataSource tag
DataSource
public boolean isRootEntity()
Context
isRootEntity
in class Context
public String currentProcess()
Context
currentProcess
in class Context
public Map<String,Object> getRequestParameters()
Context
getRequestParameters
in class Context
public EntityProcessor getEntityProcessor()
Context
getEntityProcessor
in class Context
EntityProcessor
public void setSessionAttribute(String name, Object val, String scope)
Context
setSessionAttribute
in class Context
name
- the keyval
- the valuescope
- the scope in which the given key, value pair is to be storedpublic Object getSessionAttribute(String name, String scope)
Context
getSessionAttribute
in class Context
name
- the keyscope
- the scope from which the value is to be retrieved
public Context getParentContext()
Context
getParentContext
in class Context
public SolrCore getSolrCore()
Context
getSolrCore
in class Context
public Map<String,Object> getStats()
Context
getStats
in class Context
public String getScript()
Context
getScript
in class Context
public String getScriptLanguage()
Context
getScriptLanguage
in class Context
public void deleteDoc(String id)
Context
deleteDoc
in class Context
public void deleteDocByQuery(String query)
Context
deleteDocByQuery
in class Context
public Object resolve(String var)
Context
resolve
in class Context
var
- 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 |