|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAbstractItemObj
PrivacyItem
An SSI item object containing various privacy-related settings.
Note that this class is only used to store data and that changes to this
object are not reflected on the server without sending the changes to the
server with a ModifyItemsCmd
.
Field Summary | |
static int |
MODE_ALLOW_ALL
A privacy mode under which the block list is ignored and thus no users are blocked. |
static int |
MODE_ALLOW_BUDDIES
A privacy mode under which all users not on one's buddy list are blocked. |
static int |
MODE_ALLOW_PERMITS
A privacy mode under which all users not on the "allow list" are blocked. |
static int |
MODE_BLOCK_ALL
A privacy mode under which all users are blocked. |
static int |
MODE_BLOCK_DENIES
A privacy mode under which only users on the block list are blocked. |
static long |
VISMASK_HIDE_WIRELESS
A visibility flag indicating that the fact that the user is or is not using a wireless/mobile device (cell phone) should be hidden from other users. |
Constructor Summary | |
PrivacyItem(int id,
int mode,
long visibleMask)
Creates a new privacy settings item object with the given properties and a visible class mask of FullUserInfo.MASK_ALL . |
|
PrivacyItem(int id,
int mode,
long classMask,
long visibleMask)
Creates a new privacy settings item object with the given properties. |
|
PrivacyItem(int id,
int mode,
long classMask,
long visibleMask,
TlvChain extraTlvs)
Creates a new privacy settings item object with the given properties. |
|
PrivacyItem(PrivacyItem other)
Creates a new privacy settings item object with the same properties as the given object. |
|
PrivacyItem(SsiItem item)
Creates a new privacy settings item object generated from the given SSI item. |
Method Summary | |
long |
getClassMask()
Returns this object's "visible class mask." |
int |
getId()
Returns the item ID of this privacy settings item object. |
int |
getPrivacyMode()
Returns this privacy settings object's (and, consequently, the user's) privacy mode. |
long |
getVisibleMask()
Returns this object's "visibility settings mask." |
void |
setClassMask(long classMask)
Sets the user's "visible class mask." |
void |
setPrivacyMode(int privacyMode)
Sets this item's privacy mode code. |
void |
setVisibleMask(long visibleMask)
Sets the user's "visibility flags." |
SsiItem |
toSsiItem()
Returns an SsiItem that represents this item object. |
java.lang.String |
toString()
|
Methods inherited from class AbstractItemObj |
addExtraTlvs, copyExtraTlvs, generateItem, generateSsiItems, getExtraTlvs |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MODE_ALLOW_ALL
public static final int MODE_BLOCK_ALL
public static final int MODE_ALLOW_PERMITS
public static final int MODE_BLOCK_DENIES
public static final int MODE_ALLOW_BUDDIES
public static final long VISMASK_HIDE_WIRELESS
Constructor Detail |
public PrivacyItem(SsiItem item)
item
- a privacy settings SSI itempublic PrivacyItem(PrivacyItem other)
other
- a privacy settings item object to copypublic PrivacyItem(int id, int mode, long visibleMask)
FullUserInfo.MASK_ALL
.
id
- the unique privacy item ID for this itemmode
- the "privacy mode," like MODE_ALLOW_BUDDIES
visibleMask
- a "visibility mask," like VISMASK_HIDE_WIRELESS
public PrivacyItem(int id, int mode, long classMask, long visibleMask)
id
- the unique privacy item ID for this itemmode
- the "privacy mode," like MODE_ALLOW_BUDDIES
classMask
- a "class mask," like FullUserInfo.MASK_FREE
| FullUserInfo.MASK_WIRELESS
or
(preferably) FullUserInfo.MASK_ALL
visibleMask
- a "visibility mask," like VISMASK_HIDE_WIRELESS
public PrivacyItem(int id, int mode, long classMask, long visibleMask, TlvChain extraTlvs)
id
- the unique privacy item ID for this itemmode
- the "privacy mode," like MODE_ALLOW_BUDDIES
classMask
- a "class mask," like FullUserInfo.MASK_FREE
| FullUserInfo.MASK_WIRELESS
or
(preferably) FullUserInfo.MASK_ALL
visibleMask
- a "visibility mask," like VISMASK_HIDE_WIRELESS
extraTlvs
- a list of extra TLV's to store in this itemMethod Detail |
public final int getId()
public final int getPrivacyMode()
MODE_ALLOW_ALL
, MODE_BLOCK_ALL
, MODE_ALLOW_PERMITS
, MODE_BLOCK_DENIES
, and MODE_ALLOW_BUDDIES
. This value will
be -1
if no privacy mode code is stored in this item.
-1
if none is stored
in this itempublic final long getClassMask()
FullUserInfo.MASK_*
constants.
if ((privacyItem.getClassMask() & FullUserInfo.MASK_WIRELESS) != 0) { System.out.println("We are visible to wireless AIM users"); }NOTE that this value might be
-1
, meaning that
any bit mask will match. Always check for -1
before performing bitwise operations on this value.
FullUserInfo.MASK_ALL
), but if you really wanted
to you could set yourself to be only visible to, for example, users who
were either away or using AIM on a cell phone (using FullUserInfo.MASK_AWAY
| FullUserInfo.MASK_WIRELESS
).
- Returns:
- the user's "visible class mask," or
-1
if no class
mask is stored in this item
public final long getVisibleMask()
VISMASK_HIDE_WIRELESS
. Well, okay, so it can't be
a bitwise combination of one value. But in the future other flags could
be added, so it's best to use bitwise comparisons on this value.
if ((privacyItem.getVisibleMask() & PrivacyItem.VISMASK_HIDE_WIRELESS) != 0) { System.out.println("No one knows if we are on a cell phone or not!"); }NOTE that this value might be
-1
, meaning that
any bit mask will match. Always check for -1
before performing bitwise operations on this value.
-1
if no
visibility settings mask is stored in this itempublic final void setPrivacyMode(int privacyMode)
privacyMode
should
normally be one of MODE_ALLOW_ALL
, MODE_BLOCK_ALL
,
MODE_ALLOW_PERMITS
, MODE_BLOCK_DENIES
, and MODE_ALLOW_BUDDIES
. privacyMode
can be -1
to
erase the privacy mode stored in this item.
privacyMode
- a privacy mode code, or -1
to erase any
privacy mode stored in this itempublic final void setClassMask(long classMask)
classMask
should
normally be a bitwise combination of any of the FullUserInfo.MASK_*
constants. classMask
can also be -1
to erase
the visible class mask stored in this item.
classMask
- a new "visible class mask" to store in this privacy
settings item, or -1
to erase any visible class mask
stored in this itempublic final void setVisibleMask(long visibleMask)
visibleMask
- a new set of "visibility flags" to store in this
privacy settings itempublic SsiItem toSsiItem()
SsiItemObj
SsiItem
that represents this item object.
SsiItem
that represents this item objectpublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |