Methods Summary |
---|
public void | addRole(org.apache.catalina.Role role)Add a new {@link Role} to those assigned specifically to this group.
synchronized (roles) {
if (!roles.contains(role)) {
roles.add(role);
}
}
|
public java.util.Iterator | getRoles()Return the set of {@link Role}s assigned specifically to this group.
// ------------------------------------------------------------- Properties
synchronized (roles) {
return (roles.iterator());
}
|
public org.apache.catalina.UserDatabase | getUserDatabase()Return the {@link UserDatabase} within which this Group is defined.
return (this.database);
|
public java.util.Iterator | getUsers()Return the set of {@link org.apache.catalina.User}s that are members of this group.
ArrayList results = new ArrayList();
Iterator users = database.getUsers();
while (users.hasNext()) {
MemoryUser user = (MemoryUser) users.next();
if (user.isInGroup(this)) {
results.add(user);
}
}
return (results.iterator());
|
public boolean | isInRole(org.apache.catalina.Role role)Is this group specifically assigned the specified {@link Role}?
synchronized (roles) {
return (roles.contains(role));
}
|
public void | removeRole(org.apache.catalina.Role role)Remove a {@link Role} from those assigned to this group.
synchronized (roles) {
roles.remove(role);
}
|
public void | removeRoles()Remove all {@link Role}s from those assigned to this group.
synchronized (roles) {
roles.clear();
}
|
public java.lang.String | toString()Return a String representation of this group in XML format.
StringBuffer sb = new StringBuffer("<group groupname=\"");
sb.append(groupname);
sb.append("\"");
if (description != null) {
sb.append(" description=\"");
sb.append(description);
sb.append("\"");
}
synchronized (roles) {
if (roles.size() > 0) {
sb.append(" roles=\"");
int n = 0;
Iterator values = roles.iterator();
while (values.hasNext()) {
if (n > 0) {
sb.append(',");
}
n++;
sb.append((String) ((Role) values.next()).getRolename());
}
sb.append("\"");
}
}
sb.append("/>");
return (sb.toString());
|