public abstract class AbstractScheduleStore extends Object implements ScheduleStore
AbstractScheduleStore is a base implementation of a
ScheduleStore. It first checks the integrity of the provided
ScheduleHierarchys, persists all Content to the
ContentStore and then resolves and updates schedule as necessary.
Schedules are divided into discrete, contiguous blocks of regular duration,
represented by ChannelSchedules. The block duration is determined by
the concrete implementation. Blocks may be empty, partially populated or
fully populated. Blocks may also have entries in common if they overlap the
start or end of the block interval.
This base will also detect overwritten
Broadcasts and update them in the
ContentStore.| Constructor and Description |
|---|
AbstractScheduleStore(ContentStore contentStore) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doWrite(org.atlasapi.media.entity.Publisher source,
List<ChannelSchedule> blocks)
Write the blocks of schedule for a source.
|
protected abstract List<ChannelSchedule> |
resolveCurrentScheduleBlocks(org.atlasapi.media.entity.Publisher source,
org.atlasapi.media.channel.Channel channel,
org.joda.time.Interval interval)
Resolve the current block(s) of schedule for a given source, channel and
interval.
|
List<WriteResult<? extends Content>> |
writeSchedule(List<ScheduleHierarchy> content,
org.atlasapi.media.channel.Channel channel,
org.joda.time.Interval interval)
Write a schedule of Items.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitresolvepublic AbstractScheduleStore(ContentStore contentStore)
public List<WriteResult<? extends Content>> writeSchedule(List<ScheduleHierarchy> content, org.atlasapi.media.channel.Channel channel, org.joda.time.Interval interval) throws WriteException
ScheduleWriterBroadcast on the provided
Channel within the provided Interval. The Hierarchies must be ordered
such that the relevant Broadcasts are contiguous.
All the Content must be from the same
Source.
All Content must be persisted to a
ContentStore.
A ScheduleWriter is also responsible for maintaining
Broadcast "actively published" flag status in the
ContentStore.writeSchedule in interface ScheduleWritercontent - - an list of ScheduleHierarchys ordered by Broadcast
transmission start time.channel - - the channel for which the schedule is to be written.interval - - the interval for which the schedule is provided.WriteException - if the write is not successfully performed.protected abstract List<ChannelSchedule> resolveCurrentScheduleBlocks(org.atlasapi.media.entity.Publisher source, org.atlasapi.media.channel.Channel channel, org.joda.time.Interval interval) throws WriteException
source - channel - interval - WriteExceptionprotected abstract void doWrite(org.atlasapi.media.entity.Publisher source,
List<ChannelSchedule> blocks)
throws WriteException
|A, B| | B | | B, C|if the broadcast B is long enough to cover more than one entire block.
source - blocks - WriteExceptionCopyright © 2014. All rights reserved.