Interface UICCTransportLink

All Superinterfaces:
Observable

public interface UICCTransportLink extends Observable
The UICCTransportLink interface represents a logical connection to a remote entity based on a reliable protocol. Objects implementing UICCTransportLink interface and returned by the ConnectionServer.getConnection method are Permanent Entry Point Objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Disconnects the application from the remote entity and requests the closing of the underlying connection.
    short
    connect(int iMaxRequestedInSDUSize, int iMaxRequestedOutSDUSize, short sDestPort, byte[] baLinkData, short sOffset, short sLength)
    Connects the application via the reliable link to a remote entity.
    boolean
    Disconnects the application from the remote entity.
    int
    Retrieves the size used for incoming SDUs on this reliable link.
    int
    Retrieves the size used for outgoing SDUs on this reliable link.
    boolean
    Checks if the remote entity is still connected to the application.
    boolean
    sendSDU(byte[] baSDUData, short sOffset, short sLength)
    Sends a SDU on a reliable link to the remote entity.
  • Method Details

    • connect

      short connect(int iMaxRequestedInSDUSize, int iMaxRequestedOutSDUSize, short sDestPort, byte[] baLinkData, short sOffset, short sLength) throws ArrayIndexOutOfBoundsException, ConnectionException, NullPointerException
      Connects the application via the reliable link to a remote entity. The configuration of the reliable link is made according to the delivered parameters. The underlying connection specified by the Connection object is implicitly opened.

      Note: this method returns when the link is established.

      Parameters:
      iMaxRequestedInSDUSize - the maximum SDU size requested by the application for data reception.
      iMaxRequestedOutSDUSize - the maximum SDU size requested by the application for data emission.
      sDestPort - link destination port to connect with
      baLinkData - Reference of the byte array containing the data to be used during the link establishment.
      sOffset - Position, within the baLinkData byte array, where the identification data begins
      sLength - Length of the data
      Returns:
      • CONNECT_OPERATION_FAILED if the connect operation has failed.
      • CONNECT_OPERATION_PERFORMED_SUCCESSFULLY if the connect operation has been performed successfully.
      • CONNECT_OPERATION_PERFORMED_WITH_MODIFICATIONS if the connect operation has been performed with modifications, i.e. SDU sizes requested have been modified.
      Throws:
      ArrayIndexOutOfBoundsException - if sOffset and sLength are causing access outside of baLinkData array bounds
      ConnectionException - with the following reason code:
      • TOOLKIT_RESOURCE_NOT_AVAILABLE if the proactive command could not be issued.
      • INVALID_STATE if the reliable link is already connected.
      • USER_CANCELLATION if the user cancelled the opening of the underlying connection.
      • CONNECTION_REFUSED if the remote entity refused the connection setup attempt.
      • TIME_OUT if a timeout occurs.
      • UNSUPPORTED_OPERATION if the Terminal Equipment does not support the required mechanisms to perform the action.
      • RESOURCE_NOT_AVAILABLE if there are not sufficient resources available (on the UICC or on the terminal).
      NullPointerException - if baLinkData or oObserver equal to null
    • disconnect

      boolean disconnect() throws ConnectionException
      Disconnects the application from the remote entity. The underlying connection is not closed implicitly.
      Returns:
      true if the proactive command has been issued successfully or if the UICCTransportLink is already disconnected; false otherwise
      Throws:
      ConnectionException - with the following reason code:
      • TOOLKIT_RESOURCE_NOT_AVAILABLE if the proactive command could not be issued.
      • USER_CANCELLATION if the user cancelled the disconnecting of the reliable link
    • closeConnection

      boolean closeConnection() throws ConnectionException
      Disconnects the application from the remote entity and requests the closing of the underlying connection. In case of multiplexing Connection, this is performed only if there is no other UICCTransportLink connected using the same Connection.
      Returns:
      true if the proactive command has been issued successfully and the UICCTransportLink gets disconnected; false otherwise
      Throws:
      ConnectionException - with the following reason code:
      • TOOLKIT_RESOURCE_NOT_AVAILABLE if the proactive command could not be issued.
      • USER_CANCELLATION if the user cancelled the disconnecting of the reliable link
    • sendSDU

      boolean sendSDU(byte[] baSDUData, short sOffset, short sLength)
      Sends a SDU on a reliable link to the remote entity.

      Note: The method returns when all ACK PDUs related to all data PDUs sent have been received.

      Parameters:
      baSDUData - the SDU to be sent
      sOffset - the starting offset of the SDU in the baSDUData byte array
      sLength - the length of the data
      Returns:
      true if the proactive command has been issued successfully; false otherwise
      Throws:
      ArrayIndexOutOfBoundsException - if sOffset and sLength are causing access outside of baSDUData array bounds
      NullPointerException - if baSDUData is equal to null
      ConnectionException - with the following reason code:
      • TOOLKIT_RESOURCE_NOT_AVAILABLE if the proactive command could not be issued.
      • INVALID_STATE if the reliable link is not connected.
      • USER_CANCELLATION if the user cancelled the data sending
      • OPERATION_NOT_ALLOWED if the data sending is not allowed.
      • TIME_OUT if a timeout occurs.
    • getInSDUSize

      int getInSDUSize()
      Retrieves the size used for incoming SDUs on this reliable link.
      Returns:
      the size used for the incoming SDUs
    • getOutSDUSize

      int getOutSDUSize()
      Retrieves the size used for outgoing SDUs on this reliable link.
      Returns:
      the size used for the outgoing SDUs
    • isAlive

      boolean isAlive()
      Checks if the remote entity is still connected to the application. In case of CAT_TP it sends a NUL-ACK PDU to check if the connection is alive.

      Note: The method returns when an acknowledgement has been received and it returns false if the connection is no longer active (e.g. the retransmission counter is exceeded in the CAT_TP protocol layer).

      Returns:
      true if the remote entity is still connected to the application; false if the remote entity is not connected to the application
      Throws:
      ConnectionException - with the following reason code:
      • TOOLKIT_RESOURCE_NOT_AVAILABLE if the proactive command could not be issued.
      • INVALID_STATE if the reliable link is not connected.
      • USER_CANCELLATION if the user cancelled the data sending.