org.icenigrid.gridsam.core.hostenv
Class UserMappingUtil

java.lang.Object
  extended by org.icenigrid.gridsam.core.hostenv.UserMappingUtil

public class UserMappingUtil
extends java.lang.Object

Purpose:
A Utility class, providing some usermap-related functions.

Version:
1.0.1 2007-11-15
Author:
RibPig Qiao, Yongqiang Zou

Field Summary
static org.apache.commons.logging.Log sLog
          logger.
 
Constructor Summary
UserMappingUtil()
           
 
Method Summary
static java.lang.String getDefaultUserDN()
          Get the userDN of the default user.
static java.util.Map getDefaultUserMapInfo()
          Get the user mapping of the default users.
static java.lang.String getLocalHomePath(java.lang.String userDN)
          To get the correponding home location for the UserDN on the indicated cluster.
static java.lang.String getLocalUN(java.lang.String userDN)
          Get the local UserName using the corresponding Global UserMap
static java.lang.String getLocalUserGroup(java.lang.String userDN)
          To get local user's group for the UserDN on the indicated cluster.
static java.util.Map getUserMapInfo(java.lang.String userDN)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sLog

public static org.apache.commons.logging.Log sLog
logger.

Constructor Detail

UserMappingUtil

public UserMappingUtil()
Method Detail

getLocalUN

public static java.lang.String getLocalUN(java.lang.String userDN)
                                   throws JobManagerException
Get the local UserName using the corresponding Global UserMap

Parameters:
userDN - The global User DN
Returns:
String : the local Username correponding to the global username.
Throws:
JobManagerException - When something error.

getLocalHomePath

public static java.lang.String getLocalHomePath(java.lang.String userDN)
                                         throws JobManagerException
To get the correponding home location for the UserDN on the indicated cluster.

Parameters:
userDN - The global User DN
Returns:
String : the local Username correponding to the global username.
Throws:
JobManagerException - When something error.

getLocalUserGroup

public static java.lang.String getLocalUserGroup(java.lang.String userDN)
                                          throws JobManagerException
To get local user's group for the UserDN on the indicated cluster.

Parameters:
userDN - The global User DN
Returns:
String : the group name that user belong to.
Throws:
JobManagerException - When something error.

getUserMapInfo

public static java.util.Map getUserMapInfo(java.lang.String userDN)
                                    throws JobManagerException
Parameters:
userDN -
Returns:
a UserMapInfo instance
Throws:
JobManagerException

getDefaultUserDN

public static java.lang.String getDefaultUserDN()
                                         throws JobManagerException
Get the userDN of the default user. Default user is the container user.

Returns:
the default user DN.
Throws:
JobManagerException - No defaultUserDN configuration.

getDefaultUserMapInfo

public static java.util.Map getDefaultUserMapInfo()
                                           throws JobManagerException
Get the user mapping of the default users.

Returns:
a Map. The key are SupportContants.USER_MAP_LOCALNAME, SupportContants.USER_MAP_GROUP and SupportContants.USER_MAP_HOMEDIR.
Throws:
JobManagerException - No defaultUserDN configuration, No userMapping,


Copyright © 2009. All Rights Reserved.