Package com.day.cq.dam.commons.util
Interface AssetUpdate
- 
public interface AssetUpdateAn update of (part of) an asset being performed. Represents an ongoing update of an asset (or an aspect of it, such as its metadata) to be used in monitoring workflow processes and allow supervision of execution times and successes. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAssetUpdate.AssetCheckCheck if the given asset is acceptable for the asset, e.g.static interfaceAssetUpdate.CheckSimple check if a null asset (e.g.static interfaceAssetUpdate.JobRunnerRun the update on the given asset and update instance.static interfaceAssetUpdate.RunnerRun the update on the given asset and update instance. 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddJob(Job job)Announce that a job is run as part of this update.voidcheckAndRun(AssetUpdate.Check check, AssetUpdate.Runner runner)Perform and the check, and if successful, run the instancejava.io.SerializablecheckAndRunJob(AssetUpdate.Check check, AssetUpdate.JobRunner runner)Variation ofcheckAndRun(Check, Runner)that can return the identity of a started, decoupled sling job.voiddone()Report the upate as finished.voiderror(java.lang.Exception ex)Report an error during update.AssetgetAsset()Get the asset this update is about.AssetgetAsset(AssetUpdate.Check check)Get the asset, if it is acceptable.voidignore()Ignore this update in monitoring.booleanisIgnored() 
 - 
 
- 
- 
Method Detail
- 
getAsset
Asset getAsset()
Get the asset this update is about.- Returns:
 - the asset being updated.
 
 
- 
getAsset
Asset getAsset(AssetUpdate.Check check) throws WorkflowException
Get the asset, if it is acceptable. Otherwise return null.- Parameters:
 check- the check to be performed- Returns:
 - the checked asset or null
 - Throws:
 WorkflowException- on general failure
 
- 
checkAndRun
void checkAndRun(AssetUpdate.Check check, AssetUpdate.Runner runner) throws WorkflowException
Perform and the check, and if successful, run the instance- Parameters:
 check- the check to be performed on the assetrunner- the code to be executed on a successful check- Throws:
 WorkflowException- on general failure
 
- 
checkAndRunJob
java.io.Serializable checkAndRunJob(AssetUpdate.Check check, AssetUpdate.JobRunner runner) throws WorkflowException
Variation ofcheckAndRun(Check, Runner)that can return the identity of a started, decoupled sling job.- Parameters:
 check- the check to be performed on the assetrunner- the code to be executed on a successful check- Returns:
 - the identifier of the started job or null
 - Throws:
 WorkflowException- on general failure
 
- 
isIgnored
boolean isIgnored()
 
- 
ignore
void ignore()
Ignore this update in monitoring. 
- 
done
void done()
Report the upate as finished. 
- 
error
void error(java.lang.Exception ex)
Report an error during update.- Parameters:
 ex- the exception that as caught, or null.
 
- 
addJob
void addJob(Job job)
Announce that a job is run as part of this update.- Parameters:
 job- the job that will run
 
 - 
 
 -