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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ThreadLocal<Boolean>
PUBLISH_WORKFLOW
protected Workflow
workflow
-
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
Constructors Modifier Constructor Description PublishableObject()
PublishableObject(long id)
protected
PublishableObject(PublishableObject<T> source)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
acceptChanges()
Accept the mutations on this object by recalculating crc32.protected void
beforeUnmarshal(javax.xml.bind.Unmarshaller u, Object parent)
protected CRC32
calcCRC32()
We keep track of a CRC32 hash to determin if an object is 'changed', in the sense that it would need republication.Date
getCreationDate()
Deprecated.Long
getHash()
Date
getLastModified()
Deprecated.Date
getLastPublished()
Deprecated.Workflow
getWorkflow()
boolean
hasChanges()
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
isDeleted()
boolean
isInAllowedPublicationWindow(long millisFromNow)
Deprecated.protected byte[]
serializeForCalcCRC32()
void
setCreationDate(Date creationDate)
Deprecated.void
setLastModified(Date lastModified)
Deprecated.void
setLastPublished(Date lastPublished)
Deprecated.protected void
setWorkflow(Workflow workflow)
String
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 Detail
-
PUBLISH_WORKFLOW
public static ThreadLocal<Boolean> PUBLISH_WORKFLOW
-
workflow
protected Workflow workflow
-
-
Constructor Detail
-
PublishableObject
protected PublishableObject(PublishableObject<T> source)
-
PublishableObject
public PublishableObject()
-
PublishableObject
public PublishableObject(long id)
-
-
Method Detail
-
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
public Long getHash()
-
serializeForCalcCRC32
protected byte[] serializeForCalcCRC32()
-
calcCRC32
protected CRC32 calcCRC32()
We keep track of a CRC32 hash to determin if an object is 'changed', in the sense that it would need republication.
-
isActivation
public boolean isActivation(Instant now)
-
isDeactivation
public boolean isDeactivation(Instant now)
-
getLastModified
@Deprecated public Date getLastModified()
Deprecated.
-
setLastModified
@Deprecated public void setLastModified(Date lastModified)
Deprecated.
-
getCreationDate
@Deprecated public final Date getCreationDate()
Deprecated.
-
setCreationDate
@Deprecated public final void setCreationDate(Date creationDate)
Deprecated.
-
getLastPublished
@Deprecated public Date getLastPublished()
Deprecated.
-
setLastPublished
@Deprecated public void setLastPublished(Date lastPublished)
Deprecated.
-
getWorkflow
public Workflow getWorkflow()
- Specified by:
getWorkflow
in interfaceTrackableObject
-
setWorkflow
protected void setWorkflow(Workflow workflow)
-
isDeleted
public boolean isDeleted()
-
toString
public String toString()
- Overrides:
toString
in classAbstractPublishableObject<T extends PublishableObject<T>>
-
isInAllowedPublicationWindow
@Deprecated public boolean isInAllowedPublicationWindow(long millisFromNow)
Deprecated.
-
beforeUnmarshal
protected void beforeUnmarshal(javax.xml.bind.Unmarshaller u, Object parent)
- Overrides:
beforeUnmarshal
in classAbstractPublishableObject<T extends PublishableObject<T>>
-
-