Package nl.vpro.domain.media.update
Class AssemblageConfig
- java.lang.Object
-
- nl.vpro.domain.media.update.AssemblageConfig
-
public class AssemblageConfig extends Object
Contains hints and configuration about how to assemble media objects fromMediaUpdate
objects.- Since:
- 5.5
- Author:
- Michiel Meeuwissen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AssemblageConfig.Builder
static class
AssemblageConfig.FatalRequiredFieldException
static class
AssemblageConfig.MidRequire
static class
AssemblageConfig.Require<S,F>
static class
AssemblageConfig.RequiredFieldException
Exception that can be thrown during assemblage if some required field is not filled.static class
AssemblageConfig.RequireEnum
static class
AssemblageConfig.SkippingRequiredFieldException
If a required field is not filled, then this exception can be thrown to indicate that the related object can just be ignored then.static class
AssemblageConfig.Steal
static interface
AssemblageConfig.TriSteal<T>
static class
AssemblageConfig.TriStealImpl<T>
-
Field Summary
Fields Modifier and Type Field Description static BiPredicate<List<String>,Relation>
DEFAULT_RELATION_MATCH
-
Constructor Summary
Constructors Constructor Description AssemblageConfig()
AssemblageConfig(nl.vpro.domain.media.support.OwnerType owner, List<nl.vpro.domain.media.support.OwnerType> similarOwnerTypes, boolean copyWorkflow, Boolean copyLanguageAndCountry, boolean imageMetaData, Boolean copyPredictions, boolean episodeOfUpdate, boolean guessEpisodePosition, BiPredicate<MemberRef,AssemblageConfig> memberOfUpdate, boolean ratingsUpdate, Boolean copyTwitterRefs, boolean copyIntentions, boolean copyTargetGroups, boolean copyGeoLocations, boolean copyTopics, BiPredicate<List<String>,Relation> relations, boolean createScheduleEvents, Predicate<Program> deleteIfNoScheduleEventsLeft, Duration mergeScheduleEvents, BiPredicate<MediaObject,AssemblageConfig> inferDurationFromScheduleEvents, boolean locationsUpdate, AssemblageConfig.Steal stealMids, org.meeuw.functional.TriPredicate<MediaObject,MediaObject,String> stealCrids, AssemblageConfig.Steal stealSegments, BiPredicate<Segment,AssemblageConfig> segmentsForDeletion, Predicate<String> cridsForDelete, AssemblageConfig.Steal updateType, boolean followMerges, AssemblageConfig.MidRequire requireIncomingMid, BiPredicate<MediaObject,PublishableObject<?>> markForDeleteOnly, Predicate<MediaObject> deleteBroadcasters, nl.vpro.logging.simple.SimpleLogger logger)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
backwardsCompatible(IntegerVersion version)
Makes the default assemblage backwards compatible for certain properties (unless they were explicitly stated).static @NonNull AssemblageConfig.Builder
builder()
protected boolean
canEqual(@Nullable Object other)
boolean
considerForDeletion(Segment segment)
AssemblageConfig
copy()
boolean
equals(@Nullable Object o)
Boolean
getCopyLanguageAndCountry()
Boolean
getCopyPredictions()
Boolean
getCopyTwitterRefs()
Predicate<String>
getCridsForDelete()
Predicate<MediaObject>
getDeleteBroadcasters()
Predicate<Program>
getDeleteIfNoScheduleEventsLeft()
BiPredicate<MediaObject,AssemblageConfig>
getInferDurationFromScheduleEvents()
nl.vpro.logging.simple.SimpleLogger
getLogger()
BiPredicate<MediaObject,PublishableObject<?>>
getMarkForDeleteOnly()
BiPredicate<MemberRef,AssemblageConfig>
getMemberOfUpdate()
Predicate<MemberRef>
getMemberOfUpdatePredicate()
Duration
getMergeScheduleEvents()
This is mainly targeted at PREPR which does not support programs spanning 0 o'clock.nl.vpro.domain.media.support.OwnerType
getOwner()
Set<nl.vpro.domain.media.support.OwnerType>
getOwnerAndSimilar()
BiPredicate<List<String>,Relation>
getRelations()
AssemblageConfig.MidRequire
getRequireIncomingMid()
BiPredicate<Segment,AssemblageConfig>
getSegmentsForDeletion()
On default, if you merge a program, existing segments will not be removed This can be configured using this.List<nl.vpro.domain.media.support.OwnerType>
getSimilarOwnerTypes()
org.meeuw.functional.TriPredicate<MediaObject,MediaObject,String>
getStealCrids()
Matching happens on crid.AssemblageConfig.Steal
getStealMids()
AssemblageConfig.Steal
getStealSegments()
If an incoming segment matches a segment of _different_ program, then disconnect it from that other program Otherwise consider this situation errorneous.AssemblageConfig.Steal
getUpdateType()
int
hashCode()
boolean
isCopyGeoLocations()
boolean
isCopyIntentions()
boolean
isCopyLanguageAndCountry()
boolean
isCopyPredictions()
boolean
isCopyTargetGroups()
boolean
isCopyTopics()
boolean
isCopyTwitterRefs()
boolean
isCopyWorkflow()
boolean
isCreateScheduleEvents()
boolean
isEpisodeOfUpdate()
boolean
isFollowMerges()
TODOboolean
isGuessEpisodePosition()
boolean
isImageMetaData()
boolean
isLocationsUpdate()
boolean
isMemberOfUpdate()
boolean
isRatingsUpdate()
nl.vpro.logging.simple.SimpleLogger
loggerFor(Logger log)
nl.vpro.logging.simple.SimpleLogger
loggerFor(Logger log)
void
setCopyGeoLocations(boolean copyGeoLocations)
void
setCopyIntentions(boolean copyIntentions)
void
setCopyLanguageAndCountry(Boolean copyLanguageAndCountry)
void
setCopyPredictions(Boolean copyPredictions)
void
setCopyTargetGroups(boolean copyTargetGroups)
void
setCopyTopics(boolean copyTopics)
void
setCopyTwitterRefs(Boolean copyTwitterRefs)
void
setCopyWorkflow(boolean copyWorkflow)
void
setCreateScheduleEvents(boolean createScheduleEvents)
void
setCridsForDelete(Predicate<String> cridsForDelete)
void
setDeleteBroadcasters(Predicate<MediaObject> deleteBroadcasters)
void
setDeleteIfNoScheduleEventsLeft(Predicate<Program> deleteIfNoScheduleEventsLeft)
void
setEpisodeOfUpdate(boolean episodeOfUpdate)
void
setFollowMerges(boolean followMerges)
TODOvoid
setGuessEpisodePosition(boolean guessEpisodePosition)
void
setImageMetaData(boolean imageMetaData)
void
setInferDurationFromScheduleEvents(BiPredicate<MediaObject,AssemblageConfig> inferDurationFromScheduleEvents)
void
setLocationsUpdate(boolean locationsUpdate)
void
setLogger(nl.vpro.logging.simple.SimpleLogger logger)
void
setMarkForDeleteOnly(BiPredicate<MediaObject,PublishableObject<?>> markForDeleteOnly)
void
setMemberOfUpdate(BiPredicate<MemberRef,AssemblageConfig> memberOfUpdate)
void
setMemberOfUpdateBoolean(boolean bool)
void
setMergeScheduleEvents(Duration mergeScheduleEvents)
This is mainly targeted at PREPR which does not support programs spanning 0 o'clock.void
setOwner(nl.vpro.domain.media.support.OwnerType owner)
void
setRatingsUpdate(boolean ratingsUpdate)
void
setRelations(BiPredicate<List<String>,Relation> relations)
void
setRequireIncomingMid(AssemblageConfig.MidRequire requireIncomingMid)
void
setSegmentsForDeletion(BiPredicate<Segment,AssemblageConfig> segmentsForDeletion)
On default, if you merge a program, existing segments will not be removed This can be configured using this.void
setSimilarOwnerTypes(List<nl.vpro.domain.media.support.OwnerType> similarOwnerTypes)
void
setStealCrids(org.meeuw.functional.TriPredicate<MediaObject,MediaObject,String> stealCrids)
Matching happens on crid.void
setStealMids(AssemblageConfig.Steal stealMids)
void
setStealSegments(AssemblageConfig.Steal stealSegments)
If an incoming segment matches a segment of _different_ program, then disconnect it from that other program Otherwise consider this situation errorneous.void
setUpdateType(AssemblageConfig.Steal updateType)
@NonNull AssemblageConfig.Builder
toBuilder()
@NonNull String
toString()
static AssemblageConfig.Builder
withAllTrue()
Sets updating as permissive as possible, with a few exceptions: relations: only sync relations of the broadcasters associated with the account (this is also the default) memberrefsAssemblageConfig
withLogger(nl.vpro.logging.simple.SimpleLogger logger)
AssemblageConfig
withThreadLocalLogger()
-
-
-
Field Detail
-
DEFAULT_RELATION_MATCH
public static final BiPredicate<List<String>,Relation> DEFAULT_RELATION_MATCH
-
-
Constructor Detail
-
AssemblageConfig
public AssemblageConfig()
-
AssemblageConfig
public AssemblageConfig(nl.vpro.domain.media.support.OwnerType owner, List<nl.vpro.domain.media.support.OwnerType> similarOwnerTypes, boolean copyWorkflow, Boolean copyLanguageAndCountry, boolean imageMetaData, Boolean copyPredictions, boolean episodeOfUpdate, boolean guessEpisodePosition, BiPredicate<MemberRef,AssemblageConfig> memberOfUpdate, boolean ratingsUpdate, Boolean copyTwitterRefs, boolean copyIntentions, boolean copyTargetGroups, boolean copyGeoLocations, boolean copyTopics, BiPredicate<List<String>,Relation> relations, boolean createScheduleEvents, Predicate<Program> deleteIfNoScheduleEventsLeft, Duration mergeScheduleEvents, BiPredicate<MediaObject,AssemblageConfig> inferDurationFromScheduleEvents, boolean locationsUpdate, AssemblageConfig.Steal stealMids, org.meeuw.functional.TriPredicate<MediaObject,MediaObject,String> stealCrids, AssemblageConfig.Steal stealSegments, BiPredicate<Segment,AssemblageConfig> segmentsForDeletion, Predicate<String> cridsForDelete, AssemblageConfig.Steal updateType, boolean followMerges, AssemblageConfig.MidRequire requireIncomingMid, BiPredicate<MediaObject,PublishableObject<?>> markForDeleteOnly, Predicate<MediaObject> deleteBroadcasters, nl.vpro.logging.simple.SimpleLogger logger)
-
-
Method Detail
-
getOwnerAndSimilar
public Set<nl.vpro.domain.media.support.OwnerType> getOwnerAndSimilar()
-
loggerFor
public nl.vpro.logging.simple.SimpleLogger loggerFor(Logger log)
-
loggerFor
public nl.vpro.logging.simple.SimpleLogger loggerFor(Logger log)
-
copy
public AssemblageConfig copy()
-
withLogger
public AssemblageConfig withLogger(nl.vpro.logging.simple.SimpleLogger logger)
-
withThreadLocalLogger
public AssemblageConfig withThreadLocalLogger()
-
isMemberOfUpdate
public boolean isMemberOfUpdate()
-
withAllTrue
public static AssemblageConfig.Builder withAllTrue()
Sets updating as permissive as possible, with a few exceptions:- relations: only sync relations of the broadcasters associated with the account (this is also the default)
- memberrefs
-
considerForDeletion
public boolean considerForDeletion(Segment segment)
-
backwardsCompatible
public void backwardsCompatible(IntegerVersion version)
Makes the default assemblage backwards compatible for certain properties (unless they were explicitly stated).
-
setMemberOfUpdateBoolean
public void setMemberOfUpdateBoolean(boolean bool)
-
isCopyPredictions
public boolean isCopyPredictions()
-
isCopyTwitterRefs
public boolean isCopyTwitterRefs()
-
isCopyLanguageAndCountry
public boolean isCopyLanguageAndCountry()
-
builder
public static @NonNull AssemblageConfig.Builder builder()
-
toBuilder
public @NonNull AssemblageConfig.Builder toBuilder()
-
getOwner
public nl.vpro.domain.media.support.OwnerType getOwner()
-
getSimilarOwnerTypes
public List<nl.vpro.domain.media.support.OwnerType> getSimilarOwnerTypes()
-
isCopyWorkflow
public boolean isCopyWorkflow()
-
getCopyLanguageAndCountry
public Boolean getCopyLanguageAndCountry()
-
isImageMetaData
public boolean isImageMetaData()
-
getCopyPredictions
public Boolean getCopyPredictions()
-
isEpisodeOfUpdate
public boolean isEpisodeOfUpdate()
-
isGuessEpisodePosition
public boolean isGuessEpisodePosition()
-
getMemberOfUpdate
public BiPredicate<MemberRef,AssemblageConfig> getMemberOfUpdate()
-
isRatingsUpdate
public boolean isRatingsUpdate()
-
getCopyTwitterRefs
public Boolean getCopyTwitterRefs()
-
isCopyIntentions
public boolean isCopyIntentions()
-
isCopyTargetGroups
public boolean isCopyTargetGroups()
-
isCopyGeoLocations
public boolean isCopyGeoLocations()
-
isCopyTopics
public boolean isCopyTopics()
-
getRelations
public BiPredicate<List<String>,Relation> getRelations()
-
isCreateScheduleEvents
public boolean isCreateScheduleEvents()
-
getMergeScheduleEvents
public Duration getMergeScheduleEvents()
This is mainly targeted at PREPR which does not support programs spanning 0 o'clock. If this is set to >= 0, then schedule merging will merge adjacent schedule events if they are of the same MID The size of the duration defines the maximal gap between the events. (For PREPR there is never anything broadcast in the second before midnight)
-
getInferDurationFromScheduleEvents
public BiPredicate<MediaObject,AssemblageConfig> getInferDurationFromScheduleEvents()
-
isLocationsUpdate
public boolean isLocationsUpdate()
-
getStealMids
public AssemblageConfig.Steal getStealMids()
-
getStealCrids
public org.meeuw.functional.TriPredicate<MediaObject,MediaObject,String> getStealCrids()
Matching happens on crid. There is a possibility though that the found object is of the wrong type (e.g. a Program and not a Segment) If stealCrids is true, then in that situation the existing object is left, but the matching crid is removed.
-
getStealSegments
public AssemblageConfig.Steal getStealSegments()
If an incoming segment matches a segment of _different_ program, then disconnect it from that other program Otherwise consider this situation errorneous.
-
getSegmentsForDeletion
public BiPredicate<Segment,AssemblageConfig> getSegmentsForDeletion()
On default, if you merge a program, existing segments will not be removed This can be configured using this. See alsAssemblageConfig.Builder.deleteSegmentsForOwner()
-
getUpdateType
public AssemblageConfig.Steal getUpdateType()
-
isFollowMerges
public boolean isFollowMerges()
TODO- Since:
- 5.13
-
getRequireIncomingMid
public AssemblageConfig.MidRequire getRequireIncomingMid()
- Since:
- 5.13
-
getMarkForDeleteOnly
public BiPredicate<MediaObject,PublishableObject<?>> getMarkForDeleteOnly()
-
getDeleteBroadcasters
public Predicate<MediaObject> getDeleteBroadcasters()
-
getLogger
public nl.vpro.logging.simple.SimpleLogger getLogger()
-
setOwner
public void setOwner(nl.vpro.domain.media.support.OwnerType owner)
-
setSimilarOwnerTypes
public void setSimilarOwnerTypes(List<nl.vpro.domain.media.support.OwnerType> similarOwnerTypes)
-
setCopyWorkflow
public void setCopyWorkflow(boolean copyWorkflow)
-
setCopyLanguageAndCountry
public void setCopyLanguageAndCountry(Boolean copyLanguageAndCountry)
-
setImageMetaData
public void setImageMetaData(boolean imageMetaData)
-
setCopyPredictions
public void setCopyPredictions(Boolean copyPredictions)
-
setEpisodeOfUpdate
public void setEpisodeOfUpdate(boolean episodeOfUpdate)
-
setGuessEpisodePosition
public void setGuessEpisodePosition(boolean guessEpisodePosition)
-
setMemberOfUpdate
public void setMemberOfUpdate(BiPredicate<MemberRef,AssemblageConfig> memberOfUpdate)
-
setRatingsUpdate
public void setRatingsUpdate(boolean ratingsUpdate)
-
setCopyTwitterRefs
public void setCopyTwitterRefs(Boolean copyTwitterRefs)
-
setCopyIntentions
public void setCopyIntentions(boolean copyIntentions)
-
setCopyTargetGroups
public void setCopyTargetGroups(boolean copyTargetGroups)
-
setCopyGeoLocations
public void setCopyGeoLocations(boolean copyGeoLocations)
-
setCopyTopics
public void setCopyTopics(boolean copyTopics)
-
setRelations
public void setRelations(BiPredicate<List<String>,Relation> relations)
-
setCreateScheduleEvents
public void setCreateScheduleEvents(boolean createScheduleEvents)
-
setDeleteIfNoScheduleEventsLeft
public void setDeleteIfNoScheduleEventsLeft(Predicate<Program> deleteIfNoScheduleEventsLeft)
-
setMergeScheduleEvents
public void setMergeScheduleEvents(Duration mergeScheduleEvents)
This is mainly targeted at PREPR which does not support programs spanning 0 o'clock. If this is set to >= 0, then schedule merging will merge adjacent schedule events if they are of the same MID The size of the duration defines the maximal gap between the events. (For PREPR there is never anything broadcast in the second before midnight)
-
setInferDurationFromScheduleEvents
public void setInferDurationFromScheduleEvents(BiPredicate<MediaObject,AssemblageConfig> inferDurationFromScheduleEvents)
-
setLocationsUpdate
public void setLocationsUpdate(boolean locationsUpdate)
-
setStealMids
public void setStealMids(AssemblageConfig.Steal stealMids)
-
setStealCrids
public void setStealCrids(org.meeuw.functional.TriPredicate<MediaObject,MediaObject,String> stealCrids)
Matching happens on crid. There is a possibility though that the found object is of the wrong type (e.g. a Program and not a Segment) If stealCrids is true, then in that situation the existing object is left, but the matching crid is removed.
-
setStealSegments
public void setStealSegments(AssemblageConfig.Steal stealSegments)
If an incoming segment matches a segment of _different_ program, then disconnect it from that other program Otherwise consider this situation errorneous.
-
setSegmentsForDeletion
public void setSegmentsForDeletion(BiPredicate<Segment,AssemblageConfig> segmentsForDeletion)
On default, if you merge a program, existing segments will not be removed This can be configured using this. See alsAssemblageConfig.Builder.deleteSegmentsForOwner()
-
setUpdateType
public void setUpdateType(AssemblageConfig.Steal updateType)
-
setFollowMerges
public void setFollowMerges(boolean followMerges)
TODO- Since:
- 5.13
-
setRequireIncomingMid
public void setRequireIncomingMid(AssemblageConfig.MidRequire requireIncomingMid)
- Since:
- 5.13
-
setMarkForDeleteOnly
public void setMarkForDeleteOnly(BiPredicate<MediaObject,PublishableObject<?>> markForDeleteOnly)
-
setDeleteBroadcasters
public void setDeleteBroadcasters(Predicate<MediaObject> deleteBroadcasters)
-
setLogger
public void setLogger(nl.vpro.logging.simple.SimpleLogger logger)
-
canEqual
protected boolean canEqual(@Nullable Object other)
-
-