netscape.ldap.controls
Class LDAPPasswordExpiringControl
java.lang.Object
|
+--netscape.ldap.LDAPControl
|
+--netscape.ldap.controls.LDAPStringControl
|
+--netscape.ldap.controls.LDAPPasswordExpiringControl
- All Implemented Interfaces:
- java.lang.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.
- See Also:
LDAPControl
, Serialized Form
Field Summary |
static java.lang.String |
EXPIRING
|
protected java.lang.String |
m_msg
|
Constructor Summary |
LDAPPasswordExpiringControl(java.lang.String oid,
boolean critical,
byte[] value)
Contructs an LDAPPasswordExpiringControl object.
|
Method Summary |
java.lang.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 java.lang.String |
parseResponse(LDAPControl[] controls)
Deprecated. LDAPPasswordExpiringControl controls are now automatically
instantiated. |
static java.lang.String |
parseResponse(LDAPControl[] controls,
java.lang.String type)
Parses a response control sent by the server and
retrieves a string.
|
java.lang.String |
toString()
Return a string representation of the control for debugging |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
EXPIRING
public static final java.lang.String EXPIRING
m_msg
protected java.lang.String m_msg
LDAPPasswordExpiringControl
public LDAPPasswordExpiringControl(java.lang.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 throwncritical
- true
if this control is criticalvalue
- the value associated with this control- Throws:
LDAPException
- If oid is not
LDAPPasswordExpiringControl.EXPIRING.
- See Also:
LDAPControl.register(java.lang.String, java.lang.Class)
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:
java.lang.NumberFormatException
- If the server returned an
undecipherable message. In this case, use getMessage
to
retrieve the message as a string.
getMessage
public java.lang.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
public static java.lang.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.
- See Also:
LDAPConnection.getResponseControls()
toString
public java.lang.String toString()
- Description copied from class:
LDAPControl
- Return a string representation of the control for debugging
- Overrides:
toString
in class LDAPControl
- Following copied from class:
netscape.ldap.LDAPControl
- Returns:
- a string representation of the control.
parseResponse
public static java.lang.String parseResponse(LDAPControl[] controls,
java.lang.String type)
- 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 the
LDAPConnection
class.
- 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.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:
LDAPConnection.getResponseControls()