org.davic.mpeg
Class NotAuthorizedException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.davic.mpeg.NotAuthorizedException
All Implemented Interfaces:
NotAuthorizedInterface, java.io.Serializable

public class NotAuthorizedException
extends java.lang.Exception
implements NotAuthorizedInterface

This class is thrown by MPEG related APIs when access is requested to information which is scrambled and to which access is not permitted by the security system.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.davic.mpeg.NotAuthorizedInterface
COMMERCIAL_DIALOG, ELEMENTARY_STREAM, FREE_PREVIEW_DIALOG, GEOGRAPHICAL_BLACKOUT, MATURITY_RATING, MATURITY_RATING_DIALOG, NO_ENTITLEMENT, NOT_POSSIBLE, OTHER, POSSIBLE_UNDER_CONDITIONS, SERVICE, TECHNICAL, TECHNICAL_DIALOG
 
Constructor Summary
NotAuthorizedException()
          Constructs a NotAuthorizedException with no detail message
NotAuthorizedException(java.lang.String s)
          Constructs a NotAuthorizedException with the specified detail message
 
Method Summary
 ElementaryStream[] getElementaryStreams()
          If getType() returns ELEMENTARY_STREAM, then this method returns the set of ElementaryStreams that could not be descrambled.
 int[] getReason(int index)
          Returns the reason(s) why descrambling was not possible.
 Service getService()
          If getType() returns SERVICE, then this method returns the Service that could not be descrambled.
 int getType()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotAuthorizedException

public NotAuthorizedException()
Constructs a NotAuthorizedException with no detail message


NotAuthorizedException

public NotAuthorizedException(java.lang.String s)
Constructs a NotAuthorizedException with the specified detail message

Parameters:
s - the detail message
Method Detail

getType

public int getType()
Specified by:
getType in interface NotAuthorizedInterface
Returns:
SERVICE or ELEMENTARY_STREAM to indicate that either a service (MPEG program) or one or more elementary streams could not be descrambled.

getService

public Service getService()
If getType() returns SERVICE, then this method returns the Service that could not be descrambled. Otherwise it returns null.

Specified by:
getService in interface NotAuthorizedInterface
Returns:
either the Service that could not be descrambled or null

getElementaryStreams

public ElementaryStream[] getElementaryStreams()
If getType() returns ELEMENTARY_STREAM, then this method returns the set of ElementaryStreams that could not be descrambled. Otherwise it returns null.

Specified by:
getElementaryStreams in interface NotAuthorizedInterface
Returns:
either the set of ElementaryStreams that could not be descrambled or null

getReason

public int[] getReason(int index)
                throws java.lang.IndexOutOfBoundsException
Returns the reason(s) why descrambling was not possible.

Specified by:
getReason in interface NotAuthorizedInterface
Parameters:
index - If the component to which access failed is a Service, index shall be 0. Otherwise index shall refer to one stream in the set returnedby getElementaryStreams().
Returns:
an array of length 2 where the first element of the array is the major reason and the second element of the array is the minor reason.
Throws:
java.lang.IndexOutOfBoundsException - If the component to which access failed is a Service, this exception will be thrown if index is non zero. If the component(s) to which access failed was a (set of) elementary streams then this exception will be thrown where index is beyond the size of the array returned by getElementaryStreams.
See Also:
NotAuthorizedInterface.getElementaryStreams()