|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.crypto.transcoder.Transcoder
public abstract class Transcoder
This abstract class defines the methods required to encode and decode data sent to
and from the device. A Transcoder must register with the
TranscoderManager using TranscoderManager.register(net.rim.device.api.crypto.transcoder.Transcoder)
before it will be used to encode or decode any messages.
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_SERVICE_RECORD_UID
The hashtable key for retrieving an array of service record UID string(s) from the context
object. The retrieved array will never be null.
In encode(...), the retrieved array will 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.
In decode(...), the retrieved array will contain 0 or 1 item(s). There will
be exactly 1 item if and only if the transmission contains a bounded service record.
Type: String[]
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 retrieved string will never be null.
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 final byte getID()
public abstract boolean willTranscode(IntHashtable context)
context - the context to be checked
true if transcoding will be performed in the
supplied context, 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. Messages sent from the device will be passed into this method for encoding if this transcoder is registered.
input - the message to encodeoutput - the encoded message should be stored in this output streamcontext - the context of the message
true if encoding was successful, false otherwise.
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. Messages sent to the device will be passed into this method for decoding if this transcoder is registered.
input - the message to decodeoutput - the decoded message should be stored in this output streamcontext - the context of the message
true if decoding was successful, false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal