|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ToolkitRegistry
The ToolkitRegistry interface offers basic services and methods to allow
any Toolkit Applet to register its configuration (supported events) during
the install phase and possibly to change it during all the applet life time.
Each Toolkit Applet will get a reference to its registry entry with the static
method getEntry from the ToolkitRegistrySystem class
The initial state of all the events is cleared. The registry entry object implementing
the ToolkitRegistry interface is a permanent JCRE entry point object
All updates performed on the ToolkitRegistry are atomic. The ToolkitRegistry
update operations are subject to atomic commit capacity limitations. If the commit
capacity is exceeded, no update is performed and a TransactionException exception is thrown.
Note: the constants related to the events are defined in the ToolkitConstants
interface.
ToolkitInterface,
ToolkitRegistrySystem| Method Summary | |
|---|---|
byte |
allocateServiceIdentifier()
Allocate a Service identifier that the applet can manage. |
byte |
allocateTimer()
Asks the CAT Runtime Environment to allocate a Timer that the applet can manage. |
void |
changeMenuEntry(byte id,
byte[] menuEntry,
short offset,
short length,
byte nextAction,
boolean helpSupported,
byte iconQualifier,
short iconIdentifier)
Changes the value of a menu entry. |
void |
clearEvent(short event)
Clears an event in the Toolkit Registry entry of the applet. |
void |
deregisterFileEvent(short fileEvent,
byte[] baFileList,
short sOffset1,
short sLength1,
byte[] baADFAid,
short sOffset2,
byte bLength2)
Deregister a ToolkitRegistry object from the EVENT_EXTERNAL_FILE_UPDATE for a file list. |
void |
deregisterFileEvent(short fileEvent,
FileView aFileView)
Deregister a ToolkitRegistry object from the EVENT_EXTERNAL_FILE_UPDATE for a file. |
void |
disableMenuEntry(byte id)
Disables a menu entry. |
void |
enableMenuEntry(byte id)
Enables a menu entry. |
short |
getPollInterval()
Returns the number of seconds of the adjusted duration for the calling Toolkit Applet. |
byte |
initMenuEntry(byte[] menuEntry,
short offset,
short length,
byte nextAction,
boolean helpSupported,
byte iconQualifier,
short iconIdentifier)
Initialises the next menu entry allocated at loading. |
boolean |
isEventSet(short event)
Allows to know if an event is set in the Toolkit Registry entry of the applet. |
void |
registerFileEvent(short fileEvent,
byte[] baFileList,
short sOffset1,
short sLength1,
byte[] baADFAid,
short sOffset2,
byte bLength2)
Register a ToolkitRegistry object to the EVENT_EXTERNAL_FILE_UPDATE for a file list. |
void |
registerFileEvent(short fileEvent,
FileView aFileView)
Register a ToolkitRegistry object to the EVENT_EXTERNAL_FILE_UPDATE for a file. |
void |
releaseServiceIdentifier(byte serviceIdentifier)
Release a Service Identifier that has been allocated to the calling applet. |
void |
releaseTimer(byte timerIdentifier)
Release a Timer that has been allocated to the calling applet. |
void |
requestPollInterval(short duration)
Requests a duration for the EVENT_STATUS_COMMAND event of the registering Toolkit Applet. |
void |
setEvent(short event)
Sets an event in the Toolkit Registry entry of the applet. |
void |
setEventList(short[] eventList,
short offset,
short length)
Sets an event list in the Toolkit Registry entry of the applet. |
void |
setMenuEntryTextAttribute(byte id,
byte[] textAttribute,
short offset,
short length)
Sets the text attribute of a menu entry. |
| Method Detail |
|---|
void setEvent(short event)
throws ToolkitException,
javacard.framework.TransactionException
event - value of the new event to register (between -32768 and 32767)
ToolkitException - with the following reason codes: javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
void setEventList(short[] eventList,
short offset,
short length)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException,
javacard.framework.TransactionException
eventList - buffer containing the list of the new events to registeroffset - offset in the eventlist buffer for event registrationlength - length in the eventlist buffer for event registration
java.lang.NullPointerException - if eventlist is null
java.lang.ArrayIndexOutOfBoundsException - if offset or length or both would cause access outside array bounds
ToolkitException - with the following reason codes: eventList contains EVENT_MENU_SELECTION,
EVENT_MENU_SELECTION_HELP_REQUEST,
EVENT_TIMER_EXPIRATION, EVENT_STATUS_COMMAND,
EVENT_EVENT_ DOWNLOAD_LOCAL_CONNECTION,EVENT_EXTERNAL_FILE_UPDATE,EVENT_REMOTE_FILE_UPDATEjavacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
void clearEvent(short event)
throws ToolkitException,
javacard.framework.TransactionException
event - the value of the event to unregister (between -32768 and 32767)
ToolkitException - with the following reason codes: javacard.framework.TransactionException - Description of the Exceptionboolean isEventSet(short event)
event - the value of the event (between -32768 and 32767)
void disableMenuEntry(byte id)
throws ToolkitException,
javacard.framework.TransactionException
id - the menu entry identifier supplied by the initMenuEntry() method
ToolkitException - with the following reason codes: javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
void enableMenuEntry(byte id)
throws ToolkitException,
javacard.framework.TransactionException
id - the menu entry identifier supplied by the initMenuEntry() method
ToolkitException - with the following reason codes: javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
byte initMenuEntry(byte[] menuEntry,
short offset,
short length,
byte nextAction,
boolean helpSupported,
byte iconQualifier,
short iconIdentifier)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException,
javacard.framework.TransactionException
helpSupported boolean parameter
defines the registration status of the applet to the event
EVENT_MENU_SELECTION_HELP_REQUEST. The applet is registered to
the EVENT_MENU_SELECTION. The icon identifier provided will be added to
the icon identifier list of the item icon identifier list Comprehension TLV if
all the applets registered to the EVENT_MENU_SELECTION provide it.
The Icon list qualifier transmitted to the Terminal will be 'icon is not self
explanatory' if one of the applet registered prefers this qualifier.
This method shall be called by the applet in the same order than the
order of the item parameters defined at the applet loading if the applet
has several menu entries. The applet shall initialise all its loaded
menu entries during its installation.
menuEntry - a reference on a byte array, containing the menu entry stringoffset - offset of the menu entry string in the bufferlength - length of the menu entry stringnextAction - a byte coding the next action indicator for the menu entry (or 0)helpSupported - equals true if help is available for the menu entryiconQualifier - the preferred value for the icon list qualifiericonIdentifier - the icon identifier for the menu entry (0 means no icon)
java.lang.NullPointerException - if menuEntry is null
java.lang.ArrayIndexOutOfBoundsException - if offset or length or both would cause access outside array bounds
ToolkitException - with the following reason codes: javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
void changeMenuEntry(byte id,
byte[] menuEntry,
short offset,
short length,
byte nextAction,
boolean helpSupported,
byte iconQualifier,
short iconIdentifier)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException,
javacard.framework.TransactionException
helpSupported boolean
parameter defines the registration status of the EVENT_MENU_SELECTION_HELP_REQUEST
event. The icon identifier provided will be added to the icon identifier list
of the item icon identifier list Comprehension TLV if all the applets registered
to the EVENT_MENU_SELECTION provide it.
The Icon list qualifier transmitted to the Terminal will be 'icon is not self
explanatory' if one of the applet registered prefers this qualifier.
After the invocation of this method, during the current card session, the CAT Runtime Environment
shall dynamically update the menu stored in the Terminal.
id - the menu entry identifier supplied by the initMenuEntry() methodmenuEntry - a reference on a byte array, containing the menu entry stringoffset - the position of the menu entry string in the bufferlength - the length of the menu entry stringnextAction - a byte coding the next action indicator for the menu entry (or 0)helpSupported - equals true if help is available for the menu entryiconQualifier - the preferred value for the icon list qualifiericonIdentifier - the icon identifier for the menu entry (0 means no icon)
java.lang.NullPointerException - if menuEntry is null
java.lang.ArrayIndexOutOfBoundsException - if offset or length or both would cause access outside array bounds
ToolkitException - with the following reason codes: javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
byte allocateTimer()
throws ToolkitException,
javacard.framework.TransactionException
ToolkitException - with the following reason codes: javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
void releaseTimer(byte timerIdentifier)
throws ToolkitException,
javacard.framework.TransactionException
timerIdentifier - the identifier of the Timer to be released
ToolkitException - with the following reason codes: timerIdentifierd is not allocated to this applet.javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
void requestPollInterval(short duration)
throws ToolkitException,
javacard.framework.TransactionException
duration - specifies the number of seconds requested for proactive polling.
The maximum value of duration is 15300 (255 minutes).
If duration is equal to POLL_NO_DURATION,
the calling applet deregisters from EVENT_STATUS_COMMAND, and
the CAT Runtime Environment may issue the POLLING OFF proactive command.
If duration is equal to POLL_SYSTEM_DURATION,
the calling applet registers to the EVENT_STATUS_COMMAND and let
the CAT Runtime Environment define the duration.
- Throws:
ToolkitException - with the following reason codes:
- REGISTRY_ERROR if
duration is greater than the maximum value.
javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceededshort getPollInterval()
POLL_NO_DURATION, the Toolkit
Applet is not registered to EVENT_STATUS_COMMAND event.
The returned duration may :
- be a multiple of the real adjusted poll interval time at the Terminal.
- differ from the requested duration due to request of other toolkit
applets or due to restrictions of the current Terminal.
- be changed during the card session due requests from other Toolkit Applets.
- be wrong due to direct generation of the proactive command POLL INTERVAL or POLLING OFF.
- not correspond to the elapsed time due to additional STATUS commands send by the Terminal.
- Returns:
- the number of seconds of the adjusted duration for the applet
byte allocateServiceIdentifier()
throws ToolkitException,
javacard.framework.TransactionException
ToolkitException - with the following reason codes: javacard.framework.TransactionException
void releaseServiceIdentifier(byte serviceIdentifier)
throws ToolkitException,
javacard.framework.TransactionException
serviceIdentifier - the identifier of the Service to be released
ToolkitException - with the following reason codes: serviceIdentifier is not allocated to this Applet.javacard.framework.TransactionException
void registerFileEvent(short fileEvent,
byte[] baFileList,
short sOffset1,
short sLength1,
byte[] baADFAid,
short sOffset2,
byte bLength2)
throws ToolkitException,
java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
javacard.framework.TransactionException,
javacard.framework.SystemException
EVENT_EXTERNAL_FILE_UPDATE for a file list.
fileEvent - Indicates the File event to be registeredbaFileList - array containing the file list. The baFileList shall be coded as the value part of the COMPREHENSION-TLV File List defined in TS 102 223
If the path provided indicates a dedicated file (DF), the Applet shall be triggered when an elementary file that is an immediate child of the DF is updated.sOffset1 - offset in the baFileList buffer for event registrationsLength1 - length in the baFileList buffer for event registrationbaADFAid - array containing the AID of the ADF. The baADFAid shall be coded as the value part of the COMPREHENSION-TLV AID defined in TS 102 223. If baADFAid is nullnull, it indicates that the file is located under the MF and not located under an ADF .sOffset2 - offset in the baADFAid buffer for event registrationbLength2 - length in the baADFAid buffer for event registration
java.lang.NullPointerException - if baFileList is null
java.lang.ArrayIndexOutOfBoundsException - if sOffset or sLength or both would cause access outside array bounds
javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
javacard.framework.SystemException - with the following reason code:SystemException.ILLEGAL_VALUE if bLength2 is not in the range of 5 – 16 bytes. ToolkitException - with the following reason code:EVENT_NOT_ALLOWED if the event is one of the following events: EVENT_MENU_SELECTION, EVENT_MENU_SELECTION_HELP_REQUEST, EVENT_TIMER_EXPIRATION, EVENT_STATUS_COMMAND
EVENT_NOT_SUPPORTED if the event is not one of the following event: EVENT_EXTERNAL_FILE_UPDATE, EVENT_REMOTE_FILE_UPDATE.UICCException - in case of error COMMAND_NOT_ALLOWED if the referenced file is terminated
void deregisterFileEvent(short fileEvent,
byte[] baFileList,
short sOffset1,
short sLength1,
byte[] baADFAid,
short sOffset2,
byte bLength2)
throws ToolkitException,
java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
javacard.framework.TransactionException,
javacard.framework.SystemException
EVENT_EXTERNAL_FILE_UPDATE for a file list.
fileEvent - Indicates the File event to be deregisteredbaFileList - array containing the file list. The baFileList shall be coded as the value part of the COMPREHENSION-TLV File List defined in TS 102 223
If a file in baFileList is a dedicated file the deregistration shall not affect the monitoring of an elementary file within the dedicated file that was individually registered.
If a file in baFileList is an elementary file the deregistration will not affect the monitoring of the parent dedicated file that was individually registered.sOffset1 - offset in the baFileList buffer for event registrationsLength1 - length in the baFileList buffer for event registrationbaADFAid - array containing the AID of the ADF. The baADFAid shall be coded as the value part of the COMPREHENSION-TLV AID defined in TS 102 223. If baADFAid is null, it indicates that the file is located under the MF and not located under an ADF .sOffset2 - offset in the baADFAid buffer for event registrationbLength2 - length in the baADFAid buffer for event registration
java.lang.NullPointerException - if baFileList is null
java.lang.ArrayIndexOutOfBoundsException - if sOffset or sLength or both would cause access outside array bounds
javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
javacard.framework.SystemException - with the following reason codes:SystemException.ILLEGAL_VALUE if bLength2 is not in the range of 5 – 16 bytes. ToolkitException - with the following reason code:EVENT_NOT_ALLOWED if the event is one of the following events: EVENT_MENU_SELECTION, EVENT_MENU_SELECTION_HELP_REQUEST, EVENT_TIMER_EXPIRATION, EVENT_STATUS_COMMAND
EVENT_NOT_SUPPORTED if the event is not one of the following event: EVENT_EXTERNAL_FILE_UPDATE, EVENT_REMOTE_FILE_UPDATE.UICCException - in case of error COMMAND_NOT_ALLOWED if the referenced file is terminated
void registerFileEvent(short fileEvent,
FileView aFileView)
throws ToolkitException,
java.lang.NullPointerException,
javacard.framework.TransactionException
EVENT_EXTERNAL_FILE_UPDATE for a file.
fileEvent - Indicates the File event to be registeredaFileView - The FileView object's current file indicates the file to be monitored. If the current file is a dedicated file, the Applet shall be triggered when an elementary file that is an immediate child of the DF is updated. A later change in the FileView shall not modify the registration.
java.lang.NullPointerException - if aFileView is null
javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
ToolkitException - with the following reason code:EVENT_NOT_ALLOWED if the event is one of the following events: EVENT_MENU_SELECTION, EVENT_MENU_SELECTION_HELP_REQUEST, EVENT_TIMER_EXPIRATION, EVENT_STATUS_COMMAND
EVENT_NOT_SUPPORTED if the event is not one of the following event: EVENT_EXTERNAL_FILE_UPDATE, EVENT_REMOTE_FILE_UPDATE.UICCException - in case of error COMMAND_NOT_ALLOWED if the referenced file is terminated
void deregisterFileEvent(short fileEvent,
FileView aFileView)
throws ToolkitException,
java.lang.NullPointerException,
javacard.framework.TransactionException
EVENT_EXTERNAL_FILE_UPDATE for a file.
fileEvent - Indicates the File event to be deregisteredaFileView - The FileView object's current file indicates the file that is no longer monitored.
If the current file is a dedicated file the deregistration shall not affect the monitoring of an elementary file within the dedicated file that was individually registered.
If the current file is an elementary file the deregistration will not affect the monitoring of the parent dedicated file that was individually registered.
java.lang.NullPointerException - if aFileView is null
javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
ToolkitException - with the following reason code:EVENT_NOT_ALLOWED if the event is one of the following events: EVENT_MENU_SELECTION, EVENT_MENU_SELECTION_HELP_REQUEST, EVENT_TIMER_EXPIRATION, EVENT_STATUS_COMMAND
EVENT_NOT_SUPPORTED if the event is not one of the following event: EVENT_EXTERNAL_FILE_UPDATE, EVENT_REMOTE_FILE_UPDATE.UICCException - in case of error COMMAND_NOT_ALLOWED if the referenced file is terminated
void setMenuEntryTextAttribute(byte id,
byte[] textAttribute,
short offset,
short length)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException,
javacard.framework.TransactionException
id.
After the invocation of this method, during the current card session, the CAT Runtime Environment
shall dynamically update the menu stored in the terminal.
id - the menu entry identifier supplied by the initMenuEntry() methodtextAttribute - a reference on a byte array, containing the menu text attributeoffset - the position of the menu entry text attribute in the bufferlength - the length of the menu entry text attribute in the buffer
java.lang.NullPointerException - if textAttribute is null
java.lang.ArrayIndexOutOfBoundsException - if offset or length or both would cause access outside array bounds
ToolkitException - with the following reason codes: length is different from 4javacard.framework.TransactionException - if the operation would cause the commit capacity to be exceeded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||