ShellBasedUnixGroupsNetgroupMapping (Hadoop 0.20.2-cdh3u0 API)
Date: 2011-03-25

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.security
Class ShellBasedUnixGroupsNetgroupMapping

    java.lang.Object
      org.apache.hadoop.security.ShellBasedUnixGroupsMapping
          org.apache.hadoop.security.ShellBasedUnixGroupsNetgroupMapping

All Implemented Interfaces:
  GroupMappingServiceProvider

    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.

Field Summary
`protected static Map<String,Set<String>>` | `netgroupToUsersMap`
`protected static boolean` | `netgroupToUsersMapUpdated`
`protected static Map<String,Set<String>>` | `userToNetgroupsMap`

Constructor Summary
`ShellBasedUnixGroupsNetgroupMapping()`

Method Summary
`void` | `cacheGroupsAdd(List<String> groups)` Caches the group user information
`void` | `cacheGroupsRefresh()` Refresh the cache of groups and user mapping
`protected void` | `cacheNetgroup(String group)`
`protected String` | `execShellGetUnixGroups(String user)`
`protected String` | `execShellGetUserForNetgroup(String netgroup)`
`List<String>` | `getGroups(String user)` Get all various group memberships of a given user.
`protected void` | `getNetgroups(String user, List<String> groups)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### netgroupToUsersMapUpdated

    protected static boolean netgroupToUsersMapUpdated

### netgroupToUsersMap

    protected static Map<String,Set<String>> netgroupToUsersMap

### userToNetgroupsMap

    protected static Map<String,Set<String>> userToNetgroupsMap

Constructor Detail

### ShellBasedUnixGroupsNetgroupMapping

    public ShellBasedUnixGroupsNetgroupMapping()

Method Detail

### getGroups

    public List<String> getGroups(String user)
                           throws IOException

  Description copied from interface: `GroupMappingServiceProvider`
  Get all various group memberships of a given user. Returns EMPTY list in case of non-existing user

  Specified by:
    `getGroups` in interface `GroupMappingServiceProvider`
  Overrides:
    `getGroups` in class `ShellBasedUnixGroupsMapping`
  Parameters:
    `user` - User's name
  Returns:
    group memberships of user
  Throws:
    `IOException`

### cacheGroupsRefresh

    public void cacheGroupsRefresh()
                            throws IOException

  Description copied from interface: `GroupMappingServiceProvider`
  Refresh the cache of groups and user mapping

  Specified by:
    `cacheGroupsRefresh` in interface `GroupMappingServiceProvider`
  Overrides:
    `cacheGroupsRefresh` in class `ShellBasedUnixGroupsMapping`
  Throws:
    `IOException`

### cacheGroupsAdd

    public void cacheGroupsAdd(List<String> groups)
                        throws IOException

  Description copied from interface: `GroupMappingServiceProvider`
  Caches the group user information

  Specified by:
    `cacheGroupsAdd` in interface `GroupMappingServiceProvider`
  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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation