com.novell.security.nmas.mgmt
Class NMASPwdMgr

java.lang.Object
  |
  +--com.novell.security.nmas.mgmt.NMASPwdMgr

public final class NMASPwdMgr
extends java.lang.Object

Provides a simple set of controls to access (set, get and delete) the NMAS password.


Constructor Summary
NMASPwdMgr(javax.naming.ldap.LdapContext ldapCtx)
          Instantiates the NMASPwdMgr constructor.
NMASPwdMgr(com.novell.security.nmas.mgmt.PwdTransport pwdTransport)
          Specifies the NMASPwdMgr constructor.
 
Method Summary
 void changePwd(java.lang.String tName, java.lang.String objectDN, java.lang.String oldPwd, java.lang.String newPwd)
          Changes the password for the specified object.
 void deletePwd(java.lang.String tName, java.lang.String objectDN)
          Deletes the password for the specified object.
 java.lang.String getPwd(java.lang.String tName, java.lang.String objectDN)
          Reads the password from the given object.
 java.lang.String getPwdPolicyDN(java.lang.String sTreeName, java.lang.String sUserDN)
          Gets the DN of the spwd Policy assigned to this user object.
 java.lang.String getPwdPolicyDNX500(java.lang.String sUserDN)
          Gets the x500 form of the DN of the spwd Policy assigned to this user object.
 com.novell.security.nmas.mgmt.NMASPwdStatus getPwdStatus(java.lang.String tName, java.lang.String objectDN)
          Returns an object containing the password status.
 int pwdPolicyCheck(java.lang.String tName, java.lang.String objectDN, java.lang.String pwd)
          Verifies the valid password for the current policy.
 void setPwd(java.lang.String tName, java.lang.String objectDN, java.lang.String data)
          Sets the password of the specified object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NMASPwdMgr

public NMASPwdMgr(javax.naming.ldap.LdapContext ldapCtx)
Instantiates the NMASPwdMgr constructor.

Parameters:
ldapCtx - An LdapContext object that has been initialized and authenticated by the caller.

NMASPwdMgr

public NMASPwdMgr(com.novell.security.nmas.mgmt.PwdTransport pwdTransport)
Specifies the NMASPwdMgr constructor.

Parameters:
pwdTransport - A PwdTransport object initialized with the appropriate connection.
Method Detail

setPwd

public void setPwd(java.lang.String tName,
                   java.lang.String objectDN,
                   java.lang.String data)
            throws NMASPwdException
Sets the password of the specified object.

Parameters:
tName - The eDirectory tree name.
objectDN - The distinguished name of the object to write password data to.
data - A string containing the password to be written.
Throws:
NMASPwdException - NMASPwdException contains the NMAS error code.

getPwd

public java.lang.String getPwd(java.lang.String tName,
                               java.lang.String objectDN)
                        throws NMASPwdException
Reads the password from the given object.

Parameters:
tName - The eDirectory tree name.
objectDN - The distinguished name of the object to write password data to.
Returns:
String A string containing the password data read.
Throws:
NMASPwdException - contains the NMAS error code.

deletePwd

public void deletePwd(java.lang.String tName,
                      java.lang.String objectDN)
               throws NMASPwdException
Deletes the password for the specified object.

Parameters:
tName - The eDirectory tree name.
objectDN - The distinguished name of the object to write password data to.
Throws:
NMASPwdException - contains the NMAS error code.

changePwd

public void changePwd(java.lang.String tName,
                      java.lang.String objectDN,
                      java.lang.String oldPwd,
                      java.lang.String newPwd)
               throws NMASPwdException
Changes the password for the specified object.

Parameters:
tName - The eDirectory tree name.
objectDN - The distinguished name of the object on which to change the password.
oldPwd - A string containing the old password.
newPwd - A string containing the new password.
Throws:
NMASPwdException - contains the NMAS error code.

pwdPolicyCheck

public int pwdPolicyCheck(java.lang.String tName,
                          java.lang.String objectDN,
                          java.lang.String pwd)
                   throws NMASPwdException
Verifies the valid password for the current policy. If a null password is passed in, the transport will set a flag to check the existing password.

Parameters:
pwd - The password to be checked for policy compliance.
tName - The eDirectory tree name.
objectDN - The distinguished name of the object on which to write password data.
Returns:
void
Throws:
NMASPwdException - contains the NMAS error code.

getPwdPolicyDN

public java.lang.String getPwdPolicyDN(java.lang.String sTreeName,
                                       java.lang.String sUserDN)
                                throws NMASPwdException
Gets the DN of the spwd Policy assigned to this user object.

Parameters:
sTreeName - The eDirectory tree name.
sUserDN - The distinguished name of the user object.
Returns:
String A string containing the DN of the spwd Policy.
Throws:
NMASPwdException - contains the NMAS error code.

getPwdPolicyDNX500

public java.lang.String getPwdPolicyDNX500(java.lang.String sUserDN)
                                    throws NMASPwdException
Gets the x500 form of the DN of the spwd Policy assigned to this user object.

Parameters:
sUserDN - The distinguished name of the user object.
Returns:
String A string containing the DN of the spwd Policy.
Throws:
NMASPwdException - contains the NMAS error code.

getPwdStatus

public com.novell.security.nmas.mgmt.NMASPwdStatus getPwdStatus(java.lang.String tName,
                                                                java.lang.String objectDN)
                                                         throws NMASPwdException
Returns an object containing the password status. The object has accessor methods to report the status values.

Parameters:
tName - The eDirectory tree name.
objectDN - The distinguished name of the object in which to write password data.
Returns:
NMASPwdStatus An object containing the password status.
Throws:
NMASPwdException - contains the NMAS error code.