Package org.apache.hadoop.security
Class NetgroupCache
java.lang.Object
org.apache.hadoop.security.NetgroupCache
Class that caches the netgroups and inverts group-to-user map
to user-to-group map, primarily intended for use with
netgroups (as returned by getent netgrgoup) which only returns
group to user mapping.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdd group to cachestatic voidclear()Clear the cacheGet the list of cached netgroupsstatic voidgetNetgroups(String user, List<String> groups) Get netgroups for a given userstatic booleanReturns true if a given netgroup is cached
-
Constructor Details
-
NetgroupCache
public NetgroupCache()
-
-
Method Details
-
getNetgroups
Get netgroups for a given user- Parameters:
user- get groups for this usergroups- put groups into this List
-
getNetgroupNames
Get the list of cached netgroups- Returns:
- list of cached groups
-
isCached
Returns true if a given netgroup is cached- Parameters:
group- check if this group is cached- Returns:
- true if group is cached, false otherwise
-
clear
public static void clear()Clear the cache -
add
Add group to cache- Parameters:
group- name of the group to add to cacheusers- list of users for a given group
-