|
|||||||||
| Home >> All >> com >> RuntimeCollective >> webapps >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.RuntimeCollective.webapps.bean
Class UserGroup

java.lang.Objectcom.RuntimeCollective.webapps.bean.UserGroup
- All Implemented Interfaces:
- java.util.Collection, EntityBean, java.lang.Iterable, java.io.Serializable
- public class UserGroup
- extends java.lang.Object
- implements EntityBean, java.util.Collection
- extends java.lang.Object
A group of users.
- Version:
- $Id: UserGroup.java,v 1.34 2003/10/13 15:42:43 fabrice Exp $
| Field Summary | |
private java.util.List |
addBuffer
A list of Users to add to this UserGroup, when next saved. |
private static java.lang.String |
AND
|
private static java.lang.String |
AND_USER_ID
|
protected java.util.List |
cachedUserIds
A cache of the user ids saved to the db. |
private static java.lang.String |
CLOSE
|
private static java.lang.String |
COMMA
|
private static java.lang.String |
DATA_VALUES
|
static java.lang.String |
DATABASE_TABLE
The name of a table (in the default database) that indexes this bean type. |
private static java.lang.String |
DELETE_FROM
|
private static java.lang.String |
END_PAR
|
private static java.lang.String |
ESC
|
private static java.lang.String |
FIRST_NAME
|
private int |
iId
Unique identifier |
private java.lang.String |
iName
The name of this user group. |
private static java.lang.String |
INSERT_INTO
|
private int |
iTypeId
The type of this user group. |
private static java.lang.String |
LAST_USED
|
static java.lang.String |
MEMBERSHIP_TABLE
The table that maps users to groups. |
private static java.lang.String |
NAME
|
private java.util.List |
removeBuffer
A list of Users to remove from this UserGroup, when next saved. |
private static java.lang.String |
SELECT_DATA
|
private static java.lang.String |
SELECT_ID
|
private static java.lang.String |
SELECT_ID_NAME
|
private static java.lang.String |
SELECT_USER_ID
|
private static java.lang.String |
SPACE
|
private static java.lang.String |
SPACE_OPEN
|
private static java.lang.String |
TYPE_ID
|
private static java.lang.String |
WHERE_GROUP_ID
|
private static java.lang.String |
WHERE_ID
|
private static java.lang.String |
WHERE_NAME
|
private static java.lang.String |
WHERE_T_ID
|
private static java.lang.String |
WHERE_TYPE_ID
|
| Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean |
INTERFACE_BEAN, NULL_ID |
| Constructor Summary | |
UserGroup()
Default constructor generates a new blank bean with a new unique ID. |
|
UserGroup(int id)
Generate a bean from the database for the given primary key. |
|
| Method Summary | |
boolean |
add(java.lang.Object o)
Add a user to this group. |
boolean |
addAll(java.util.Collection c)
Add a collection of users to this group. |
void |
clear()
Remove all users from this group. |
boolean |
contains(java.lang.Object o)
Returns true if the specified user is in this group |
boolean |
containsAll(java.util.Collection c)
Returns true if this group contains a collection of users. |
void |
delete()
Delete this bean from the database. |
static com.RuntimeCollective.webapps.SearchResults |
getAllGroups()
Deprecated. Instead, use RuntimeParameters.getUserGroups().getAllGroups() |
static com.RuntimeCollective.webapps.SearchResults |
getAllGroups(UserGroupType type)
Deprecated. Instead, use RuntimeParameters.getUserGroups().getAllGroups(UserGroupType type) |
private java.util.Collection |
getAllUserIds()
Get the ids of all users in this usergroup. |
private java.util.Collection |
getAllUsers()
Get all users in this usergroup, by getting the list of ids and loading all the users from the EBS. |
static UserGroup |
getForName(java.lang.String name)
Deprecated. Instead, use RuntimeParameters.getUserGroups().getForName(String name) |
int |
getId()
Get unique identifier |
java.lang.String |
getName()
Get the name of this user group. |
UserGroupType |
getType()
Get the type of this user group. |
java.util.Iterator |
getUsers()
Returns an iterator over the users in this group. |
java.util.List |
getUsersSortedList()
Get the users as an alphabetically-ordered list of users. |
int |
hashCode()
Returns the hash code value for this group. |
protected java.lang.Integer |
idFromUser(java.lang.Object o)
Returns the ID of a User object, if indeed this object is a User |
protected java.util.Collection |
idsFromUsers(java.util.Collection c)
Takes a Collection of Users, and returns a Collection of their ids, as Integers. |
boolean |
isEmpty()
Returns true if this group contains no users. |
java.util.Iterator |
iterator()
Returns an iterator over the users in this group. |
boolean |
remove(java.lang.Object o)
Removes a single instance of the specified user from this group, if it is present. |
boolean |
removeAll(java.util.Collection c)
Removes all this group's users that are also contained in the specified collection. |
boolean |
retainAll(java.util.Collection c)
Retains only the users in this group that are contained in the specified collection. |
void |
save()
Save this bean to the database. |
void |
setId(int id)
Set unique identifier |
void |
setName(java.lang.String name)
Set the name of this user group. |
void |
setType(UserGroupType type)
Set the type of this user group. |
int |
size()
Returns the number of users in this group. |
java.lang.Object[] |
toArray()
Returns an array of Users in this group |
java.lang.Object[] |
toArray(java.lang.Object[] a)
Returns an array of Users in this group, using the specified array, if possible. |
protected User |
userFromId(java.lang.Object o)
Returns a User from an Integer object , if indeed this object is an Integer |
protected java.util.Collection |
usersFromIds(java.util.Collection c)
Takes a Collection of Integer ids, and returns a Collection of the corresponding Users. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
equals |
| Field Detail |
DATABASE_TABLE
public static final java.lang.String DATABASE_TABLE
- The name of a table (in the default database) that indexes this bean type.
This table must have a PK column called "id" and a row for each of the beans of this type.
- See Also:
- Constant Field Values
MEMBERSHIP_TABLE
public static final java.lang.String MEMBERSHIP_TABLE
- The table that maps users to groups.
- See Also:
- Constant Field Values
SELECT_ID
private static final java.lang.String SELECT_ID
- See Also:
- Constant Field Values
DELETE_FROM
private static final java.lang.String DELETE_FROM
- See Also:
- Constant Field Values
SELECT_DATA
private static final java.lang.String SELECT_DATA
- See Also:
- Constant Field Values
WHERE_ID
private static final java.lang.String WHERE_ID
- See Also:
- Constant Field Values
WHERE_T_ID
private static final java.lang.String WHERE_T_ID
- See Also:
- Constant Field Values
INSERT_INTO
private static final java.lang.String INSERT_INTO
- See Also:
- Constant Field Values
DATA_VALUES
private static final java.lang.String DATA_VALUES
- See Also:
- Constant Field Values
WHERE_GROUP_ID
private static final java.lang.String WHERE_GROUP_ID
- See Also:
- Constant Field Values
AND_USER_ID
private static final java.lang.String AND_USER_ID
- See Also:
- Constant Field Values
SELECT_USER_ID
private static final java.lang.String SELECT_USER_ID
- See Also:
- Constant Field Values
SELECT_ID_NAME
private static final java.lang.String SELECT_ID_NAME
- See Also:
- Constant Field Values
FIRST_NAME
private static final java.lang.String FIRST_NAME
- See Also:
- Constant Field Values
NAME
private static final java.lang.String NAME
- See Also:
- Constant Field Values
TYPE_ID
private static final java.lang.String TYPE_ID
- See Also:
- Constant Field Values
WHERE_TYPE_ID
private static final java.lang.String WHERE_TYPE_ID
- See Also:
- Constant Field Values
WHERE_NAME
private static final java.lang.String WHERE_NAME
- See Also:
- Constant Field Values
AND
private static final java.lang.String AND
- See Also:
- Constant Field Values
LAST_USED
private static final java.lang.String LAST_USED
- See Also:
- Constant Field Values
SPACE
private static final java.lang.String SPACE
- See Also:
- Constant Field Values
SPACE_OPEN
private static final java.lang.String SPACE_OPEN
- See Also:
- Constant Field Values
CLOSE
private static final java.lang.String CLOSE
- See Also:
- Constant Field Values
ESC
private static final java.lang.String ESC
- See Also:
- Constant Field Values
COMMA
private static final java.lang.String COMMA
- See Also:
- Constant Field Values
END_PAR
private static final java.lang.String END_PAR
- See Also:
- Constant Field Values
iId
private int iId
- Unique identifier
iName
private java.lang.String iName
- The name of this user group.
iTypeId
private int iTypeId
- The type of this user group.
addBuffer
private java.util.List addBuffer
- A list of Users to add to this UserGroup, when next saved.
removeBuffer
private java.util.List removeBuffer
- A list of Users to remove from this UserGroup, when next saved.
cachedUserIds
protected java.util.List cachedUserIds
- A cache of the user ids saved to the db.
| Constructor Detail |
UserGroup
public UserGroup()
- Default constructor generates a new blank bean with a new unique ID.
UserGroup
public UserGroup(int id)
- Generate a bean from the database for the given primary key.
| Method Detail |
getId
public int getId()
- Get unique identifier
- Specified by:
getIdin interfaceEntityBean
setId
public void setId(int id)
- Set unique identifier
- Specified by:
setIdin interfaceEntityBean
getName
public java.lang.String getName()
- Get the name of this user group.
setName
public void setName(java.lang.String name)
- Set the name of this user group.
getType
public UserGroupType getType()
- Get the type of this user group. (optional)
setType
public void setType(UserGroupType type)
- Set the type of this user group. (optional)
getUsers
public java.util.Iterator getUsers()
- Returns an iterator over the users in this group.
getUsersSortedList
public java.util.List getUsersSortedList()
- Get the users as an alphabetically-ordered list of users.
save
public void save()
- Save this bean to the database.
- Specified by:
savein interfaceEntityBean
delete
public void delete()
- Delete this bean from the database.
- Specified by:
deletein interfaceEntityBean
add
public boolean add(java.lang.Object o)
- Add a user to this group.
(The user will not actually be added until the UserGroup is saved.)
- Specified by:
addin interfacejava.util.Collection
addAll
public boolean addAll(java.util.Collection c)
- Add a collection of users to this group.
- Specified by:
addAllin interfacejava.util.Collection
clear
public void clear()
- Remove all users from this group.
- Specified by:
clearin interfacejava.util.Collection
contains
public boolean contains(java.lang.Object o)
- Returns true if the specified user is in this group
- Specified by:
containsin interfacejava.util.Collection
containsAll
public boolean containsAll(java.util.Collection c)
- Returns true if this group contains a collection of users.
- Specified by:
containsAllin interfacejava.util.Collection
hashCode
public int hashCode()
- Returns the hash code value for this group.
- Specified by:
hashCodein interfacejava.util.Collection
isEmpty
public boolean isEmpty()
- Returns true if this group contains no users.
- Specified by:
isEmptyin interfacejava.util.Collection
iterator
public java.util.Iterator iterator()
- Returns an iterator over the users in this group.
- Specified by:
iteratorin interfacejava.util.Collection
remove
public boolean remove(java.lang.Object o)
- Removes a single instance of the specified user from this group, if it is present.
- Specified by:
removein interfacejava.util.Collection
removeAll
public boolean removeAll(java.util.Collection c)
- Removes all this group's users that are also contained in the specified collection.
- Specified by:
removeAllin interfacejava.util.Collection
retainAll
public boolean retainAll(java.util.Collection c)
- Retains only the users in this group that are contained in the specified collection.
- Specified by:
retainAllin interfacejava.util.Collection
size
public int size()
- Returns the number of users in this group.
- Specified by:
sizein interfacejava.util.Collection
toArray
public java.lang.Object[] toArray()
- Returns an array of Users in this group
- Specified by:
toArrayin interfacejava.util.Collection
toArray
public java.lang.Object[] toArray(java.lang.Object[] a)
- Returns an array of Users in this group, using the specified array, if possible.
- Specified by:
toArrayin interfacejava.util.Collection
getAllUsers
private java.util.Collection getAllUsers()
- Get all users in this usergroup, by getting
the list of ids and loading all the users from the EBS.
getAllUserIds
private java.util.Collection getAllUserIds()
- Get the ids of all users in this usergroup.
If clustered, this queries the the database every time.
Otherwise we use the cache.
It takes into account users in the add/remove buffers
that have not been saved yet.
getAllGroups
public static com.RuntimeCollective.webapps.SearchResults getAllGroups()
- Deprecated. Instead, use
RuntimeParameters.getUserGroups().getAllGroups()- Get a list of all the user groups.
- Get a list of all the user groups.
getAllGroups
public static com.RuntimeCollective.webapps.SearchResults getAllGroups(UserGroupType type)
- Deprecated. Instead, use
RuntimeParameters.getUserGroups().getAllGroups(UserGroupType type)- Get a list of all the user groups of the given type.
- Get a list of all the user groups of the given type.
getForName
public static UserGroup getForName(java.lang.String name)
- Deprecated. Instead, use
RuntimeParameters.getUserGroups().getForName(String name)- Get a user group for the given name.
- Get a user group for the given name.
idFromUser
protected java.lang.Integer idFromUser(java.lang.Object o) throws java.lang.ClassCastException
- Returns the ID of a User object, if indeed this object is a User
userFromId
protected User userFromId(java.lang.Object o) throws java.lang.ClassCastException
- Returns a User from an Integer object , if indeed this object is an Integer
idsFromUsers
protected java.util.Collection idsFromUsers(java.util.Collection c)
- Takes a Collection of Users, and returns
a Collection of their ids, as Integers.
usersFromIds
protected java.util.Collection usersFromIds(java.util.Collection c)
- Takes a Collection of Integer ids, and returns
a Collection of the corresponding Users.
|
|||||||||
| Home >> All >> com >> RuntimeCollective >> webapps >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.RuntimeCollective.webapps.bean.UserGroup