|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.stanbol.enhancer.jobmanager.event.impl.EnhancementJob
public class EnhancementJob
Represents the enhancement of a ContentItem by following the
execution plan provided by a Chain as parsed to an
EnhancementJobManager.
TODO: This might become part of the Stanbol Enhancer Services API.
| Constructor Summary | |
|---|---|
EnhancementJob(org.apache.stanbol.enhancer.servicesapi.ContentItem contentItem)
Creates an EnhancemenJob based on already existing execution metadata present for a ContentItem. |
|
EnhancementJob(org.apache.stanbol.enhancer.servicesapi.ContentItem contentItem,
String chainName,
org.apache.clerezza.rdf.core.Graph executionPlan,
boolean isDefaultChain)
Constructor used to create and initialise a new enhancement job. |
|
| Method Summary | |
|---|---|
String |
getChainName()
This returns the name of the Chain used to initialise the execution plan for this enhancement job. |
Set<org.apache.clerezza.rdf.core.NonLiteral> |
getCompleted()
Getter for a read only view over the completed execution. |
org.apache.stanbol.enhancer.servicesapi.ContentItem |
getContentItem()
The ContentItem enhanced by this job. |
Exception |
getError()
if isFailed() this may contain the Exception that caused
the enhancement job to fail. |
String |
getErrorMessage()
|
Set<org.apache.clerezza.rdf.core.NonLiteral> |
getExecutable()
Getter for the executable nodes. |
org.apache.clerezza.rdf.core.NonLiteral |
getExecution(org.apache.clerezza.rdf.core.NonLiteral executionNode)
Getter for the em:Execution linked to a ep:ExecutionNode |
org.apache.clerezza.rdf.core.MGraph |
getExecutionMetadata()
Getter for the ExecutionMetadata. |
org.apache.clerezza.rdf.core.NonLiteral |
getExecutionNode(org.apache.clerezza.rdf.core.NonLiteral execution)
Getter for the ep:ExecutionNode linked to a em:Execution |
org.apache.clerezza.rdf.core.Graph |
getExecutionPlan()
The used execution plan for processing the ContentItem |
ReadWriteLock |
getLock()
Getter for the lock used to synchronise read/write to this enhancement job. |
Set<org.apache.clerezza.rdf.core.NonLiteral> |
getRunning()
Getter for a read only view over the currently running executions. |
boolean |
isFailed()
Getter for the failed state. |
boolean |
isFinished()
Returns true if this chain has finished. |
void |
setCompleted(org.apache.clerezza.rdf.core.NonLiteral execution)
Sets the state of the parsed executionNode to completed. |
void |
setFailed(org.apache.clerezza.rdf.core.NonLiteral execution,
org.apache.stanbol.enhancer.servicesapi.EnhancementEngine engine,
Exception exception)
|
void |
setRunning(org.apache.clerezza.rdf.core.NonLiteral execution)
Sets the state of the parsed execution to running. |
void |
startProcessing()
Marks the execution of the enhancement process as started. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EnhancementJob(org.apache.stanbol.enhancer.servicesapi.ContentItem contentItem,
String chainName,
org.apache.clerezza.rdf.core.Graph executionPlan,
boolean isDefaultChain)
ExecutionMetadata.CHAIN_EXECUTION to the
ContentItem.
contentItem - chainName - executionPlan - isDefaultChain - public EnhancementJob(org.apache.stanbol.enhancer.servicesapi.ContentItem contentItem)
contentItem - the ContentItem with an already existing content part
containing an MGraph with all required execution metadata and the
execution plan.
IllegalArgumentException - if the parsed ContentItem does
not provide the required data to (re)initialise the EnhancementJob.| Method Detail |
|---|
public org.apache.clerezza.rdf.core.NonLiteral getExecutionNode(org.apache.clerezza.rdf.core.NonLiteral execution)
IllegalArgumentException - if the parsed em:Execution is not
part of the execution metadata of this enhancement jobpublic org.apache.clerezza.rdf.core.NonLiteral getExecution(org.apache.clerezza.rdf.core.NonLiteral executionNode)
IllegalArgumentException - if the parsed ep:ExecutionNode is not
part of the execution plan of this enhancement jobpublic final org.apache.clerezza.rdf.core.Graph getExecutionPlan()
ContentItem
public final org.apache.stanbol.enhancer.servicesapi.ContentItem getContentItem()
public final String getChainName()
NOTE that because chains can change (activate, change, deactivate) at any moment there is no guarantee
that the a chain with that name is still available nor that calling Chain.getExecutionPlan()
will be equals to the getExecutionPlan() used by this enhancement job. This is the reason why
this method just returns the name of the chain and not the Chain instance.
public final ReadWriteLock getLock()
ContentItem.getLock()
public Set<org.apache.clerezza.rdf.core.NonLiteral> getRunning()
public Set<org.apache.clerezza.rdf.core.NonLiteral> getCompleted()
public void setCompleted(org.apache.clerezza.rdf.core.NonLiteral execution)
execution - the exection to be marked as running
IllegalArgumentException - if null is parsed as execution node
IllegalStateException - if the parsed execution node can not be marked as completed because some of its
depended nodes are not yet marked as completed.public void setRunning(org.apache.clerezza.rdf.core.NonLiteral execution)
execution - the execution to be marked as running
IllegalArgumentException - if null is parsed as execution node
IllegalStateException - if the parsed execution node can not be marked as running because some of its depended
nodes are not yet marked as completed.public Set<org.apache.clerezza.rdf.core.NonLiteral> getExecutable()
public boolean isFinished()
public void setFailed(org.apache.clerezza.rdf.core.NonLiteral execution,
org.apache.stanbol.enhancer.servicesapi.EnhancementEngine engine,
Exception exception)
public boolean isFailed()
public String toString()
toString in class Objectpublic Exception getError()
isFailed() this may contain the Exception that caused
the enhancement job to fail.
null if no exception is availablepublic String getErrorMessage()
public org.apache.clerezza.rdf.core.MGraph getExecutionMetadata()
public void startProcessing()
ContentItem to
ExecutionMetadata.STATUS_IN_PROGRESS
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||