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 Classes Modifier and Type Interface Description static interface
AssetUpdate.AssetCheck
Check if the given asset is acceptable for the asset, e.g.static interface
AssetUpdate.Check
Simple check if a null asset (e.g.static interface
AssetUpdate.JobRunner
Run the update on the given asset and update instance.static interface
AssetUpdate.Runner
Run the update on the given asset and update instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addJob(Job job)
Announce that a job is run as part of this update.void
checkAndRun(AssetUpdate.Check check, AssetUpdate.Runner runner)
Perform and the check, and if successful, run the instancejava.io.Serializable
checkAndRunJob(AssetUpdate.Check check, AssetUpdate.JobRunner runner)
Variation ofcheckAndRun(Check, Runner)
that can return the identity of a started, decoupled sling job.void
done()
Report the upate as finished.void
error(java.lang.Exception ex)
Report an error during update.Asset
getAsset()
Get the asset this update is about.Asset
getAsset(AssetUpdate.Check check)
Get the asset, if it is acceptable.void
ignore()
Ignore this update in monitoring.boolean
isIgnored()
-
-
-
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
-
-