org.apache.hadoop.security
Class ShellBasedUnixGroupsNetgroupMapping
java.lang.Object
org.apache.hadoop.security.ShellBasedUnixGroupsMapping
org.apache.hadoop.security.ShellBasedUnixGroupsNetgroupMapping
public class ShellBasedUnixGroupsNetgroupMapping
- extends ShellBasedUnixGroupsMapping
A simple shell-based implementation of GroupMappingServiceProvider
that exec's the groups
shell command to fetch the group
memberships of a given user.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
netgroupToUsersMapUpdated
protected static boolean netgroupToUsersMapUpdated
netgroupToUsersMap
protected static Map<String,Set<String>> netgroupToUsersMap
userToNetgroupsMap
protected static Map<String,Set<String>> userToNetgroupsMap
ShellBasedUnixGroupsNetgroupMapping
public ShellBasedUnixGroupsNetgroupMapping()
getGroups
public List<String> getGroups(String user)
throws IOException
- Get all various group memberships of a given user.
Returns EMPTY list in case of non-existing user
- Overrides:
getGroups
in class ShellBasedUnixGroupsMapping
- Parameters:
user
- User's name
- Returns:
- group memberships of user
- Throws:
IOException
cacheGroupsRefresh
public void cacheGroupsRefresh()
throws IOException
- Refresh the cache of groups and user mapping
- Overrides:
cacheGroupsRefresh
in class ShellBasedUnixGroupsMapping
- Throws:
IOException
cacheGroupsAdd
public void cacheGroupsAdd(List<String> groups)
throws IOException
- Caches the group user information
- Overrides:
cacheGroupsAdd
in class ShellBasedUnixGroupsMapping
- Parameters:
groups
- list of groups to add to cache
- Throws:
IOException
cacheNetgroup
protected void cacheNetgroup(String group)
throws IOException
- Throws:
IOException
getNetgroups
protected void getNetgroups(String user,
List<String> groups)
throws IOException
- Throws:
IOException
execShellGetUnixGroups
protected String execShellGetUnixGroups(String user)
throws IOException
- Throws:
IOException
execShellGetUserForNetgroup
protected String execShellGetUserForNetgroup(String netgroup)
throws IOException
- Throws:
IOException
Copyright © 2009 The Apache Software Foundation