|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.jndi.ldap.BasicControl
com.sun.jndi.ldap.ctl.PasswordExpiringResponseControl
public class PasswordExpiringResponseControl
This class implements the LDAP response control notifying
password expiration. The Password Expiring control is a notification
to the client when password is about to expiring according to the
server's password policy.
This control should be checked whenever a LDAP bind operation is
performed as a result of operations on the context such as when a new
initial context is created or when InitialLdapContext.reconnect
is called.
The Password Expiring control is defined in draft-vchu-ldap-pwd-policy-00.txt
The object identifier for Password Expiry is 2.16.840.1.113730.3.4.5 and the value returned indicates the time left until the password expires. The control's value has the following ASN.1 definition:
PasswordExpiring ::= OCTET STRING ; time in seconds until the
; password expires
The following code sample shows how the control may be used:
// create an initial context using the supplied environment properties
LdapContext ctx = new InitialLdapContext(env, null);
Control[] respControls;
// retrieve response controls
if ((respControls = ctx.getResponseControls()) != null) {
for (int i = 0; i < respControls.length; i++) {
// locate the password expiring control
if (respControls[i] instanceof PasswordExpiringResponseControl) {
System.out.println("Password expires in " +
((PasswordExpiringResponseControl) respControls[i])
.timeRemaining() + " seconds");
}
}
}
PasswordExpiredResponseControl,
Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
OID
The password expiring control's assigned object identifier is 2.16.840.1.113730.3.4.5. |
private static long |
serialVersionUID
|
private long |
timeLeft
The time remaining until the password expires |
| Fields inherited from class com.sun.jndi.ldap.BasicControl |
|---|
criticality, id, value |
| Fields inherited from interface javax.naming.ldap.Control |
|---|
CRITICAL, NONCRITICAL |
| Constructor Summary | |
|---|---|
PasswordExpiringResponseControl(java.lang.String id,
boolean criticality,
byte[] value)
Constructs a control to notify of password expiration. |
|
| Method Summary | |
|---|---|
byte[] |
getEncodedValue()
Retrieves the PasswordExpiring control response's ASN.1 BER encoded value. |
long |
timeRemaining()
The time remaining until the password expires. |
| Methods inherited from class com.sun.jndi.ldap.BasicControl |
|---|
getID, isCritical |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String OID
private long timeLeft
private static final long serialVersionUID
| Constructor Detail |
|---|
PasswordExpiringResponseControl(java.lang.String id,
boolean criticality,
byte[] value)
throws java.io.IOException
id - The control's object identifier string.criticality - The control's criticality.value - The control's ASN.1 BER encoded value.
May be null.
java.io.IOException - if an error is encountered
while decoding the control's value.| Method Detail |
|---|
public long timeRemaining()
public byte[] getEncodedValue()
getEncodedValue in interface javax.naming.ldap.ControlgetEncodedValue in class com.sun.jndi.ldap.BasicControl
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||