use of org.osgi.service.useradmin.Role in project aries by apache.
the class UserAdmin method getGroup.
/**
* @see org.osgi.jmx.service.useradmin.UserAdminMBean#getGroup(java.lang.String)
*/
public CompositeData getGroup(String groupname) throws IOException {
if (groupname == null) {
throw new IOException("Group name cannot be null");
}
Role role = userAdmin.getRole(groupname);
if (role == null) {
return null;
}
validateRoleType(role, Role.GROUP);
return new GroupData((Group) role).toCompositeData();
}
use of org.osgi.service.useradmin.Role in project aries by apache.
the class UserAdmin method getMembers.
/**
* @see org.osgi.jmx.service.useradmin.UserAdminMBean#getMembers(java.lang.String)
*/
public String[] getMembers(String groupname) throws IOException {
if (groupname == null) {
throw new IOException("Group name cannot be null");
}
Role role = userAdmin.getRole(groupname);
if (role != null) {
validateRoleType(role, Role.GROUP);
Role[] roles = ((Group) role).getMembers();
if (roles != null) {
String[] members = new String[roles.length];
for (int i = 0; i < roles.length; i++) {
members[i] = roles[i].getName();
}
return members;
}
}
return null;
}
use of org.osgi.service.useradmin.Role in project aries by apache.
the class UserAdmin method getAuthorization.
/**
* @see org.osgi.jmx.service.useradmin.UserAdminMBean#getAuthorization(java.lang.String)
*/
public CompositeData getAuthorization(String username) throws IOException {
if (username == null) {
throw new IOException("User name cannot be null");
}
Role role = userAdmin.getRole(username);
if (role == null) {
return null;
}
validateRoleType(role, Role.USER);
Authorization auth = userAdmin.getAuthorization((User) role);
if (auth == null) {
return null;
}
return new AuthorizationData(auth).toCompositeData();
}
Aggregations