Package nl.vpro.domain.media
Class Prediction
java.lang.Object
nl.vpro.domain.media.Prediction
- All Implemented Interfaces:
Serializable
,Comparable<Prediction>
,Child<MediaObject>
,Embargo
,Updatable<Prediction>
,MutableEmbargo<Prediction>
@Entity
public class Prediction
extends Object
implements Comparable<Prediction>, Updatable<Prediction>, Serializable, MutableEmbargo<Prediction>, Child<MediaObject>
A prediction is related to a program and indicates that locations (for a certain platform) will be available, and nowadays also whether it is or was available.
Also, it contains information about the embargo restrictions for that platform.
There may be an encryption
associated. If set then the prediction will only be valid for the platform and that given prediction. If not set, normally both encrypted and non-encrypted locations will be present.
- Since:
- 1.6
- Author:
- Michiel Meeuwissen
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected Encryption
protected @NotNull Instant
protected MediaObject
protected @NotNull Platform
protected Prediction.State
protected Instant
protected Instant
protected @NotNull Prediction.State
-
Constructor Summary
ConstructorDescriptionPrediction
(String platform) Constructor needed for jackson unmarshallingPrediction
(Platform platform) Prediction
(Platform platform, Instant publishStart, Instant publishStop) Prediction
(Platform platform, Prediction.State state) -
Method Summary
Modifier and TypeMethodDescriptionstatic Prediction.Builder
static Prediction.Builder
static @NonNull Prediction.Builder
builder()
int
compareTo
(@NonNull Prediction o) static Prediction
copy
(Prediction source, Authority authority) static Prediction
copy
(Prediction source, MediaObject parent) Copied a prediction to a new parent, with authorityAuthority.USER
boolean
boolean
equalsIgnoreParent
(Prediction other) boolean
fieldEquals
(Prediction prediction) An embargo object based ongetOwnPublishStartInstant()
andgetOwnPublishStopInstant()
com.google.common.collect.Range<Instant>
'Own' embargo wrapped in aRange
.Returns the 'own' embargo start.Returns the 'own' embargo stop.Basically the start of a prediction isgetOwnPublishStartInstant()
.When this prediction will be revoked.getState()
int
hashCode()
protected void
boolean
isDRM()
// See MSE-3992boolean
isNew()
boolean
TODO The state is 'ANNOUNCED', so shouldn't we name this field 'announcedAvailability'?static Prediction.Builder
realized()
static Prediction.Builder
revoked()
void
setAuthority
(Authority authority) void
setEncryption
(Encryption encryption) void
setIssueDate
(Instant issueDate) void
setParent
(MediaObject mo) void
setPlannedAvailability
(boolean plannedAvailability) void
setPlatform
(Platform platform) @NonNull Prediction
setPublishStartInstant
(Instant start) @NonNull Prediction
setPublishStopInstant
(Instant publishStop) void
setState
(Prediction.State state) toString()
static Prediction
unavailable
(MediaObject parent, Platform platform, Authority authority) void
update
(Prediction from) Copies all fields from argumentstatic Prediction
virtual
(MediaObject parent, Platform platform, Authority authority) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.vpro.domain.Embargo
asRange, inPublicationWindow, inPublicationWindow, isConsiderableForPublication, isPublishable, isUnderEmbargo, isUnderEmbargo, wasUnderEmbargo, wasUnderEmbargo, willBePublished, willBePublished, willBeUnderEmbargo, willBeUnderEmbargo
Methods inherited from interface nl.vpro.domain.MutableEmbargo
set
-
Field Details
-
issueDate
-
state
-
previousState
-
publishStart
-
publishStop
-
platform
-
mediaObject
-
encryption
-
-
Constructor Details
-
Prediction
public Prediction() -
Prediction
Constructor needed for jackson unmarshalling -
Prediction
-
Prediction
-
Prediction
-
-
Method Details
-
copy
-
copy
Copied a prediction to a new parent, with authorityAuthority.USER
-
virtual
-
announced
-
announced
-
revoked
-
realized
-
setParent
- Specified by:
setParent
in interfaceChild<MediaObject>
-
getParent
- Specified by:
getParent
in interfaceChild<MediaObject>
-
isNew
public boolean isNew() -
getPublishStartInstant
Basically the start of a prediction isgetOwnPublishStartInstant()
. If there are locations that are to be published earlier, they won't be published either. If there are no locations, then the assumption is that the publish start is 'predicted' and around that time a notify from NEP fill follow.- Specified by:
getPublishStartInstant
in interfaceEmbargo
-
setPublishStartInstant
- Specified by:
setPublishStartInstant
in interfaceMutableEmbargo<Prediction>
-
getPublishStopInstant
When this prediction will be revoked.If all locations will be revoked before the
registered publishstop in
this prediction, then this method will return the latest value of that.- Specified by:
getPublishStopInstant
in interfaceEmbargo
- See Also:
-
getOwnPublishStartInstant
Returns the 'own' embargo start. Currently, always the same asgetPublishStartInstant()
- Since:
- 7.10
- See Also:
-
getOwnPublishStopInstant
Returns the 'own' embargo stop.getPublishStopInstant()
may be restricted by available locations.- Since:
- 7.10
- See Also:
-
getOwnPublicationRange
'Own' embargo wrapped in aRange
.- Since:
- 7.10
- See Also:
-
getOwnEmbargo
An embargo object based ongetOwnPublishStartInstant()
andgetOwnPublishStopInstant()
- Since:
- 7.10
- See Also:
-
setPublishStopInstant
- Specified by:
setPublishStopInstant
in interfaceMutableEmbargo<Prediction>
-
setPlatform
-
setAuthority
-
setPlannedAvailability
public void setPlannedAvailability(boolean plannedAvailability) -
setEncryption
-
setState
-
invalidateXml
protected void invalidateXml() -
compareTo
- Specified by:
compareTo
in interfaceComparable<Prediction>
-
equals
-
equalsIgnoreParent
-
fieldEquals
-
hashCode
public int hashCode() -
update
Description copied from interface:Updatable
Copies all fields from argument- Specified by:
update
in interfaceUpdatable<Prediction>
-
isDRM
public boolean isDRM()// See MSE-3992 -
toString
-
builder
-
getIssueDate
-
setIssueDate
-
getState
-
getPreviousState
-
getPlatform
-
getAuthority
-
isPlannedAvailability
public boolean isPlannedAvailability()TODO The state is 'ANNOUNCED', so shouldn't we name this field 'announcedAvailability'?- Since:
- 5.6
-
getEncryption
-