com.intel.util
Class IntelApplet
- java.lang.Object
-
- com.trustedlogic.isdi.Service
-
- com.intel.util.IntelApplet
-
public abstract class IntelApplet extends com.trustedlogic.isdi.Service
This is the base class that must be inherited by all applets. The applets must not inherit thecom.trustedlogic.isdi.Service
class directly.
-
-
Field Summary
Fields Modifier and Type Field and Description static int
APPLET_ERROR_BAD_PARAMETERS
static int
APPLET_ERROR_BAD_STATE
static int
APPLET_ERROR_GENERIC
static int
APPLET_ERROR_NOT_SUPPORTED
static int
APPLET_SUCCESS
-
Constructor Summary
Constructors Constructor and Description IntelApplet()
-
Method Summary
Methods Modifier and Type Method and Description java.lang.String
getUUID()
Returns the UUID of this applet in String representation.abstract int
invokeCommand(int commandId, byte[] request)
This method will be called by the VM to handle a command sent to this applet instance.int
onClose()
This method will be called by the VM when the session being handled by this applet instance is being closed and this applet instance is about to be removed.void
onCloseSession()
This method must not be used directly.int
onCommand(int commandId, com.trustedlogic.isdi.SDecoder request, com.trustedlogic.isdi.SEncoder response)
This method must not be used directly.int
onInit(byte[] request)
This method will be called by the VM when a new session is opened to the applet and this applet instance is being created to handle the new session.int
onOpenSession(com.trustedlogic.isdi.SDecoder request, com.trustedlogic.isdi.SEncoder response)
This method must not be used directly.void
setResponse(byte[] response, int index, int length)
Updates the response data to be returned duringinvokeCommand
processing.
-
-
-
Field Detail
-
APPLET_SUCCESS
public static final int APPLET_SUCCESS
- See Also:
- Constant Field Values
-
APPLET_ERROR_GENERIC
public static final int APPLET_ERROR_GENERIC
- See Also:
- Constant Field Values
-
APPLET_ERROR_BAD_PARAMETERS
public static final int APPLET_ERROR_BAD_PARAMETERS
- See Also:
- Constant Field Values
-
APPLET_ERROR_BAD_STATE
public static final int APPLET_ERROR_BAD_STATE
- See Also:
- Constant Field Values
-
APPLET_ERROR_NOT_SUPPORTED
public static final int APPLET_ERROR_NOT_SUPPORTED
- See Also:
- Constant Field Values
-
-
Method Detail
-
onOpenSession
public final int onOpenSession(com.trustedlogic.isdi.SDecoder request, com.trustedlogic.isdi.SEncoder response)
This method must not be used directly.- Overrides:
onOpenSession
in classcom.trustedlogic.isdi.Service
- Parameters:
request
- the data sent with the open session.response
- the data answered to the open session- Returns:
- the execution status that will be forwarded to the client (see
SResult
) - See Also:
onInit(byte[])
-
onCloseSession
public final void onCloseSession()
This method must not be used directly.- Overrides:
onCloseSession
in classcom.trustedlogic.isdi.Service
- See Also:
onClose()
-
onCommand
public final int onCommand(int commandId, com.trustedlogic.isdi.SDecoder request, com.trustedlogic.isdi.SEncoder response)
This method must not be used directly.- Specified by:
onCommand
in classcom.trustedlogic.isdi.Service
- Parameters:
commandId
- the command identifier specified by the clientrequest
- the command dataresponse
- the response data- Returns:
- the execution status that will be forwarded to the client (see
SResult
) - See Also:
invokeCommand(int commandId, byte[] request)
-
onInit
public int onInit(byte[] request)
This method will be called by the VM when a new session is opened to the applet and this applet instance is being created to handle the new session. To return the response data to the command, call thesetResponse
method before returning from this method.- Parameters:
request
- the input data sent to the applet during session creation- Returns:
APPLET_SUCCESS
if the operation was processed successfully, error status code otherwise (see APPLET_ERROR... definitions above for possible values).
-
onClose
public int onClose()
This method will be called by the VM when the session being handled by this applet instance is being closed and this applet instance is about to be removed. This method cannot provide response data and therefore callingsetResponse
from it will throw aNullPointerException
.- Returns:
APPLET_SUCCESS
if the operation was processed successfully, error status code otherwise (see APPLET_ERROR... definitions above for possible values).
-
invokeCommand
public abstract int invokeCommand(int commandId, byte[] request)
This method will be called by the VM to handle a command sent to this applet instance. To return the response data to the command, call thesetResponse
method before returning from this method.- Parameters:
commandId
- the command ID (applet specific)request
- the input data for this command- Returns:
APPLET_SUCCESS
if the operation was processed successfully, error status code otherwise (see APPLET_ERROR... definitions above for possible values).
-
setResponse
public final void setResponse(byte[] response, int index, int length)
Updates the response data to be returned duringinvokeCommand
processing. Note that calling this method more than once will reset the response data previously set.- Parameters:
response
- the response data to be returned during command processingindex
- index in the response data arraylength
- length of the response data to be returned
-
getUUID
public final java.lang.String getUUID()
Returns the UUID of this applet in String representation.- Returns:
- The UUID of this applet in String representation.
-
-