Package com.day.cq.dam.api
Class DamEvent
- java.lang.Object
-
- com.day.cq.dam.api.DamEvent
-
public class DamEvent extends java.lang.ObjectTheDamEventrepresents events occurring upon assets within DAM. Such events are sent out from implementations performing any of the specified eventDamEvent.Types.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDamEvent.TypeA list of events that are supported by assets.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEVENT_TOPICEvent topic for DAM events.static java.lang.StringPROPERTY_ADDITIONAL_INFOArbitrary additional information settable for the event.static java.lang.StringPROPERTY_CREATEDBYThe creator of asset.static java.lang.StringPROPERTY_EXPIRATIONDATEThe expiration date of asset.static java.lang.StringPROPERTY_LICENSE_INFOThe license information (e.g.static java.lang.StringPROPERTY_VERSION_IDThe version created for the asset.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DamEventaccepted(java.lang.String assetPath, java.lang.String userId, java.lang.String licenseInfo)Creates aDamEventthat corresponds to the event of the license of a DRM-protected asset having been accepted.static DamEventaddedComment(java.lang.String assetPath, java.lang.String userId, java.lang.String additionalInfo)Creates aDamEventthat corresponds to the event of addidng a commment to an asset.static DamEventassetCreated(java.lang.String assetPath, java.lang.String userId)Creates aDamEventthat corresponds to the event of an asset having been created.static DamEventassetExpired(java.lang.String assetPath, java.lang.String userId, java.util.Date expirationDate, java.lang.String createdBy)Creates aDamEventthat corresponds to the event of an asset after expiration.static DamEventassetExpiring(java.lang.String assetPath, java.lang.String userId, java.util.Date expirationDate, java.lang.String createdBy)Creates aDamEventthat corresponds to the event of an asset getting expired in future.static DamEventassetMoved(java.lang.String assetPath, java.lang.String userId)Creates aDamEventthat corresponds to the event of an asset having been ,pved.static DamEventassetPublished(java.lang.String assetPath, java.lang.String userId)Creates aDamEventthat corresponds to the event of an asset being published.static DamEventassetRemoved(java.lang.String assetPath, java.lang.String userId)Creates aDamEventthat corresponds to the event of an asset having been removed.static DamEventassetShared(java.lang.String assetPath, java.lang.String userId, java.lang.String additionalInfo)Creates aDamEventthat corresponds to the event of an asset being shared on different cloud solutions.static DamEventassetUsage(java.lang.String assetPath, java.lang.String usageType, java.util.Date date)Creates aDamEventthat corresponds to the event that asset is used in some solution.static DamEventassetViewed(java.lang.String assetPath, java.lang.String userId)Creates aDamEventthat corresponds to the event upon visiting an asset's detail page.static DamEventcollectionViewed(java.lang.String assetPath, java.lang.String userId)Creates aDamEventthat corresponds to the event of a collection being viewed.static DamEventdamMetadataWritebackWorkflowCompleted(java.lang.String assetPath)Creates aDamEventthat corresponds to the event that DAM metadata writeback workflow is completed.static DamEventdamUpdateAssetWorkflowCompleted(java.lang.String assetPath)Creates aDamEventthat corresponds to the event that DAM update asset workflow is completed.static DamEventdownloaded(java.lang.String assetPath, java.lang.String userId)Creates aDamEventthat corresponds to the event of an asset having been downloaded.static DamEventdownloaded(java.lang.String assetPath, java.lang.String userId, java.lang.String additionalInfo)Creates aDamEventthat corresponds to the event of an asset having been downloaded.static DamEventfromEvent(Event event)java.lang.StringgetAdditionalInfo()Any additional information provided for certain event types.java.lang.StringgetAssetPath()The path of the asset the event occurred upon.java.lang.StringgetCreatedBy()Creator of the asset.java.util.DategetDate()The date the event occurred on.java.util.DategetExpirationDate()Expiration date for the ASSET_EXPIRED event.java.lang.StringgetLicenseInfo()Information about the license upon which the user accepted or rejected.DamEvent.TypegetType()TheDamEvent.Typeof event that occurred on the asset.java.lang.StringgetUserId()The id of the user generating the event.java.lang.StringgetVersionId()The ID of the version that was created upon the asset versioning event.booleanisPublishedExternally()Indicates whether this event represents an asset having been uploaded to an external system.static DamEventmetadataUpdated(java.lang.String assetPath, java.lang.String userId)Creates aDamEventthat corresponds to the event of an asset's metadata having been updated.static DamEventmetadataUpdated(java.lang.String assetPath, java.lang.String userId, java.lang.String additionalInfo)Creates aDamEventthat corresponds to the event of an asset's metadata having been updated.static DamEventoriginalUpdated(java.lang.String assetPath, java.lang.String userId)Creates aDamEventthat corresponds to the event of an asset's original rendition having been updated.static DamEventprojectViewed(java.lang.String assetPath, java.lang.String userId)Creates aDamEventthat corresponds to the event of a project being viewed.static DamEventpublishedExternally(java.lang.String assetPath, java.lang.String userId, java.lang.String additionalInfo)Creates aDamEventthat corresponds to the event of an asset having been uploaded to an external system.static DamEventrejected(java.lang.String assetPath, java.lang.String userId, java.lang.String licenseInfo)Creates aDamEventthat corresponds to the event of the license of a DRM-protected asset having been rejected.static DamEventrenditionDownloaded(java.lang.String assetPath, java.lang.String userId, java.lang.String renditionPath)Creates aDamEventthat corresponds to the event of a rendition having been downloaded for an asset.static DamEventrenditionRemoved(java.lang.String assetPath, java.lang.String userId, java.lang.String renditionPath)Creates aDamEventthat corresponds to the event of a rendition having been removed for an asset.static DamEventrenditionUpdated(java.lang.String assetPath, java.lang.String userId, java.lang.String renditionPath)Creates aDamEventthat corresponds to the event of a rendition having been added or updated for an asset.static DamEventrestored(java.lang.String assetPath, java.lang.String userId, java.lang.String versionId)Creates aDamEventthat corresponds to the event of an asset having been restored from a previous version.static DamEventsubassetRemoved(java.lang.String assetPath, java.lang.String userId, java.lang.String subassetPath)Creates aDamEventthat corresponds to the event of a sub-asset having been removed for an asset.static DamEventsubassetUpdated(java.lang.String assetPath, java.lang.String userId, java.lang.String subassetPath)Creates aDamEventthat corresponds to the event of a sub-asset having been added or updated for an asset.EventtoEvent()Create a distributable event.EventtoNonDistributableEvent()Create a non distributable event.static DamEventversioned(java.lang.String assetPath, java.lang.String userId, java.lang.String versionId)Creates aDamEventthat corresponds to the event of an asset having been versioned.
-
-
-
Field Detail
-
EVENT_TOPIC
public static final java.lang.String EVENT_TOPIC
Event topic for DAM events.- See Also:
- Constant Field Values
-
PROPERTY_EXPIRATIONDATE
public static final java.lang.String PROPERTY_EXPIRATIONDATE
The expiration date of asset.- See Also:
- Constant Field Values
-
PROPERTY_CREATEDBY
public static final java.lang.String PROPERTY_CREATEDBY
The creator of asset.- See Also:
- Constant Field Values
-
PROPERTY_VERSION_ID
public static final java.lang.String PROPERTY_VERSION_ID
The version created for the asset.- See Also:
- Constant Field Values
-
PROPERTY_LICENSE_INFO
public static final java.lang.String PROPERTY_LICENSE_INFO
The license information (e.g. URL/path) that served for accepting/rejecting events.- See Also:
- Constant Field Values
-
PROPERTY_ADDITIONAL_INFO
public static final java.lang.String PROPERTY_ADDITIONAL_INFO
Arbitrary additional information settable for the event.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAssetPath
public java.lang.String getAssetPath()
The path of the asset the event occurred upon.- Returns:
- A
Stringrepresenting the asset, folder or collection path.
-
getDate
public java.util.Date getDate()
The date the event occurred on.- Returns:
- The
Daterepresenting the date/time the event occurred on.
-
getLicenseInfo
public java.lang.String getLicenseInfo()
Information about the license upon which the user accepted or rejected.- Returns:
- A
Stringrepresenting the license information, ornullif n/a.
-
getVersionId
public java.lang.String getVersionId()
The ID of the version that was created upon the asset versioning event.- Returns:
- A
Stringrepresenting the version ID, ornullif n/a.
-
getUserId
public java.lang.String getUserId()
The id of the user generating the event.- Returns:
- A
Stringrepresenting the user id.
-
getType
public DamEvent.Type getType()
TheDamEvent.Typeof event that occurred on the asset.- Returns:
- The
DamEvent.Type
-
getAdditionalInfo
public java.lang.String getAdditionalInfo()
Any additional information provided for certain event types.- Returns:
- A
Stringrepresenting the additional information, ornullif n/a.
-
getExpirationDate
public java.util.Date getExpirationDate()
Expiration date for the ASSET_EXPIRED event.- Returns:
Daterepresenting the expiration date, ornullif n/a.
-
getCreatedBy
public java.lang.String getCreatedBy()
Creator of the asset.- Returns:
Stringrepresenting the creator of asset, ornullif n/a.
-
isPublishedExternally
public boolean isPublishedExternally()
Indicates whether this event represents an asset having been uploaded to an external system.- Returns:
trueif the event type isDamEvent.Type.PUBLISHED_EXTERNAL.
-
toEvent
public Event toEvent()
Create a distributable event.- Returns:
- An event.
-
toNonDistributableEvent
public Event toNonDistributableEvent()
Create a non distributable event.- Returns:
- An event.
-
accepted
public static DamEvent accepted(java.lang.String assetPath, java.lang.String userId, java.lang.String licenseInfo)
Creates aDamEventthat corresponds to the event of the license of a DRM-protected asset having been accepted.- Parameters:
assetPath- The path of the asset for which the license has been accepted.userId- The id of the user that accepted the license.licenseInfo- Information about the license, such as its path or URL.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ACCEPTED
-
rejected
public static DamEvent rejected(java.lang.String assetPath, java.lang.String userId, java.lang.String licenseInfo)
Creates aDamEventthat corresponds to the event of the license of a DRM-protected asset having been rejected.- Parameters:
assetPath- The path of the asset for which the license has been rejected.userId- The id of the user that rejected the license.licenseInfo- Information about the license, such as its path or URL.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.REJECTED
-
downloaded
public static DamEvent downloaded(java.lang.String assetPath, java.lang.String userId)
Creates aDamEventthat corresponds to the event of an asset having been downloaded. In case of a DRM-protected asset, this event can only follow aaccepted(String, String, String)event.- Parameters:
assetPath- The path of the asset that was downloaded.userId- The id of the user that downloaded the asset.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.DOWNLOADED
-
downloaded
public static DamEvent downloaded(java.lang.String assetPath, java.lang.String userId, java.lang.String additionalInfo)
Creates aDamEventthat corresponds to the event of an asset having been downloaded. In case of a DRM-protected asset, this event can only follow aaccepted(String, String, String)event.- Parameters:
assetPath- The path of the asset that was downloaded.userId- The id of the user that downloaded the asset.additionalInfo- Name of the source workflow of the downloaded asset, empty value means normal download.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.DOWNLOADED
-
versioned
public static DamEvent versioned(java.lang.String assetPath, java.lang.String userId, java.lang.String versionId)
Creates aDamEventthat corresponds to the event of an asset having been versioned.- Parameters:
assetPath- The path of the asset that was versioned.userId- The id of the user that versioned the asset.versionId- The id of the version that was created.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.VERSIONED,Asset.createRevision(String, String)
-
restored
public static DamEvent restored(java.lang.String assetPath, java.lang.String userId, java.lang.String versionId)
Creates aDamEventthat corresponds to the event of an asset having been restored from a previous version.- Parameters:
assetPath- The path of the asset that was restored.userId- The id of the user that restored the asset.versionId- The id of the version from which the asset was restored.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.RESTORED,AssetManager.restore(String)
-
metadataUpdated
public static DamEvent metadataUpdated(java.lang.String assetPath, java.lang.String userId)
Creates aDamEventthat corresponds to the event of an asset's metadata having been updated.- Parameters:
assetPath- The path of the asset the metadata of which was updated.userId- The id of the user that updated the metadata.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.METADATA_UPDATED
-
metadataUpdated
public static DamEvent metadataUpdated(java.lang.String assetPath, java.lang.String userId, java.lang.String additionalInfo)
Creates aDamEventthat corresponds to the event of an asset's metadata having been updated.- Parameters:
assetPath- The path of the asset the metadata of which was updated.userId- The id of the user that updated the metadata.additionalInfo- metadata info passed as "property1=value1,property2=value2..."- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.METADATA_UPDATED
-
publishedExternally
public static DamEvent publishedExternally(java.lang.String assetPath, java.lang.String userId, java.lang.String additionalInfo)
Creates aDamEventthat corresponds to the event of an asset having been uploaded to an external system.- Parameters:
assetPath- The path of the asset that was uploaded.userId- The id of the user that uploaded the asset.additionalInfo- Information about the external system to which the asset was uploaded, such as a URL.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.PUBLISHED_EXTERNAL
-
originalUpdated
public static DamEvent originalUpdated(java.lang.String assetPath, java.lang.String userId)
Creates aDamEventthat corresponds to the event of an asset's original rendition having been updated.- Parameters:
assetPath- The path of the asset the original of which was updated.userId- The id of the user that updated the asset's original.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ORIGINAL_UPDATED,Asset.addRendition(String, java.io.InputStream, String)
-
renditionUpdated
public static DamEvent renditionUpdated(java.lang.String assetPath, java.lang.String userId, java.lang.String renditionPath)
Creates aDamEventthat corresponds to the event of a rendition having been added or updated for an asset.- Parameters:
assetPath- The path of the asset for which a rendition was added or updated.userId- The id of the user that added/updated the rendition.renditionPath- The path of the rendition that was added/updated.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.RENDITION_UPDATED,Asset.addRendition(String, java.io.InputStream, String)
-
renditionRemoved
public static DamEvent renditionRemoved(java.lang.String assetPath, java.lang.String userId, java.lang.String renditionPath)
Creates aDamEventthat corresponds to the event of a rendition having been removed for an asset.- Parameters:
assetPath- The path of the asset for which a rendition was removed.userId- The id of the user that removed the rendition.renditionPath- The path of the rendition that was removed.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.RENDITION_REMOVED,Asset.removeRendition(String)
-
renditionDownloaded
public static DamEvent renditionDownloaded(java.lang.String assetPath, java.lang.String userId, java.lang.String renditionPath)
Creates aDamEventthat corresponds to the event of a rendition having been downloaded for an asset.- Parameters:
assetPath- The path of the asset for which a rendition was downloaded.userId- The id of the user that downloaded the rendition.renditionPath- The path of the rendition that was downloaded.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.RENDITION_DOWNLOADED
-
subassetUpdated
public static DamEvent subassetUpdated(java.lang.String assetPath, java.lang.String userId, java.lang.String subassetPath)
Creates aDamEventthat corresponds to the event of a sub-asset having been added or updated for an asset.- Parameters:
assetPath- The path of the asset for which a sub-asset was added or updated.userId- The id of the user that added/updated the sub-asset.subassetPath- The path of the sub-asset that was added/updated.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.SUBASSET_UPDATED,Asset.addSubAsset(String, String, java.io.InputStream)
-
subassetRemoved
public static DamEvent subassetRemoved(java.lang.String assetPath, java.lang.String userId, java.lang.String subassetPath)
Creates aDamEventthat corresponds to the event of a sub-asset having been removed for an asset.- Parameters:
assetPath- The path of the asset for which a sub-asset was removed.userId- The id of the user that removed the sub-asset.subassetPath- The path of the sub-asset that was removed.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.SUBASSET_REMOVED
-
assetCreated
public static DamEvent assetCreated(java.lang.String assetPath, java.lang.String userId)
Creates aDamEventthat corresponds to the event of an asset having been created.- Parameters:
assetPath- The path of the asset that was just created.userId- The id of the user that created the asset.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ASSET_CREATED,AssetManager.createAsset(String, java.io.InputStream, String, boolean)
-
assetMoved
public static DamEvent assetMoved(java.lang.String assetPath, java.lang.String userId)
Creates aDamEventthat corresponds to the event of an asset having been ,pved.- Parameters:
assetPath- The path of the asset that was just moved.userId- The id of the user that moved the asset.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ASSET_MOVED
-
assetRemoved
public static DamEvent assetRemoved(java.lang.String assetPath, java.lang.String userId)
Creates aDamEventthat corresponds to the event of an asset having been removed.- Parameters:
assetPath- The path of the asset that was just removed.userId- The id of the user that removed the asset.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ASSET_REMOVED
-
assetExpired
public static DamEvent assetExpired(java.lang.String assetPath, java.lang.String userId, java.util.Date expirationDate, java.lang.String createdBy)
Creates aDamEventthat corresponds to the event of an asset after expiration. By default expiration date property that is considered is jcr:content/offTime- Parameters:
assetPath- The path of the asset that was expired.expirationDate- The expiration date of the asset.createdBy- Creator of the assetuserId- The id of the user that expired the asset.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ASSET_EXPIRING
-
assetExpiring
public static DamEvent assetExpiring(java.lang.String assetPath, java.lang.String userId, java.util.Date expirationDate, java.lang.String createdBy)
Creates aDamEventthat corresponds to the event of an asset getting expired in future. By default expiration date property that is considered is jcr:content/offTime- Parameters:
assetPath- The path of the asset that is getting expired.expirationDate- The expiration date of the asset.createdBy- Creator of the assetuserId- The id of the user that expired the asset.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ASSET_EXPIRED
-
assetViewed
public static DamEvent assetViewed(java.lang.String assetPath, java.lang.String userId)
Creates aDamEventthat corresponds to the event upon visiting an asset's detail page.- Parameters:
assetPath- The path of the asset whose details were accessed.userId- The id of the user that accessed the asset details page.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ASSET_VIEWED
-
assetShared
public static DamEvent assetShared(java.lang.String assetPath, java.lang.String userId, java.lang.String additionalInfo)
Creates aDamEventthat corresponds to the event of an asset being shared on different cloud solutions.- Parameters:
assetPath- The path of the asset that was shared.userId- The id of the user who shared the asset.additionalInfo- Place where this asset was shared.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ASSET_SHARED
-
assetPublished
public static DamEvent assetPublished(java.lang.String assetPath, java.lang.String userId)
Creates aDamEventthat corresponds to the event of an asset being published.- Parameters:
assetPath- The path of the asset that was published.userId- The id of the user that updated the metadata.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ASSET_PUBLISHED
-
projectViewed
public static DamEvent projectViewed(java.lang.String assetPath, java.lang.String userId)
Creates aDamEventthat corresponds to the event of a project being viewed.- Parameters:
assetPath- The path of the project that was viewed.userId- The id of the user who viewed the project.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.PROJECT_VIEWED
-
collectionViewed
public static DamEvent collectionViewed(java.lang.String assetPath, java.lang.String userId)
Creates aDamEventthat corresponds to the event of a collection being viewed.- Parameters:
assetPath- The path of the collection that was viewed.userId- The id of the user who viewed the collection.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.COLLECTION_VIEWED
-
addedComment
public static DamEvent addedComment(java.lang.String assetPath, java.lang.String userId, java.lang.String additionalInfo)
Creates aDamEventthat corresponds to the event of addidng a commment to an asset.- Parameters:
assetPath- The path of the asset which was commented upon.userId- The id of the user who commented on the asset.additionalInfo- Message of added comment.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ADDED_COMMENT
-
assetUsage
public static DamEvent assetUsage(java.lang.String assetPath, java.lang.String usageType, java.util.Date date)
Creates aDamEventthat corresponds to the event that asset is used in some solution.- Parameters:
assetPath- The path of the asset which was used.usageType- defines the type of usage, whether asset is used in collection or some third party solution like Campaign, Social.date- The time when asset was used.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.ASSET_USAGE
-
damUpdateAssetWorkflowCompleted
public static DamEvent damUpdateAssetWorkflowCompleted(java.lang.String assetPath)
Creates aDamEventthat corresponds to the event that DAM update asset workflow is completed.- Parameters:
assetPath- The path of the asset on which the DAM update asset workflow executed.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.DAM_UPDATE_ASSET_WORKFLOW_COMPLETED
-
damMetadataWritebackWorkflowCompleted
public static DamEvent damMetadataWritebackWorkflowCompleted(java.lang.String assetPath)
Creates aDamEventthat corresponds to the event that DAM metadata writeback workflow is completed.- Parameters:
assetPath- The path of the asset on which the DAM metadata writeback workflow executed.- Returns:
- The corresponding
DamEvent - See Also:
DamEvent.Type.DAM_METADATA_WRITEBACK_WORKFLOW_COMPLETED
-
-