org.apache.hadoop.security
Class UserGroupInformation

java.lang.Object
  extended by org.apache.hadoop.security.UserGroupInformation
All Implemented Interfaces:
Writable
Direct Known Subclasses:
UnixUserGroupInformation

public abstract class UserGroupInformation
extends Object
implements Writable

A Writable abstract class for storing user and groups information.


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
UserGroupInformation()
           
 
Method Summary
static UserGroupInformation getCurrentUGI()
           
abstract  String[] getGroupNames()
          Get the name of the groups that the user belong to
abstract  String getUserName()
          Get username
static UserGroupInformation login(Configuration conf)
          Login and return a UserGroupInformation object.
static UserGroupInformation readFrom(Configuration conf)
          Read a UserGroupInformation from conf
static void setCurrentUGI(UserGroupInformation ugi)
          Set the UserGroupInformation for the current thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.io.Writable
readFields, write
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

UserGroupInformation

public UserGroupInformation()
Method Detail

getCurrentUGI

public static UserGroupInformation getCurrentUGI()
Returns:
the UserGroupInformation for the current thread

setCurrentUGI

public static void setCurrentUGI(UserGroupInformation ugi)
Set the UserGroupInformation for the current thread


getUserName

public abstract String getUserName()
Get username

Returns:
the user's name

getGroupNames

public abstract String[] getGroupNames()
Get the name of the groups that the user belong to

Returns:
an array of group names

login

public static UserGroupInformation login(Configuration conf)
                                  throws LoginException
Login and return a UserGroupInformation object.

Throws:
LoginException

readFrom

public static UserGroupInformation readFrom(Configuration conf)
                                     throws IOException
Read a UserGroupInformation from conf

Throws:
IOException


Copyright © 2008 The Apache Software Foundation