use of org.apache.catalina.Group in project tomcat by apache.
the class UserMBean method getGroups.
// ------------------------------------------------------------- Attributes
/**
* @return the MBean Names of all groups this user is a member of.
*/
public String[] getGroups() {
User user = (User) this.resource;
List<String> results = new ArrayList<>();
Iterator<Group> groups = user.getGroups();
while (groups.hasNext()) {
Group group = null;
try {
group = groups.next();
ObjectName oname = MBeanUtils.createObjectName(managed.getDomain(), group);
results.add(oname.toString());
} catch (MalformedObjectNameException e) {
throw new IllegalArgumentException(sm.getString("userMBean.createError.group", group), e);
}
}
return results.toArray(new String[0]);
}
Aggregations