Package nl.vpro.domain.media.support
Class Image
- All Implemented Interfaces:
Serializable
,Accountable
,Changeable
,Child<MediaObject>
,Embargo
,Identifiable<Long>
,Metadata
,MutableMetadata<Image>
,nl.vpro.domain.media.support.MutableOwnable
,nl.vpro.domain.media.support.Ownable
,TrackableObject
,MutableEmbargo<Image>
,MutableEmbargoDeprecated<Image>
,Publishable<Image>
,Trackable
@Entity
public class Image
extends PublishableObject<Image>
implements MutableMetadata<Image>, nl.vpro.domain.media.support.MutableOwnable, Child<MediaObject>
A MediaObject
can have more than one images. But among them getImageUri()
/getType()
is unique.
The image owner describes an origin of the image. Several media suppliers provide there own images. To prevent conflicts while updating for incoming data, images for those suppliers are kept in parallel.
TODO: I think we may elaborate a bit on image uniqueness. equals(Object)
implements what is said above. But why e.g. a different getOwner()
would not make a different image?
- Since:
- 0.4
- Author:
- Roelof Jan Koekoek
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface nl.vpro.domain.image.Metadata
Metadata.LombokBuilder<SELF extends Metadata.LombokBuilder<SELF>>
-
Field Summary
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
ModifierConstructorDescriptionImage()
Image
(nl.vpro.domain.media.support.OwnerType owner) protected
Image
(nl.vpro.domain.media.support.OwnerType owner, ImageType type, String imageUri, String title, String description, Long id, String credits, nl.vpro.domain.support.License license, String source, String sourceName, Integer height, Integer width, Duration offset, String date, Instant publishStart, Instant publishStop, Instant creationInstant, Instant lastModified, List<String> crids) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull Image.Builder
builder()
static Image
copyFrom
(@NonNull MutableMetadata<?> metadata) boolean
getCrids()
getDate()
static @Nullable Long
getIdFromImageUri
(@Nullable String imageUri) The 'uri' of the image on the image server This means a string of the form urn:vpro:image:<id> where id is the database id of the image in the image database.nl.vpro.domain.support.License
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.getTitle()
getType()
For images in the media database it is "urn:vpro:media:image:"getWidth()
int
hashCode()
static Long
static Image
of
(@NonNull BackendImageMetadata<?> metaData) void
setCredits
(String credits) void
void
void
setDescription
(String description) void
setHighlighted
(Boolean highlighted) setImageUri
(String uri) void
setLicense
(nl.vpro.domain.support.License license) void
setOwner
(nl.vpro.domain.media.support.OwnerType owner) void
setParent
(MediaObject mediaObject) @NonNull Image
setPublishStartInstant
(Instant publishStart) @NonNull Image
setPublishStopInstant
(Instant publishStop) void
void
setSourceName
(String sourceName) void
void
void
@NonNull Image.Builder
toString()
static @NonNull Image
Methods inherited from class nl.vpro.domain.media.support.PublishableObject
acceptChanges, beforeUnmarshal, calcCRC32, getHash, getWorkflow, hasChanges, isActivation, isDeactivation, isDeleted, serializeForCalcCRC32, setWorkflow
Methods inherited from class nl.vpro.domain.AbstractPublishableObject
getCreatedBy, getCreationInstant, getLastModifiedBy, getLastModifiedInstant, getLastPublishedInstant, getPublishStartInstant, getPublishStopInstant, 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, getPublishStartInstant, getPublishStopInstant, inPublicationWindow, inPublicationWindow, isUnderEmbargo, isUnderEmbargo, wasUnderEmbargo, wasUnderEmbargo, willBePublished, willBePublished, willBeUnderEmbargo, willBeUnderEmbargo
Methods inherited from interface nl.vpro.domain.image.Metadata
getAlternative, getAlternativeOrTitle, getAreaOfInterest, getDimension
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.image.MutableMetadata
copyFrom, copyFromIfSourceSet, copyFromIfTargetUnset, setDate, setLastModifiedInstant
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
-
SERVER_URI_PATTERN
-
BASE_URN
- See Also:
-
offset
-
crids
-
-
Constructor Details
-
Image
public Image() -
Image
public Image(nl.vpro.domain.media.support.OwnerType owner) -
Image
-
Image
-
Image
protected Image(nl.vpro.domain.media.support.OwnerType owner, ImageType type, String imageUri, String title, String description, Long id, String credits, nl.vpro.domain.support.License license, String source, String sourceName, Integer height, Integer width, Duration offset, String date, Instant publishStart, Instant publishStop, Instant creationInstant, Instant lastModified, List<String> crids) -
Image
-
-
Method Details
-
copy
-
idFromUrn
-
update
-
setTitle
- Specified by:
setTitle
in interfaceMutableMetadata<Image>
-
setLicense
public void setLicense(nl.vpro.domain.support.License license) - Specified by:
setLicense
in interfaceMutableMetadata<Image>
-
setDescription
- Specified by:
setDescription
in interfaceMutableMetadata<Image>
-
setSource
- Specified by:
setSource
in interfaceMutableMetadata<Image>
-
setSourceName
- Specified by:
setSourceName
in interfaceMutableMetadata<Image>
-
getImageUri
The 'uri' of the image on the image server This means a string of the form urn:vpro:image:<id> where id is the database id of the image in the image database.Several image may share this image uri, if they represent the exact same image (but may vary in meta data)
- Specified by:
getImageUri
in interfaceMutableMetadata<Image>
-
setImageUri
-
getImageId
-
getIdFromImageUri
-
setOffset
-
isHighlighted
-
setHighlighted
-
setCredits
- Specified by:
setCredits
in interfaceMutableMetadata<Image>
-
setDate
- Specified by:
setDate
in interfaceMutableMetadata<Image>
-
setPublishStopInstant
- Specified by:
setPublishStopInstant
in interfaceMutableEmbargo<Image>
- Overrides:
setPublishStopInstant
in classAbstractPublishableObject<Image>
-
setPublishStartInstant
- Specified by:
setPublishStartInstant
in interfaceMutableEmbargo<Image>
- Overrides:
setPublishStartInstant
in classAbstractPublishableObject<Image>
-
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
For images in the media database it is "urn:vpro:media:image:"- Specified by:
getUrnPrefix
in classAbstractPublishableObject<Image>
-
toString
- Overrides:
toString
in classPublishableObject<Image>
-
equals
- Overrides:
equals
in classDomainObject
-
of
-
copyFrom
- Specified by:
copyFrom
in interfaceMutableMetadata<Image>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classDomainObject
-
builder
-
toBuilder
-
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
-
getType
-
setType
- Specified by:
setType
in interfaceMutableMetadata<Image>
-
getTitle
-
getDescription
- Specified by:
getDescription
in interfaceMetadata
-
getOffset
-
getWidth
-
setWidth
- Specified by:
setWidth
in interfaceMutableMetadata<Image>
-
getHeight
-
setHeight
- Specified by:
setHeight
in interfaceMutableMetadata<Image>
-
getCredits
- Specified by:
getCredits
in interfaceMetadata
-
getSource
-
getSourceName
- Specified by:
getSourceName
in interfaceMetadata
-
getLicense
public nl.vpro.domain.support.License getLicense()- Specified by:
getLicense
in interfaceMetadata
-
getDate
- Specified by:
getDate
in interfaceMutableMetadata<Image>
-
getCrids
-
setCrids
-