netscape.ldap.controls

Class LDAPPasswordExpiringControl

Implemented Interfaces:
Cloneable, java.io.Serializable

public class LDAPPasswordExpiringControl
extends netscape.ldap.controls.LDAPStringControl

Represents an LDAP v3 server control that may be returned if a password is about to expire, and password policy is enabled on the server. The OID for this control is 2.16.840.1.113730.3.4.5.

Version:
1.0
See Also:
LDAPControl, Serialized Form

Field Summary

static String
EXPIRING

Fields inherited from class netscape.ldap.controls.LDAPStringControl

m_msg

Fields inherited from class netscape.ldap.LDAPControl

MANAGEDSAIT, PWEXPIRED, PWEXPIRING, m_critical, m_value

Constructor Summary

LDAPPasswordExpiringControl(String oid, boolean critical, byte[] value)
Contructs an LDAPPasswordExpiringControl object.

Method Summary

String
getMessage()
Gets the value associated with this control parsed as a string.
int
getSecondsToExpiration()
Gets the number of seconds until the password expires returned by the server.
static String
parseResponse(LDAPControl[] controls)
Deprecated. LDAPPasswordExpiringControl controls are now automatically instantiated.
String
toString()

Methods inherited from class netscape.ldap.controls.LDAPStringControl

parseResponse

Methods inherited from class netscape.ldap.LDAPControl

clone, createControl, flattenBER, getID, getValue, isCritical, lookupControlClass, newInstance, register, toString

Field Details

EXPIRING

public static final String EXPIRING

Constructor Details

LDAPPasswordExpiringControl

public LDAPPasswordExpiringControl(String oid,
                                   boolean critical,
                                   byte[] value)
            throws LDAPException
Contructs an LDAPPasswordExpiringControl object. This constructor is used by LDAPControl.register to instantiate password expiring controls.

To retrieve the number of seconds until this password expires, call getSecondsToExpiration.

Parameters:
oid - this parameter must be LDAPPasswordExpiringControl.EXPIRING or an LDAPException is thrown
critical - true if this control is critical
value - the value associated with this control
Throws:
LDAPException - If oid is not LDAPPasswordExpiringControl.EXPIRING.

Method Details

getMessage

public String getMessage()
Gets the value associated with this control parsed as a string.
Returns:
the value associated with this control parsed as a string.

getSecondsToExpiration

public int getSecondsToExpiration()
Gets the number of seconds until the password expires returned by the server.
Returns:
int the number of seconds until the password expires.

parseResponse

public static String parseResponse(LDAPControl[] controls)

Deprecated. LDAPPasswordExpiringControl controls are now automatically instantiated.

Parameters:
controls - an array of LDAPControl objects, representing the controls returned by the server. after a search. To get these controls, use the getResponseControls method of the LDAPConnection class.
Returns:
an error message string, or null if none is in the control.

toString

public String toString()
Overrides:
toString in interface LDAPControl