Java DTV API 1.3
18-Nov-2009

com.sun.dtv.locator
Class EntityLocator

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

public abstract class EntityLocator
extends URLLocator
implements TransportDependentLocator

Locator for entities in the transport stream. These entities can be transport streams, services, elementary streams and events.


Constructor Summary
EntityLocator(int originalNetworkId, int transportId)
          Create a locator for a transport stream.
EntityLocator(int originalNetworkId, int transportId, int serviceId)
          Create a locator for a service.
EntityLocator(int originalNetworkId, int transportId, int serviceId, int contentId)
          Create a locator for an elementary stream.
EntityLocator(int originalNetworkId, int transportId, int serviceId, int contentId, int eventId)
          Create a locator for an event.
EntityLocator(String url)
          Create a locator from the given url.
 
Method Summary
 int getContentId()
          Get the content Id of this locator.
 int getEventId()
          Get the event Id of this locator.
 MediaLocator getMediaLocator()
          Provides the MediaLocator representation if this instance is a locator to a TransportStream or an ElementaryStream in a format which is supported by the JMF implementation.
 int getOriginalNetworkId()
          Gets the original network Id of this locator.
 int getServiceId()
          Get the service Id of this locator.
 int getTransportStreamId()
          Get the transport stream Id of this locator.
 String toExternalForm()
          Generates a canonical, string-based representation of this Locator.
 
Methods inherited from class com.sun.dtv.locator.URLLocator
equals, hashCode, hasMultipleTransformations, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.tv.locator.Locator
equals, hashCode, hasMultipleTransformations, toString
 

Constructor Detail

EntityLocator

public EntityLocator(String url)
              throws InvalidLocatorException
Create a locator from the given url.

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

EntityLocator

public EntityLocator(int originalNetworkId,
                     int transportId)
              throws InvalidLocatorException
Create a locator for a transport stream.

Parameters:
originalNetworkId - original network Id, “-1” must be used to specify the default network id
transportId - transport stream Id
Throws:
InvalidLocatorException - if the locator can not be created from the provided parameters.

EntityLocator

public EntityLocator(int originalNetworkId,
                     int transportId,
                     int serviceId)
              throws InvalidLocatorException
Create a locator for a service.

Parameters:
originalNetworkId - original network Id, “-1” must be used to specify the default network id
transportId - transport stream Id
serviceId - service Id
Throws:
InvalidLocatorException - if the locator can not be created from the provided parameters.

EntityLocator

public EntityLocator(int originalNetworkId,
                     int transportId,
                     int serviceId,
                     int contentId)
              throws InvalidLocatorException
Create a locator for an elementary stream.

Parameters:
originalNetworkId - original network ID, “-1” must be used to specify the default network id
transportId - transport stream ID
serviceId - service Id
contentId - contents Id of the elementary stream
Throws:
InvalidLocatorException - if the locator can not be created from the provided parameters.

EntityLocator

public EntityLocator(int originalNetworkId,
                     int transportId,
                     int serviceId,
                     int contentId,
                     int eventId)
              throws InvalidLocatorException
Create a locator for an event.

Parameters:
originalNetworkId - original network ID, “-1” must be used to specify the default network id
transportId - transport stream Id.
serviceId - the service Id.
contentId - the content Id of the elementary stream.
eventId - event Id.
Throws:
InvalidLocatorException - if the locator can not be created from the provided parameters.
Method Detail

getOriginalNetworkId

public int getOriginalNetworkId()
Gets the original network Id of this locator.

Returns:
the Original Network ID. “-1” if not available.

getTransportStreamId

public int getTransportStreamId()
Get the transport stream Id of this locator.

Returns:
the transport stream Id. “-1” if not available.

getServiceId

public int getServiceId()
Get the service Id of this locator.

Returns:
the service Id. “-1” if not available.

getContentId

public int getContentId()
Get the content Id of this locator.

Returns:
the content Id. “-1” if not available.

getEventId

public int getEventId()
Get the event Id of this locator.

Returns:
the event Id. “-1” if not available.

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
Overrides:
toExternalForm in class URLLocator
Returns:
A string-based representation of this Locator.
See Also:
Locator.toExternalForm()

getMediaLocator

public MediaLocator getMediaLocator()
Provides the MediaLocator representation if this instance is a locator to a TransportStream or an ElementaryStream in a format which is supported by the JMF implementation.

Returns:
the MediaLocator if this EntityLocator is a locator to media that can be rendered by a JMF Player instance, otherwise null.

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.