Package nl.vpro.domain.media
Class Location
- All Implemented Interfaces:
Serializable
,Comparable<Location>
,Accountable
,Changeable
,Child<MediaObject>
,Embargo
,Identifiable<Long>
,nl.vpro.domain.media.support.MutableOwnable
,nl.vpro.domain.media.support.Ownable
,TrackableObject
,MutableEmbargo<Location>
,MutableEmbargoDeprecated<Location>
,Publishable<Location>
,Trackable
@Entity
public class Location
extends PublishableObject<Location>
implements nl.vpro.domain.media.support.MutableOwnable, Comparable<Location>, Child<MediaObject>
A location is a wrapper around a
url
together with some metadata about it, and basically should be somehow actually playable. It may e.g. represent a downloadable MP3 file. But it can also represent an url with a scheme that can only be understood by a specific NPO player.
A MediaObject
can have more than one location which should differ in URL and
owner.
- Since:
- 0.4
- Author:
- Roelof Jan Koekoek
- See Also:
-
OwnerType
- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AVAttributes
static final String
protected Duration
protected MediaObject
protected Long
protected Duration
protected @NonNull nl.vpro.domain.media.support.OwnerType
protected Platform
static final Comparator<Location>
protected String
protected String
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
-
Constructor Summary
ConstructorsModifierConstructorDescriptionLocation()
Location
(@NonNull nl.vpro.domain.media.support.OwnerType owner) Location
(String programUrl, AVAttributes avAttributes) Deprecated.Location
(String programUrl, nl.vpro.domain.media.support.OwnerType owner, AVAttributes avAttributes) protected
Location
(String programUrl, nl.vpro.domain.media.support.OwnerType owner, AVAttributes avAttributes, Duration duration, Integer bitrate, AVFileFormat avFileFormat, AudioAttributes audioAttributes, VideoAttributes videoAttributes, Platform platform, Instant publishStart, Instant publishStop, Workflow workflow, Instant creationDate, Long byteSize, Long id) Location
(String programUrl, nl.vpro.domain.media.support.OwnerType owner, Platform platform, AVAttributes avAttributes) Location
(Location source, MediaObject parent) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull Location.Builder
builder()
int
Locations are basically order on their programUrlstatic Location
static Location
copy
(Location source, MediaObject parent) boolean
@Nullable AVFileFormat
@Nullable Integer
@Nullable Long
Note that thisXmlTransient
and hence not available in frontend api@NonNull nl.vpro.domain.media.support.OwnerType
getOwner()
com.google.common.collect.Range<Instant>
'Own' embargo wrapped in aRange
.Implementations can optionally become child of a trackable parent where the parents track-ability decides on this child's track-ability.For a Location it is true that it cannot have a wider embargo than itsassociated platform
@Nullable Instant
The publishstop of a location is can be restricted by theassociated platform
.Note that thisXmlTransient
and hence not available in frontend apiprotected String
boolean
hasDrm()
int
hashCode()
boolean
Deprecated.boolean
boolean
AsheadRequest(Duration)
, defaulting to 1 dayboolean
headRequest
(Duration age) Executes a head request on the current location (if that seems possible), and updates some fields if neededstatic Long
boolean
Note that thisXmlTransient
and hence not available in frontend apiboolean
static String
sanitizedProgramUrl
(String value) void
setAuthorityUpdate
(Boolean ceresUpdate) setAvAttributes
(AVAttributes avAttributes) setAvFileFormat
(AVFileFormat format) setBitrate
(@Nullable Integer bitrate) setByteSize
(Long byteSize) void
setDuration
(Duration duration) void
setLastStatusChange
(Instant lastStatusChange) Note that thisXmlTransient
and hence not available in frontend apivoid
setOwner
(@NonNull nl.vpro.domain.media.support.OwnerType owner) void
setParent
(MediaObject mediaObject) void
setPlatform
(@NonNull Platform platform) setProgramUrl
(String url) @NonNull Location
setPublishStartInstant
(Instant publishStart) @NonNull Location
setPublishStopInstant
(Instant publishStop) void
setStatusCode
(Integer statusCode) Note that thisXmlTransient
and hence not available in frontend apisetSubtitles
(String subtitles) protected void
setWorkflow
(Workflow workflow) toString()
static Location
static String
urnForId
(long id) Methods inherited from class nl.vpro.domain.media.support.PublishableObject
acceptChanges, beforeUnmarshal, calcCRC32, getHash, getWorkflow, hasChanges, isActivation, isDeactivation, isDeleted, serializeForCalcCRC32
Methods inherited from class nl.vpro.domain.AbstractPublishableObject
getCreatedBy, getCreationInstant, getLastModifiedBy, getLastModifiedInstant, getLastPublishedInstant, getUrn, setCreatedBy, setCreationInstant, setLastModifiedBy, setLastModifiedInstant, setLastPublishedInstant, setUrn
Methods inherited from class nl.vpro.domain.DomainObject
getId, isPersisted, setId, superHashCode
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, isUnderEmbargo, isUnderEmbargo, wasUnderEmbargo, wasUnderEmbargo, willBePublished, willBePublished, willBeUnderEmbargo, willBeUnderEmbargo
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.domain.Trackable
getCreationInstant, getLastModifiedInstant
Methods inherited from interface nl.vpro.domain.media.TrackableObject
isConsiderableForPublication, isMerged, isPublishable, isPublishable, isRevocable
-
Field Details
-
BASE_URN
- See Also:
-
programUrl
-
avAttributes
-
mediaObject
-
subtitles
-
offset
-
duration
-
owner
protected @NonNull nl.vpro.domain.media.support.OwnerType owner -
neboId
-
platform
-
PRESENTATION_ORDER
-
-
Constructor Details
-
Location
public Location() -
Location
public Location(@NonNull nl.vpro.domain.media.support.OwnerType owner) -
Location
-
Location
public Location(String programUrl, nl.vpro.domain.media.support.OwnerType owner, Platform platform, AVAttributes avAttributes) -
Location
-
Location
Deprecated. -
Location
public Location(String programUrl, nl.vpro.domain.media.support.OwnerType owner, AVAttributes avAttributes) -
Location
protected Location(String programUrl, nl.vpro.domain.media.support.OwnerType owner, AVAttributes avAttributes, Duration duration, Integer bitrate, AVFileFormat avFileFormat, AudioAttributes audioAttributes, VideoAttributes videoAttributes, Platform platform, Instant publishStart, Instant publishStop, Workflow workflow, Instant creationDate, Long byteSize, Long id) -
Location
-
Location
-
-
Method Details
-
sanitizedProgramUrl
-
copy
-
copy
-
idFromUrn
-
urnForId
-
update
-
headRequest
public boolean headRequest()AsheadRequest(Duration)
, defaulting to 1 day -
headRequest
Executes a head request on the current location (if that seems possible), and updates some fields if needed- Parameters:
age
- The minimal of the last status change, if it is younger, no request will be done.- Returns:
- Whether changes were made
- Since:
- 7.10
-
setPlatform
-
getProgramUrl
-
setProgramUrl
-
getScheme
-
getAvAttributes
-
setAvAttributes
-
getParent
Description copied from interface:TrackableObject
Implementations can optionally become child of a trackable parent where the parents track-ability decides on this child's track-ability.- Specified by:
getParent
in interfaceChild<MediaObject>
- Specified by:
getParent
in interfaceTrackableObject
- Returns:
- a trackable parent, null when a parent is not set or no parent-child relation exists
- See Also:
-
setParent
- Specified by:
setParent
in interfaceChild<MediaObject>
-
getUrnPrefix
- Specified by:
getUrnPrefix
in classAbstractPublishableObject<Location>
-
setSubtitles
-
setOffset
-
setDuration
-
getOwner
public @NonNull nl.vpro.domain.media.support.OwnerType getOwner()- Specified by:
getOwner
in interfacenl.vpro.domain.media.support.Ownable
-
setOwner
public void setOwner(@NonNull nl.vpro.domain.media.support.OwnerType owner) - Specified by:
setOwner
in interfacenl.vpro.domain.media.support.MutableOwnable
-
getBitrate
-
setBitrate
-
getByteSize
-
setByteSize
-
getAvFileFormat
-
setAvFileFormat
-
hasPlatform
Deprecated. -
hasDrm
public boolean hasDrm() -
onStreaming
public boolean onStreaming() -
hasVideoSizing
public boolean hasVideoSizing() -
setAuthorityUpdate
-
getPublishStartInstant
For a Location it is true that it cannot have a wider embargo than itsassociated platform
- Specified by:
getPublishStartInstant
in interfaceEmbargo
- Overrides:
getPublishStartInstant
in classAbstractPublishableObject<Location>
- See Also:
-
getOwnPublishStartInstant
- Since:
- 7.10
-
setPublishStartInstant
- Specified by:
setPublishStartInstant
in interfaceMutableEmbargo<Location>
- Overrides:
setPublishStartInstant
in classAbstractPublishableObject<Location>
-
getPublishStopInstant
The publishstop of a location is can be restricted by theassociated platform
.- Specified by:
getPublishStopInstant
in interfaceEmbargo
- Overrides:
getPublishStopInstant
in classAbstractPublishableObject<Location>
- See Also:
-
getOwnPublishStopInstant
- Since:
- 7.10
-
setPublishStopInstant
- Specified by:
setPublishStopInstant
in interfaceMutableEmbargo<Location>
- Overrides:
setPublishStopInstant
in classAbstractPublishableObject<Location>
-
getOwnPublicationRange
'Own' embargo wrapped in aRange
.Note that this ensures that stop >= start
- Since:
- 7.10
- See Also:
-
getOwnEmbargo
- Since:
- 7.10
- See Also:
-
getAuthority
-
compareTo
Locations are basically order on their programUrl- Specified by:
compareTo
in interfaceComparable<Location>
-
setWorkflow
- Overrides:
setWorkflow
in classPublishableObject<Location>
-
toString
- Overrides:
toString
in classPublishableObject<Location>
-
equals
- Overrides:
equals
in classDomainObject
-
hashCode
public int hashCode()- Overrides:
hashCode
in classDomainObject
-
builder
-
getSubtitles
-
getOffset
-
getDuration
-
getPlatform
-
isAuthorityUpdate
public boolean isAuthorityUpdate()Note that thisXmlTransient
and hence not available in frontend api- See Also:
-
getStatusCode
Note that thisXmlTransient
and hence not available in frontend api -
setStatusCode
Note that thisXmlTransient
and hence not available in frontend api -
getLastStatusChange
Note that thisXmlTransient
and hence not available in frontend api -
setLastStatusChange
Note that thisXmlTransient
and hence not available in frontend api
-