FileDocCategorySizeDatePackage
EnvelopeResponseHandler.javaAPI DocphoneME MR2 API (J2ME)5296Wed May 02 18:00:40 BST 2007sim.toolkit

EnvelopeResponseHandler

public final class EnvelopeResponseHandler extends EditHandler
The EnvelopeResponseHandler class contains basic methods to handle the Envelope response data field. This class will be used by the Toolkit applet in order to edit the response to current Envelope command. No constructor is available for the Toolkit applet. The EnvelopeResponseHandler class is a Temporary JCRE Entry Point Object. The only way to get a EnvelopeResponseHandler reference is through the getTheHandler() static method.

version
8.3.0
see
ViewHandler
see
EditHandler
see
EnvelopeHandler
see
ToolkitException

Fields Summary
boolean
handlerAvailable
boolean
postCalled
public static byte
status
private short
outDataSize
Constructors Summary
private EnvelopeResponseHandler()
Constructor

    
Methods Summary
public shortgetCapacity()
Returns the maximum size of the Simple TLV list managed by the handler.

return
size in bytes
exception
ToolkitException with the following reason codes:
  • HANDLER_NOT_AVAILABLE if the handler is busy

        return (short)0;
    
public static sim.toolkit.EnvelopeResponseHandlergetTheHandler()
Returns the single system instance of the EnvelopeResponseHandler class. The applet shall get the reference of the handler at its triggering, the beginning of the processToolkit method.

return
reference of the system instance
exception
ToolkitException with the following reason codes:
  • HANDLER_NOT_AVAILABLE if the handler is busy.

        EnvelopeResponseHandler theEnvelopeResponseHandler = 
	    new EnvelopeResponseHandler();
        theEnvelopeResponseHandler.outDataSize = 0;
        theEnvelopeResponseHandler.handlerAvailable = false;
        theEnvelopeResponseHandler.postCalled = false;
        return theEnvelopeResponseHandler;
    
public voidpost(byte statusType)
Pepares the Envelope response. Should be used with Envelope SMS-PP Data Download.

param
statusType the status to be sent to the ME (SW1_RP_ACK or SW1_RP_ERROR)
exception
ToolkitException with the following reason codes:
  • HANDLER_NOT_AVAILABLE if the handler is busy

        if (postCalled) {
            ToolkitException.throwIt(ToolkitException.HANDLER_NOT_AVAILABLE);
        }
        postCalled = true;
        status = statusType;
    
public voidpostAsBERTLV(byte statusType, byte tag)
Prepare the Envelope response in a BER TLV structure. Should be used with Envelope Call Control by SIM or MO Short Message Control by SIM. The tag value is to be used to set the Result for Call Control and MO Short Message Control by the SIM.

param
statusType the status to be sent to the ME (SW1_RP_ACK or SW1_RP_ERROR)
param
tag the BER Tag to be used at the beginning of the SIMPLE_TLV list.
exception
ToolkitException with the following reason codes:
  • HANDLER_NOT_AVAILABLE if the handler is busy

        if (postCalled) {
            ToolkitException
		.throwIt(ToolkitException.HANDLER_NOT_AVAILABLE);
        }
        postCalled = true;
        status = statusType;