public abstract class UserManager extends Object
Modifier | Constructor and Description |
---|---|
protected |
UserManager() |
Modifier and Type | Method and Description |
---|---|
protected abstract Set<String> |
getGroups(Principal user)
Retrieves the group membership for the given principal.
|
String |
getHostAddress()
Returns the current user's hostName.
|
static UserManager |
getInstance()
Returns the (singleton) instance of UserManager.
|
String |
getUserName()
Returns the current user's name.
|
void |
setHostAddress(String hostName)
Sets the (thread local) user hostName to be used in further calls.
|
void |
setUser(Principal user,
boolean isAdmin)
Sets the (thread local) user principal to be used in further calls
and retrieves the group information.
|
boolean |
userHasAdminRole()
Checks if the user has admin role.
|
boolean |
userIsInGroup(String group)
Checks if the user is in the specified group.
|
public static UserManager getInstance()
protected abstract Set<String> getGroups(Principal user)
user
- a userpublic void setUser(Principal user, boolean isAdmin)
user
- principalisAdmin
- flag: true = user has Admin rolepublic boolean userIsInGroup(String group)
group
- name of the group to check membershippublic boolean userHasAdminRole()
public String getUserName()
public void setHostAddress(String hostName)
haostName
- String of host namepublic String getHostAddress()
Copyright © 2010-2014 Michigan State University. All Rights Reserved.