org.dvb.tvanytime.metadata
Interface MonitoredDatabase

All Superinterfaces:
Database
All Known Implementing Classes:
DvbDatabase, MulticastDatabase

public interface MonitoredDatabase
extends Database

Sources of metadata conforming to this interface can be continuously monitored for changes. Queries are constructed using a DatabaseQuery object, which is then passed to different database instances depending on the required source. Results are returned inside a DatabaseQueryResult object which is initially empty. An application can receive a sequence of events as each element is added by providing an instance of ResultListener. The scope of the metadata that is returned by a query can be restricted by the use of QueryConstraints. An application can receive notification of metadata changes that affect the DatabaseQueryResult by providing an instance of MetadataChangedListener.

See Also:
Database, DatabaseQuery, ResultListener, MetadataChangedListener, QueryConstraints, DatabaseQueryResult

Method Summary
 DatabaseQueryResult getMetadata(CRID crid, ResultListener resultListener, MetadataChangedListener changeListener)
          Get all available metadata on a specific CRID.
 DatabaseQueryResult getMetadata(CRID crid, ResultListener resultListener, MetadataChangedListener changeListener, QueryConstraints constraints)
          Get all available metadata on a specific CRID.
 DatabaseQueryResult query(DatabaseQuery query, ResultListener resultListener, MetadataChangedListener changeListener)
          Make a metadata query to the database.
 DatabaseQueryResult query(DatabaseQuery query, ResultListener resultListener, MetadataChangedListener changeListener, QueryConstraints constraints)
          Make a metadata query to the database.
 
Methods inherited from interface org.dvb.tvanytime.metadata.Database
getDiscoveryRecord, getMetadata, getMetadata, getOptimisedQueryFields, query, query
 

Method Detail

getMetadata

DatabaseQueryResult getMetadata(CRID crid,
                                ResultListener resultListener,
                                MetadataChangedListener changeListener)
                                throws DatabaseException
Get all available metadata on a specific CRID.

Parameters:
crid - The CRID to look up
resultListener - an instance of ResultListener or null
changeListener - an instance of a metadataChangedListener
Returns:
DatabaseQueryResult that contains metadata fragments where the given CRID is the primary key. The document will be in the form of a TV Anytime compliant document (i.e. the top level element will be a TVAMain, followed by all the programme/group/... tables). The DatabaseQueryResult.getAvailableTables() method can be used to see if this contains a ProgramInformation or GroupInformation table, which can be used to decide if this is a group or programme CRID. If the CRID cannot be found, an empty document will be returned.

Implementations can choose whether or not to inline credits information directly, or to reference a fragment in the CreditsInformationTable.

Throws:
DatabaseException - if the CRID is invalid or if there is an error accessing the database.

getMetadata

DatabaseQueryResult getMetadata(CRID crid,
                                ResultListener resultListener,
                                MetadataChangedListener changeListener,
                                QueryConstraints constraints)
                                throws DatabaseException
Get all available metadata on a specific CRID.

Parameters:
crid - The CRID to look up
resultListener - an instance of ResultListener or null
changeListener - an instance of a metadataChangedListener
constraints - the constraints to apply to this metadata request
Returns:
DatabaseQueryResult that contains metadata fragments where the given CRID is the primary key. The document will be in the form of a TV Anytime compliant document (i.e. the top level element will be a TVAMain, followed by all the programme/group/... tables). The DatabaseQueryResult.getAvailableTables() method can be used to see if this contains a ProgramInformation or GroupInformation table, which can be used to decide if this is a group or programme CRID. If the CRID cannot be found, an empty document will be returned.

Implementations can choose whether or not to inline credits information directly, or to reference a fragment in the CreditsInformationTable. Specifying the CreditsInformationTable in the QueryConstraints determines if the server returns credits information at all, but does not impact the above choice on how to include the credits information. The implementation will not return credits information if the CreditsInformationTable is not specified in the QueryConstraints.

Throws:
DatabaseException - if the CRID is invalid or if there is an error accessing the database.

query

DatabaseQueryResult query(DatabaseQuery query,
                          ResultListener resultListener,
                          MetadataChangedListener changeListener)
                          throws DatabaseException
Make a metadata query to the database.

Parameters:
query - The query to perform on the database
resultListener - an instance of ResultListener or null
changeListener - an instance of a metadataChangedListener
Returns:
DatabaseQueryResult that contains all the metadata that matches the query. The document will be in the form of a TV Anytime compliant document (i.e. the top level element will be a TVAMain, followed by all the programme/group/... tables) If nothing matches the query, an empty document will be returned.

Implementations can choose whether or not to inline credits information directly, or to reference a fragment in the CreditsInformationTable.

A ServiceInformationTable will always be included in the response if a ServiceInformation entry is being referenced (using a serviceIDRef) from a ProgramLocationTable.

Throws:
DatabaseException - if the CRID is invalid or if there is an error accessing the database.

query

DatabaseQueryResult query(DatabaseQuery query,
                          ResultListener resultListener,
                          MetadataChangedListener changeListener,
                          QueryConstraints constraints)
                          throws DatabaseException
Make a metadata query to the database.

Parameters:
query - The query to perform on the database
resultListener - an instance of ResultListener or null
changeListener - an instance of a metadataChangedListener
constraints - the constraints to apply to this metadata request
Returns:
DatabaseQueryResult that contains all the metadata that matches the query. The document will be in the form of a TV Anytime compliant document (i.e. the top level element will be a TVAMain, followed by all the programme/group/... tables) If nothing matches the query, an empty document will be returned.

Implementations can choose whether or not to inline credits information directly, or to reference a fragment in the CreditsInformationTable. Specifying the CreditsInformationTable in the QueryConstraints determines if the server returns credits information at all, but does not impact the above choice on how to include the credits information. The implementation will not return credits information if the CreditsInformationTable is not specified in the QueryConstraints.

A ServiceInformationTable will always be included in the response if a ServiceInformation entry is being referenced (using a serviceIDRef) from a ProgramLocationTable. Thus, specifying the ServiceInformationTable in the QueryConstraints will have no effect if a ProgramLocationTable is being returned.

Throws:
DatabaseException - if the CRID is invalid or if there is an error accessing the database.