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
MediaObject
can have more than one location which should differ in URL and
owner.
The location owner describes an origin of the location. Several media suppliers provide
their own locations. To prevent conflicts while updating for incoming data, locations
for those suppliers are kept in parallel.
Note that this class confirms to a natural ordering not consistent with equals.- Since:
- 0.4
- Author:
- Roelof Jan Koekoek
- See Also:
-
OwnerType
- Serialized Form
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected AVAttributes
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
ModifierConstructorDescriptionLocation()
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) Location
(Location source, MediaObject parent) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull Location.Builder
builder()
int
Locations are basicly order on their programUrlstatic Location
static Location
copy
(Location source, MediaObject parent) boolean
@Nullable AVFileFormat
@Nullable Integer
@Nullable Long
@NonNull nl.vpro.domain.media.support.OwnerType
getOwner()
Implementations can optionally become child of a trackable parent where the parents track-ability decides on this child's track-ability.@Nullable Instant
The publish stop of a location is rather complicated: 1.protected String
boolean
hasDrm()
int
hashCode()
boolean
boolean
static Long
boolean
boolean
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
setOwner
(@NonNull nl.vpro.domain.media.support.OwnerType owner) void
setParent
(MediaObject mediaObject) void
setPlatform
(Platform platform) setProgramUrl
(String url) @NonNull Location
setPublishStartInstant
(Instant publishStart) @NonNull Location
setPublishStopInstant
(Instant publishStop) setSubtitles
(String subtitles) 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
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
isMerged, isPublishable, isPublishable, isRevocable
-
Field Details
-
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
-
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) -
Location
-
Location
-
-
Method Details
-
sanitizedProgramUrl
-
copy
-
copy
-
idFromUrn
-
urnForId
-
update
-
getPlatform
-
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>
-
getSubtitles
-
setSubtitles
-
getOffset
-
setOffset
-
getDuration
-
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
public boolean hasPlatform() -
hasDrm
public boolean hasDrm() -
onStreaming
public boolean onStreaming() -
hasVideoSizing
public boolean hasVideoSizing() -
isAuthorityUpdate
public boolean isAuthorityUpdate() -
setAuthorityUpdate
-
getPublishStartInstant
- Specified by:
getPublishStartInstant
in interfaceEmbargo
- Overrides:
getPublishStartInstant
in classAbstractPublishableObject<Location>
-
setPublishStartInstant
- Specified by:
setPublishStartInstant
in interfaceMutableEmbargo<Location>
- Overrides:
setPublishStartInstant
in classAbstractPublishableObject<Location>
-
getPublishStopInstant
The publish stop of a location is rather complicated: 1. It is the offline date of the corresponding streaming platform status if that is available. 2. It not, then it is the offline date of the corresponding authority record. 3. It that too is not available then it will fall back to it's own fieldAbstractPublishableObject.getPublishStopInstant()
- Specified by:
getPublishStopInstant
in interfaceEmbargo
- Overrides:
getPublishStopInstant
in classAbstractPublishableObject<Location>
-
setPublishStopInstant
- Specified by:
setPublishStopInstant
in interfaceMutableEmbargo<Location>
- Overrides:
setPublishStopInstant
in classAbstractPublishableObject<Location>
-
getAuthority
-
compareTo
Locations are basicly 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
-