|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFullUserInfo
A very widely used structure that represents a single screen name and various flags and values associated with it. Such values include warning level, idle time, and away status.
Field Summary | |
static int |
MASK_AB
A user mask indicating that a user is an ActiveBuddy robot. |
static int |
MASK_ADMIN
A user mask indicating that a user is an administrator. |
static long |
MASK_ALL
A user mask representing all users. |
static int |
MASK_AOL
A user mask indicating that a user is using AOL and not AIM. |
static int |
MASK_AWAY
A user mask indicating that a user is away. |
static int |
MASK_FREE
A user mask indicating that a user is using AIM for free (as opposed to using AOL, as with MASK_AOL ). |
static int |
MASK_UNCONFIRMED
A user mask indicating that a user never replied to his confirmation email, and may in fact not actually own the email address to which the screenname is registered. |
static int |
MASK_WIRELESS
A user mask indicating that a user is using a mobile phone to chat. |
Constructor Summary | |
FullUserInfo(java.lang.String sn,
int warningLevel,
int flags,
java.util.Date accountCreated,
java.util.Date memberSince,
long sessAIM,
long sessAOL,
java.util.Date onSince,
int idleMins,
CapabilityBlock[] capabilityBlocks,
java.lang.Boolean away,
ExtraInfoBlock[] extraInfos,
ByteBlock certHash,
ShortCapabilityBlock[] shortCaps)
Creates a new user info block with the given properties. |
|
FullUserInfo(java.lang.String sn,
int warningLevel,
int flags,
java.util.Date accountCreated,
java.util.Date memberSince,
long sessAIM,
long sessAOL,
java.util.Date onSince,
int idleMins,
CapabilityBlock[] capabilityBlocks,
java.lang.Boolean away,
ExtraInfoBlock[] extraInfos,
ByteBlock certHash,
ShortCapabilityBlock[] shortCaps,
ImmutableTlvChain extraTlvs)
Creates a new user info block with the given properties. |
Method Summary | |
java.util.Date |
getAccountCreated()
Returns the date at which this user's account was created, or null if this field was not sent. |
java.lang.Boolean |
getAwayStatus()
Returns whether this user is away, or null if this field
was not sent. |
CapabilityBlock[] |
getCapabilityBlocks()
Returns the list of "capability blocks" which this user is advertising, or null if this field was not sent. |
ByteBlock |
getCertInfoHash()
Returns an MD5 hash of the user's security information block, or null if none is contained in this
user info object. |
ExtraInfoBlock[] |
getExtraInfoBlocks()
Returns the list of extra information objects this user is advertising, or null if this field was not sent. |
ImmutableTlvChain |
getExtraTlvs()
Returns a TLV chain consisting of all TLV's not processed into fields accessible by get* methods of this object. |
int |
getFlags()
Returns this user's "user mask" flags. |
int |
getIdleMins()
Returns the number of minutes for which this user has been idle, or -1 if this field was not sent. |
java.util.Date |
getMemberSince()
Returns the date since which this user has been a member of AIM, or null if this field was not sent. |
java.util.Date |
getOnSince()
Returns the date at which this user began the current session (that is, the current AIM connection). |
java.lang.String |
getScreenname()
Returns the screenname of the user whose info this object represents. |
long |
getSessionLengthAIM()
Returns the number of seconds for which this user has been online, if this user is an AIM user and not an AOL user. |
long |
getSessionLengthAOL()
Returns the number of seconds for which this user has been online, if this user is an AOL user. |
ShortCapabilityBlock[] |
getShortCapabilityBlocks()
Returns the list of "short capability blocks" contained in this user info object. |
int |
getTotalSize()
Returns the total number of bytes that were read to generate this user info block. |
int |
getWarningLevel()
Returns the warning level of this user, as a "percentage," but multiplied by ten. |
static FullUserInfo |
readUserInfo(ByteBlock block)
Reads a user info block from the given data block, or returns null if no valid user info block is present in the given
data block. |
java.lang.String |
toString()
|
void |
write(java.io.OutputStream out)
Writes a representation of this object to the given stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MASK_UNCONFIRMED
public static final int MASK_ADMIN
public static final int MASK_AOL
public static final int MASK_FREE
MASK_AOL
).
public static final int MASK_WIRELESS
public static final int MASK_AB
public static final int MASK_AWAY
public static final long MASK_ALL
PrivacyItem
.
Constructor Detail |
public FullUserInfo(java.lang.String sn, int warningLevel, int flags, java.util.Date accountCreated, java.util.Date memberSince, long sessAIM, long sessAOL, java.util.Date onSince, int idleMins, CapabilityBlock[] capabilityBlocks, java.lang.Boolean away, ExtraInfoBlock[] extraInfos, ByteBlock certHash, ShortCapabilityBlock[] shortCaps)
sn
can be null
or
-1
(depending on argument type) to indicate that the given
field should not be sent in this user info block.
sn
- the user's screennamewarningLevel
- the user's warning levelflags
- the user's "user flags," like MASK_FREE
accountCreated
- the date at which this user's account was createdmemberSince
- the date since which this user has been a membersessAIM
- the amount of time, in seconds this user has been online,
if this user is not an AOL usersessAOL
- the amount of time, in seconds, this user has been online,
if this user is on AOLonSince
- the date at which this user signed onidleMins
- the number of minutes this user has been idlecapabilityBlocks
- a list of capability blocks that this user is
advertisingaway
- whether this user is awayextraInfos
- a list of extra information blocks that this user is
advertisingcertHash
- an MD5 hash of the user's certificate information blockshortCaps
- a list of "short capability blocks"public FullUserInfo(java.lang.String sn, int warningLevel, int flags, java.util.Date accountCreated, java.util.Date memberSince, long sessAIM, long sessAOL, java.util.Date onSince, int idleMins, CapabilityBlock[] capabilityBlocks, java.lang.Boolean away, ExtraInfoBlock[] extraInfos, ByteBlock certHash, ShortCapabilityBlock[] shortCaps, ImmutableTlvChain extraTlvs)
sn
can be null
or
-1
(depending on argument type) to indicate that the given
field should not be sent in this user info block. This constructor allows
you to specify extra user info TLV's to be sent, in the case of a
feature added to the protcool after the release of this library.
sn
- the user's screennamewarningLevel
- the user's warning levelflags
- the user's "user flags," like MASK_FREE
accountCreated
- the date at which this user's account was createdmemberSince
- the date since which this user has been a membersessAIM
- the amount of time, in seconds this user has been online,
if this user is not an AOL usersessAOL
- the amount of time, in seconds, this user has been online,
if this user is on AOLonSince
- the date at which this user signed onidleMins
- the number of minutes this user has been idlecapabilityBlocks
- a list of capability blocks that this user is
advertisingaway
- whether this user is awayextraInfos
- a list of extra information blocks that this user is
advertisingcertHash
- an MD5 hash of the user's certificate information blockshortCaps
- a list of "short capability blocks"extraTlvs
- a set of extra TLV's to be appended to this user info
blockMethod Detail |
public static FullUserInfo readUserInfo(ByteBlock block)
null
if no valid user info block is present in the given
data block.
block
- the block from which to read user info
public final java.lang.String getScreenname()
public final int getWarningLevel()
0
to
999
(which represents the percentage range 0% to 99.9%), but
will be -1
if no warning level was sent.
public final int getFlags()
MASK_UNCONFIRMED
, MASK_FREE
, MASK_AWAY
, MASK_AOL
, MASK_WIRELESS
, MASK_ADMIN
, and MASK_AB
. To test for a given flag, use
something resembling the following code:
if ((userInfo.getFlags() & FullUserInfo.MASK_WIRELESS) != 0) { System.out.println("User " + userInfo.getScreenname() + " is using a " + "wireless device!"); }Note that this will return
-1
if this field was not sent.
public final java.util.Date getAccountCreated()
null
if this field was not sent. This field does not appear
to be sent anymore by normal AIM servers.
public final java.util.Date getMemberSince()
null
if this field was not sent. This field does not appear
to be sent anymore by normal AIM servers.
public final long getSessionLengthAIM()
null
if this field was not sent.
public final long getSessionLengthAOL()
null
if this field
was not sent.
public final java.util.Date getOnSince()
null
if this field
was not sent.
public final int getIdleMins()
-1
if this field was not sent.
public final CapabilityBlock[] getCapabilityBlocks()
null
if this field was not sent. Note that this will
return an array of size zero instead of null
if this field
was sent but contained no capability blocks.
public final java.lang.Boolean getAwayStatus()
null
if this field
was not sent.
public final ExtraInfoBlock[] getExtraInfoBlocks()
null
if this field was not sent. Note that this will
return a zero-length array if the field was sent but empty.
public final ByteBlock getCertInfoHash()
null
if none is contained in this
user info object.
public ShortCapabilityBlock[] getShortCapabilityBlocks()
public final ImmutableTlvChain getExtraTlvs()
get*
methods of this object. This is useful
to aid in processing additional fields AOL may add to the standard user
info block after the release of this library.
public final int getTotalSize()
-1
if this object was not read from
a block of data but instead instantiated manually.
public void write(java.io.OutputStream out) throws java.io.IOException
LiveWritable
write
in interface LiveWritable
out
- the stream to which to write
java.io.IOException
- if an I/O error occurspublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |