Package com.day.cq.dam.commons.util
Interface AssetUpdate
public interface AssetUpdate
An 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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceCheck if the given asset is acceptable for the asset, e.g.static interfaceSimple check if a null asset (e.g.static interfaceRun the update on the given asset and update instance.static interfaceRun the update on the given asset and update instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidAnnounce 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 instancecheckAndRunJob(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.voidReport an error during update.getAsset()Get the asset this update is about.getAsset(AssetUpdate.Check check) Get the asset, if it is acceptable.voidignore()Ignore this update in monitoring.boolean
-
Method Details
-
getAsset
Asset getAsset()Get the asset this update is about.- Returns:
- the asset being updated.
-
getAsset
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
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
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
Report an error during update.- Parameters:
ex- the exception that as caught, or null.
-
addJob
Announce that a job is run as part of this update.- Parameters:
job- the job that will run
-