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
IOException
public ShellBasedIdMapping(Configuration conf) throws IOException
IOException
public 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
IOException
public void updateMaps() throws IOException
IOException
public int getUid(String user) throws IOException
getUid
in interface IdMappingServiceProvider
IOException
public int getGid(String group) throws IOException
getGid
in interface IdMappingServiceProvider
IOException
public String getUserName(int uid, String unknown)
getUserName
in interface IdMappingServiceProvider
public String getGroupName(int gid, String unknown)
getGroupName
in interface IdMappingServiceProvider
public int getUidAllowingUnknown(String user)
getUidAllowingUnknown
in interface IdMappingServiceProvider
public int getGidAllowingUnknown(String group)
getGidAllowingUnknown
in interface IdMappingServiceProvider
Copyright © 2016 Apache Software Foundation. All Rights Reserved.