|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.sql.SQLPeerDatum
com.tootsville.UserList
public class UserList
Generic class that handles both buddy lists and ignore lists, depending upon its mood. Unlike most of my stuff, you can actually use the constructor safely, here.
| Field Summary | |
|---|---|
(package private) AbstractZone |
activeZone
The Zone in which the owner of this list is active |
private int |
myUserID
WRITEME |
private static long |
serialVersionUID
Java serialisations unique ID |
private String |
tableName
WRITEME |
(package private) HashMap<Integer,String> |
theRealList
WRITEME |
| Constructor Summary | |
|---|---|
UserList(AbstractUser myGuy,
boolean buddyTrueBlockFalse)
|
|
UserList(UserRecord myGuy,
boolean buddyTrueIgnoreFalse)
WRITEME: Document this constructor brpocock@star-hope.org |
|
| Method Summary | |
|---|---|
boolean |
addUser(AbstractUser other)
Add a user to this list |
User[] |
asArrayOfUsers()
Deprecated. |
Map<Integer,String> |
asMap()
Get a map copy of the buddy list with keys as user ID's and values as user names. |
Set<String> |
asNames()
WRITEME: document this method (brpocock@star-hope.org, Oct 13, 2009) |
void |
changed()
Indicate that some of the contents of this datum have changed, and that the database and/or object caches may need to be updated. |
void |
flush()
This is an overriding method. |
static String |
getBuddyApprovalCookie(AbstractUser requester,
AbstractUser requestee)
Generate an opaque cookie which can only be produced by the requester, and must be returned by the requestee in order to prove that a request has been made. |
protected String |
getCacheUniqueID()
This is an overriding method. |
private void |
init(AbstractZone zone)
WRITEME: document this method (brpocock@star-hope.org, Aug 31, 2009) |
boolean |
isOnList(AbstractUser u)
WRITEME: document this method (brpocock@star-hope.org, Aug 31, 2009) |
private void |
readList()
Read the user list from the database (XXX: contains SQL) |
boolean |
removeUser(AbstractUser other)
Remove a user from this list (XXX: contains SQL) |
protected void |
set(ResultSet rs)
This is an overriding method. |
int |
size()
|
org.json.JSONObject |
toJSON(AbstractZone zone)
Convert this list into a JSON form. |
| Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
|---|
compareTo, findInCache, get, saveInCache, set, toJSON |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
transient AbstractZone activeZone
private int myUserID
private final String tableName
HashMap<Integer,String> theRealList
| Constructor Detail |
|---|
public UserList(AbstractUser myGuy,
boolean buddyTrueBlockFalse)
myGuy - The user whose buddy list or ignore list is being
instantiatedbuddyTrueBlockFalse - true, for buddy list; false, for
ignore list.
public UserList(UserRecord myGuy,
boolean buddyTrueIgnoreFalse)
myGuy - WRITEMEbuddyTrueIgnoreFalse - WRITEME| Method Detail |
|---|
public static String getBuddyApprovalCookie(AbstractUser requester,
AbstractUser requestee)
requester - user placing the buddy requestrequestee - user being requested as a buddy
public boolean addUser(AbstractUser other)
addUser in interface UserListother - the user to be added
UserList.addUser(AbstractUser)@Deprecated public User[] asArrayOfUsers()
public Map<Integer,String> asMap()
UserList
asMap in interface UserListUserList.asMap()public Set<String> asNames()
UserList
asNames in interface UserListUserList.asNames()public void changed()
SQLPeerDatum
changed in interface UserListchanged in class SQLPeerDatumUserList.changed()public void flush()
UserList
flush in interface UserListflush in class SQLPeerDatumUserList.flush()protected String getCacheUniqueID()
getCacheUniqueID in class SQLPeerDatumSQLPeerDatum.getCacheUniqueID()private void init(AbstractZone zone)
zone - WRITEMEpublic boolean isOnList(AbstractUser u)
UserList
isOnList in interface UserListu - the user being checked
UserList.isOnList(AbstractUser)
private void readList()
throws SQLException
SQLException - WRITEMEpublic boolean removeUser(AbstractUser other)
removeUser in interface UserListother - The other user to remove from this list
UserList.removeUser(AbstractUser)
protected void set(ResultSet rs)
throws SQLException
set in class SQLPeerDatumrs - The result of an SQL query, with the cursor already
pointed at the row describing this specific instance of
the object.
SQLException - if the database fails somehowSQLPeerDatum.set(java.sql.ResultSet)public int size()
size in interface UserListUserList.size()
public org.json.JSONObject toJSON(AbstractZone zone)
throws org.json.JSONException
toJSON in interface UserListzone - The zone for which the list's online status should be
checked.
org.json.JSONException - WRITEMEUserList.toJSON(org.starhope.appius.types.AbstractZone)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||