uicc.toolkit

## Interface EnvelopeHandler

- All Superinterfaces:
    BERTLVViewHandler, ViewHandler

      public interface EnvelopeHandler
      extends BERTLVViewHandler

  The `EnvelopeHandler` interface contains basic methods to handle the Envelope data field. A class implementing this interface will be used by the Toolkit applet in order to have access to the current Envelope information. A class implementing the EnvelopeHandler interface is a Temporary JCRE Entry Point Object and can be retrieved by invoking the `getTheHandler()` method of the `EnvelopeHandlerSystem` class. Toolkit Applet Example:

       private static final byte MY_TAG = (byte)0x54;
       private byte[] data;
       data = new byte[32];

       void processToolkit(byte event) throws ToolkitException {
           // get the EnvelopeHandler system instance
           EnvelopeHandler theEnv = EnvelopeHandlerSystem.getTheHandler();
           // look for MY_TAG TLV
           if (theEnv.findTLV(MY_TAG, (byte)1) != TLV_NOT_FOUND) {
               // check first element byte
               if (theEnv.getValueByte((short)0) == (byte)1) {
                   // copy element part into data buffer
                   theEnv.copyValue((short)1,
                                    data,
                                    (short)0,
                                    (short)(theEnv.getValueLength() - 1));
               }
           }
       }

  See Also:
    `ViewHandler`, `EnvelopeHandlerSystem`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte` | `getChannelIdentifier()` Returns the channel identifier value from the first Channel status TLV element in the current Envelope data field.
    `short` | `getChannelStatus(byte channelIdentifier)` Returns the value of the first Channel Status TLV element whose channel identifier is equal to the `channelIdentifier` parameter.
    `byte` | `getItemIdentifier()` Returns the item identifier byte value from the first Item Identifier TLV element in the current Envelope data field.

    - ### Methods inherited from interface uicc.toolkit.BERTLVViewHandler

      `getSize, getTag`

    - ### Methods inherited from interface uicc.toolkit.ViewHandler

      `compareValue, copy, copyValue, findAndCompareValue, findAndCompareValue, findAndCopyValue, findAndCopyValue, findTLV, getCapacity, getLength, getValueByte, getValueLength, getValueShort`

- - ### Method Detail

    - #### getItemIdentifier

          byte getItemIdentifier()
                          throws ToolkitException

      Returns the item identifier byte value from the first Item Identifier TLV element in the current Envelope data field. If the element is available it becomes the TLV selected.
      Returns:
        item identifier
      Throws:
        `ToolkitException` - with the following reason codes:
        - `UNAVAILABLE_ELEMENT` in case of unavailable TLV element
        - `OUT_OF_TLV_BOUNDARIES` if the item identifier byte is missing in the Item Identifier Comprehension TLV.

    - #### getChannelIdentifier

          byte getChannelIdentifier()
                             throws ToolkitException

      Returns the channel identifier value from the first Channel status TLV element in the current Envelope data field. If the element is available it becomes the currently selected TLV.
      Returns:
        channel identifier
      Throws:
        `ToolkitException` - - with the following reason codes:
        - `UNAVAILABLE_ELEMENT` in case of unavailable TLV element.
        - `OUT_OF_TLV_BOUNDARIES` if the Comprehension TLV Channels Status length is equal to zero.

    - #### getChannelStatus

          short getChannelStatus(byte channelIdentifier)
                          throws ToolkitException

      Returns the value of the first Channel Status TLV element whose channel identifier is equal to the `channelIdentifier` parameter. If the element is available it becomes the currently selected TLV element.
      Parameters:
        `channelIdentifier` - the channel number
      Returns:
        channel identifier and status : MSB = byte 1 of the Channel Status TLV value (byte 3 of the Channel Status TLV element), LSB = byte 2 of the Channel Status TLV value (byte 4 of the Channel Status TLV element).
      Throws:
        `ToolkitException` - with the following reason codes:
        - `UNAVAILABLE_ELEMENT` if no Channel Status TLV element with the right identifier could be found
        - `OUT_OF_TLV_BOUNDARIES` if a Channel Status TLV element with the right identifier could be found but its value is less than 2 bytes long

Copyright © 2017 ETSI All Rights Reserved.