it.dtt.ca
Class Slot

java.lang.Object
  extended by it.dtt.ca.CAObject
      extended by it.dtt.ca.Slot

public abstract class Slot
extends CAObject

This class represents the physical slot in which a smart card can be inserted. Access to the slot via the class methods is allowed as long as the current session remains open, i.e. until the application calls it.dtt.ca.CAManagerFactory.closeSession() to close the current session; subsequently, the class methods will throw the it.dtt.ca.exception.SessionClosedException exception. This behaviour is implemented by CAObject from which Slot derives.


Constructor Summary
protected Slot(CAManager manager, int id)
          Create a slot instance.
 
Method Summary
 void addSlotListener(SlotListener listener)
          A SlotListener is notified if the card is inserted or removed from the slot.
 int getSlotId()
          Returns the number identifying this slot.
abstract  SmartCard getSmartCard()
          Get the Smart Card object associated with this card reader.
abstract  int getStatus()
          Tells if a smart card is inserted in the slot.
 void removeSlotListener(SlotListener listener)
          Remove a previously added SlotListener.
 
Methods inherited from class it.dtt.ca.CAObject
checkSession, closeSession, getParent, getSession, sessionClosed, sessionClosing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Slot

protected Slot(CAManager manager,
               int id)
Create a slot instance.

Parameters:
manager - the CA Manager controlling this slot.
id - the id of this slot.
Method Detail

getSlotId

public int getSlotId()
              throws SessionClosedException
Returns the number identifying this slot. The first slot is numbered zero; this is normally the only slot present in the STB.

Returns:
number identifying the slot.
Throws:
SessionClosedException - if the session is closed.

addSlotListener

public void addSlotListener(SlotListener listener)
                     throws SessionClosedException
A SlotListener is notified if the card is inserted or removed from the slot.

Parameters:
listener - object listening to slot changes.
Throws:
SessionClosedException - if the session is closed.

removeSlotListener

public void removeSlotListener(SlotListener listener)
                        throws SessionClosedException
Remove a previously added SlotListener.

Parameters:
listener - object to be removed.
Throws:
SessionClosedException - if the session is closed.

getStatus

public abstract int getStatus()
                       throws SessionClosedException
Tells if a smart card is inserted in the slot. The return value is one of the values defined in it.dtt.ca.event.SlotEvent. See SlotEvent for a description of the semantics of each value.

Returns:
a SlotEvent costant value
Throws:
SessionClosedException - if the session is closed.
See Also:
SlotEvent

getSmartCard

public abstract SmartCard getSmartCard()
                                throws CardNotFoundException,
                                       AccessDeniedException,
                                       SessionClosedException
Get the Smart Card object associated with this card reader.

Returns:
smart card related object
Throws:
CardNotFoundException - if a card is not inserted in the slot
AccessDeniedException - if the wrong card is inserted in the slot (i.e. a card which do not correspond to the CA kernel in use)
SessionClosedException - if the session is closed.
See Also:
SmartCard, CardNotFoundException, AccessDeniedException, SessionClosedException