Interface IProgramLineupProvider2
interface IProgramLineupProvider2
Extends com.amazon.apmf.IStandard
An updated interface for IProgramLineupProvider which supports partially successful commits and
provides error feedback for programs that failed to commit.
This provider is used to update the program lineup in the EPG.
The upsert() function can be called multiple times within the same provider object to add programs to the
commit queue. All operations performed within the provider will be persisted when the commit() function is called.
If the provider object is destroyed before calling commit(), all changes that were queued up will be lost.
Please note that this interface is not thread-safe. Do not create multiple instances of this object for use
in different threads to avoid non-deterministic behavior.
Please discard this object and create a new instance if this object has thrown an error in one of its methods.
Methods
upsert()
Upserts a list of programs for the program lineup in the EPG. Will skip any programs that failed to be inserted and will continue to try to insert the rest of the programs provided. Inserts programs into the LiveTV Provider data store. This action is not persisted untilIUpsertProgramFailure*[]upsert(com.amazon.kepler.tv.epg_provider_models.IProgram*[]programs)
commit() is called.
Parameters
programs
com.amazon.kepler.tv.epg_provider_models.IProgram*[] — Required
An array of program instances to be inserted.
Returns
IUpsertProgramFailure*[]
A list of programs that failed to be added to the commit queue and the error
causing the failure. An empty array will be returened if all programs are added to the commit queue successfully.
Throws
IllegalStateError— if this function is called after the sameProgramLineupProviderhas already thrown an error previously in one of its methods.InternalError— if this function encounters an unrecoverable error such as data store connection issues, etc.StorageLimitError— if this function encounters an error due to ingested data exceeding the storage limit. Consult with your Amazon contact if you encounter this error.
clearAllPrograms()
void clearAllPrograms()
Clears all programs from the data store.
Removes all programs from the data store. This action is not persisted until commit() is called.
This will not clear channel information from the data store. Utilize this function exclusively when there is a need
to remove added programs from the Electronic Program Guide (EPG). The function call for clearAllPrograms()
must preceed all calls to upsert() within the same transaction.
Throws
IllegalStateError— ifclearAllPrograms()is called afterupsert()has already been called within this transaction, or if this function is called after the sameProgramLineupProviderhas already thrown anInternalErrorpreviously.InternalError— if the program data cannot be cleared for any other reason.
commit()
Commits any pending operations that didn’t result in avoidcommit(stringversion)
IUpsertProgramFailure to the data store.
This function should be called after performing operations on the provider using the other
methods in the provider interface. EpgLineupInformation.getLastCommittedProgramLineupVersion()
will begin to return this version value once this call succeeds.
Parameters
version
string — Required
A string representing the version of the program lineup that will be in the
data store as a result of this commit. Please refer to the developer guide for more information
on how to use this field.
Throws
IllegalStateError— if this function is called after the sameProgramLineupProviderhas already thrown anInternalErrorpreviously in one of its methods.InternalError— if the data cannot be committed to the LiveTV Providers data store.

