|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectInstantMessage
Represents a single instant message, either plain or encrypted.
Field Summary | |
static int |
ENCRYPTIONCODE_DEFAULT
A default encryption code used by the offiical AIM clients. |
Constructor Summary | |
InstantMessage(ByteBlock encryptedData)
Creates a new encrypted instant message with the given encrypted data and an encryption code of ENCRYPTIONCODE_DEFAULT . |
|
InstantMessage(int encryptionCode,
ByteBlock encryptedData)
Creates a new encrypted instant message with the given encryption code and the given encrypted message data block. |
|
InstantMessage(java.lang.String message)
Creates a new plaintext (unencrypted) instant message object with the given message text. |
Method Summary | |
ByteBlock |
getEncryptedData()
Returns the encrypted message data stored in this message, if encrypted. |
int |
getEncryptionCode()
Returns the encryption code stored in this message, if any. |
java.lang.String |
getMessage()
Returns the text of the message, if unencrypted. |
boolean |
isEncrypted()
Returns whether or not this message is encrypted. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ENCRYPTIONCODE_DEFAULT
Constructor Detail |
public InstantMessage(java.lang.String message)
message
- the message body textpublic InstantMessage(ByteBlock encryptedData)
ENCRYPTIONCODE_DEFAULT
.
encryptedData
- the encrypted message blockpublic InstantMessage(int encryptionCode, ByteBlock encryptedData)
encryptionCode
- an encryption code, normally ENCRYPTIONCODE_DEFAULT
encryptedData
- the encrypted message blockMethod Detail |
public final boolean isEncrypted()
true
, encrypted message data can be retrieved using
getEncryptedData()
. If the returned value is false
,
the message body text can be retrieved using getMessage()
.
public final java.lang.String getMessage()
null
if isEncrypted()
is true
;
it will never return null
otherwise.
public final int getEncryptionCode()
ENCRYPTIONCODE_DEFAULT
.
Note that this method will always return -1
if isEncrypted()
is false
, and may still return
-1
otherwise (if no encryption code was included in this
message).
-1
if
none was sent or if this message is not encryptedpublic final ByteBlock getEncryptedData()
null
if isEncrypted()
is false
, and will never return
null
otherwise.
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |