Package nl.vpro.domain.media
Class Segment
-
- All Implemented Interfaces:
Serializable
,Comparable<Segment>
,Accountable
,Changeable
,Child<Program>
,Embargo
,Identifiable<Long>
,LocalizedObject<Title,Description,Website,TwitterRef,MediaObject>
,Media<MediaObject>
,MediaIdentifiable
,MidIdentifiable
,nl.vpro.domain.media.support.MutableOwnable
,nl.vpro.domain.media.support.Ownable
,TrackableMedia
,TrackableObject
,MutableEmbargo<MediaObject>
,MutableEmbargoDeprecated<MediaObject>
,Publishable<MediaObject>
,TextualObject<Title,Description,MediaObject>
,TextualObjectUpdate<Title,Description,MediaObject>
,Trackable
,NicamRated
@Entity @SegmentValidation public class Segment extends MediaObject implements Comparable<Segment>, Child<Program>, nl.vpro.domain.media.support.MutableOwnable
A segment is a view on a program, representing a part of if starting at a givengetStart()
after the beginning of the program (and with a shorterMediaObject.getDuration()
. It cannot exist alone, and always has agetParent()
, which always is aProgram
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface nl.vpro.domain.media.MediaIdentifiable
MediaIdentifiable.Correlation
-
-
Field Summary
Fields Modifier and Type Field Description protected String
midRef
protected Program
parent
protected Duration
start
protected @NotNull(message="no segment type given") SegmentType
type
protected String
urnRef
-
Fields inherited from class nl.vpro.domain.media.MediaObject
ageRating, avAttributes, avType, awards, broadcasters, contentRatings, countries, credits, crids, DELETED_FILTER, descriptions, duration, email, EMBARGO_FILTER, genres, geoLocations, geoRestrictions, images, intentions, INVERSE_DELETED_FILTER, INVERSE_EMBARGO_FILTER, INVERSE_PUBLICATION_FILTER, isDubbed, isEmbeddable, languages, locations, memberOf, mid, portalRestrictions, portals, predictions, PUBLICATION_FILTER, relations, releaseYear, repubDate, repubDestinations, repubReason, sortInstant, source, tags, targetGroups, teletext, thirdParties, titles, topics, twitterRefs, version, websites
-
Fields inherited from class nl.vpro.domain.media.support.PublishableObject
PUBLISH_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
-
Fields inherited from interface nl.vpro.domain.TextualObject
DEFAULT_OWNER
-
-
Constructor Summary
Constructors Constructor Description Segment()
Segment(String mid, Program program, Duration start, AuthorizedDuration duration)
Segment(AVType avType)
Segment(AVType avType, Duration start)
Segment(AVType avType, Duration start, Duration duration)
Segment(AVType avType, Duration start, AuthorizedDuration duration)
Segment(Program program)
Segment(Program program, String midRef, Duration start, AuthorizedDuration duration)
Segment(Program program, Duration start, Duration duration)
Segment(Program program, Duration start, AuthorizedDuration duration)
Segment(Segment source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MediaBuilder.SegmentBuilder
builder()
MediaIdentifiable.Correlation
calcCorrelation()
The correlation id of a segment currently is the correlation id of its _parent_.int
compareTo(@NonNull Segment o)
static Segment
copy(Segment source)
protected void
findAncestry(MediaObject ancestor, List<MediaObject> ancestors)
SortedSet<MediaObject>
getAncestors()
String
getMidRef()
nl.vpro.domain.media.support.OwnerType
getOwner()
Program
getParent()
Returns the parentProgram
of this segment.RecursiveMemberRef
getSegmentOf()
Duration
getStart()
@NotNull SegmentType
getType()
protected String
getUrnPrefix()
String
getUrnRef()
boolean
hasAncestor(MediaObject ancestor)
boolean
isActivation(Instant now)
boolean
isDeactivation(Instant now)
boolean
isMerged()
MediaObjects can be merged.boolean
isRevocable(Instant now)
void
setMediaType(MediaType type)
void
setMidRef(String midRef)
void
setOwner(nl.vpro.domain.media.support.OwnerType owner)
void
setParent(Program parent)
void
setSegmentOf(RecursiveMemberRef parentRef)
void
setStart(Duration start)
void
setType(SegmentType segmentType)
void
setUrnRef(String urnRef)
-
Methods inherited from class nl.vpro.domain.media.MediaObject
addAllImages, addAward, addBroadcaster, addContentRating, addCountry, addCountry, addCountry, addCrid, addDescription, addDescription, addEmail, addGenre, addGeoRestriction, addImage, addImage, addLanguage, addLocation, addName, addPerson, addPortal, addPortalRestriction, addRelation, addThirdParty, addTitle, addTitle, calcCRC32, clearPortals, clearThirdParties, equals, findAncestry, findCredit, findGeoRestriction, findImage, findImage, findImage, findImages, findLocation, findLocation, findLocation, findMemberOfRef, findMemberOfRef, findMemberOfRef, findName, findOrCreatePrediction, findOrCreatePrediction, findPerson, findPerson, findPortalRestriction, findRelation, findRelation, get_Locations, get_Relations, getAbbreviatedTitle, getAgeRating, getAuthority, getAvailableSubtitles, getAvAttributes, getAVType, getAwards, getBroadcasters, getContentRatings, getCorrelation, getCountries, getCredits, getCrids, getDescendantOf, getDescriptions, getDuration, getDurationAsDate, getEmail, getExpandedGeoLocations, getExpandedIntentions, getExpandedTargetGroups, getExpandedTitles, getExpandedTopics, getGenres, getGeoLocations, getGeoRestrictions, getImage, getImage, getImage, getImages, getIntentions, getJsonCredits, getLanguages, getLexicoTitle, getLocation, getLocations, getMainBroadcaster, getMainDescription, getMainEmail, getMainImage, getMainTitle, getMediaType, getMemberOf, getMergedTo, getMergedToRef, getMid, getModifiableStreamingPlatformStatus, getOriginalTitle, getOwnedDescriptionCreator, getOwnedTitleCreator, getPersons, getPortalRestrictions, getPortals, getPrediction, getPredictions, getPredictionsForXml, getPresentationOrderLocations, getRelations, getReleaseYear, getRepubDestinations, getRepubReason, getShortDescription, getShortTitle, getSortDate, getSortInstant, getSource, getStreamingPlatformStatus, getSubDescription, getSubTitle, getTags, getTargetGroups, getTeletext, getThirdParties, getTitles, getTopics, getTwitterRefs, getVersion, getVirtualMemberRefs, getWebsites, getWorkTitle, giveCredits, hasAuthorizedDuration, hasDescendant, hasDescriptions, hasEpisode, hashCode, hasInternetVodAuthority, hasMember, hasSubtitles, hasTitles, invalidateSortDate, isDubbed, isEmbeddable, isHasSubtitles, isLocationAuthorityUpdate, isMember, isMemberOf, isMemberOf, mergeImages, removeBroadcaster, removeCrid, removeDescription, removeGeoRestriction, removeImage, removeImage, removeImages, removeLocation, removeLocation, removeName, removePerson, removePerson, removePortal, removePortalRestriction, removePrediction, removeRelation, removeThirdParty, removeTitle, revokeLocations, serializeForCalcCRC32, set_Locations, set_Relations, setAgeRating, setAvailableSubtitles, setAvAttributes, setAVType, setAwards, setBroadcasters, setContentRatings, setCountries, setCreationInstant, setCredits, setCrids, setDescriptions, setDuration, setDurationWithDate, setEmail, setEmbeddable, setGenres, setGeoLocations, setGeoRestrictions, setHasSubtitles, setImages, setIntentions, setIsDubbed, setJsonCredits, setLanguages, setLocationAuthorityUpdate, setLocations, setMemberOf, setMergedTo, setMergedToRef, setMid, setPersons, setPortalRestrictions, setPortals, setPredictions, setPredictionsForXml, setPublishStartInstant, setPublishStopInstant, setRelations, setReleaseYear, setRepubDestinations, setRepubReason, setSource, setTags, setTargetGroups, setTeletext, setTitles, setTopics, setTwitterRefs, setWebsites, setWorkflow, toString
-
Methods inherited from class nl.vpro.domain.media.support.PublishableObject
acceptChanges, beforeUnmarshal, getCreationDate, getHash, getLastModified, getLastPublished, getWorkflow, hasChanges, isDeleted, isInAllowedPublicationWindow, setCreationDate, setLastModified, setLastPublished
-
Methods inherited from class nl.vpro.domain.AbstractPublishableObject
getCreatedBy, getCreationInstant, getLastModifiedBy, getLastModifiedInstant, getLastPublishedInstant, getPublishStartInstant, getPublishStopInstant, getUrn, setCreatedBy, setLastModifiedBy, setLastModifiedInstant, setLastPublishedInstant, setUrn
-
Methods inherited from class nl.vpro.domain.DomainObject
getId, 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.LocalizedObject
addTag, addTwitterRef, addWebsite, addWebsite, findWebsite, findWebsite, getMainWebsite, getWebsite, removeTag, removeWebsite, removeWebsite
-
Methods inherited from interface nl.vpro.domain.media.MediaIdentifiable
getCorrelationId, getId, getMainIdentifier
-
Methods inherited from interface nl.vpro.domain.MutableEmbargo
set
-
Methods inherited from interface nl.vpro.domain.MutableEmbargoDeprecated
getPublishStart, getPublishStop, setPublishStart, setPublishStop
-
Methods inherited from interface nl.vpro.nicam.NicamRated
isNicamRated
-
Methods inherited from interface nl.vpro.domain.TextualObject
addDescription, addTitle, findDescription, findTitle, getDescriptionCreator, getTitleCreator, removeDescription, removeDescriptionsForOwner, removeTitle, removeTitlesForOwner, setDescription, setTitle
-
Methods inherited from interface nl.vpro.domain.TextualObjectUpdate
findDescription, findTitle, getLanguage, getLongDescription, removeDescription, self, setDescription, setDescription, setLongDescription, setMainDescription, setMainTitle, setTitle, setTitle
-
Methods inherited from interface nl.vpro.domain.Trackable
getCreationInstant, getLastModifiedInstant
-
Methods inherited from interface nl.vpro.domain.media.TrackableObject
getWorkflow, isPublishable, isPublishable
-
-
-
-
Field Detail
-
parent
protected Program parent
-
start
@NotNull(message="start property is required") protected Duration start
-
urnRef
protected String urnRef
-
midRef
protected String midRef
-
type
@NotNull(message="no segment type given") protected @NotNull(message="no segment type given") SegmentType type
-
-
Constructor Detail
-
Segment
public Segment()
-
Segment
public Segment(Program program, String midRef, Duration start, AuthorizedDuration duration)
-
Segment
public Segment(Program program)
-
Segment
public Segment(Program program, Duration start, AuthorizedDuration duration)
-
Segment
public Segment(String mid, Program program, Duration start, AuthorizedDuration duration)
-
Segment
public Segment(AVType avType)
-
Segment
public Segment(AVType avType, Duration start, AuthorizedDuration duration)
-
Segment
public Segment(Segment source)
-
-
Method Detail
-
builder
public static MediaBuilder.SegmentBuilder builder()
-
isActivation
public boolean isActivation(Instant now)
- Overrides:
isActivation
in classPublishableObject<MediaObject>
-
isDeactivation
public boolean isDeactivation(Instant now)
- Overrides:
isDeactivation
in classPublishableObject<MediaObject>
-
isRevocable
public boolean isRevocable(Instant now)
- Specified by:
isRevocable
in interfaceTrackableObject
-
isMerged
public boolean isMerged()
Description copied from class:MediaObject
MediaObjects can be merged. This means thatMediaObject.getMergedTo()
(orMediaObject.getMergedToRef()
) is nonnull
- Specified by:
isMerged
in interfaceTrackableObject
- Overrides:
isMerged
in classMediaObject
-
getParent
public Program getParent()
Returns the parentProgram
of this segment. Not that this does not work directly after a simple unmarshall of an individual segment because the full program object simply is not available then.Use
getMidRef()
for the mid, and obtain it seperately.- Specified by:
getParent
in interfaceChild<Program>
- Specified by:
getParent
in interfaceTrackableObject
- Returns:
- a trackable parent, null when a parent is not set or no parent-child relation exists
- See Also:
Image.getParent()
,Location.getParent()
,getParent()
-
setParent
public void setParent(Program parent)
-
getUrnRef
public String getUrnRef()
-
setUrnRef
public void setUrnRef(String urnRef)
-
getMidRef
public String getMidRef()
- Since:
- 1.9
-
setMidRef
public void setMidRef(String midRef)
- Since:
- 1.9
-
getUrnPrefix
protected String getUrnPrefix()
- Specified by:
getUrnPrefix
in classMediaObject
-
getStart
public Duration getStart()
-
setStart
public void setStart(Duration start)
-
getAncestors
public SortedSet<MediaObject> getAncestors()
- Overrides:
getAncestors
in classMediaObject
-
hasAncestor
public boolean hasAncestor(MediaObject ancestor)
- Overrides:
hasAncestor
in classMediaObject
-
findAncestry
protected void findAncestry(MediaObject ancestor, List<MediaObject> ancestors)
- Overrides:
findAncestry
in classMediaObject
-
compareTo
public int compareTo(@NonNull Segment o)
- Specified by:
compareTo
in interfaceComparable<Segment>
-
getType
@NotNull public @NotNull SegmentType getType()
- Specified by:
getType
in classMediaObject
-
setMediaType
public void setMediaType(MediaType type)
- Specified by:
setMediaType
in classMediaObject
-
setType
public void setType(SegmentType segmentType)
-
calcCorrelation
public MediaIdentifiable.Correlation calcCorrelation()
The correlation id of a segment currently is the correlation id of its _parent_.I forgot why this is important, but I think it may give problems when a segment is converted to a clip and/or vice versa.
For 7.1 release we'll leave it
- Overrides:
calcCorrelation
in classMediaObject
-
getSegmentOf
public RecursiveMemberRef getSegmentOf()
-
setSegmentOf
public void setSegmentOf(RecursiveMemberRef parentRef)
-
getOwner
public nl.vpro.domain.media.support.OwnerType getOwner()
- Specified by:
getOwner
in interfacenl.vpro.domain.media.support.Ownable
-
setOwner
public void setOwner(nl.vpro.domain.media.support.OwnerType owner)
- Specified by:
setOwner
in interfacenl.vpro.domain.media.support.MutableOwnable
-
-