Java AFS Admin API v1.3

org.openafs.jafsadm
Class K5PasswordPolicy

java.lang.Object
  |
  +--org.openafs.jafsadm.K5PasswordPolicy

public class K5PasswordPolicy
extends Object

An abstract representation of a Kerberos 5 Password Policy.

Version:
1.0, 4/02/02

Constructor Summary
K5PasswordPolicy(String name)
          Constructs a new K5PasswordPolicy object instance given the name of Kerberos 5 Password Policy it will represent.
 
Method Summary
 int compareTo(K5PasswordPolicy user)
          Compares two K5PasswordPolicy objects respective to their names and does not factor any other attribute.
 void create()
          Creates a Kerberos 5 Password Policy that corresponds to this abstract representation.
 void delete()
          Deletes the K5 Password Policy.
 boolean equals(K5PasswordPolicy policy)
          Tests whether two K5PasswordPolicy objects are equal, based on their names.
 int getMaxPasswordLifetime()
          Returns the maximum lifetime of a password.
 short getMinCharacterClasses()
          Returns the minimum number of character classes required.
 short getMinPasswordLength()
          Returns the minimum length a password is allowed to have.
 int getMinPasswordLifetime()
          Returns the minimum lifetime of a password (in seconds).
 String getName()
          Returns the name of this password policy.
 int getPastKeyCount()
          Returns the number of past keys kept.
 int getReferenceCount()
          Returns the number of principals using this policy.
 void setMaxPasswordLifetime(int seconds)
          Sets the maximum lifetime of a password (in seconds).
 void setMinCharacterClasses(int number)
          Requires at least number of character classes in a password.
 void setMinPasswordLength(int characters)
          Sets the minimum password length (character length).
 void setMinPasswordLifetime(int seconds)
          Sets the minimum lifetime of a password (in seconds).
 void setPastKeyCount(int number)
          Sets the number of past keys kept for a principal to number.
 String toString()
          Returns the name of this K5PasswordPolicy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

K5PasswordPolicy

public K5PasswordPolicy(String name)
                 throws AFSAdminException
Constructs a new K5PasswordPolicy object instance given the name of Kerberos 5 Password Policy it will represent.
Parameters:
name - the name of the user to represent
Throws:
AFSAdminException - If an error occurs in the native code
Method Detail

create

public void create()
            throws AFSAdminException
Creates a Kerberos 5 Password Policy that corresponds to this abstract representation.
Throws:
AFSAdminException - If an error occurs in the native code

delete

public void delete()
            throws AFSAdminException
Deletes the K5 Password Policy.

Note that you must cancel the policy from all principals before deleting it. The delete_policy command will fail if it is in use by any principals.

Throws:
AFSAdminException - If an error occurs in the native code

getName

public String getName()
Returns the name of this password policy.
Returns:
the name of this password policy

getMinPasswordLifetime

public int getMinPasswordLifetime()
                           throws AFSAdminException
Returns the minimum lifetime of a password (in seconds).
Returns:
the minimum lifetime of a password (in seconds).
Throws:
AFSAdminException - If an error occurs in the native code

getMaxPasswordLifetime

public int getMaxPasswordLifetime()
                           throws AFSAdminException
Returns the maximum lifetime of a password.
Returns:
the maximum lifetime of a password (in seconds).
Throws:
AFSAdminException - If an error occurs in the native code

getMinPasswordLength

public short getMinPasswordLength()
                           throws AFSAdminException
Returns the minimum length a password is allowed to have.
Returns:
the minimum length a password is allowed to have.
Throws:
AFSAdminException - If an error occurs in the native code

getMinCharacterClasses

public short getMinCharacterClasses()
                             throws AFSAdminException
Returns the minimum number of character classes required.
Returns:
the minimum number of character classes required.
Throws:
AFSAdminException - If an error occurs in the native code

getPastKeyCount

public int getPastKeyCount()
                    throws AFSAdminException
Returns the number of past keys kept.
Returns:
the number of past keys kept.
Throws:
AFSAdminException - If an error occurs in the native code

getReferenceCount

public int getReferenceCount()
                      throws AFSAdminException
Returns the number of principals using this policy.
Returns:
the number of principals using this policy.
Throws:
AFSAdminException - If an error occurs in the native code

setMaxPasswordLifetime

public void setMaxPasswordLifetime(int seconds)
Sets the maximum lifetime of a password (in seconds).
Parameters:
seconds - the maximum lifetime of a password (in seconds).

setMinPasswordLifetime

public void setMinPasswordLifetime(int seconds)
Sets the minimum lifetime of a password (in seconds).
Parameters:
seconds - the minimum lifetime of a password (in seconds).

setMinPasswordLength

public void setMinPasswordLength(int characters)
Sets the minimum password length (character length).
Parameters:
characters - the minimum password length (character length).

setMinCharacterClasses

public void setMinCharacterClasses(int number)
Requires at least number of character classes in a password.
Parameters:
seconds - of character classes in a password.

setPastKeyCount

public void setPastKeyCount(int number)
Sets the number of past keys kept for a principal to number.
Parameters:
number - of past keys kept for a principal

compareTo

public int compareTo(K5PasswordPolicy user)
Compares two K5PasswordPolicy objects respective to their names and does not factor any other attribute. Alphabetic case is significant in comparing names.
Parameters:
policy - The K5PasswordPolicy object to be compared to this K5PasswordPolicy instance
Returns:
Zero if the argument is equal to this policy's name, a value less than zero if this policy's name is lexicographically less than the argument, or a value greater than zero if this policy's name is lexicographically greater than the argument

equals

public boolean equals(K5PasswordPolicy policy)
Tests whether two K5PasswordPolicy objects are equal, based on their names.
Parameters:
policy - the user to test
Returns:
whether the specifed user is the same as this user

toString

public String toString()
Returns the name of this K5PasswordPolicy
Overrides:
toString in class Object
Returns:
the name of this K5PasswordPolicy

Java AFS Admin (jafsadm) API for OpenAFS

Copyright (c) 2001-2002 International Business Machines Corp.
All rights reserved.
See copyright statement.