|
JAFS API v2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openafs.jafs.User
An abstract representation of an AFS user. It holds information about
the user, such as what groups it belongs to.
Constructing an instance of a User
does not mean an actual
AFS user is created in a cell -- usually a User
object is a representation of an already existing AFS user. If,
however, the User
is constructed with the name of a
user that does not exist in the cell represented by the provided
Cell
, a new user with that name can be
created in that server by calling the create(String, int)
or
create(String)
method. If such a user does already exist when
one of these methods is called, an exception will be thrown.
Each User
object has its own individual set of
Group
s that it owns and Group
s for which
it is a member. These represents the properties and attributes
of an actual AFS user.
Since this User
object is a union of both the PTS and KAS
properties of AFS users, some methods meant for users with a PTS entry
will throw exceptions if used on a user with only a KAS entry, and vice
versa.
Associated with an AFS user are many attributes, such as whether or not
it can change its own password, or who is allowed to find out the groups
to which this user belongs. The User
class has many
"set" methods to indicate values for these attributes (i.e.
setChangePassword(boolean)
and setListMembership(int)
).
However, in order for these values to be written to the actual AFS user,
the flushInfo()
method needs to be called. This writes all user
attributes set through this API to AFS. This is done to minimize calls
through JNI.
The following is a simple example of how to construct and use a
User
object. It iterates through the list of users
(a union of pts and kas users) for a cell, and prints out the name and
id of each.
import org.openafs.jafs.Cell; import org.openafs.jafs.AFSException; import org.openafs.jafs.User; ... public class ... { ... private Cell cell; ... public static void main(String[] args) throws Exception { String username = arg[0]; String password = arg[1]; String cellName = arg[2]; token = new Token(username, password, cellName); cell = new Cell(token); server = cell.getServer(serverName); System.out.println("Users in Cell " + cell.getName() + ":"); User[] users = cell.getUsers(); for (int i = 0; i < users.length; i++) { System.out.println(" -> " + users[i] + ": " users[i].getID()); } } ... }
Field Summary | |
static int |
ADMIN
User has administrative kas privileges |
protected int |
adminSetting
whether or not this user has kas administrative privileges. |
protected boolean |
cachedInfo
Whether or not the information fields of this user have been filled. |
protected Cell |
cell
|
protected int |
cellHandle
|
static int |
CHANGE_PASSWORD
User can change their password |
protected int |
cpwSetting
whether this user is allowed to change its password. |
protected String |
creator
|
protected int |
creatorUID
|
protected int |
daysToPasswordExpire
|
static int |
ENCRYPT
TGS can use user's key for an encryption key |
protected String |
encryptionKey
|
protected int |
encSetting
whether the TGS can use this user's key as an encryption key. |
protected int |
failLoginCount
|
static int |
GRANT_TICKETS
TGS will grant tickets for user |
protected int |
groupCreationQuota
|
protected int |
groupMembershipCount
|
protected ArrayList |
groupNames
|
protected ArrayList |
groups
|
protected ArrayList |
groupsOwned
|
protected ArrayList |
groupsOwnedNames
|
protected boolean |
kas
Does this user have a kas entry? |
protected long |
keyCheckSum
|
protected int |
keyVersion
|
protected int |
lastChangePasswordTime
|
protected GregorianCalendar |
lastChangePasswordTimeDate
|
protected String |
lastModName
|
protected int |
lastModTime
|
protected GregorianCalendar |
lastModTimeDate
|
protected int |
listGroupsOwned
who is allowed to execute pts listowned for this user. |
protected int |
listMembership
who is allowed to execute pts membership for this user. |
protected int |
listStatus
who is allowed to execute pts examine for this user. |
protected int |
lockedUntil
|
protected GregorianCalendar |
lockedUntilDate
|
protected int |
lockTime
|
protected int |
maxTicketLifetime
|
protected String |
name
|
protected int |
nameUID
|
static int |
NO_ADMIN
User has no administrative kas privileges |
static int |
NO_CHANGE_PASSWORD
User cannot change their password |
static int |
NO_ENCRYPT
TGS cannot use user's key for an encryption key |
static int |
NO_GRANT_TICKETS
TGS will not grant tickets for user |
static int |
NO_REUSE_PASSWORD
User cannot reuse their password |
protected String |
owner
|
protected int |
ownerUID
|
protected boolean |
pts
Does this user have a pts entry? |
static int |
REUSE_PASSWORD
User can reuse their password |
protected int |
rpwSetting
whether this user is allowed to reuse its password. |
protected int |
tgsSetting
whether the TGS will grant tickets for this user. |
static int |
USER_ANYUSER_ACCESS
Any user has access |
static int |
USER_OWNER_ACCESS
Only the owner of the user has access |
protected int |
userExpiration
|
protected GregorianCalendar |
userExpirationDate
|
Fields inherited from interface org.openafs.jafs.PTSEntry |
PTS_GROUP, PTS_USER |
Constructor Summary | |
(package private) |
User(Cell cell)
Constructs a blank User object given the cell to which
the user belongs. |
|
User(String name,
Cell cell)
Constructs a new User object instance given the name
of the AFS user and the AFS cell, represented by
cell , to which it belongs. |
|
User(String name,
Cell cell,
boolean preloadAllMembers)
Constructs a new User object instance given the name
of the AFS user and the AFS cell, represented by
cell , to which it belongs. |
Method Summary | |
boolean |
canChangePassword()
KAS: Returns whether or not the user can change their password |
boolean |
canEncrypt()
KAS: Returns whether or not TGS can use this users ticket for an encryption key |
boolean |
canReusePassword()
KAS: Returns whether or not the user can reuse their password |
int |
compareTo(Object obj)
Comparable interface method. |
int |
compareTo(User user)
Compares two User objects respective to their names and does not factor any other attribute. |
protected static void |
create(int cellHandle,
String userName,
String password,
int uid)
Creates the kas and pts entries for a new user. |
void |
create(String password)
Creates the kas and pts entries for a new user in this cell. |
void |
create(String password,
int uid)
Creates the kas and pts entries for a new user in this cell. |
void |
delete()
Deletes the pts and kas entries for a user in this cell. |
protected static void |
delete(int cellHandle,
String userName)
Deletes the pts and kas entry for a user. |
boolean |
equals(User otherUser)
Tests whether two User objects are equal, based on their
names. |
void |
flushInfo()
Flushes the current information of this User object to disk.
|
Cell |
getCell()
Returns the Cell this user belongs to. |
PTSEntry |
getCreator()
PTS: Returns the creator of this user in the form of a PTSEntry .
|
int |
getDaysToPasswordExpire()
KAS: Returns the number of days a password is valid before it expires. |
String |
getEncryptionKey()
KAS: Returns the encryption key, in octal form, of this user. |
int |
getFailLoginCount()
KAS: Returns the number of failed login attempts this user is allowed before being locked out. |
int |
getGroupCreationQuota()
PTS: Returns how many more groups this user is allowed to create |
int |
getGroupMembershipCount()
PTS: Returns the number of groups to which this user belongs. |
String[] |
getGroupNames()
PTS: Returns a String array of the group names
to which this user belongs. |
Group[] |
getGroups()
PTS: Returns an array of the Group objects
to which this user belongs. |
Group[] |
getGroupsOwned()
PTS: Returns an array of the Group objects
this user owns. |
protected static int |
getGroupsOwnedBegin(int cellHandle,
String name)
Begin the process of getting the groups that a user or group owns. |
int |
getGroupsOwnedCount()
PTS: Returns the total count of groups this user owns. |
protected static int |
getGroupsOwnedCount(int cellHandle,
String name)
Returns the total number of groups owned by the user. |
protected static void |
getGroupsOwnedDone(int iterationId)
Signals that the iteration is complete and will not be accessed anymore. |
String[] |
getGroupsOwnedNames()
PTS: Returns a String array of the group names
this user owns. |
protected static int |
getGroupsOwnedNext(int cellHandle,
int iterationId,
Group theGroup)
Fills the next group object that the user or group owns. |
protected static String |
getGroupsOwnedNextString(int iterationId)
Returns the next group the user or group owns. |
protected String |
getInfo()
Returns a String representation of this User .
|
protected String |
getInfoGroups()
Returns a String containing the String
representations of all the groups to which this user belongs. |
protected String |
getInfoGroupsOwned()
Returns a String containing the String
representations of all the groups that this user owns. |
long |
getKeyCheckSum()
KAS: Returns the check sum of this user's key. |
int |
getKeyVersion()
KAS: Returns the version number of the user's key. |
int |
getLastChangePasswordTime()
KAS: Returns the last date and time (in UTC) the user changed its password. |
GregorianCalendar |
getLastChangePasswordTimeDate()
KAS: Returns the last date and time the user changed its password. |
String |
getLastModName()
KAS: Returns the name of the user that last modified this user. |
int |
getLastModTime()
KAS: Returns the date and time (in UTC) the user's KAS entry was last modified. |
GregorianCalendar |
getLastModTimeDate()
KAS: Returns the date and time the user was last modified. |
int |
getListGroupsOwned()
PTS: Returns who can list the groups owned (pts listowned) by this user. |
int |
getListMembership()
PTS: Returns who can list the groups (pts membership) to which this user belongs. |
int |
getListStatus()
PTS: Returns who can list the status (pts examine) of this user. |
int |
getLockedUntil()
KAS: Returns the date and time (in UTC) at which the user stops being locked out. |
GregorianCalendar |
getLockedUntilDate()
KAS: Returns the date and time at which the user stops being locked out. |
int |
getLockTime()
KAS: Returns the amount of time (in seconds) a user is locked out when it exceeds the maximum number of allowable failed login attempts. |
int |
getMaxTicketLifetime()
KAS: Returns the maximum lifetime of a ticket issued to this user (in seconds). |
String |
getName()
Returns the name of this user. |
PTSEntry |
getOwner()
PTS: Returns the owner of this user in the form of a PTSEntry .
|
short |
getType()
Returns the type of PTSEntry this object represents.
|
int |
getUID()
PTS: Returns the numeric AFS id of this user. |
int |
getUserExpiration()
KAS: Returns the date and time the user expires. |
GregorianCalendar |
getUserExpirationDate()
KAS: Returns the date and time the user expires. |
protected static int |
getUserGroupsBegin(int cellHandle,
String name)
Begin the process of getting the groups to which the user belongs. |
protected static void |
getUserGroupsDone(int iterationId)
Signals that the iteration is complete and will not be accessed anymore. |
protected static int |
getUserGroupsNext(int cellHandle,
int iterationId,
Group theGroup)
Fills the next group object of which the user belongs. |
protected static String |
getUserGroupsNextString(int iterationId)
Returns the next group to which the user belongs. |
protected static void |
getUserInfo(int cellHandle,
String name,
User user)
Fills in the information fields of the provided User .
|
boolean |
isAdmin()
KAS: Returns whether or not this user has kas administrative privileges |
boolean |
isKAS()
Returns whether or not this user has a kas entry. |
boolean |
isPTS()
Returns whether or not this user has a pts entry. |
protected static void |
reclaimUserMemory()
Reclaims all memory being saved by the user portion of the native library. |
void |
refresh()
Refreshes the properties of this User object instance with values from the AFS user it represents. |
protected void |
refresh(boolean all)
Refreshes the properties of this User object instance with values from the AFS user it represents. |
protected void |
refreshGroupNames()
Refreshes the current information about the group names to which the user belongs. |
protected void |
refreshGroups()
Refreshes the current information about the group objects to which the user belongs. |
protected void |
refreshGroupsOwned()
Refreshes the current information about the group objects that the user \ owns. |
protected void |
refreshGroupsOwnedNames()
Refreshes the current information about the group names that the user owns. |
protected void |
refreshInfo()
Refreshes the information fields of this User to reflect
the current state of the AFS user. |
protected static void |
rename(int cellHandle,
String oldName,
String newName)
Renames the given user. |
void |
rename(String newName)
Change the name of this user. |
void |
setAdmin(boolean setting)
KAS: Sets whether or not this user has kas administrative privileges |
void |
setChangePassword(boolean setting)
KAS: Sets whether or not the user can change their password |
void |
setDaysToPasswordExpire(int days)
KAS: Sets the number of days a password is valid before it expires. |
void |
setEncrypt(boolean setting)
KAS: Sets whether or not TGS can use this users ticket for an encryption key |
void |
setFailLoginCount(int logins)
KAS: Sets the number of failed login attempts this user is allowed before being locked out. |
void |
setGrantTickets(boolean setting)
KAS: Sets whether or not TGS will issue tickets for this user |
void |
setGroupCreationQuota(int quota)
PTS: Sets how many more groups this user is allowed to create |
void |
setListGroupsOwned(int value)
PTS: Sets who can list the groups owned (pts listowned) by this user. |
void |
setListMembership(int value)
PTS: Sets who can list the groups (pts membership) to which this user belongs. |
void |
setListStatus(int value)
PTS: Sets who can list the status (pts examine) of this user. |
void |
setLockTime(int seconds)
KAS: Sets the amount of time (in seconds) a user is locked out when it exceeds the maximum number of allowable failed login attempts. |
void |
setMaxTicketLifetime(int seconds)
KAS: Sets the maximum lifetime of a ticket issued to this user (in seconds). |
protected static void |
setPassword(int cellHandle,
String userName,
String newPassword)
Sets the password of the given user. |
void |
setPassword(String newPassword)
Sets the password of this user to something new. |
void |
setReusePassword(boolean setting)
KAS: Sets whether or not the user can reuse their password |
void |
setUserExpiration(GregorianCalendar expirationDate)
KAS: Sets the date and time the user expires. |
protected static void |
setUserInfo(int cellHandle,
String name,
User theUser)
Sets the information values of this AFS user to be the parameter values. |
String |
toString()
Returns the name of this User |
void |
unlock()
Unlocks the given user if they were locked out of the cell. |
protected static void |
unlock(int cellHandle,
String userName)
Unlocks a user. |
boolean |
willGrantTickets()
KAS: Returns whether or not TGS will issue tickets for this user |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int USER_OWNER_ACCESS
public static final int USER_ANYUSER_ACCESS
public static final int ADMIN
public static final int NO_ADMIN
public static final int GRANT_TICKETS
public static final int NO_GRANT_TICKETS
public static final int ENCRYPT
public static final int NO_ENCRYPT
public static final int CHANGE_PASSWORD
public static final int NO_CHANGE_PASSWORD
public static final int REUSE_PASSWORD
public static final int NO_REUSE_PASSWORD
protected Cell cell
protected int cellHandle
protected String name
protected boolean kas
protected boolean pts
protected int groupCreationQuota
protected int groupMembershipCount
protected int nameUID
protected int ownerUID
protected int creatorUID
protected int listStatus
USER_OWNER_ACCESS
-- only the owner has permissionUSER_ANYUSER_ACCESS
-- any user has permission
protected int listGroupsOwned
USER_OWNER_ACCESS
-- only the owner has permissionUSER_ANYUSER_ACCESS
-- any user has permission
protected int listMembership
USER_OWNER_ACCESS
-- only the owner has permissionUSER_ANYUSER_ACCESS
-- any user has permission
protected String owner
protected String creator
protected ArrayList groups
protected ArrayList groupNames
protected ArrayList groupsOwned
protected ArrayList groupsOwnedNames
protected int adminSetting
protected int tgsSetting
protected int encSetting
protected int cpwSetting
protected int rpwSetting
protected int userExpiration
protected int lastModTime
protected String lastModName
protected int lastChangePasswordTime
protected int maxTicketLifetime
protected int keyVersion
protected String encryptionKey
protected long keyCheckSum
protected int daysToPasswordExpire
protected int failLoginCount
protected int lockTime
protected int lockedUntil
protected GregorianCalendar lockedUntilDate
protected GregorianCalendar userExpirationDate
protected GregorianCalendar lastModTimeDate
protected GregorianCalendar lastChangePasswordTimeDate
protected boolean cachedInfo
Constructor Detail |
public User(String name, Cell cell) throws AFSException
User
object instance given the name
of the AFS user and the AFS cell, represented by
cell
, to which it belongs. This does not actually
create a new AFS user, it just represents one.
If name
is not an actual AFS user, exceptions
will be thrown during subsequent method invocations on this
object, unless the create(String, int)
or create(String)
method is explicitly called to create it.
name
- the name of the user to representcell
- the cell to which the user belongs.
AFSException
- If an error occurs in the native codepublic User(String name, Cell cell, boolean preloadAllMembers) throws AFSException
User
object instance given the name
of the AFS user and the AFS cell, represented by
cell
, to which it belongs. This does not actually
create a new AFS user, it just represents one.
If name
is not an actual AFS user, exceptions
will be thrown during subsequent method invocations on this
object, unless the create(String, int)
or create(String)
method is explicitly called to create it. Note that if the process
doesn't exist and preloadAllMembers
is true, an exception
will be thrown.
This constructor is ideal for point-in-time representation and
transient applications. It ensures all data member values are set and
available without calling back to the filesystem at the first request
for them. Use the refresh()
method to address any coherency
concerns.
name
- the name of the user to representcell
- the cell to which the user belongs.preloadAllMembers
- true will ensure all object members are
set upon construction;
otherwise members will be set upon access,
which is the default behavior.
AFSException
- If an error occurs in the native coderefresh()
User(Cell cell) throws AFSException
User
object given the cell to which
the user belongs. This blank object can then be passed into other
methods to fill out its properties.
cell
- the cell to which the user belongs.
AFSException
- If an error occurs in the native codeMethod Detail |
public void create(String password) throws AFSException
password
- the password for the new user
AFSException
- If an error occurs in the native codepublic void create(String password, int uid) throws AFSException
password
- the password for the new useruid
- the user id to assign to the new user
AFSException
- If an error occurs in the native codepublic void delete() throws AFSException
AFSException
- If an error occurs in the native codepublic void unlock() throws AFSException
AFSException
- If an error occurs in the native codepublic void flushInfo() throws AFSException
User
object to disk.
This will update the information of the actual AFS user to match the
settings that have been modified within this User
object.
This function must be called before any changes made to the information
fields of this user will be seen by AFS.
AFSException
- If an error occurs in the native codepublic void rename(String newName) throws AFSException
newName
- the new name for this user
AFSException
- If an error occurs in the native codepublic void refresh() throws AFSException
Since in most environments administrative changes can be administered from an AFS command-line program or an alternate GUI application, this method provides a means to refresh the Java object representation and thereby ascertain any possible modifications that may have been made from such alternate administrative programs. Using this method before an associated instance accessor will ensure the highest level of representative accuracy, accommodating changes made external to the Java application space. If administrative changes to the underlying AFS system are only allowed via this API, then the use of this method is unnecessary.
AFSException
- If an error occurs in the native codeprotected void refresh(boolean all) throws AFSException
all
is true
then all of the properties of this User object instance will be
set, or renewed, according to the values of the AFS user it represents,
disregarding any previously set properties.
Thus, if all
is false
then properties that
are currently set will be refreshed and properties that are not set will
remain uninitialized. See refresh()
for more information.
all
- if true set or renew all object properties; otherwise renew
all set properties
AFSException
- If an error occurs in the native coderefresh()
protected void refreshInfo() throws AFSException
User
to reflect
the current state of the AFS user. Does not refresh the groups to which
the user belongs or groups owned by the user.
AFSException
- If an error occurs in the native codeprotected void refreshGroupNames() throws AFSException
AFSException
- If an error occurs in the native codeprotected void refreshGroups() throws AFSException
AFSException
- If an error occurs in the native codeprotected void refreshGroupsOwnedNames() throws AFSException
AFSException
- If an error occurs in the native codeprotected void refreshGroupsOwned() throws AFSException
AFSException
- If an error occurs in the native codepublic String getName()
getName
in interface PTSEntry
public Cell getCell()
getCell
in interface PTSEntry
public boolean isKAS() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public boolean isPTS() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public Group[] getGroups() throws AFSException
Group
objects
to which this user belongs.
AFSException
- If an error occurs in the native coderefresh()
public int getGroupsOwnedCount() throws AFSException
If the total list of groups or group names have already been
collected (see getGroupsOwned()
), then the returning value
will be calculated based upon the current list. Otherwise, PTS will
be explicitly queried for the information.
AFSException
- If an error occurs in the native codegetGroupsOwned()
,
getGroupsOwnedNames()
public Group[] getGroupsOwned() throws AFSException
Group
objects
this user owns.
Groups
this user owns
AFSException
- If an error occurs in the native coderefresh()
public String[] getGroupNames() throws AFSException
String
array of the group names
to which this user belongs.
String
array of the groups to which this
user belongs
AFSException
- If an error occurs in the native coderefresh()
public String[] getGroupsOwnedNames() throws AFSException
String
array of the group names
this user owns.
String
array of the groups this user owns
AFSException
- If an error occurs in the native coderefresh()
public int getUID() throws AFSException
getUID
in interface PTSEntry
AFSException
- If an error occurs in the native coderefresh()
public int getGroupCreationQuota() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public int getGroupMembershipCount() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public PTSEntry getOwner() throws AFSException
PTSEntry
.
The returning object could be either a User
or Group
;
to determine what type of object the PTSEntry
represents,
call the PTSEntry.getType()
method.
getOwner
in interface PTSEntry
AFSException
- If an error occurs in the native codePTSEntry
,
PTSEntry.getType()
,
refresh()
public PTSEntry getCreator() throws AFSException
PTSEntry
.
The returning object could be either a User
or Group
;
to determine what type of object the PTSEntry
represents,
call the PTSEntry.getType()
method.
getCreator
in interface PTSEntry
AFSException
- If an error occurs in the native codePTSEntry
,
PTSEntry.getType()
,
refresh()
public short getType()
PTSEntry
this object represents.
This method will always return PTSEntry.PTS_USER
.
getType
in interface PTSEntry
PTSEntry.PTS_USER
)PTSEntry
,
PTSEntry.getType()
public int getListStatus() throws AFSException
USER_OWNER_ACCESS
-- only the owner has permissionUSER_ANYUSER_ACCESS
-- any user has permission
AFSException
- If an error occurs in the native coderefresh()
public int getListGroupsOwned() throws AFSException
USER_OWNER_ACCESS
-- only the owner has permissionUSER_ANYUSER_ACCESS
-- any user has permission
AFSException
- If an error occurs in the native coderefresh()
public int getListMembership() throws AFSException
USER_OWNER_ACCESS
-- only the owner has permissionUSER_ANYUSER_ACCESS
-- any user has permission
AFSException
- If an error occurs in the native coderefresh()
public boolean isAdmin() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public boolean willGrantTickets() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public boolean canEncrypt() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public boolean canChangePassword() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public boolean canReusePassword() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public int getUserExpiration() throws AFSException
null
value indicates the user never exipres (or that
there is no kas entry for this user).
AFSException
- If an error occurs in the native coderefresh()
public GregorianCalendar getUserExpirationDate() throws AFSException
null
value indicates the user never expires (or that
there is no kas entry for this user).
AFSException
- If an error occurs in the native coderefresh()
public int getLastModTime() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public GregorianCalendar getLastModTimeDate() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public String getLastModName() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public GregorianCalendar getLastChangePasswordTimeDate() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public int getLastChangePasswordTime() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public int getMaxTicketLifetime() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public int getDaysToPasswordExpire() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public int getFailLoginCount() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public int getLockTime() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public String getEncryptionKey() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public long getKeyCheckSum() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public int getKeyVersion() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public int getLockedUntil() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public GregorianCalendar getLockedUntilDate() throws AFSException
null
indicates the user is not currently locked
out. If the user is locked out forever, the value
getLockedUntil().getTime().getTime()
will be equal to -1.
AFSException
- If an error occurs in the native coderefresh()
public void setGroupCreationQuota(int quota)
quota
- the new group creation quotapublic void setListStatus(int value) throws AFSException
USER_OWNER_ACCESS
-- only the owner has permissionUSER_ANYUSER_ACCESS
-- any user has permission
value
- the value of the new list status permission
AFSException
- if an error occurs in the native code
IllegalArgumentException
- if an invalud argument is providedpublic void setListGroupsOwned(int value) throws AFSException
USER_OWNER_ACCESS
-- only the owner has permissionUSER_ANYUSER_ACCESS
-- any user has permission
value
- the value of the new list groups owned permission
AFSException
- if an error occurs in the native code
IllegalArgumentException
- if an invalud argument is providedpublic void setListMembership(int value) throws AFSException
USER_OWNER_ACCESS
-- only the owner has permissionUSER_ANYUSER_ACCESS
-- any user has permission
value
- the value of the new list membership permission
AFSException
- if an error occurs in the native code
IllegalArgumentException
- if an invalud argument is providedpublic void setAdmin(boolean setting)
setting
- whether or not this user has kas
administrative privilegespublic void setGrantTickets(boolean setting)
setting
- whether or not TGS will issue tickets for this userpublic void setEncrypt(boolean setting)
setting
- whether or not TGS can use this users ticket for an
encryption keypublic void setChangePassword(boolean setting)
setting
- whether or not the user can change their passwordpublic void setReusePassword(boolean setting)
setting
- whether or not the user can reuse their passwordpublic void setUserExpiration(GregorianCalendar expirationDate)
null
value indicates the user never exipres.
expirationDate
- the date and time the user expirespublic void setMaxTicketLifetime(int seconds)
seconds
- the maximum lifetime of a ticket issued to this user (in seconds).public void setDaysToPasswordExpire(int days)
days
- the number of days for which a password is validpublic void setFailLoginCount(int logins)
logins
- the number of failed login attempts a user is allowedpublic void setLockTime(int seconds)
seconds
- the number of failed login attempts a user is allowedpublic void setPassword(String newPassword) throws AFSException
newPassword
- the new password for this user
AFSException
- If an error occurs in the native codeprotected String getInfo()
String
representation of this User
.
Contains the information fields and groups.
String
representation of the User
protected String getInfoGroups() throws AFSException
String
containing the String
representations of all the groups to which this user belongs.
String
representation of the groups belonged to
AFSException
Group.toString()
protected String getInfoGroupsOwned() throws AFSException
String
containing the String
representations of all the groups that this user owns.
String
representation of the groups owned
AFSException
Group.toString()
public int compareTo(User user)
user
- The User object to be compared to this User instance
public int compareTo(Object obj)
compareTo
in interface Comparable
compareTo(User)
public boolean equals(User otherUser)
User
objects are equal, based on their
names.
otherUser
- the user to test
public String toString()
User
toString
in class Object
User
protected static void create(int cellHandle, String userName, String password, int uid) throws AFSException
cellHandle
- the handle of the cell to which the user belongsuserName
- the name of the user to createpassword
- the password for the new useruid
- the user id to assign to the user (0 to have one
automatically assigned)
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static void delete(int cellHandle, String userName) throws AFSException
cellHandle
- the handle of the cell to which the user belongs
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static void unlock(int cellHandle, String userName) throws AFSException
cellHandle
- the handle of the cell to which the user belongs
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static void getUserInfo(int cellHandle, String name, User user) throws AFSException
User
.
Fills in values based on the current pts and kas information of the user.
cellHandle
- the handle of the cell to which the user belongsname
- the name of the user for which to get the informationuser
- the User
object in which to fill in the
information
AFSException
- If an error occurs in the native codeCell.getCellHandle()
,
User
protected static void setUserInfo(int cellHandle, String name, User theUser) throws AFSException
cellHandle
- the handle of the cell to which the user belongsname
- the name of the user for which to set the informationtheUser
- the User
object containing the desired
information
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static void rename(int cellHandle, String oldName, String newName) throws AFSException
cellHandle
- the handle of the cell to which the user belongsoldName
- the name of the user to renamenewName
- the new name for the user
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static void setPassword(int cellHandle, String userName, String newPassword) throws AFSException
cellHandle
- the handle of the cell to which the user belongsuserName
- the name of the user for which to set the passwordnewPassword
- the new password for the user
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static int getUserGroupsBegin(int cellHandle, String name) throws AFSException
getUserGroupsNext
and getUserGroupsDone
.
cellHandle
- the handle of the cell to which the user belongsname
- the name of the user for which to get the groups
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static String getUserGroupsNextString(int iterationId) throws AFSException
null
if there are no more groups.
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetUserGroupsBegin(int, java.lang.String)
protected static int getUserGroupsNext(int cellHandle, int iterationId, Group theGroup) throws AFSException
cellHandle
- the handle of the cell to which the users belongiterationId
- the iteration ID of this iterationtheGroup
- a Group object to be populated with the values of the
next group
AFSException
- If an error occurs in the native codeCell.getCellHandle()
,
getUserGroupsBegin(int, java.lang.String)
protected static void getUserGroupsDone(int iterationId) throws AFSException
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetUserGroupsBegin(int, java.lang.String)
protected static int getGroupsOwnedCount(int cellHandle, String name) throws AFSException
cellHandle
- the handle of the cell to which the user belongsname
- the name of the user for which to get the groups
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static int getGroupsOwnedBegin(int cellHandle, String name) throws AFSException
getGroupsOwnedNext
and getGroupsOwnedDone
.
cellHandle
- the handle of the cell to which the user belongsname
- the name of the user or group for which to get the groups
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static String getGroupsOwnedNextString(int iterationId) throws AFSException
null
if there are no more groups.
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetGroupsOwnedBegin(int, java.lang.String)
protected static int getGroupsOwnedNext(int cellHandle, int iterationId, Group theGroup) throws AFSException
cellHandle
- the handle of the cell to which the users belongiterationId
- the iteration ID of this iterationtheGroup
- a Group object to be populated with the values of the
next group
AFSException
- If an error occurs in the native codeCell.getCellHandle()
,
getGroupsOwnedBegin(int, java.lang.String)
protected static void getGroupsOwnedDone(int iterationId) throws AFSException
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetGroupsOwnedBegin(int, java.lang.String)
protected static void reclaimUserMemory()
Users
are expected
to be used.
|
JAFS API v2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |