Package nl.vpro.domain.media.update
Class AssemblageConfig
java.lang.Object
nl.vpro.domain.media.update.AssemblageConfig
- All Implemented Interfaces:
Serializable
Contains hints and configuration about how to assemble media objects from
MediaUpdate
objects.- Since:
- 5.5
- Author:
- Michiel Meeuwissen
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
Exception that can be thrown during assemblage if some required field is not filled.static enum
static class
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 enum
static interface
static class
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAssemblageConfig
(nl.vpro.domain.media.support.OwnerType owner, List<nl.vpro.domain.media.support.OwnerType> similarOwnerTypes, boolean copyWorkflow, Boolean copyLanguageAndCountry, boolean imageMetaData, Boolean copyPredictions, Authority authority, 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, Function<MediaObject, Optional<String>> publishImmediately, Predicate<MediaObject> implicitUndelete, nl.vpro.logging.simple.SimpleLogger logger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
backwardsCompatible
(IntegerVersion version) Makes the default assemblage backwards compatible for certain properties (unless they were explicitly stated).static @NonNull AssemblageConfig.Builder
builder()
protected boolean
boolean
considerForDeletion
(Segment segment) copy()
boolean
nl.vpro.logging.simple.SimpleLogger
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>
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>
org.meeuw.functional.TriPredicate<MediaObject,
MediaObject, String> Matching happens on crid.If an incoming segment matches a segment of _different_ program, then disconnect it from that other program Otherwise consider this situation errorneous.int
hashCode()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
TODOboolean
boolean
boolean
boolean
boolean
nl.vpro.logging.simple.SimpleLogger
loggerFor
(org.apache.logging.log4j.Logger log) nl.vpro.logging.simple.SimpleLogger
void
setAuthority
(Authority authority) 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
setImplicitUndelete
(Predicate<MediaObject> implicitUndelete) 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
setPublishImmediately
(Function<MediaObject, Optional<String>> publishImmediately) 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
@NonNull String
toString()
static AssemblageConfig.Builder
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) memberrefswithLogger
(nl.vpro.logging.simple.SimpleLogger logger)
-
Field Details
-
DEFAULT_RELATION_MATCH
-
-
Constructor Details
-
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, Authority authority, 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, Function<MediaObject, Optional<String>> publishImmediately, Predicate<MediaObject> implicitUndelete, nl.vpro.logging.simple.SimpleLogger logger)
-
-
Method Details
-
getOwnerAndSimilar
-
loggerFor
public nl.vpro.logging.simple.SimpleLogger loggerFor(org.apache.logging.log4j.Logger log) -
loggerFor
-
copy
-
withLogger
-
withThreadLocalLogger
-
isMemberOfUpdate
public boolean isMemberOfUpdate() -
getMemberOfUpdatePredicate
-
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
-
backwardsCompatible
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
-
toBuilder
-
getOwner
public nl.vpro.domain.media.support.OwnerType getOwner() -
getSimilarOwnerTypes
-
isCopyWorkflow
public boolean isCopyWorkflow() -
getCopyLanguageAndCountry
-
isImageMetaData
public boolean isImageMetaData() -
getCopyPredictions
-
getAuthority
-
isEpisodeOfUpdate
public boolean isEpisodeOfUpdate() -
isGuessEpisodePosition
public boolean isGuessEpisodePosition() -
getMemberOfUpdate
-
isRatingsUpdate
public boolean isRatingsUpdate() -
getCopyTwitterRefs
-
isCopyIntentions
public boolean isCopyIntentions() -
isCopyTargetGroups
public boolean isCopyTargetGroups() -
isCopyGeoLocations
public boolean isCopyGeoLocations() -
isCopyTopics
public boolean isCopyTopics() -
getRelations
-
isCreateScheduleEvents
public boolean isCreateScheduleEvents() -
getDeleteIfNoScheduleEventsLeft
-
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
-
isLocationsUpdate
public boolean isLocationsUpdate() -
getStealMids
-
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
If an incoming segment matches a segment of _different_ program, then disconnect it from that other program Otherwise consider this situation errorneous. -
getSegmentsForDeletion
On default, if you merge a program, existing segments will not be removed This can be configured using this. See alsAssemblageConfig.Builder.deleteSegmentsForOwner()
-
getCridsForDelete
-
getUpdateType
-
isFollowMerges
public boolean isFollowMerges()TODO- Since:
- 5.13
-
getRequireIncomingMid
- Since:
- 5.13
-
getMarkForDeleteOnly
-
getDeleteBroadcasters
-
getPublishImmediately
-
getImplicitUndelete
-
getLogger
public nl.vpro.logging.simple.SimpleLogger getLogger() -
setOwner
public void setOwner(nl.vpro.domain.media.support.OwnerType owner) -
setSimilarOwnerTypes
-
setCopyWorkflow
public void setCopyWorkflow(boolean copyWorkflow) -
setCopyLanguageAndCountry
-
setImageMetaData
public void setImageMetaData(boolean imageMetaData) -
setCopyPredictions
-
setAuthority
-
setEpisodeOfUpdate
public void setEpisodeOfUpdate(boolean episodeOfUpdate) -
setGuessEpisodePosition
public void setGuessEpisodePosition(boolean guessEpisodePosition) -
setMemberOfUpdate
-
setRatingsUpdate
public void setRatingsUpdate(boolean ratingsUpdate) -
setCopyTwitterRefs
-
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
-
setCreateScheduleEvents
public void setCreateScheduleEvents(boolean createScheduleEvents) -
setDeleteIfNoScheduleEventsLeft
-
setMergeScheduleEvents
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
-
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
If an incoming segment matches a segment of _different_ program, then disconnect it from that other program Otherwise consider this situation errorneous. -
setSegmentsForDeletion
On default, if you merge a program, existing segments will not be removed This can be configured using this. See alsAssemblageConfig.Builder.deleteSegmentsForOwner()
-
setCridsForDelete
-
setUpdateType
-
setFollowMerges
public void setFollowMerges(boolean followMerges) TODO- Since:
- 5.13
-
setRequireIncomingMid
- Since:
- 5.13
-
setMarkForDeleteOnly
-
setDeleteBroadcasters
-
setPublishImmediately
-
setImplicitUndelete
-
setLogger
public void setLogger(nl.vpro.logging.simple.SimpleLogger logger) -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-