|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.crypto.transcoder.Transcoder
This interface defines the methods required to encode and decode data sent to
and from the device. In order to encode or decode any messages, a Transcoder
must first register with the TranscoderManager using
.
TranscoderManager#registerTranscoder
Once a Transcoder has been registered, messages sent from the device
will be passed into its encode(...) method for encoding. Similarly,
messages sent to the device will be passed into its decode(...) method
for decoding.
The transcoder is responsible for ensuring that a corresponding transcoder has been implemented on the receiver/sender before performing any transcoding. The transcoder will also be responsible for any and all key management required as part of the encoding scheme.
| Field Summary | ||
|
static int |
CONTEXT_GME_ADDRESS_STRING
The hashtable key for retrieving the GME address string from the context. |
|
static int |
CONTEXT_SERVICE_RECORD_UID
The hashtable key for retrieving an array of service record UID string(s) from the context object. |
| Constructor Summary | ||
|
Transcoder(byte id)
Creates a transcoder instance |
|
| Method Summary | ||
|
abstract boolean |
decode(InputStream input,
OutputStream output,
IntHashtable context)
Decodes the data in the input stream and outputs the decoded data into the output stream. |
|
abstract boolean |
encode(InputStream input,
OutputStream output,
IntHashtable context)
Encodes the data in the input stream and outputs the encoded data into the output stream. |
|
byte |
getID()
Returns a byte that uniquely identifies this transcoder |
|
abstract boolean |
willTranscode(IntHashtable context)
Query the transcoder with a context to see if the transcoder will perform an operation in the supplied context. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int CONTEXT_GME_ADDRESS_STRING
The hashtable key for retrieving the GME address string from the context. The
string will be formatted according to:
[CID]([/UID[(REDIRECT)][:PIN[(REDIRECT)]])*[$SRC[(REDIRECT)]]
The object will never be null.
Type: String
public static final int CONTEXT_SERVICE_RECORD_UID
The hashtable key for retrieving an array of service record UID string(s) from the context
object. The retrieved object will never be null.
When a message is sent from the device, this array may contain 0 or more items. Each item in this array will correspond to a service record in the service book. The service record(s) for the transmission may be retrieved using the UID string(s) in this array.
When a message is sent to the device, this array may contain 0 or 1 item(s). There will be 1 item if and only if the transmission contains a bounded service record.
Type: String[]
| Constructor Detail |
public Transcoder(byte id)
id - The unique id of this transcoder instance. Cannot be zero.IllegalArgumentException - if id equals 0.| Method Detail |
public abstract boolean decode(InputStream input, OutputStream output, IntHashtable context)
Decodes the data in the input stream and outputs the decoded data into the output stream.
If this Transcoder has registered with the TranscoderManager,
messages sent to the device will be passed into this method for decoding. This method
should check whether the message was encoded with a corresponding encoder before
decoding the message.
input - the message to decodeoutput - the decoded message should be stored in this output streamcontext - the context of the message; the list of keys used to obtain the
context-sensitive information in this hashtable could be found at
Transcoder (as the constants beginning with "CONTEXT_")true if encoding was successful, false otherwise.public abstract boolean encode(InputStream input, OutputStream output, IntHashtable context)
Encodes the data in the input stream and outputs the encoded data into the output stream.
If this Transcoder has registered with the TranscoderManager,
messages sent from the device will be passed into this method for encoding. This method
should check whether a corresponding decoder has been implemented on the receiver
before encoding the message.
input - the message to encodeoutput - the encoded message should be stored in this output streamcontext - the context of the message; the list of keys used to obtain the
context-sensitive information in this hashtable could be found at
Transcoder (as the constants beginning with "CONTEXT_")true if encoding was successful, false otherwise.public final byte getID()
public abstract boolean willTranscode(IntHashtable context)
context - the context to be checkedtrue if transcoding will be performed in the supplied context, false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2008 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.