org.apache.stanbol.enhancer.servicesapi
Interface EnhancementEngine

All Known Implementing Classes:
AbstractEnhancementEngine

public interface EnhancementEngine

Interface to internal or external semantic enhancement engines. There will usually be several of those, that the EnhancementJobManager uses to enhance content items.


Field Summary
static int CANNOT_ENHANCE
          Return value for canEnhance(org.apache.stanbol.enhancer.servicesapi.ContentItem), meaning this engine cannot enhance supplied ContentItem
static int ENHANCE_ASYNC
          Return value for canEnhance(org.apache.stanbol.enhancer.servicesapi.ContentItem), meaning this engine can enhance supplied ContentItem, and suggests queuing a request for enhancement instead of enhancing it synchronously.
static int ENHANCE_SYNCHRONOUS
          Return value for canEnhance(org.apache.stanbol.enhancer.servicesapi.ContentItem), meaning this engine can enhance supplied ContentItem, and suggests enhancing it synchronously instead of queuing a request for enhancement.
static java.lang.String PROPERTY_NAME
          The property used to provide the name of an enhancement engine.
 
Method Summary
 int canEnhance(ContentItem ci)
          Indicate if this engine can enhance supplied ContentItem, and if it suggests enhancing it synchronously or asynchronously.
 void computeEnhancements(ContentItem ci)
          Compute enhancements for supplied ContentItem.
 java.lang.String getName()
          Getter for the name of this EnhancementEngine instance as configured by PROPERTY_NAME
 

Field Detail

PROPERTY_NAME

static final java.lang.String PROPERTY_NAME
The property used to provide the name of an enhancement engine.

See Also:
Constant Field Values

CANNOT_ENHANCE

static final int CANNOT_ENHANCE
Return value for canEnhance(org.apache.stanbol.enhancer.servicesapi.ContentItem), meaning this engine cannot enhance supplied ContentItem

See Also:
Constant Field Values

ENHANCE_SYNCHRONOUS

static final int ENHANCE_SYNCHRONOUS
Return value for canEnhance(org.apache.stanbol.enhancer.servicesapi.ContentItem), meaning this engine can enhance supplied ContentItem, and suggests enhancing it synchronously instead of queuing a request for enhancement.

See Also:
Constant Field Values

ENHANCE_ASYNC

static final int ENHANCE_ASYNC
Return value for canEnhance(org.apache.stanbol.enhancer.servicesapi.ContentItem), meaning this engine can enhance supplied ContentItem, and suggests queuing a request for enhancement instead of enhancing it synchronously.

See Also:
Constant Field Values
Method Detail

canEnhance

int canEnhance(ContentItem ci)
               throws EngineException
Indicate if this engine can enhance supplied ContentItem, and if it suggests enhancing it synchronously or asynchronously. The EnhancementJobManager can force sync/async mode if desired, it is just a suggestion from the engine.

Throws:
EngineException - if the introspecting process of the content item fails

computeEnhancements

void computeEnhancements(ContentItem ci)
                         throws EngineException
Compute enhancements for supplied ContentItem. The results of the process are expected to be stored in the metadata of the content item. The client (usually an EnhancementJobManager) should take care of persistent storage of the enhanced ContentItem.

Throws:
EngineException - if the underlying process failed to work as expected

getName

java.lang.String getName()
Getter for the name of this EnhancementEngine instance as configured by PROPERTY_NAME

Returns:
the name


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.