com.nokia.notifications
public interface NotificationPayload
NotificationPayload
is the notification payload that is received
from the service.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENCODING_BASE64
Encoding value for binary data.
|
static java.lang.String |
ENCODING_NONE
Payload is not encoded.
|
static java.lang.String |
ENCODING_STRING
Encoding value when the payload is plain text.
|
static java.lang.String |
TYPE_APPLICATION_OCTET_STREAM
Content type for binary data.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBase64Data()
Returns the decoded Base64 data.
|
java.lang.String |
getData()
Returns the payload data as a string.
|
java.lang.String |
getEncoding()
Returns the encoding type of the data.
|
java.lang.String |
getType()
Returns the content type of the data.
|
static final java.lang.String ENCODING_BASE64
It is advised to use encoding value base64
for Base64
encoded content because that is automatically used for binary data that
is sent by using the PUT method of the REST API.
getEncoding()
,
Constant Field Valuesstatic final java.lang.String ENCODING_STRING
getEncoding()
,
Constant Field Valuesstatic final java.lang.String ENCODING_NONE
ENCODING_STRING
.getEncoding()
,
Constant Field Valuesstatic final java.lang.String TYPE_APPLICATION_OCTET_STREAM
It is advised to use content type application/octet-stream
for binary data because that is automatically used for binary data that
is sent by using the PUT method of the REST API.
getType()
,
Constant Field Valuesjava.lang.String getData()
java.lang.String getEncoding()
Supported values are ENCODING_BASE64
and
ENCODING_STRING
but MIDlet specific custom values may also
be defined.
null
if specific encoding
value has not been setENCODING_BASE64
,
ENCODING_STRING
,
ENCODING_NONE
java.lang.String getType()
Supported value is
TYPE_APPLICATION_OCTET_STREAM
but MIDlet
specific custom values may also be defined. It is recommended to use IANA
registered content types.
null
if specific content type
has not been setTYPE_APPLICATION_OCTET_STREAM
byte[] getBase64Data() throws java.io.IOException
Returns the decoded Base64 data. This method may only be used if the payload has been encoded by using Base64. An empty array is returned if the payload is empty.
java.lang.IllegalStateException
- if the encoding is not
ENCODING_BASE64
java.io.IOException
- if decoding the data failed, e.g. due to invalid
encoding