Package nl.vpro.domain.media.support
Class PublishableObject<T extends PublishableObject<T>>
java.lang.Object
nl.vpro.domain.DomainObject
nl.vpro.domain.AbstractPublishableObject<T>
nl.vpro.domain.media.support.PublishableObject<T>
- All Implemented Interfaces:
Serializable
,Accountable
,Changeable
,Embargo
,Identifiable<Long>
,TrackableObject
,MutableEmbargo<T>
,MutableEmbargoDeprecated<T>
,Publishable<T>
,Trackable
- Direct Known Subclasses:
Image
,Location
,MediaObject
@MappedSuperclass
@EmbargoValidation(groups=nl.vpro.validation.PomsValidatorGroup.class)
public abstract class PublishableObject<T extends PublishableObject<T>>
extends AbstractPublishableObject<T>
implements MutableEmbargoDeprecated<T>, TrackableObject
- Author:
- arne, roekoe
- See Also:
-
Field Summary
Fields inherited from class nl.vpro.domain.AbstractPublishableObject
createdBy, creationInstant, lastModified, lastModifiedBy, lastPublished, publishStart, publishStop
Fields inherited from class nl.vpro.domain.DomainObject
id
-
Constructor Summary
ModifierConstructorDescriptionPublishableObject
(long id) protected
PublishableObject
(PublishableObject<T> source) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Accept the mutations on this object by recalculating crc32.protected void
beforeUnmarshal
(javax.xml.bind.Unmarshaller u, Object parent) protected CRC32
We keep track of a CRC32 hash to determine whether an object is 'changed', in the sense that it would need republication.getHash()
boolean
Checks if this object is changed compared to the persistent version by calculating the runtime CRC32 and compare it to the stored CRCboolean
isActivation
(Instant now) boolean
isDeactivation
(Instant now) boolean
protected byte[]
protected void
setWorkflow
(Workflow workflow) toString()
Methods inherited from class nl.vpro.domain.AbstractPublishableObject
getCreatedBy, getCreationInstant, getLastModifiedBy, getLastModifiedInstant, getLastPublishedInstant, getPublishStartInstant, getPublishStopInstant, getUrn, getUrnPrefix, setCreatedBy, setCreationInstant, setLastModifiedBy, setLastModifiedInstant, setLastPublishedInstant, setPublishStartInstant, setPublishStopInstant, setUrn
Methods inherited from class nl.vpro.domain.DomainObject
equals, getId, hashCode, isPersisted, setId
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.vpro.domain.Embargo
asRange, getPublishStartInstant, getPublishStopInstant, inPublicationWindow, inPublicationWindow, isUnderEmbargo, isUnderEmbargo, wasUnderEmbargo, wasUnderEmbargo, willBePublished, willBePublished, willBeUnderEmbargo, willBeUnderEmbargo
Methods inherited from interface nl.vpro.domain.MutableEmbargo
set, setPublishStartInstant, setPublishStopInstant
Methods inherited from interface nl.vpro.domain.MutableEmbargoDeprecated
getPublishStart, getPublishStop, setPublishStart, setPublishStop
Methods inherited from interface nl.vpro.domain.Trackable
getCreationInstant, getLastModifiedInstant
Methods inherited from interface nl.vpro.domain.media.TrackableObject
getParent, isMerged, isPublishable, isPublishable, isRevocable
-
Field Details
-
PUBLISH_WORKFLOW
-
workflow
-
-
Constructor Details
-
PublishableObject
-
PublishableObject
public PublishableObject() -
PublishableObject
public PublishableObject(long id)
-
-
Method Details
-
hasChanges
public boolean hasChanges()Checks if this object is changed compared to the persistent version by calculating the runtime CRC32 and compare it to the stored CRC- Specified by:
hasChanges
in interfaceChangeable
-
acceptChanges
public void acceptChanges()Accept the mutations on this object by recalculating crc32. If hasChanges() is called after this, it always returns false -
getHash
-
serializeForCalcCRC32
protected byte[] serializeForCalcCRC32() -
calcCRC32
We keep track of a CRC32 hash to determine whether an object is 'changed', in the sense that it would need republication. -
isActivation
-
isDeactivation
-
getWorkflow
- Specified by:
getWorkflow
in interfaceTrackableObject
-
setWorkflow
-
isDeleted
public boolean isDeleted() -
toString
- Overrides:
toString
in classAbstractPublishableObject<T extends PublishableObject<T>>
-
beforeUnmarshal
- Overrides:
beforeUnmarshal
in classAbstractPublishableObject<T extends PublishableObject<T>>
-