All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ocap.net.OcapLocator.html Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version






OcapLocator














org.ocap.net
Class OcapLocator

java.lang.Object
  extended by org.davic.net.Locator
      extended by org.ocap.net.OcapLocator
All Implemented Interfaces:
javax.tv.locator.Locator

public class OcapLocator
extends Locator

This class encapsulates an OCAP URL into an object. This class provides access to locations of various types of items in the transport stream.

The javax.tv.locator.Locator.toExternalForm() method returns an OCAP URL string that is used to create an OcapLocator instance, in canonical form. If an OCAP locator is in canonical form, the following MUST hold:

  • no character is escaped if it is possible to represent it without escaping according to the OCAP URL BNF. (E.g. "%41" is changed to "A").
  • hex numbers do not have leading zeros, except for the number zero itself, which is represented as "0x0". (E.g. "0x01" is changed to "0x1").
  • all instances of ISO_639_language_code must be lowercase. (E.g. "SPA" is changed to "spa").
No other change is performed to convert an OCAP locator to its canonical form.

All methods defined in this class that return Strings, except for toExternalForm(), return the String in Unicode format. I.e. They MUST un-escape characters in the corresponding portion of the URL that are escaped with the %nn syntax (where that syntax is permitted by the OCAP URL BNF), and they MUST UTF-8 decode the string.

All constructors defined in this class that take String parameters, except for the OcapLocator(String url) constructor, require the String in Unicode format. I.e. Where permitted by the OCAP URL BNF they MUST UTF-8 encode the string and they MUST escape (using the %nn syntax) any characters that require escaping. They MUST NOT escape any character that can be represented without escaping.

See Also:
Locator, AppAttributes.getServiceLocator()

Constructor Summary
OcapLocator(int sourceID)
           A constructor of this class corresponding to the OCAP URL form "ocap://source_id".
OcapLocator(int frequency, int modulationFormat)
           A constructor of this class corresponding to the OCAP URL form "ocap://f=frequency[.m=modulation_format]".
OcapLocator(int sourceID, int[] PID, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://source_id[.
OcapLocator(int frequency, int programNumber, int modulationFormat)
           A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number[.m=modulation_format]".
OcapLocator(int sourceID, int eventID, int[] componentTags, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://source_id[.
OcapLocator(int frequency, int programNumber, int modulationFormat, int[] PID, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number[.m=modulation_format] [.
OcapLocator(int frequency, int programNumber, int modulationFormat, int eventID, int[] componentTags, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number[.m=modulation_format] [.
OcapLocator(int frequency, int programNumber, int modulationFormat, short[] streamType, int[] index, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number.
OcapLocator(int frequency, int programNumber, int modulationFormat, short[] streamType, java.lang.String[] ISO639LanguageCode, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number[.m=modulation_format] [.stream_type[,ISO_639_language_code] {&stream_type[,ISO_639_language_code]}][;event_id]{/path_segments}".
OcapLocator(int frequency, int programNumber, int modulationFormat, java.lang.String[] componentName, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number[.m=modulation_format] [.
OcapLocator(int sourceID, short[] streamType, int[] index, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://source_id[.stream_type[,index]{&stream_type[,index]}] [;event_id]{/path_segments}".
OcapLocator(int sourceID, short[] streamType, java.lang.String[] ISO639LanguageCode, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://source_id[.stream_type[,ISO_639_language_code]{& stream_type[,ISO_639_language_code]}][;event_id]{/path_segments}".
OcapLocator(int sourceID, java.lang.String[] componentName, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://source_id[.
OcapLocator(java.lang.String url)
           A constructor of this class for any form of OCAP URL.
OcapLocator(java.lang.String serviceName, int[] PID, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://n=service_name[.
OcapLocator(java.lang.String serviceName, int eventID, int[] componentTags, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://n=service_name[.
OcapLocator(java.lang.String serviceName, short[] streamType, int[] index, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://n=service_name[.stream_type[,index]{&stream_type[,index]}] [;event_id]{/path_segments}".
OcapLocator(java.lang.String serviceName, short[] streamType, java.lang.String[] ISO639LanguageCode, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://n=service_name[.stream_type[,ISO_639_language_code]{& stream_type[,ISO_639_language_code]}][;event_id]{/path_segments}".
OcapLocator(java.lang.String serviceName, java.lang.String[] componentName, int eventID, java.lang.String pathSegments)
           A constructor of this class corresponding to the OCAP URL form "ocap://n=service_name[.
 
Method Summary
 java.lang.String[] getComponentNames()
          This method returns a component_name value of the OCAP URL represented by this OcapLocator instance.
 int[] getComponentTags()
          This method returns a component_tag value of the OCAP URL represented by this OcapLocator instance.
 int getEventId()
          This method returns an event_id value of the OCAP URL represented by this OcapLocator instance.
 int getFrequency()
          This method returns a frequency value, in hertz, of the OCAP URL represented by this OcapLocator instance.
 int[] getIndexes()
          This method returns an index value of the OCAP URL represented by this OcapLocator instance.
 java.lang.String[] getLanguageCodes()
          This method returns an ISO_639_language_code value of the OCAP URL represented by this OcapLocator instance.
 int getModulationFormat()
          This method returns a value representing a modulation_format as specified in SCTE 65.
 java.lang.String getPathSegments()
          This method returns a path_segments string of the OCAP URL represented by this OcapLocator instance.
 int[] getPIDs()
          This method returns a PID value of the OCAP URL represented by this OcapLocator instance.
 int getProgramNumber()
          This method returns a program_number value of the OCAP URL represented by this OcapLocator instance.
 java.lang.String getServiceName()
          This method returns a service_name value of the OCAP URL represented by this OcapLocator instance.
 int getSourceID()
          This method returns a source_id value of the OCAP URL represented by this OcapLocator instance.
 short[] getStreamTypes()
          This method returns a stream_type value of the OCAP URL represented by this OcapLocator instance.
 
Methods inherited from class org.davic.net.Locator
hasMultipleTransformations, toExternalForm, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.tv.locator.Locator
equals, hashCode
 

Constructor Detail

OcapLocator

public OcapLocator(int sourceID)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://source_id".

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
sourceID - a source_id value for the OCAP URL.
Throws:
InvalidLocatorException - if the sourceID to construct the locator doesn't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int frequency,
                   int programNumber,
                   int modulationFormat)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number[.m=modulation_format]".

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getSourceId() etc. is called.

Parameters:
frequency - a frequency value for the OCAP URL in hertz. If the value is -1 then "oobfdc" is used instead of the frequency term and the modulationFormat parameter is ignored.
programNumber - a program_number value for the OCAP URL
modulationFormat - a value representing a modulation_format as specified in SCTE 65. If the value is 0xFF the modulation_format is treated as NTSC analog and the programNumber parameter is ignored. If the value is -1 the modulation_format is not specified and the modulation_format term will not be included in the locator constructed.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int frequency,
                   int modulationFormat)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://f=frequency[.m=modulation_format]".

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getSourceId() etc. is called.

Parameters:
frequency - a frequency value for the OCAP URL in hertz.
modulationFormat - a value representing a modulation_format as specified in SCTE 65. If the value is 0xFF the modulation_format is treated as NTSC analog. If the value is -1 the modulation_format is not specified and the modulation_format term will not be included in the locator constructed.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(java.lang.String url)
            throws InvalidLocatorException

A constructor of this class for any form of OCAP URL.

Note that the OcapLocator does not automatically transform the specified url string to any other form, even if any get methods for the value that is not included in the url string are called.

Parameters:
url - a string expression that represents the OCAP URL.
Throws:
InvalidLocatorException - if the url to construct the locator doesn't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int sourceID,
                   short[] streamType,
                   java.lang.String[] ISO639LanguageCode,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://source_id[.stream_type[,ISO_639_language_code]{& stream_type[,ISO_639_language_code]}][;event_id]{/path_segments}". Some of the parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
sourceID - a source_id value for the OCAP URL.
streamType - a stream_type value for the OCAP URL. A combination of the streamType[n] and the ISO639LanguageCode[n] makes a program_element. The streamType shall be a zero length array, if it is omitted in the OCAP URL.
ISO639LanguageCode - an ISO_639_language_code value for the OCAP URL. A combination of the streamType[n] and the ISO639LanguageCode[n] makes a program_element. The ISO639LanguageCode shall be a zero length array, if it is omitted in the OCAP URL. If ISO639LanguageCode is not a zero-length array, it shall be an array with the same length as streamType. If ISO639LanguageCode[n] is null, then the language code for streamType[n] is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int sourceID,
                   short[] streamType,
                   int[] index,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://source_id[.stream_type[,index]{&stream_type[,index]}] [;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
sourceID - a source_id value for the OCAP URL.
streamType - a stream_type value for the OCAP URL. A combination of the streamType[n] and the index[n] makes a program_element. The streamType shall be a zero length array, if it is omitted in the OCAP URL.
index - an index value for the OCAP URL. A combination of the streamType[n] and the index[n] makes a program_element. The index shall be a zero length array, if it is omitted in the OCAP URL. If index is not a zero-length array, it shall be an array with the same length as streamType. If index[n] is -1, then the index for streamType[n] is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int sourceID,
                   int[] PID,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://source_id[.+PID{&PID}][;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
sourceID - a source_id value for the OCAP URL.
PID - a PID value for the OCAP URL. The PID shall be a zero length array, if it is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int sourceID,
                   java.lang.String[] componentName,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://source_id[.$component_name{&component_name}] [;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
sourceID - a source_id value for the OCAP URL.
componentName - a component_name value for the OCAP URL. The component_name shall be a zero length array, if it is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int sourceID,
                   int eventID,
                   int[] componentTags,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://source_id[.@component_tag{&component_tag}][;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

WARNING: Note that the parameter order for this constructor is different from other OcapLocator constructors - the eventId is before the componentTags. If you are an OCAP application author and you get it wrong, your program will compile and run but it will be calling the constructor that expects a list of PIDs instead.

Parameters:
sourceID - a source_id value for the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
componentTags - a component_tag value for the OCAP URL. The component_tag shall be a zero length array, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(java.lang.String serviceName,
                   short[] streamType,
                   java.lang.String[] ISO639LanguageCode,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://n=service_name[.stream_type[,ISO_639_language_code]{& stream_type[,ISO_639_language_code]}][;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
serviceName - a service_name value for the OCAP URL.
streamType - a stream_type value for the OCAP URL. A combination of the streamType[n] and the ISO639LanguageCode[n] makes a program_element. The streamType shall be a zero length array, if it is omitted in the OCAP URL.
ISO639LanguageCode - an ISO_639_language_code value for the OCAP URL. A combination of the streamType[n] and the ISO639LanguageCode[n] makes a program_element. The ISO639LanguageCode shall be a zero length array, if it is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(java.lang.String serviceName,
                   short[] streamType,
                   int[] index,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://n=service_name[.stream_type[,index]{&stream_type[,index]}] [;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
serviceName - a service_name value for the OCAP URL.
streamType - a stream_type value for the OCAP URL. A combination of the streamType[n] and the index[n] makes a program_element. The streamType shall be a zero length array, if it is omitted in the OCAP URL.
index - an index value for the OCAP URL. A combination of the streamType[n] and the index[n] makes a program_element. The index shall be a zero length array, if it is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(java.lang.String serviceName,
                   int[] PID,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://n=service_name[.+PID{&PID}][;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
serviceName - a service_name value for the OCAP URL.
PID - a PID value for the OCAP URL. The PID shall be a zero length array, if it is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(java.lang.String serviceName,
                   java.lang.String[] componentName,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://n=service_name[.$component_name{&component_name}] [;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
serviceName - a service_name value for the OCAP URL.
componentName - a component_name value for the OCAP URL. The component_name shall be a zero length array, if it is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(java.lang.String serviceName,
                   int eventID,
                   int[] componentTags,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://n=service_name[.@component_tag{&component_tag}][;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

WARNING: Note that the parameter order for this constructor is different from other OcapLocator constructors - the eventId is before the componentTags. If you are an OCAP application author and you get it wrong, your program will compile and run but it will be calling the constructor that expects a list of PIDs instead.

Parameters:
serviceName - a service_name value for the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
componentTags - a component_tag value for the OCAP URL. The component_tag shall be a zero length array, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int frequency,
                   int programNumber,
                   int modulationFormat,
                   short[] streamType,
                   java.lang.String[] ISO639LanguageCode,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number[.m=modulation_format] [.stream_type[,ISO_639_language_code] {&stream_type[,ISO_639_language_code]}][;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
frequency - a frequency value for the OCAP URL in hertz. If the value is -1 then "oobfdc" is used instead of the frequency term and the modulationFormat parameter is ignored.
programNumber - a program_number value for the OCAP URL
modulationFormat - a value representing a modulation_format as specified in SCTE 65. If the value is 0xFF the modulation_format is treated as NTSC analog and the programNumber parameter is ignored. If the value is -1 the modulation_format is not specified and the modulation_format term will not be included in the locator constructed.
streamType - a stream_type value for the OCAP URL. A combination of the streamType[n] and the ISO639LanguageCode[n] makes a program_element. The streamType shall be a zero length array, if it is omitted in the OCAP URL.
ISO639LanguageCode - an ISO_639_language_code value for the OCAP URL. A combination of the streamType[n] and the ISO639LanguageCode[n] makes a program_element. The ISO639LanguageCode shall be a zero length array, if it is omitted in the OCAP URL. If ISO639LanguageCode is not a zero-length array, it shall be an array with the same length as streamType. If ISO639LanguageCode[n] is null, then the language code for streamType[n] is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int frequency,
                   int programNumber,
                   int modulationFormat,
                   short[] streamType,
                   int[] index,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number.[m=modulation_format] [.stream_type[,index]{&stream_type[,index]}] [;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
frequency - a frequency value for the OCAP URL in hertz. If the value is -1 then "oobfdc" is used instead of the frequency term and the modulationFormat parameter is ignored.
programNumber - a program_number value for the OCAP URL
modulationFormat - a value representing a modulation_format as specified in SCTE 65. If the value is 0xFF the modulation_format is treated as NTSC analog and the programNumber parameter is ignored. If the value is -1 the modulation_format is not specified and the modulation_format term will not be included in the locator constructed.
streamType - a stream_type value for the OCAP URL. A combination of the streamType[n] and the index[n] makes a program_element. The streamType shall be a zero length array, if it is omitted in the OCAP URL.
index - an index value for the OCAP URL. A combination of the streamType[n] and the index[n] makes a program_element. The index shall be a zero length array, if it is omitted in the OCAP URL. If index is not a zero-length array, it shall be an array with the same length as streamType. If index[n] is -1, then the index for streamType[n] is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int frequency,
                   int programNumber,
                   int modulationFormat,
                   int[] PID,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number[.m=modulation_format] [.+PID{&PID}][;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
frequency - a frequency value for the OCAP URL in hertz. If the value is -1 then "oobfdc" is used instead of the frequency term and the modulationFormat parameter is ignored.
programNumber - a program_number value for the OCAP URL
modulationFormat - a value representing a modulation_format as specified in SCTE 65. If the value is 0xFF the modulation_format is treated as NTSC analog and the programNumber parameter is ignored. If the value is -1 the modulation_format is not specified and the modulation_format term will not be included in the locator constructed.
PID - a PID value for the OCAP URL. The PID shall be a zero length array, if it is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int frequency,
                   int programNumber,
                   int modulationFormat,
                   java.lang.String[] componentName,
                   int eventID,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number[.m=modulation_format] [.$component_name{&component_name}] [;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

Parameters:
frequency - a frequency value for the OCAP URL in hertz. If the value is -1 then "oobfdc" is used instead of the frequency term and the modulationFormat parameter is ignored.
programNumber - a program_number value for the OCAP URL
modulationFormat - a value representing a modulation_format as specified in SCTE 65. If the value is 0xFF the modulation_format is treated as NTSC analog and the programNumber parameter is ignored. If the value is -1 the modulation_format is not specified and the modulation_format term will not be included in the locator constructed.
componentName - a component_name value for the OCAP URL. The component_name shall be a zero length array, if it is omitted in the OCAP URL.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).

OcapLocator

public OcapLocator(int frequency,
                   int programNumber,
                   int modulationFormat,
                   int eventID,
                   int[] componentTags,
                   java.lang.String pathSegments)
            throws InvalidLocatorException

A constructor of this class corresponding to the OCAP URL form "ocap://(oobfdc|f=frequency).program_number[.m=modulation_format] [.@component_tag{&component_tag}][;event_id]{/path_segments}". Some of parameters can be omitted according to the OCAP URL BNF definition.

Note that the OcapLocator does not automatically transform this OCAP URL BNF form to any other form, even if the getFrequency() etc. is called.

WARNING: Note that the parameter order for this constructor is different from other OcapLocator constructors - the eventId is before the componentTags. If you are an OCAP application author and you get it wrong, your program will compile and run but it will be calling the constructor that expects a list of PIDs instead.

Parameters:
frequency - a frequency value for the OCAP URL in hertz. If the value is -1 then "oobfdc" is used instead of the frequency term and the modulationFormat parameter is ignored.
programNumber - a program_number value for the OCAP URL
modulationFormat - a value representing a modulation_format as specified in SCTE 65. If the value is 0xFF the modulation_format is treated as NTSC analog and the programNumber parameter is ignored. If the value is -1 the modulation_format is not specified and the modulation_format term will not be included in the locator constructed.
eventID - an event_id value for the OCAP URL. The event_id shall be -1, if it is omitted in the OCAP URL.
componentTags - a component_tag value for the OCAP URL. The component_tag shall be a zero length array, if it is omitted in the OCAP URL.
pathSegments - a path_segments value for the OCAP URL. The pathSegments shall be null, if it is omitted in the OCAP URL.
Throws:
InvalidLocatorException - if the parameters to construct the locator don't specify a valid OCAP URL (e.g. a value is out of range).
Method Detail

getSourceID

public int getSourceID()
This method returns a source_id value of the OCAP URL represented by this OcapLocator instance.

Returns:
a source_id value of the OCAP URL represented by this OcapLocator instance. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it, -1 returns.

getServiceName

public java.lang.String getServiceName()
This method returns a service_name value of the OCAP URL represented by this OcapLocator instance.

Returns:
a service_name value of the OCAP URL represented by this OcapLocator instance. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it, null returns.

getFrequency

public int getFrequency()
This method returns a frequency value, in hertz, of the OCAP URL represented by this OcapLocator instance.

Returns:
a frequency value, in hertz, of the OCAP URL represented by this OcapLocator instance. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it or the locator is OOB, -1 is returned. If the getProgramNumber method returns a value other than -1, the locator is OOB.

getModulationFormat

public int getModulationFormat()
This method returns a value representing a modulation_format as specified in SCTE 65. A modulation_format value of 0xFF indicates an NTSC analog video format.

Returns:
a value representing the modulation format. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it or -1 was passed in as the modulation format, -1 is returned. When the locator contains a frequency term and this method returns a -1, a default modulation format value of QAM256 is implied.

getProgramNumber

public int getProgramNumber()
This method returns a program_number value of the OCAP URL represented by this OcapLocator instance.

Returns:
a program_number value of the OCAP URL represented by this OcapLocator instance. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it, -1 returns.

getStreamTypes

public short[] getStreamTypes()
This method returns a stream_type value of the OCAP URL represented by this OcapLocator instance.

Returns:
a stream_type value of the OCAP URL represented by this OcapLocator instance. The order of stream_types is same as specified in the constructor. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it, a zero length array returns.

getLanguageCodes

public java.lang.String[] getLanguageCodes()
This method returns an ISO_639_language_code value of the OCAP URL represented by this OcapLocator instance.

Returns:
an ISO_639_language_code value of the OCAP URL represented by this OcapLocator instance. The order of ISO_639_language_code is same as specified in the constructor. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include any language codes, a zero length array returns. If the OCAP URL that is specified to construct an OcapLocator instance includes any language codes, an array is returned that is the same length as that returned by getStreamTypes(). Some of the elements in this array may be null, if no language was specified for the corresponding stream_type.

getIndexes

public int[] getIndexes()
This method returns an index value of the OCAP URL represented by this OcapLocator instance.

Returns:
an index value of the OCAP URL represented by this OcapLocator instance. The order of index is same as specified in the constructor. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include any indexes, a zero length array returns. If the OCAP URL that is specified to construct an OcapLocator instance includes any indexes, an array is returned that is the same length as that returned by getStreamTypes(). Some of the elements in this array may be -1, if no index was specified for the corresponding stream_type.

getEventId

public int getEventId()
This method returns an event_id value of the OCAP URL represented by this OcapLocator instance.

Returns:
an event_id value of the OCAP URL represented by this OcapLocator instance. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it, -1 returns.

getPIDs

public int[] getPIDs()
This method returns a PID value of the OCAP URL represented by this OcapLocator instance.

Returns:
a PID value of the OCAP URL represented by this OcapLocator instance. The order of PID is same as specified in the constructor. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it, a zero length array returns.

getComponentNames

public java.lang.String[] getComponentNames()
This method returns a component_name value of the OCAP URL represented by this OcapLocator instance.

Returns:
a component_name value of the OCAP URL represented by this OcapLocator instance. The order of component_name is same as specified in the constructor. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it, a zero length array returns.

getComponentTags

public int[] getComponentTags()
This method returns a component_tag value of the OCAP URL represented by this OcapLocator instance.

Returns:
a component_tag value of the OCAP URL represented by this OcapLocator instance. The order of component_tags is same as specified in the constructor. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it, a zero length array returns.

getPathSegments

public java.lang.String getPathSegments()
This method returns a path_segments string of the OCAP URL represented by this OcapLocator instance.

Returns:
a path_segments string of the OCAP URL represented by this OcapLocator instance. If the OCAP URL that is specified to construct an OcapLocator instance doesn't include it, null returns.






© 2015 - 2024 Weber Informatics LLC | Privacy Policy