SHOW Signed
 

net.rim.blackberry.api.blackberrymessenger
Class Message

java.lang.Object
  |
  +--net.rim.blackberry.api.blackberrymessenger.Message

public class Message
extends Object

A container for the data that can be sent or received by the BlackBerry Messenger API.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 4.2.1

Field Summary
 Category: Signed static int DEFAULT_INTEGER
          The default value for the integer, if it is not specified to the constructor.
 Category: Signed static String DEFAULT_NAME
          The default value for the name, if it is not specified to the constructor.
 Category: Signed static String DEFAULT_URL
          The default value for the URL, if it is not specified to the constructor.
 
Constructor Summary
 Category: Signed Message(String contentType, byte[] data)
          Creates a new Message object.
 Category: Signed Message(String contentType, byte[] data, String name)
          Creates a new Message object.
 Category: Signed Message(String contentType, byte[] data, String name, int integer, String url)
          Creates a new Message object.
 
Method Summary
 Category: Signed  String getContentType()
          Returns the content type of this message.
 Category: Signed  byte[] getData()
          Returns the data of this message.
 Category: Signed  int getInteger()
          Returns an integer associated with this message.
 Category: Signed  String getName()
          Returns the name of this message.
 Category: Signed  String getURL()
          Returns a URL for this message.
 Category: Signed  void setContentType(String contentType)
          Sets the content type of this message.
 Category: Signed  void setData(byte[] data)
          Sets the data of this message.
 Category: Signed  void setInteger(int integer)
          Sets the integer of this message.
 Category: Signed  void setName(String name)
          Sets the name of this message.
 Category: Signed  void setURL(String url)
          Sets the URL of this message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_INTEGER

public static final int DEFAULT_INTEGER
The default value for the integer, if it is not specified to the constructor. The value of this constant is -1.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

DEFAULT_NAME

public static final String DEFAULT_NAME
The default value for the name, if it is not specified to the constructor. The value of this constant is null.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

DEFAULT_URL

public static final String DEFAULT_URL
The default value for the URL, if it is not specified to the constructor. The value of this constant is null.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Constructor Detail

Message

public Message(String contentType,
               byte[] data)
Creates a new Message object.
Parameters:
contentType - the content type of this message (see getContentType()).
data - the byte data associated with this message (see getData(); note that only the pointer value of specified array is copied, and thus modifications to the array made outside of this object will be reflected inside of this object also.
Throws:
NullPointerException - if any argument is null.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Message

public Message(String contentType,
               byte[] data,
               String name)
Creates a new Message object.
Parameters:
contentType - the content type of this message (see getContentType())
data - the byte data associated with this message (see getData(); note that only the pointer value of specified array is copied, and thus modifications to the array made outside of this object will be reflected inside of this object also.
name - the name of this message; may be null (see getName())
Throws:
NullPointerException - if contentType or data is null.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Message

public Message(String contentType,
               byte[] data,
               String name,
               int integer,
               String url)
Creates a new Message object.
Parameters:
contentType - the content type of this message (see getContentType())
data - the byte data associated with this message (see getData(); note that only the pointer value of specified array is copied, and thus modifications to the array made outside of this object will be reflected inside of this object also.
name - the name of this message; may be null (see getName())
integer - an integer for this message (see getInteger())
url - a URL for this message (see getURL())
Throws:
NullPointerException - if contentType or data is null.
Since:
JDE 4.2.1
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Method Detail

getContentType

public String getContentType()
Returns the content type of this message.
Returns:
the content type of this message; never returns null.
Since:
JDE 4.2.1
See Also:
setContentType(String)
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getData

public byte[] getData()
Returns the data of this message. Note that this method returns the pointer value of the internal array, and thus modifications to the returned array made outside of this object will be reflected inside this object also.
Returns:
the data of this message; never returns null.
Since:
JDE 4.2.1
See Also:
setData(byte[])
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getInteger

public int getInteger()
Returns an integer associated with this message.
Returns:
an integer associated with this message, or -1 if there is no integer associated with this message.
Since:
JDE 4.2.1
See Also:
setInteger(int)
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getName

public String getName()
Returns the name of this message.
Returns:
the name of this message; or null if this message does not have a name.
Since:
JDE 4.2.1
See Also:
setName(String)
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getURL

public String getURL()
Returns a URL for this message. The purpose of this URL is for the case that the recipient does not have the application installed or has an older version that does not recognize a new content type; the client can download the newer version from this URL.
Returns:
a URL for this message; or null if no URL is associated with this message.
Since:
JDE 4.2.1
See Also:
setURL(String)
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setContentType

public void setContentType(String contentType)
Sets the content type of this message.
Parameters:
contentType - the content type to set for this message.
Throws:
NullPointerException - if contentType is null.
Since:
JDE 4.2.1
See Also:
getContentType()
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setData

public void setData(byte[] data)
Sets the data of this message.
Parameters:
data - the data to set for this message; note that only the pointer value of specified array is copied, and thus modifications to the array made outside of this object will be reflected in this object also.
Throws:
NullPointerException - if data is null.
Since:
JDE 4.2.1
See Also:
getData()
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setInteger

public void setInteger(int integer)
Sets the integer of this message.
Parameters:
integer - the value to set as the integer of this message.
Since:
JDE 4.2.1
See Also:
getInteger()
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setName

public void setName(String name)
Sets the name of this message.
Parameters:
name - the string to set as the name of this message, or null to indicate that this message does not have a name.
Since:
JDE 4.2.1
See Also:
getName()
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setURL

public void setURL(String url)
Sets the URL of this message.
Parameters:
url - the string to set as the URL of this message; or null to indicate that this message does not have a URL.
Since:
JDE 4.2.1
See Also:
getURL()
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



Copyright 1999-2009 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.