Package nl.vpro.domain.media.update
Class MediaUpdate<M extends MediaObject>
java.lang.Object
nl.vpro.domain.media.update.MediaUpdate<M>
- Type Parameters:
M
- TheMediaObject
extension this is for.
- All Implemented Interfaces:
Embargo
,Identifiable<Long>
,MediaIdentifiable
,MidIdentifiable
,MutableEmbargo<MediaUpdate<M>>
,TextualObjectUpdate<TitleUpdate,
,DescriptionUpdate, MediaUpdate<M>> IntegerVersionSpecific
,VersionSpecific<Integer>
- Direct Known Subclasses:
GroupUpdate
,ProgramUpdate
,SegmentUpdate
@ValidEmbargo(groups=nl.vpro.validation.WarningValidatorGroup.class)
@HasTitle(groups=nl.vpro.validation.PomsValidatorGroup.class,message="{nl.vpro.constraints.hassubormaintitle}",type={SUB,MAIN}) @HasTitle(groups=nl.vpro.validation.WarningValidatorGroup.class,type=MAIN)
@HasGenre(groups=nl.vpro.validation.WarningValidatorGroup.class)
@AVTypeValidation
public abstract sealed class MediaUpdate<M extends MediaObject>
extends Object
implements MutableEmbargo<MediaUpdate<M>>, TextualObjectUpdate<TitleUpdate,DescriptionUpdate,MediaUpdate<M>>, IntegerVersionSpecific, MediaIdentifiable
permits ProgramUpdate, GroupUpdate, SegmentUpdate
A MediaUpdate is meant for communicating updates. It is not meant as a complete representation of the object.
A MediaUpdate is like a MediaObject
but
- It does not have
MutableOwnable
objects. When converting between a MediaUpdate and a MediaObject one need to indicate for which owner type this must happen. If you are updating you are always associated with a certain owner (normallyOwnerType.BROADCASTER
), so there is no case for updating fields of other owners. - It contains fewer implicit fields. E.g. a Broadcaster is just an id, and it does not contain a better string representation. These kind of fields are non modifiable, or are implicitely calculated. So there is no case in updating them.
- It may contain a 'version' Some code may check this version to know whether certain fields ought to be ignored or not. This is to arrange forward and backwards compatibility. It may e.g. happen that a newer version of POMS has a new field. If you are not aware of this, sending an update XML without the field may result in the value to be emptied. To indicate that you are aware, you should sometimes supply a sufficiently high version.
MediaObject
it has three extensions ProgramUpdate
, GroupUpdate
and SegmentUpdate
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface nl.vpro.domain.media.MediaIdentifiable
MediaIdentifiable.Correlation
-
Field Summary
Modifier and TypeFieldDescriptionprotected @Valid Asset
protected AVType
protected Boolean
protected boolean
protected List<@NotNull @Valid GeoLocationUpdate>
protected List<@NotNull @Valid ImageUpdate>
protected List<@NotNull IntentionType>
This represents the editable intentions Only display the intentions for the given owner (more intentions might be present in the metadata).protected @Valid MediaObject
protected String
protected SortedSet<@NotNull @Valid PredictionUpdate>
protected List<@NotNull TargetGroupType>
protected @Pattern(regexp="^urn:vpro:media:(?:group|program|segment):[0-9]+$") String
Deprecated.protected IntegerVersion
protected boolean
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
MediaUpdate
(IntegerVersion version, M mediaobject, nl.vpro.domain.media.support.OwnerType ownerType) -
Method Summary
Modifier and TypeMethodDescriptionstatic <M extends MediaObject>
@PolyNull MediaUpdate<M>create
(@PolyNull M object) static <M extends MediaObject>
@PolyNull MediaUpdate<M>create
(@PolyNull M object, nl.vpro.domain.media.support.OwnerType owner) static <M extends MediaObject>
@PolyNull MediaUpdate<M>create
(@PolyNull M object, nl.vpro.domain.media.support.OwnerType owner, IntegerVersion version) static <M extends MediaObject,
MB extends MediaBuilder<MB, M>>
MediaUpdate<M>createUpdate
(MB object, nl.vpro.domain.media.support.OwnerType ownerType) fetch()
fetch
(nl.vpro.domain.media.support.OwnerType owner) Convert this MediaUpdate object to a MediaObject Clone all the fields of MediaUpdate into a new MediaObjectprotected abstract void
protected final void
fillFromMedia
(M mediaobject, nl.vpro.domain.media.support.OwnerType owner) @Nullable Asset
getAsset()
Get asset containing the location source to be encoded.@NotNull AVType
@Size(min=1,groups=nl.vpro.validation.WarningValidatorGroup.class) @NonNull List<String>
@NonNull List<ContentRating>
List<org.meeuw.i18n.regions.Region>
@Valid @NonNull List<CreditsUpdate>
getCrids()
protected Boolean
@Valid @NonNull SortedSet<DescriptionUpdate>
getEmail()
@Valid @NonNull List<GeoLocationUpdate>
@Valid @NonNull SortedSet<GeoRestrictionUpdate>
getId()
@Valid @NonNull List<ImageUpdate>
@NonNull List<IntentionType>
@Valid @NonNull SortedSet<LocationUpdate>
final MediaType
@NonNull SortedSet<MemberRefUpdate>
final @Size(max=255) @Size(min=4) @Pattern(regexp="^[ .a-zA-Z0-9_-]+$",flags=CASE_INSENSITIVE,message="{nl.vpro.constraints.mid}") String
getMid()
@Valid List<PortalRestrictionUpdate>
@Valid @NonNull SortedSet<PredictionUpdate>
@NonNull SortedSet<RelationUpdate>
getTags()
@NonNull List<TargetGroupType>
How to create an instance of a title.@Valid @NotNull @NonNull @Size(min=1,groups=nl.vpro.validation.RedundantValidatorGroup.class) SortedSet<TitleUpdate>
@Valid @NonNull List<TopicUpdate>
abstract SubMediaType
getType()
getUrn()
Deprecated.protected abstract String
The POMS version this XML applies too.protected String
protected boolean
boolean
boolean
protected boolean
isNotBefore
(Integer... intVersion) boolean
isValid()
protected abstract M
newMedia()
void
setAgeRating
(AgeRating ageRating) void
void
setAvAttributes
(AVAttributesUpdate avAttributes) void
void
setBroadcasters
(String... broadcasters) void
setBroadcasters
(List<String> broadcasters) void
setContentRatings
(List<ContentRating> contentRatings) void
setCountries
(List<org.meeuw.i18n.regions.Region> countries) void
setCredits
(List<CreditsUpdate> credits) void
setCredits
(CreditsUpdate... credits) void
void
setDeleted
(boolean isDeleted) protected void
setDeletedAttribute
(Boolean deleted) void
setDescriptions
(SortedSet<DescriptionUpdate> descriptions) void
setDescriptions
(DescriptionUpdate... descriptions) void
setDuration
(Duration duration) void
void
void
setEmbeddable
(Boolean isEmbeddable) void
void
void
setGeoLocations
(List<GeoLocationUpdate> geoLocationUpdates) void
setGeoLocations
(GeoLocationUpdate... geoLocationUpdates) void
setGeoRestrictions
(SortedSet<GeoRestrictionUpdate> restrictions) void
setImages
(List<ImageUpdate> images) void
setImages
(ImageUpdate... images) void
setIntentions
(List<IntentionType> intentions) void
setLanguages
(List<Locale> languages) void
setLocations
(SortedSet<LocationUpdate> locations) void
setLocations
(LocationUpdate... locations) void
setMemberOf
(SortedSet<MemberRefUpdate> memberOf) void
void
setPortalRestrictions
(String... restrictions) void
setPortalRestrictions
(List<PortalRestrictionUpdate> restrictions) void
setPortals
(String... portals) void
setPortals
(List<String> portals) void
setPredictions
(SortedSet<PredictionUpdate> predictions) @NonNull MediaUpdate<M>
setPublishStartInstant
(Instant publishStart) @NonNull MediaUpdate<M>
setPublishStopInstant
(Instant publishStop) void
setRelations
(SortedSet<RelationUpdate> relations) void
setReleaseYear
(Short releaseYear) void
void
void
setTargetGroups
(List<TargetGroupType> targetGroups) void
setTitles
(SortedSet<TitleUpdate> titles) void
setTitles
(TitleUpdate... titles) void
setTopics
(List<TopicUpdate> topicUpdates) void
setTopics
(TopicUpdate... topicUpdates) void
setTwitterRefs
(List<String> twitterRefs) void
Deprecated.void
setVersion
(IntegerVersion version) protected void
setVersionAttribute
(String version) void
setWebsiteObjects
(List<Website> websites) void
setWebsites
(String... websites) void
setWebsites
(List<String> websites) protected <T,
U> List<T> protected <T,
U> List<T> protected <T,
U> List<T> protected MemberRef
protected <T,
U extends Comparable<U>>
TreeSet<T>protected <T,
U extends Comparable<U>>
TreeSet<T>toString()
static <N extends MediaObject>
StringviolationMessage
(Set<? extends javax.validation.ConstraintViolation<? extends MediaUpdate<? extends N>>> violations) Set<? extends javax.validation.ConstraintViolation<MediaUpdate<? extends M>>>
violations
(Class<?>... groups) Set<? extends javax.validation.ConstraintViolation<MediaUpdate<? extends M>>>
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, 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.media.MediaIdentifiable
getCorrelation, getCorrelationId, getMainIdentifier
Methods inherited from interface nl.vpro.domain.MutableEmbargo
set
Methods inherited from interface nl.vpro.domain.TextualObjectUpdate
addDescription, addDescription, addTitle, addTitle, findDescription, findTitle, getAbbreviatedTitle, getLanguage, getLexicoTitle, getLongDescription, getMainDescription, getMainTitle, getOriginalTitle, getShortDescription, getShortTitle, getSubDescription, getSubTitle, getWorkTitle, hasDescriptions, hasTitles, removeDescription, removeDescription, removeTitle, self, setDescription, setDescription, setLongDescription, setMainDescription, setMainTitle, setTitle, setTitle
-
Field Details
-
version
-
xmlVersion
protected boolean xmlVersion -
mediaObjectToValidate
-
mid
-
urn
@Deprecated(since="7.7") @Pattern(regexp="^urn:vpro:media:(?:group|program|segment):[0-9]+$") protected @Pattern(regexp="^urn:vpro:media:(?:group|program|segment):[0-9]+$") String urnDeprecated. -
avType
-
embeddable
-
images
-
intentions
This represents the editable intentions Only display the intentions for the given owner (more intentions might be present in the metadata). -
targetGroups
-
geoLocations
-
asset
-
predictions
-
fromXml
protected boolean fromXml
-
-
Constructor Details
-
MediaUpdate
protected MediaUpdate() -
MediaUpdate
protected MediaUpdate(IntegerVersion version, M mediaobject, nl.vpro.domain.media.support.OwnerType ownerType)
-
-
Method Details
-
create
public static <M extends MediaObject> @PolyNull MediaUpdate<M> create(@PolyNull M object, nl.vpro.domain.media.support.OwnerType owner) -
create
-
create
public static <M extends MediaObject> @PolyNull MediaUpdate<M> create(@PolyNull M object, nl.vpro.domain.media.support.OwnerType owner, IntegerVersion version) -
createUpdate
public static <M extends MediaObject,MB extends MediaBuilder<MB, MediaUpdate<M> createUpdateM>> (MB object, nl.vpro.domain.media.support.OwnerType ownerType) -
fillFromMedia
-
fillFrom
-
getVersion
The POMS version this XML applies too. This is optional, though some features will only be supported if you explicitly specify a version which is big enough (To ensure backward compatibility). If you don't specify it, there will be no backwards compatibility.
The main point is that the XML may contain elements which' absent means something. E.g. having no
<country
would mean that there should be no country associated with the object. This was introduced in poms 5.0. If you specify a version before 5.0, all country information will be ignored, and left was it was.- Specified by:
getVersion
in interfaceIntegerVersionSpecific
- Specified by:
getVersion
in interfaceVersionSpecific<M extends MediaObject>
-
setVersion
- Specified by:
setVersion
in interfaceIntegerVersionSpecific
-
getVersionAttribute
-
setVersionAttribute
-
isValid
public boolean isValid() -
warningViolations
public Set<? extends javax.validation.ConstraintViolation<MediaUpdate<? extends M>>> warningViolations() -
violations
public Set<? extends javax.validation.ConstraintViolation<MediaUpdate<? extends M>>> violations(Class<?>... groups) -
violationMessage
-
violationMessage
public static <N extends MediaObject> String violationMessage(Set<? extends javax.validation.ConstraintViolation<? extends MediaUpdate<? extends N>>> violations) -
newMedia
-
fetch
Convert this MediaUpdate object to a MediaObject Clone all the fields of MediaUpdate into a new MediaObject -
fetch
-
toList
-
toList
-
toList
-
toSet
protected <T,U extends Comparable<U>> TreeSet<T> toSet(Set<U> list, Predicate<U> filter, Function<U, T> mapper) -
toSet
-
getMid
@Size(max=255) @Size(min=4) @Pattern(regexp="^[ .a-zA-Z0-9_-]+$", flags=CASE_INSENSITIVE, message="{nl.vpro.constraints.mid}") public final @Size(max=255) @Size(min=4) @Pattern(regexp="^[ .a-zA-Z0-9_-]+$",flags=CASE_INSENSITIVE,message="{nl.vpro.constraints.mid}") String getMid()- Specified by:
getMid
in interfaceMidIdentifiable
- Since:
- 1.5
-
setMid
- Since:
- 1.8
-
getType
-
getMediaType
- Specified by:
getMediaType
in interfaceMidIdentifiable
- Since:
- 5.6
-
getDeletedAttribute
-
setDeletedAttribute
-
isDeleted
public boolean isDeleted() -
setDeleted
public void setDeleted(boolean isDeleted) -
getUrn
Deprecated. -
setUrn
Deprecated.Refer to existing media bymid
instead. -
getId
- Specified by:
getId
in interfaceIdentifiable<M extends MediaObject>
- Specified by:
getId
in interfaceMediaIdentifiable
-
getUrnPrefix
-
getAVType
-
setAVType
-
getEmbeddable
-
setEmbeddable
-
getPublishStartInstant
- Specified by:
getPublishStartInstant
in interfaceEmbargo
-
setPublishStartInstant
- Specified by:
setPublishStartInstant
in interfaceMutableEmbargo<M extends MediaObject>
-
getPublishStopInstant
- Specified by:
getPublishStopInstant
in interfaceEmbargo
-
setPublishStopInstant
- Specified by:
setPublishStopInstant
in interfaceMutableEmbargo<M extends MediaObject>
-
getCrids
- Specified by:
getCrids
in interfaceMediaIdentifiable
-
setCrids
-
getBroadcasters
@Size(min=1, groups=nl.vpro.validation.WarningValidatorGroup.class) public @Size(min=1,groups=nl.vpro.validation.WarningValidatorGroup.class) @NonNull List<String> getBroadcasters() -
setBroadcasters
-
setBroadcasters
-
getPortals
-
setPortals
-
setPortals
-
getPortalRestrictions
-
setPortalRestrictions
-
setPortalRestrictions
-
getGeoRestrictions
-
setGeoRestrictions
-
getTitles
@Valid @NotNull @Size(min=1, groups=nl.vpro.validation.RedundantValidatorGroup.class) public @Valid @NotNull @NonNull @Size(min=1,groups=nl.vpro.validation.RedundantValidatorGroup.class) SortedSet<TitleUpdate> getTitles()- Specified by:
getTitles
in interfaceTextualObjectUpdate<TitleUpdate,
DescriptionUpdate, MediaUpdate<M extends MediaObject>>
-
setTitles
- Specified by:
setTitles
in interfaceTextualObjectUpdate<TitleUpdate,
DescriptionUpdate, MediaUpdate<M extends MediaObject>>
-
setTitles
-
getDescriptions
- Specified by:
getDescriptions
in interfaceTextualObjectUpdate<TitleUpdate,
DescriptionUpdate, MediaUpdate<M extends MediaObject>>
-
setDescriptions
- Specified by:
setDescriptions
in interfaceTextualObjectUpdate<TitleUpdate,
DescriptionUpdate, MediaUpdate<M extends MediaObject>>
-
setDescriptions
-
getTitleCreator
Description copied from interface:TextualObjectUpdate
How to create an instance of a title. This makes a lot of default methods possible.- Specified by:
getTitleCreator
in interfaceTextualObjectUpdate<TitleUpdate,
DescriptionUpdate, MediaUpdate<M extends MediaObject>>
-
getDescriptionCreator
- Specified by:
getDescriptionCreator
in interfaceTextualObjectUpdate<TitleUpdate,
DescriptionUpdate, MediaUpdate<M extends MediaObject>>
-
getTags
-
setTags
-
setTags
-
getCountries
-
setCountries
-
getLanguages
-
setLanguages
-
getGenres
@StringList(pattern="3\\.([0-9]+\\.)*[0-9]+", maxLength=255) public @NonNull SortedSet<String> getGenres() -
setGenres
-
setGenres
-
getIntentions
-
setIntentions
-
getTargetGroups
-
setTargetGroups
-
getAvAttributes
-
setAvAttributes
-
getDuration
-
setDuration
-
getReleaseYear
-
setReleaseYear
-
getCredits
-
setCredits
-
setCredits
-
getMemberOf
-
toMemberRef
-
setMemberOf
- Throws:
CircularReferenceException
-
getAgeRating
-
setAgeRating
-
getContentRatings
-
setContentRatings
-
getEmail
-
setEmail
-
setEmail
-
getWebsites
-
setWebsites
-
setWebsites
-
setWebsiteObjects
-
getTwitterrefs
-
setTwitterRefs
-
getPredictions
- Since:
- 5.6
-
setPredictions
- Since:
- 5.6
-
getLocations
-
setLocations
-
setLocations
-
getRelations
-
setRelations
-
getImages
-
setImages
-
setImages
-
getAsset
Get asset containing the location source to be encoded.- Returns:
- asset or null when unavailable
- Since:
- 2.1
-
setAsset
-
getGeoLocations
-
setGeoLocations
-
setGeoLocations
-
getTopics
-
setTopics
-
setTopics
-
toString
-
isNotBefore
-
isBefore
-
isImported
public boolean isImported()
-
mid
instead.