org.davic.net.ca
Class DescramblerProxy

java.lang.Object
  extended byorg.davic.net.ca.DescramblerProxy
All Implemented Interfaces:
ResourceProxy

public class DescramblerProxy
extends java.lang.Object
implements ResourceProxy

The class DescramblerProxy is a proxy for the descrambling resources.

An application instantiates an object of this class to descramble a service or elementary streams of a single service. If an application wants to descramble multiple services simultaneously, it should instantiate multiple objects.


Constructor Summary
DescramblerProxy(ResourceClient c)
          Constructor of a resource proxy for a specific resource client.
 
Method Summary
 void addDescramblerListener(DescramblerListener l)
          Registers a new descrambler event listener.
 CAModule getCAModule()
          Returns the CA module that is associated with the current descrambling via this proxy.
 ResourceClient getClient()
          Returns the resource client associated with this resource proxy.
 ElementaryStream[] getElementaryStreams()
          This method returns the elementary streams being descrambled via this proxy at the moment.
 void removeDescramblerListener(DescramblerListener l)
          Removes a registered descrambler event listener.
 void startDescrambling(ElementaryStream[] streams, CAModule module, java.lang.Object requestData)
          Stops all existing descrambling initiated by this DescramblerProxy instance and starts the descrambling of the specified elementary streams (that shall be part of the same service).
 CAModule startDescrambling(ElementaryStream[] streams, java.lang.Object requestData)
          Stops all existing descrambling initiated by this DescramblerProxy instance and starts the descrambling of the specified elementary streams (that shall be part of the same service).
 void startDescrambling(Service s, CAModule module, java.lang.Object requestData)
          Stops all existing descrambling initiated by this DescramblerProxy instance and starts the descrambling of the specified service.
 CAModule startDescrambling(Service s, java.lang.Object requestData)
          Stops all existing descrambling initiated by this DescramblerProxy instance and starts the descrambling of the specified service.
 void startDescramblingDialog(ElementaryStream[] streams)
          Requests the CA system to perform any user dialogs needed before starting to descramble the service.
 void startDescramblingDialog(Service s)
          Requests the CA system to perform any user dialogs needed before starting to descramble the service.
 void stopDescrambling()
          Stops descrambling of the service.
 void stopDescrambling(ElementaryStream[] streams)
          Stops descrambling of the specified elementary streams of the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DescramblerProxy

public DescramblerProxy(ResourceClient c)
Constructor of a resource proxy for a specific resource client.

Parameters:
c - the resource client object representing the application as a client for the resource management
Method Detail

startDescramblingDialog

public void startDescramblingDialog(Service s)
                             throws CAException,
                                    NotAuthorizedException
Requests the CA system to perform any user dialogs needed before starting to descramble the service.

This version can be used for descrambling the whole service. In case of CA0 this maps onto ca_pmt with ca_pmt_cmd_id = ok_mmi (Common Interface specification, section 8.4.3.4). In systems based on the DVB common interface,the NotAuthorizedException shall never be thrown. After succesful execution, descrambling can be started with the startDescrambling method.

Parameters:
s - service to be descrambled after the dialogue
Throws:
NoFreeCapacityException - raised if the CAModule does not have available capacity to perform this action now
ModuleUnavailableException - raised if the physical CA module has been removed and is not available any more
NotTunedException - raised if performing the action would require being tuned to the transport stream carrying the service and the receiver is not currently tuned to it
NotAuthorizedException - raised if the user is not authorized to perform this action
CAException

startDescramblingDialog

public void startDescramblingDialog(ElementaryStream[] streams)
                             throws CAException,
                                    NotAuthorizedException
Requests the CA system to perform any user dialogs needed before starting to descramble the service.

This version can be used for descrambling only specified subset of elementary streams of a service. The elementary streams given in the parameter array must belong to the same service. If the parameter array is a zero length array then this method shall have no effect. In case of CA0 this maps onto ca_pmt with ca_pmt_cmd_id = ok_mmi (Common Interface specification, section 8.4.3.4). In systems based on the DVB common interface,the NotAuthorizedException shall never be thrown. After succesful execution, descrambling can be started with the startDescrambling method.

Parameters:
streams - subset of elementary streams of a service to be descrambled after the dialogue
Throws:
NoFreeCapacityException - raised if the CAModule does not have available capacity to perform this action now
ModuleUnavailableException - raised if the physical CA module has been removed and is not available any more
NotTunedException - raised if performing the action would require being tuned to the transport stream carrying the service and the receiver is not currently tuned to it
NotAuthorizedException - raised if the user is not authorized to perform this action
CAException

startDescrambling

public CAModule startDescrambling(Service s,
                                  java.lang.Object requestData)
                           throws CAException,
                                  NotAuthorizedException
Stops all existing descrambling initiated by this DescramblerProxy instance and starts the descrambling of the specified service.

The module used for descrambling is returned. If descrambling is not possible, an exception is thrown. This method may result in the CA system requesting an MMI dialog. In systems based on the DVB common interface this maps onto ca_pmt with ca_pmt_cmd_id = ok_descrambling (Common Interface specification,section 8.4.3.4) and the NotAuthorizedException shall never be thrown.

Parameters:
s - service to be descrambled
requestData - Used by the ResourceNotification API in the requestRelease method of the ResourceClient interface. Usage of this parameter is optional and a null reference may be supplied. DescramblerProxy applies from the point of view of one application. Methods such as startDescrambling and stopDescrambling apply on a per-application basis and do not impact descrambling on behalf of other applications, except subject to platform resource limitations.
Returns:
CA module used for descrambling
Throws:
NoFreeCapacityException - raised if the CAModule does not have available capacity to perform this action now
ModuleUnavailableException - raised if the physical CA module has been removed and is not available any more
NotTunedException - raised if performing the action would require being tuned to the transport stream carrying the service and the receiver is not currently tuned to it
NotAuthorizedException - raised if the user is not authorized to perform this action
CAException

startDescrambling

public CAModule startDescrambling(ElementaryStream[] streams,
                                  java.lang.Object requestData)
                           throws CAException,
                                  NotAuthorizedException
Stops all existing descrambling initiated by this DescramblerProxy instance and starts the descrambling of the specified elementary streams (that shall be part of the same service).

The module used for descrambling is returned. If descrambling is not possible, an exception is thrown. If the streams parameter is a zero length array then the method shall have no effect. This method may result in the CA system requesting an MMI dialog. In systems based on the DVB common interface this maps onto ca_pmt with ca_pmt_cmd_id = ok_descrambling (Common Interface specification,section 8.4.3.4) and the NotAuthorizedException shall never be thrown.

Parameters:
streams - subset of elementary streams of a service to be descrambled after the dialogue
requestData - Used by the ResourceNotification API in the requestRelease method of the ResourceClient interface. Usage of this parameter is optional and a null reference may be supplied.
Returns:
CA module used for descrambling
Throws:
NoFreeCapacityException - raised if the CAModule does not have available capacity to perform this action now
ModuleUnavailableException - raised if the physical CA module has been removed and is not available any more
NotTunedException - raised if performing the action would require being tuned to the transport stream carrying the service and the receiver is not currently tuned to it
NotAuthorizedException - raised if the user is not authorized to perform this action
CAException

startDescrambling

public void startDescrambling(Service s,
                              CAModule module,
                              java.lang.Object requestData)
                       throws CAException,
                              NotAuthorizedException
Stops all existing descrambling initiated by this DescramblerProxy instance and starts the descrambling of the specified service.

The module to be used for descrambling is indicated as a parameter. If descrambling is not possible, an exception is thrown. If the streams parameter is a zero length array then the method shall have no effect. This method may result in the CA system requesting an MMI dialog. In systems based on the DVB common interface this maps onto ca_pmt with ca_pmt_cmd_id = ok_descrambling (Common Interface specification,section 8.4.3.4) and the NotAuthorizedException shall never be thrown.

Parameters:
s - service to be descrambled
module - CA module to be used for descrambling
requestData - Used by the ResourceNotification API in the requestRelease method of the ResourceClient interface. Usage of this parameter is optional and a null reference may be supplied.
Throws:
NoFreeCapacityException - raised if the CAModule does not have available capacity to perform this action now
ModuleUnavailableException - raised if the physical CA module has been removed and is not available any more
NotTunedException - raised if performing the action would require being tuned to the transport stream carrying the service and the receiver is not currently tuned to it
NotAuthorizedException - raised if the user is not authorized to perform this action
CAException

startDescrambling

public void startDescrambling(ElementaryStream[] streams,
                              CAModule module,
                              java.lang.Object requestData)
                       throws CAException,
                              NotAuthorizedException
Stops all existing descrambling initiated by this DescramblerProxy instance and starts the descrambling of the specified elementary streams (that shall be part of the same service). The module to be used for descrambling is indicated as a parameter. If descrambling is not possible, an exception is thrown. This method may result in the CA system requesting an MMI dialog. In systems based on the DVB common interface this maps onto ca_pmt with ca_pmt_cmd_id = ok_descrambling (Common Interface specification,section 8.4.3.4) and the NotAuthorizedException shall never be thrown.

Parameters:
streams - subset of elementary streams of a service to be descrambled after the dialogue
module - CA module to be used for descrambling
requestData - Used by the ResourceNotification API in the requestRelease method of the ResourceClient interface. Usage of this parameter is optional and a null reference may be supplied.
Throws:
NoFreeCapacityException - raised if the CAModule does not have available capacity to perform this action now
ModuleUnavailableException - raised if the physical CA module has been removed and is not available any more
NotTunedException - raised if performing the action would require being tuned to the transport stream carrying the service and the receiver is not currently tuned to it
NotAuthorizedException - raised if the user is not authorized to perform this action
CAException

stopDescrambling

public void stopDescrambling()
                      throws CAException
Stops descrambling of the service. If no descrambling is being done then this method has no effect.

Throws:
ModuleUnavailableException - raised if the physical CA module has been removed and is not available any more
CAException

stopDescrambling

public void stopDescrambling(ElementaryStream[] streams)
                      throws CAException
Stops descrambling of the specified elementary streams of the service. This method stops the descrambling of streams which have been started through this DescramblerProxy instance, and not any started through any other instance. This method only effects members of the array of streams that are being descrambled. There is no effect on any streams listed in the array that are not being descrambled.

Parameters:
streams - the array of ElementaryStreams whose descrambling is to be stopped.
Throws:
ModuleUnavailableException - raised if the physical CA module has been removed and is not available any more
CAException

addDescramblerListener

public void addDescramblerListener(DescramblerListener l)
Registers a new descrambler event listener.

Parameters:
l - the listener to be registered

removeDescramblerListener

public void removeDescramblerListener(DescramblerListener l)
Removes a registered descrambler event listener.

Parameters:
l - the listener to be removed

getCAModule

public CAModule getCAModule()
Returns the CA module that is associated with the current descrambling via this proxy.

If there is no descrambling being active via this proxy at the moment, this method returns null.

Returns:
CAModule object representing the CA module that is associated with the current descrambling activity.

getClient

public ResourceClient getClient()
Returns the resource client associated with this resource proxy. This method implements ResourceProxy.getClient method.

Specified by:
getClient in interface ResourceProxy
Returns:
resource client

getElementaryStreams

public ElementaryStream[] getElementaryStreams()
This method returns the elementary streams being descrambled via this proxy at the moment. If there is no descrambling, the method returns an empty array.

Returns:
array of elementary stream being descrambled