Package uicc.connection
Interface UICCTransportLink
- All Superinterfaces:
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 TypeMethodDescriptionbooleanDisconnects the application from the remote entity and requests the closing of the underlying connection.shortconnect(int iMaxRequestedInSDUSize, int iMaxRequestedOutSDUSize, short sDestPort, byte[] baLinkData, short sOffset, short sLength) Connects the application via the reliable link to a remote entity.booleanDisconnects the application from the remote entity.intRetrieves the size used for incoming SDUs on this reliable link.intRetrieves the size used for outgoing SDUs on this reliable link.booleanisAlive()Checks if the remote entity is still connected to the application.booleansendSDU(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 theConnectionobject 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 withbaLinkData- Reference of the byte array containing the data to be used during the link establishment.sOffset- Position, within thebaLinkDatabyte array, where the identification data beginssLength- Length of the data- Returns:
CONNECT_OPERATION_FAILEDif the connect operation has failed.CONNECT_OPERATION_PERFORMED_SUCCESSFULLYif the connect operation has been performed successfully.CONNECT_OPERATION_PERFORMED_WITH_MODIFICATIONSif the connect operation has been performed with modifications, i.e. SDU sizes requested have been modified.
- Throws:
ArrayIndexOutOfBoundsException- ifsOffsetandsLengthare causing access outside ofbaLinkDataarray boundsConnectionException- with the following reason code:TOOLKIT_RESOURCE_NOT_AVAILABLEif the proactive command could not be issued.INVALID_STATEif the reliable link is already connected.USER_CANCELLATIONif the user cancelled the opening of the underlying connection.CONNECTION_REFUSEDif the remote entity refused the connection setup attempt.TIME_OUTif a timeout occurs.UNSUPPORTED_OPERATIONif the Terminal Equipment does not support the required mechanisms to perform the action.RESOURCE_NOT_AVAILABLEif there are not sufficient resources available (on the UICC or on the terminal).
NullPointerException- ifbaLinkDataoroObserverequal tonull
-
disconnect
Disconnects the application from the remote entity. The underlying connection is not closed implicitly.- Returns:
trueif the proactive command has been issued successfully or if theUICCTransportLinkis already disconnected;falseotherwise- Throws:
ConnectionException- with the following reason code:TOOLKIT_RESOURCE_NOT_AVAILABLEif the proactive command could not be issued.USER_CANCELLATIONif the user cancelled the disconnecting of the reliable link
-
closeConnection
Disconnects the application from the remote entity and requests the closing of the underlying connection. In case of multiplexingConnection, this is performed only if there is no otherUICCTransportLinkconnected using the same Connection.- Returns:
trueif the proactive command has been issued successfully and theUICCTransportLinkgets disconnected;falseotherwise- Throws:
ConnectionException- with the following reason code:TOOLKIT_RESOURCE_NOT_AVAILABLEif the proactive command could not be issued.USER_CANCELLATIONif 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 sentsOffset- the starting offset of the SDU in thebaSDUDatabyte arraysLength- the length of the data- Returns:
trueif the proactive command has been issued successfully;falseotherwise- Throws:
ArrayIndexOutOfBoundsException- ifsOffsetandsLengthare causing access outside ofbaSDUDataarray boundsNullPointerException- ifbaSDUDatais equal tonullConnectionException- with the following reason code:TOOLKIT_RESOURCE_NOT_AVAILABLEif the proactive command could not be issued.INVALID_STATEif the reliable link is not connected.USER_CANCELLATIONif the user cancelled the data sendingOPERATION_NOT_ALLOWEDif the data sending is not allowed.TIME_OUTif 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:
trueif the remote entity is still connected to the application;falseif the remote entity is not connected to the application- Throws:
ConnectionException- with the following reason code:TOOLKIT_RESOURCE_NOT_AVAILABLEif the proactive command could not be issued.INVALID_STATEif the reliable link is not connected.USER_CANCELLATIONif the user cancelled the data sending.
-