public class ShellBasedIdMapping extends Object implements IdMappingServiceProvider
IdMappingServiceProvider
Map id to user name or group name. It does update every 15 minutes. Only a
single instance of this class is expected to be on the server.| Constructor and Description |
|---|
ShellBasedIdMapping(Configuration conf) |
ShellBasedIdMapping(Configuration conf,
String defaultStaticIdMappingFile) |
| Modifier and Type | Method and Description |
|---|---|
int |
getGid(String group) |
int |
getGidAllowingUnknown(String group) |
String |
getGroupName(int gid,
String unknown) |
long |
getTimeout() |
int |
getUid(String user) |
int |
getUidAllowingUnknown(String user) |
String |
getUserName(int uid,
String unknown) |
static void |
updateMapInternal(com.google.common.collect.BiMap<Integer,String> map,
String mapName,
String command,
String regex,
Map<Integer,Integer> staticMapping)
Get the whole list of users and groups and save them in the maps.
|
void |
updateMaps() |
public ShellBasedIdMapping(Configuration conf, String defaultStaticIdMappingFile) throws IOException
IOExceptionpublic ShellBasedIdMapping(Configuration conf) throws IOException
IOExceptionpublic long getTimeout()
public static void updateMapInternal(com.google.common.collect.BiMap<Integer,String> map, String mapName, String command, String regex, Map<Integer,Integer> staticMapping) throws IOException
IOExceptionpublic void updateMaps() throws IOException
IOExceptionpublic int getUid(String user) throws IOException
getUid in interface IdMappingServiceProviderIOExceptionpublic int getGid(String group) throws IOException
getGid in interface IdMappingServiceProviderIOExceptionpublic String getUserName(int uid, String unknown)
getUserName in interface IdMappingServiceProviderpublic String getGroupName(int gid, String unknown)
getGroupName in interface IdMappingServiceProviderpublic int getUidAllowingUnknown(String user)
getUidAllowingUnknown in interface IdMappingServiceProviderpublic int getGidAllowingUnknown(String group)
getGidAllowingUnknown in interface IdMappingServiceProviderCopyright © 2016 Apache Software Foundation. All Rights Reserved.