|
Copyright 2008 Motorola Inc. and Nokia Corporation. All Rights Reserved. Specification License |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BroadcastConnection
BroadcastConnection
is the base interface to provide access
to data that comes with a broadcast service.
BroadcastFileConnection
and
BroadcastDatagramConnection
extend from BroadcastConnection
.
BroadcastFileConnection
abstracts a file or directory.
BroadcastDatagramConnection
provides access to read from a packet
data stream.
BroadcastFileConnections
are retrieved from the Generic Connection Framework
given the URI of the connection.
The javax.microedition.io.Connector.open()
method can be used to create the broadcast
connections. URIs are persistent as long as the files they are referring to remain in their location.
Change of a platform provider changes the file system as well. URIs associated with PlatformProvider
that currently is not selected most likely will not work until the correct PlatformProvider
is selected.
Some of the well-defined URIs are provided in the ESG.
For example, the content logo of a program,
CommonMetadataSet.PROGRAM_CONTENT_AUX_LOGO
can be retrieved as a BroadcastFileConnection
.
Auxiliary broadcast data may also be delivered as packets of data via
a BroadcastDatagramConnection
.
A BroadcastDatagramConnection
is associated with
an individual ServiceComponent
.
Once a Service
is selected
and the ServiceContext
reached the
PREPARING_MEDIA
state
and the
COMPONENTS_SET
event is delivered, the connections may be retrieved with
getBroadcastDatagramConnection(ServiceComponent)
as long as ServiceContext
is not closed or stopped.
ServiceContext
returns ServiceComponents
with type ServiceComponent.FILECAST
. Since there are no
associated audio and video streams, no Player
object will
be associated with the ServiceComponent
.
The CommonMetadataSet.PROGRAM_CONTENT_LOCATION
attribute
can be used to retrieve the URI of the content from the service guide.
The URI will point to a directory where the files will be placed.
Application will be notified of the arrival of the new files via
the BroadcastConnectionListener
.
By definition, all BroadcastConnections
are read-only. Connector.open(uri)
uses by default
the READ_WRITE
access parameter.
Connector.open(uri, READ)
should be used to open read-only
BroadcastConnections
.
Whether the broadcast data is transmitted as a BroadcastFileConnection
or a BroadcastDatagramConnection
is implementation specific.
Applications can use instanceof
to check for the specific type
of BroadcastConnections
obtained from the API.
In some implementations of the broadcast medium, not all the broadcast connections
are accessible immediately. At any given time, some of the broadcast connections
may not be available possibly because the data has not yet arrived to the device.
This interface provides some utilities to determine the availability of the connection
and to possibly control the caching behavior. A
BroadcastConnectionListener
is also provided to receive runtime status changes of the individual broadcast
connection.
Broadcast connections are always supported at least as BroadcastFileConnection
objects. However, it is quite likely that when the platform provider
is changed the files associated with the previous platform provider can't be accessed any longer.
In that case isAvailable()
returns false.
See broadcast connection examples for some usage examples.
Method Summary | |
---|---|
void |
addListener(BroadcastConnectionListener listener)
Add a new listener to this broadcast connection. |
java.lang.String |
getMimeType()
Get the type of the connection. |
java.util.Hashtable |
getProperties()
Get properties available for this connection as available from the provider. |
boolean |
isAvailable()
Check availability of the connection. |
void |
removeListener(BroadcastConnectionListener listener)
Remove the given listener from the broadcast connection. |
Methods inherited from interface javax.microedition.io.Connection |
---|
close |
Method Detail |
---|
void addListener(BroadcastConnectionListener listener)
null
or if the given listener
is already added, the method will be ignored.
listener
- the BroadcastConnectionListener
to add.java.lang.String getMimeType()
null
if no mime type can be associated with the connection.java.util.Hashtable getProperties()
null
if no properties are available.boolean isAvailable()
void removeListener(BroadcastConnectionListener listener)
null
or the listener is
already removed, the method will be ignored.
listener
- the BroadcastConnectionListener
to remove.
|
Copyright 2008 Motorola Inc. and Nokia Corporation. All Rights Reserved. Specification License |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |