org.davic.net.ca
Class CAModuleManager

java.lang.Object
  extended byorg.davic.net.ca.CAModuleManager
All Implemented Interfaces:
ResourceServer

public class CAModuleManager
extends java.lang.Object
implements ResourceServer

The CA module manager is an object that manages available CA modules.

There is only one instance of the CAModuleManager in a receiver and it can be retrieved using the getInstance method.


Method Summary
 void addCAListener(CAListener l)
          Registers a new CA event listener to CAModuleManager.
 void addMMIListener(MMIListener listener)
          Registers a listener for the MMI related events.
 void addResourceStatusEventListener(ResourceStatusListener l)
          Registers a listener for the resource status messages.
static CAModuleManager getInstance()
          Returns the instance of the CAModuleManager class.
 CAModule[] getModules()
          Returns all available CA modules.
 CAModule[] getModules(Service s)
          Returns all available modules whose CASystemID matches with the CASystemID of a CA system used to scramble this service.
 int numberOfModules()
          Returns the number of connected CA modules.
 void removeCAListener(CAListener l)
          Removes a registered listener from CAModuleManager.
 void removeMMIListener(MMIListener listener)
          Removes a registered listener for the MMI related events.
 void removeResourceStatusEventListener(ResourceStatusListener l)
          Removes a registered listener for the resource status messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CAModuleManager getInstance()
Returns the instance of the CAModuleManager class.

Returns:
the CA module manager object instance

numberOfModules

public int numberOfModules()
Returns the number of connected CA modules.

Returns:
number of connected CA modules

getModules

public CAModule[] getModules()
Returns all available CA modules.

If there are no available modules, returns an array whose length is 0.

Returns:
an array containing all available CA modules

getModules

public CAModule[] getModules(Service s)
Returns all available modules whose CASystemID matches with the CASystemID of a CA system used to scramble this service.

If there are no applicable modules, returns an array whose length is 0. If the service passed as a parameter is not scrambled, returns an empty array whose length is 0.

Parameters:
s - a service that is scrambled
Returns:
an array of CA modules

addCAListener

public void addCAListener(CAListener l)
Registers a new CA event listener to CAModuleManager.

Parameters:
l - the listener to be registered

removeCAListener

public void removeCAListener(CAListener l)
Removes a registered listener from CAModuleManager.

Parameters:
l - the listener to be removed

addMMIListener

public void addMMIListener(MMIListener listener)
                    throws CAException
Registers a listener for the MMI related events. There can be only one MMI listener registered at a time. If an application has registered (and not removed) a listener to handle the MMI dialogues and if an MMI dialogue is required, this causes the platform to ask the MMI listener to handle the MMI dialogues.If there is no application registered to handle the MMI dialogues, these will be handled by the platform.

Parameters:
listener - the listener to be registered
Throws:
MMIListenerAlreadyRegisteredException - raised if there is already a listener registered
java.lang.SecurityException - raised if the application does not have an instance of CAPermission with the "MMI" name.
CAException

removeMMIListener

public void removeMMIListener(MMIListener listener)
Removes a registered listener for the MMI related events.

Parameters:
listener - the listener to be removed

addResourceStatusEventListener

public void addResourceStatusEventListener(ResourceStatusListener l)
Registers a listener for the resource status messages.

Specified by:
addResourceStatusEventListener in interface ResourceServer
Parameters:
l - the listener to be registered

removeResourceStatusEventListener

public void removeResourceStatusEventListener(ResourceStatusListener l)
Removes a registered listener for the resource status messages.

Specified by:
removeResourceStatusEventListener in interface ResourceServer
Parameters:
l - the listener to be removed