Package netscape.ldap.controls
Class LDAPPasswordExpiringControl
java.lang.Object
netscape.ldap.LDAPControl
netscape.ldap.controls.LDAPPasswordExpiringControl
- All Implemented Interfaces:
Serializable
,Cloneable
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:
-
Field Summary
FieldsFields inherited from class netscape.ldap.LDAPControl
m_critical, m_value, MANAGEDSAIT, PWEXPIRED, PWEXPIRING
-
Constructor Summary
ConstructorsConstructorDescriptionLDAPPasswordExpiringControl
(String oid, boolean critical, byte[] value) Contructs anLDAPPasswordExpiringControl
object. -
Method Summary
Modifier and TypeMethodDescriptionGets the value associated with this control parsed as a string.int
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.static String
parseResponse
(LDAPControl[] controls, String type) Parses a response control sent by the server and retrieves a string.toString()
Return a string representation of the control for debuggingMethods inherited from class netscape.ldap.LDAPControl
clone, createControl, flattenBER, getID, getValue, isCritical, lookupControlClass, newInstance, register
-
Field Details
-
EXPIRING
- See Also:
-
m_msg
-
-
Constructor Details
-
LDAPPasswordExpiringControl
Contructs anLDAPPasswordExpiringControl
object. This constructor is used byLDAPControl.register
to instantiate password expiring controls.To retrieve the number of seconds until this password expires, call
getSecondsToExpiration
.- Parameters:
oid
- this parameter must beLDAPPasswordExpiringControl.EXPIRING
or anLDAPException
is throwncritical
-true
if this control is criticalvalue
- the value associated with this control- Throws:
LDAPException
- If oid is notLDAPPasswordExpiringControl.EXPIRING.
- See Also:
-
-
Method Details
-
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.
- Throws:
NumberFormatException
- If the server returned an undecipherable message. In this case, usegetMessage
to retrieve the message as a string.
-
getMessage
Gets the value associated with this control parsed as a string.- Returns:
- the value associated with this control parsed as a string.
-
parseResponse
Deprecated.LDAPPasswordExpiringControl controls are now automatically instantiated.- Parameters:
controls
- an array ofLDAPControl
objects, representing the controls returned by the server. after a search. To get these controls, use thegetResponseControls
method of theLDAPConnection
class.- Returns:
- an error message string, or null if none is in the control.
- See Also:
-
toString
Description copied from class:LDAPControl
Return a string representation of the control for debugging- Overrides:
toString
in classLDAPControl
- Returns:
- a string representation of the control.
-
parseResponse
Parses a response control sent by the server and retrieves a string.You can get the controls returned by the server by using the
getResponseControls
method of theLDAPConnection
class.- Parameters:
controls
- an array ofLDAPControl
objects, representing the controls returned by the server after a search. To get these controls, use thegetResponseControls
method of theLDAPConnection
class.type
- the OID of the control to look for- Returns:
- a message string, or null if the server did not return a string.
- See Also:
-