org.dvb.tvanytime.metadata
Class DvbDatabase

java.lang.Object
  extended by org.dvb.tvanytime.metadata.DvbDatabase
All Implemented Interfaces:
Database, MonitoredDatabase

public abstract class DvbDatabase
extends java.lang.Object
implements MonitoredDatabase

Class providing access to a TV Anytime metadata service that is broadcast in a DVB service. A new instance of this class is required for each of the metadata services that a client wishes to access. TV-Anytime metadata fragments obtained from a DVBDatabase shall include fragmentVersion and fragmentId attributes values which are obtained from the encapsulation structure defined in ETSI TS 102 822-3-2 clause 4.6.1.1.


Method Summary
static DvbDatabase[] getAvailableDatabases(DatabaseScope scope, boolean doNotTune)
          Get an array listing all DvbDatabases that can provide metadata for the specified scope.
abstract  int[] getAvailableFragmentTypes()
          Get the list of available fragment types as signalled in the Metadata Descriptor associated with this metadata service.
static DvbDatabase newInstance(boolean doNotTune)
          Get an instance of a DvbDatabase where the platform chooses a DVB service that contains a metadata service.
static DvbDatabase newInstance(CRID crid, boolean doNotTune)
          Get an instance of a DvbDatabase where the platform chooses a service that can provide metadata for the given CRID authority.
static DvbDatabase newInstance(org.davic.net.dvb.DvbLocator service, int metadataServiceId, boolean doNotTune)
          Get an instance of a DvbDatabase carried on a specified DVB service with the specified metadataServiceId.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.dvb.tvanytime.metadata.MonitoredDatabase
getMetadata, getMetadata, query, query
 
Methods inherited from interface org.dvb.tvanytime.metadata.Database
getDiscoveryRecord, getMetadata, getMetadata, getOptimisedQueryFields, query, query
 

Method Detail

newInstance

public static DvbDatabase newInstance(boolean doNotTune)
                               throws DatabaseException,
                                      TuningException
Get an instance of a DvbDatabase where the platform chooses a DVB service that contains a metadata service.

If the receiver does not have a DVB tuner a DatabaseException will be thrown.

Applications can use the doNotTune parameter to specify that the tuning of a reserved tuner should not be required to access the database. In this case, an org.davic.mpeg.TuningException will be thrown if the platform is unable to provide a DvbDatabase that can be accessed without tuning. If a DvbDatabase is returned but subsequently becomes inaccessible without tuning a DatabaseException will be thrown if access is attempted.

If the doNotTune parameter is set to false and tuning is required to access the database then a tuner will be reserved if one is available. If a tuner cannot be reserved then a org.davic.mpeg.TuningException will be thrown.

Parameters:
doNotTune - true indicates that tuning must not be required to access the database
Returns:
a DvbDatabase
Throws:
DatabaseException - if a metadata service cannot be found
TuningException - if tuning would be required to access a metadata service but this has been prohibited

newInstance

public static DvbDatabase newInstance(org.davic.net.dvb.DvbLocator service,
                                      int metadataServiceId,
                                      boolean doNotTune)
                               throws DatabaseException,
                                      TuningException
Get an instance of a DvbDatabase carried on a specified DVB service with the specified metadataServiceId.

If the receiver does not have a DVB tuner a DatabaseException will be thrown.

Applications can use the doNotTune parameter to specify that the tuning of a reserved tuner should not be required to access the Database. In this case, an org.davic.mpeg.TuningException will be thrown if the platform is not able to access the specified transport stream without tuning. If a DvbDatabase is returned but subsequently becomes inaccessible without tuning a DatabaseException will be thrown if access is attempted.

If the doNotTune parameter is set to false and tuning is required to access the database then a tuner will be reserved if one is available. If a tuner cannot be reserved then a org.davic.mpeg.TuningException will be thrown.

Parameters:
service - a DVB locator that points to the DVB service where a TV-Anytime metadata service can be found
metadataServiceId - a value that identifies the required metadata service
doNotTune - true indicates that tuning must not be required to access the database
Returns:
a DvbDatabase
Throws:
DatabaseException - if the specified metadata service cannot be found
TuningException - if tuning would be required to access the specified service but this has been prohibited

newInstance

public static DvbDatabase newInstance(CRID crid,
                                      boolean doNotTune)
                               throws DatabaseException,
                                      TuningException
Get an instance of a DvbDatabase where the platform chooses a service that can provide metadata for the given CRID authority.

If the receiver does not have a DVB tuner a DatabaseException will be thrown.

Applications can use the doNotTune parameter to specify that the tuning of a reserved tuner should not be required to access the database. In this case, an org.davic.mpeg.TuningException will be thrown if the platform is unable to provide a DvbDatabase that can be accessed without tuning. If a DvbDatabase is returned but subsequently becomes inaccessible without tuning a DatabaseException will be thrown if access is attempted.

If the doNotTune parameter is set to false and tuning is required to access the database then a tuner will be reserved if one is available. If a tuner cannot be reserved then a org.davic.mpeg.TuningException will be thrown.

Parameters:
crid - the authority field from the supplied CRID is used to decide which metadata service to use.
doNotTune - true indicates that tuning must not be required to access the database
Returns:
a DvbDatabase for this service,
Throws:
DatabaseException - if a metadata service cannot be found for the given CRID authority
TuningException - if tuning would be required to access a metadata service but this has been prohibited

getAvailableDatabases

public static DvbDatabase[] getAvailableDatabases(DatabaseScope scope,
                                                  boolean doNotTune)
                                           throws DatabaseException,
                                                  TuningException
Get an array listing all DvbDatabases that can provide metadata for the specified scope. This method may block for some time whilst accessing DVB-SI tables.

If the receiver does not have a DVB tuner a DatabaseException will be thrown.

Applications can use the doNotTune parameter to restrict the returned databases to those that can be accessed without the tuning of a reserved tuner. In this case, an org.davic.mpeg.TuningException will be thrown if the platform is not able to provide any DvbDatabases that can be accessed without tuning. If a DvbDatabase is returned that subsequently becomes inaccessible without tuning a DatabaseException will be thrown if access is attempted. If the doNotTune parameter is set to false then the returned databases will include those that would require the use of a reserved tuner but a tuner is not tuned or reserved.

Parameters:
scope - the required scope of the DvbDatabases.
doNotTune - true indicates that tuning must not be required to access the returned databases.
Returns:
an array listing all DvbDatabases with the required scope that are signalled in DVB-SI. This will include all existing DVBDatabase instances where they exist and new instances where an existing instance does not exist.
Throws:
DatabaseException - if no metadata services can be found for the specified scope.
TuningException - if no metadata services can be found that are accessible without tuning and this has been prohibited.

getAvailableFragmentTypes

public abstract int[] getAvailableFragmentTypes()
Get the list of available fragment types as signalled in the Metadata Descriptor associated with this metadata service. If the list is not available (i.e. the fragment_types_flag of the descriptor is set to '0') this method will return null.

Returns:
a list of fragment_type values as defined in ETSI TS 102 323, or null.