Java DTV API 1.3
18-Nov-2009

com.sun.dtv.locator
Class URLLocator

java.lang.Object
  extended by com.sun.dtv.locator.URLLocator
All Implemented Interfaces:
Locator
Direct Known Subclasses:
EntityLocator

public class URLLocator
extends Object
implements Locator

Locator based on a URL. This locator can be used as transport dependent as well as transport independent locators.

The following forms of locators MUST be used to create a locator:

for transport streams:
dtv://<original_network_id>.<transport_stream_id> or
dtv://<frequency>:<modulation>.<symbol_rate>

for services:
dtv://<original_network_id>.<transport_stream_id>.<service_id>

for service domains:
dtv://<original_network_id>.<transport_stream_id>.<service_id>[;<content_id>][.<event_id>]/<component_tag>

for program events:
dtv://<original_network_id>.<transport_stream_id>.<service_id>.<event_id>

for MPEG elementary streams:
dtv://<original_network_id>.<transport_stream_id>.<service_id>[;<content_id>][.<event_id>]/<component_tag>[;<channel_id>]{&<component_tag>[;<channel_id>]}

for files and directories:
URL of “file:”, “http:” and “https:”.
It should be noted that all broadcast files can be addressed as "file:" using the location on the local filesystem.

All ids in the URLs MUST be provided in hexadecimal form using only hexadecimal digits ('0'-'9','a'-'f','A'-'F'). Leading '0' is allowed in order to fill fixed length string.

Frequency values MUST be given as decimal numbers in kiloHertz (kHz).

Modulation MUST be “DQPSK”, “QPSK”, “16QAM” or “64QAM”. Lower case is allowed for all letters.

Symbol_rate MUST be “12” for 1/2, “23” for 2/3, “34” for 3/4, “56” for 5/6 or “78” for 7/8.


Constructor Summary
URLLocator(String url)
          Constructor for a URL based locator.
 
Method Summary
 boolean equals(Object o)
          Compares this Locator with the specified object for equality.
 int hashCode()
          Generates a hash code value for this Locator.
 boolean hasMultipleTransformations()
          Indicates whether this Locator has a mapping to multiple transports.
 String toExternalForm()
          Generates a canonical, string-based representation of this Locator.
 String toString()
          Returns the string used to create this locator.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URLLocator

public URLLocator(String url)
           throws InvalidLocatorException
Constructor for a URL based locator.

Parameters:
url - the URL string
Throws:
InvalidLocatorException - if the locator can not be created from the provided parameters.
Method Detail

hasMultipleTransformations

public boolean hasMultipleTransformations()
Indicates whether this Locator has a mapping to multiple transports.

Specified by:
hasMultipleTransformations in interface Locator
Returns:
true if multiple transformations exist for this Locator, false otherwise.
See Also:
Locator.hasMultipleTransformations()

toExternalForm

public String toExternalForm()
Generates a canonical, string-based representation of this Locator. The string returned may be entirely platform-dependent. If two locators have identical external forms, they refer to the same resource. However, two locators that refer to the same resource may have different external forms.

This method returns the canonical form of the string that was used to create the Locator (via LocatorFactory.createLocator()). In generating canonical external forms, the implementation will make its best effort at resolving locators to one-to-one relationships with the resources that they reference.

The result of this method can be used to create new Locator instances as well as other types of locators, such as JMF MediaLocators and URLs.

Specified by:
toExternalForm in interface Locator
Returns:
A string-based representation of this Locator.
See Also:
Locator.toExternalForm()

equals

public boolean equals(Object o)
Compares this Locator with the specified object for equality. The result is true if and only if the specified object is also a Locator and has an external form identical to the external form of this Locator.

Specified by:
equals in interface Locator
Overrides:
equals in class Object
Parameters:
o - The object against which to compare this Locator.
Returns:
true if the specified object is equal to this Locator.
See Also:
String.equals(Object)

hashCode

public int hashCode()
Generates a hash code value for this Locator. Two Locator instances for which Locator.equals() is true will have identical hash code values.

Specified by:
hashCode in interface Locator
Overrides:
hashCode in class Object
Returns:
The hash code value for this Locator.
See Also:
equals(Object)

toString

public String toString()
Returns the string used to create this locator.

Specified by:
toString in interface Locator
Overrides:
toString in class Object
Returns:
The string used to create this locator.

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.