Package nl.vpro.domain.image.backend
Class BackendImage
- java.lang.Object
-
- nl.vpro.domain.DomainObject
-
- nl.vpro.domain.AbstractPublishableObject<BackendImage>
-
- nl.vpro.domain.image.backend.BackendImage
-
- All Implemented Interfaces:
Serializable,Accountable,Changeable,Embargo,Identifiable<Long>,BackendImageMetadata<BackendImage>,Metadata<BackendImage>,MutableMetadata<BackendImage>,nl.vpro.domain.media.support.MutableOwnable,nl.vpro.domain.media.support.Ownable,MutableEmbargo<BackendImage>,Publishable<BackendImage>,Trackable
@Entity(name="Image") public class BackendImage extends AbstractPublishableObject<BackendImage> implements BackendImageMetadata<BackendImage>, Identifiable<Long>, Serializable, nl.vpro.domain.media.support.MutableOwnable
This is the image object as used by poms image server
It is the database entity, and also has an XML/Json representation, but this is currently not exposed in public API's.
It can also be used to represent cached converts
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBackendImage.Builder-
Nested classes/interfaces inherited from interface nl.vpro.domain.image.Metadata
Metadata.LombokBuilder<SELF extends Metadata.LombokBuilder<SELF>>
-
-
Field Summary
Fields Modifier and Type Field Description static StringBASE_URN-
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
Constructors Constructor Description BackendImage()BackendImage(String title)BackendImage(ImageType type, ImageFormat imageFormat, String title, @Nullable String description, Integer height, Integer width, Float heightInMm, Float widthInMm, Long size, String downloadUrl, String etag, Instant urlLastModified, byte[] hash, @NotNull(groups=nl.vpro.validation.WarningValidatorGroup.class) nl.vpro.domain.support.License license, String source, String sourceName, String date, String credits, org.meeuw.functional.ThrowAnySupplier<ImageStream> imageStream, String broadcaster, nl.vpro.domain.media.support.OwnerType owner)
-
Method Summary
-
Methods inherited from class nl.vpro.domain.AbstractPublishableObject
beforeUnmarshal, getCreatedBy, getCreationInstant, getLastModifiedBy, getLastModifiedInstant, getLastPublishedInstant, getPublishStartInstant, getPublishStopInstant, getUrn, setCreatedBy, setCreationInstant, setLastModifiedBy, setLastModifiedInstant, setLastPublishedInstant, setPublishStartInstant, setPublishStopInstant, setUrn, toString
-
Methods inherited from class nl.vpro.domain.DomainObject
equals, getId, hashCode, isPersisted, setId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface nl.vpro.domain.image.backend.BackendImageMetadata
copyFrom, copyFromIfSourceSet, copyFromIfTargetUnset, copyTitleToDescriptionIfEmpty, getId, setMimeType
-
Methods inherited from interface nl.vpro.domain.Changeable
hasChanges
-
Methods inherited from interface nl.vpro.domain.Embargo
asRange, getPublishStartInstant, getPublishStopInstant, inPublicationWindow, inPublicationWindow, isPublishable, isUnderEmbargo, isUnderEmbargo, wasUnderEmbargo, wasUnderEmbargo, willBePublished, willBePublished, willBeUnderEmbargo, willBeUnderEmbargo
-
Methods inherited from interface nl.vpro.domain.Identifiable
getId
-
Methods inherited from interface nl.vpro.domain.image.Metadata
getAlternative, getCrids
-
Methods inherited from interface nl.vpro.domain.MutableEmbargo
set, setPublishStartInstant, setPublishStopInstant
-
Methods inherited from interface nl.vpro.domain.image.MutableMetadata
copyFrom, setDate, setLastModifiedInstant
-
Methods inherited from interface nl.vpro.domain.Trackable
getCreationInstant, getLastModifiedInstant
-
-
-
-
Field Detail
-
BASE_URN
public static final String BASE_URN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BackendImage
public BackendImage()
-
BackendImage
public BackendImage(String title)
-
BackendImage
public BackendImage(ImageType type, ImageFormat imageFormat, String title, @Nullable String description, Integer height, Integer width, Float heightInMm, Float widthInMm, Long size, String downloadUrl, String etag, Instant urlLastModified, byte[] hash, @NotNull(groups=nl.vpro.validation.WarningValidatorGroup.class) @NotNull(groups=nl.vpro.validation.WarningValidatorGroup.class) nl.vpro.domain.support.License license, String source, String sourceName, String date, String credits, org.meeuw.functional.ThrowAnySupplier<ImageStream> imageStream, String broadcaster, nl.vpro.domain.media.support.OwnerType owner)
-
-
Method Detail
-
setImageFormat
public BackendImage setImageFormat(ImageFormat imageFormat)
- Specified by:
setImageFormatin interfaceBackendImageMetadata<BackendImage>
-
setTitle
public void setTitle(String title)
- Specified by:
setTitlein interfaceMutableMetadata<BackendImage>
-
setDescription
public void setDescription(String description)
- Specified by:
setDescriptionin interfaceMutableMetadata<BackendImage>
-
setLicense
public void setLicense(nl.vpro.domain.support.License license)
- Specified by:
setLicensein interfaceMutableMetadata<BackendImage>
-
getMimeType
public String getMimeType()
- Specified by:
getMimeTypein interfaceBackendImageMetadata<BackendImage>
-
setHeightInMm
public BackendImage setHeightInMm(Float heightInMm)
- Specified by:
setHeightInMmin interfaceBackendImageMetadata<BackendImage>
-
setWidthInMm
public BackendImage setWidthInMm(Float widthInMm)
- Specified by:
setWidthInMmin interfaceBackendImageMetadata<BackendImage>
-
setSize
public BackendImage setSize(Long size)
- Specified by:
setSizein interfaceBackendImageMetadata<BackendImage>
-
getImageStream
public ImageStream getImageStream() throws NotFoundException
- Throws:
NotFoundException
-
supplyImageStream
public BackendImage supplyImageStream(org.meeuw.functional.ThrowAnySupplier<ImageStream> data)
-
getData
public javax.activation.DataHandler getData()
-
getUrnPrefix
protected String getUrnPrefix()
For images (in the image database) it is "urn:vpro:image:"- Specified by:
getUrnPrefixin classAbstractPublishableObject<BackendImage>
-
getDownloadUrl
public URI getDownloadUrl()
- Specified by:
getDownloadUrlin interfaceBackendImageMetadata<BackendImage>
-
setDownloadUrl
public BackendImage setDownloadUrl(URI downloadUrl)
- Specified by:
setDownloadUrlin interfaceBackendImageMetadata<BackendImage>
-
getImageUri
public String getImageUri()
- Specified by:
getImageUriin interfaceMutableMetadata<BackendImage>
-
setEtag
public BackendImage setEtag(String etag)
- Specified by:
setEtagin interfaceBackendImageMetadata<BackendImage>
-
setUrlLastModified
public BackendImage setUrlLastModified(Instant lastModified)
- Specified by:
setUrlLastModifiedin interfaceBackendImageMetadata<BackendImage>
-
builder
public static @NonNull BackendImage.Builder builder()
-
getType
public ImageType getType()
- Specified by:
getTypein interfaceMetadata<BackendImage>
-
setType
public void setType(ImageType type)
- Specified by:
setTypein interfaceMutableMetadata<BackendImage>
-
getImageFormat
public ImageFormat getImageFormat()
- Specified by:
getImageFormatin interfaceBackendImageMetadata<BackendImage>
-
getTitle
public String getTitle()
- Specified by:
getTitlein interfaceMetadata<BackendImage>
-
getDescription
public @Nullable String getDescription()
- Specified by:
getDescriptionin interfaceMetadata<BackendImage>
-
getHeight
public Integer getHeight()
- Specified by:
getHeightin interfaceMetadata<BackendImage>
-
setHeight
public void setHeight(Integer height)
- Specified by:
setHeightin interfaceMutableMetadata<BackendImage>
-
getWidth
public Integer getWidth()
- Specified by:
getWidthin interfaceMetadata<BackendImage>
-
setWidth
public void setWidth(Integer width)
- Specified by:
setWidthin interfaceMutableMetadata<BackendImage>
-
getHeightInMm
public Float getHeightInMm()
- Specified by:
getHeightInMmin interfaceBackendImageMetadata<BackendImage>
-
getWidthInMm
public Float getWidthInMm()
- Specified by:
getWidthInMmin interfaceBackendImageMetadata<BackendImage>
-
getSize
public Long getSize()
- Specified by:
getSizein interfaceBackendImageMetadata<BackendImage>
-
getEtag
public String getEtag()
- Specified by:
getEtagin interfaceBackendImageMetadata<BackendImage>
-
getUrlLastModified
public Instant getUrlLastModified()
- Specified by:
getUrlLastModifiedin interfaceBackendImageMetadata<BackendImage>
-
getHash
public byte[] getHash()
-
setHash
public void setHash(byte[] hash)
-
getLicense
@NotNull(groups=nl.vpro.validation.WarningValidatorGroup.class) public @NotNull(groups=nl.vpro.validation.WarningValidatorGroup.class) nl.vpro.domain.support.License getLicense()
- Specified by:
getLicensein interfaceMetadata<BackendImage>
-
getSource
public String getSource()
Description copied from interface:MetadataSome URI describing where this image was original coming from.- Specified by:
getSourcein interfaceMetadata<BackendImage>
-
setSource
public void setSource(String source)
- Specified by:
setSourcein interfaceMutableMetadata<BackendImage>
-
getSourceName
public String getSourceName()
Description copied from interface:MetadataA description for the source of this image.- Specified by:
getSourceNamein interfaceMetadata<BackendImage>
-
setSourceName
public void setSourceName(String sourceName)
- Specified by:
setSourceNamein interfaceMutableMetadata<BackendImage>
-
getDate
public String getDate()
- Specified by:
getDatein interfaceMutableMetadata<BackendImage>
-
setDate
public void setDate(String date)
- Specified by:
setDatein interfaceMutableMetadata<BackendImage>
-
getCredits
public String getCredits()
Description copied from interface:MetadataWho or what has credits.- Specified by:
getCreditsin interfaceMetadata<BackendImage>
-
setCredits
public void setCredits(String credits)
- Specified by:
setCreditsin interfaceMutableMetadata<BackendImage>
-
getBroadcaster
public String getBroadcaster()
- Since:
- 5.10
-
setBroadcaster
public void setBroadcaster(String broadcaster)
- Since:
- 5.10
-
getOwner
public nl.vpro.domain.media.support.OwnerType getOwner()
- Specified by:
getOwnerin interfacenl.vpro.domain.media.support.Ownable- Since:
- 5.10
-
setOwner
public void setOwner(nl.vpro.domain.media.support.OwnerType owner)
- Specified by:
setOwnerin interfacenl.vpro.domain.media.support.MutableOwnable- Since:
- 5.10
-
-