@InterfaceAudience.LimitedPrivate(value={"HDFS","MapReduce"}) @InterfaceStability.Evolving public class ShellBasedUnixGroupsNetgroupMapping extends ShellBasedUnixGroupsMapping
GroupMappingServiceProvider
that exec's the groups
shell command to fetch the group
memberships of a given user.Constructor and Description |
---|
ShellBasedUnixGroupsNetgroupMapping() |
Modifier and Type | Method and Description |
---|---|
void |
cacheGroupsAdd(List<String> groups)
Add a group to cache, only netgroups are cached
|
void |
cacheGroupsRefresh()
Refresh the netgroup cache
|
protected String |
execShellGetUserForNetgroup(String netgroup)
Calls shell to get users for a netgroup by calling getent
netgroup, this is a low level function that just returns string
that
|
List<String> |
getGroups(String user)
Get unix groups (parent) and netgroups for given user
|
protected List<String> |
getUsersForNetgroup(String netgroup)
Gets users for a netgroup
|
public List<String> getGroups(String user) throws IOException
getGroups
in interface GroupMappingServiceProvider
getGroups
in class ShellBasedUnixGroupsMapping
user
- get groups and netgroups for this userIOException
public void cacheGroupsRefresh() throws IOException
cacheGroupsRefresh
in interface GroupMappingServiceProvider
cacheGroupsRefresh
in class ShellBasedUnixGroupsMapping
IOException
public void cacheGroupsAdd(List<String> groups) throws IOException
cacheGroupsAdd
in interface GroupMappingServiceProvider
cacheGroupsAdd
in class ShellBasedUnixGroupsMapping
groups
- list of group names to add to cacheIOException
protected List<String> getUsersForNetgroup(String netgroup) throws IOException
netgroup
- return users for this netgroupIOException
protected String execShellGetUserForNetgroup(String netgroup) throws IOException
netgroup
- get users for this netgroupIOException
Copyright © 2013 Apache Software Foundation. All rights reserved.