ThreadedContext (Solr 3.6.2 API)
Keywords: org.apache.solr.handler.dataimport.ThreadedContext class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.handler.dataimport
Class ThreadedContext

    java.lang.Object
      org.apache.solr.handler.dataimport.Context
          org.apache.solr.handler.dataimport.ContextImpl
              org.apache.solr.handler.dataimport.ThreadedContext

    public class ThreadedContext

extends ContextImpl

Context implementation used when run multi threaded.

Since:
  Solr 3.1

Field Summary

Fields inherited from class org.apache.solr.handler.dataimport.ContextImpl
`entity`

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
`ThreadedContext(org.apache.solr.handler.dataimport.DocBuilder.EntityRunner entityRunner, DocBuilder docBuilder, VariableResolverImpl resolver)`

Method Summary
`String` | `currentProcess()` Returns the current process FULL_DUMP, DELTA_DUMP, FIND_DELTA
`DataSource` | `getDataSource()` Gets the datasource instance defined for this entity.
`EntityProcessor` | `getEntityProcessor()` Returns the instance of EntityProcessor used for this entity
`Context` | `getParentContext()` Get the context instance for the parent entity.
`String` | `getResolvedEntityAttribute(String name)` Get the value of any attribute put into this entity after resolving all variables found in the attribute value
`VariableResolver` | `getVariableResolver()` Returns the VariableResolver used in this entity which can be used to resolve the tokens in ${}
`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 org.apache.solr.handler.dataimport.ContextImpl
`deleteDoc, deleteDocByQuery, getAllEntityFields, getDataSource, getEntityAttribute, getRequestParameters, getScript, getScriptLanguage, getSessionAttribute, getSolrCore, getStats, isRootEntity, setDoc`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ThreadedContext

    public ThreadedContext(org.apache.solr.handler.dataimport.DocBuilder.EntityRunner entityRunner,
                           DocBuilder docBuilder,
                           VariableResolverImpl resolver)

Method Detail

### getVariableResolver

    public VariableResolver getVariableResolver()

  Description copied from class: `Context`
  Returns the VariableResolver used in this entity which can be used to resolve the tokens in ${}

  Overrides:
    `getVariableResolver` in class `ContextImpl`
  Returns:
    a VariableResolver instance
  See Also:
    `VariableResolver`

### getParentContext

    public Context getParentContext()

  Description copied from class: `Context`
  Get the context instance for the parent entity. works only in the full dump If the current entity is rootmost a null is returned

  Overrides:
    `getParentContext` in class `ContextImpl`
  Returns:
    parent entity's Context

### currentProcess

    public String currentProcess()

  Description copied from class: `Context`
  Returns the current process FULL_DUMP, DELTA_DUMP, FIND_DELTA

  Overrides:
    `currentProcess` in class `ContextImpl`
  Returns:
    the type of the current running process

### getEntityProcessor

    public EntityProcessor getEntityProcessor()

  Description copied from class: `Context`
  Returns the instance of EntityProcessor used for this entity

  Overrides:
    `getEntityProcessor` in class `ContextImpl`
  Returns:
    instance of EntityProcessor used for the current entity
  See Also:
    `EntityProcessor`

### getDataSource

    public DataSource getDataSource()

  Description copied from class: `Context`
  Gets the datasource instance defined for this entity. Do not close() this instance. Transformers should use the getDataSource(String name) method.

  Overrides:
    `getDataSource` in class `ContextImpl`
  Returns:
    a new DataSource instance as configured for the current entity
  See Also:
    `DataSource`, `Context.getDataSource(String)`

### getResolvedEntityAttribute

    public String getResolvedEntityAttribute(String name)

  Description copied from class: `Context`
  Get the value of any attribute put into this entity after resolving all variables found in the attribute value

  Overrides:
    `getResolvedEntityAttribute` in class `ContextImpl`
  Parameters:
    `name` - name of the attribute
  Returns:
    value of the named attribute after resolving all variables

### setSessionAttribute

    public void setSessionAttribute(String name,
                                    Object val,
                                    String scope)

  Description copied from class: `Context`
  Store values in a certain name and scope (entity, document,global)

  Overrides:
    `setSessionAttribute` in class `ContextImpl`
  Parameters:
    `name` - the key
    `val` - the value
    `scope` - the scope in which the given key, value pair is to be stored

### resolve

    public Object resolve(String var)

  Description copied from class: `Context`
  Use this directly to resolve variable

  Overrides:
    `resolve` in class `ContextImpl`
  Parameters:
    `var` - the variable neme
  Returns:
    the resolved value

### replaceTokens

    public String replaceTokens(String template)

  Description copied from class: `Context`
  Resolve variables in a template

  Overrides:
    `replaceTokens` in class `ContextImpl`
  Returns:
    The string w/ variables resolved

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD