4.0 RTM main dev tree synch up

This commit is contained in:
miodrag%netscape.com 1999-09-15 18:32:21 +00:00
Родитель 57c84af12e
Коммит 4b1816dced
96 изменённых файлов: 2736 добавлений и 2340 удалений

Просмотреть файл

@ -130,9 +130,10 @@ ifndef JAVAC
endif
BERDOCCLASSES=netscape.ldap.ber.stream
SASLDOCCLASSES=com.netscape.sasl com.netscape.sasl.mechanisms
DOCCLASSES=netscape.ldap netscape.ldap.beans netscape.ldap.controls \
netscape.ldap.util $(TOOLSDIR)/*.java $(BERDOCCLASSES)
netscape.ldap.util $(SASLDOCCLASSES) $(TOOLSDIR)/*.java $(BERDOCCLASSES)
all: classes

Просмотреть файл

@ -19,7 +19,6 @@ package netscape.ldap;
import java.util.*;
import java.io.*;
import javax.security.auth.callback.CallbackHandler;
/**
* Encapsulates a connection to an LDAP server, providing access to the input queue
@ -33,11 +32,11 @@ public interface LDAPAsynchronousConnection {
* Adds an entry to the directory.
*
* @param entry LDAPEntry object specifying the distinguished name and
* attributes of the new entry.
* @param listener Handler for messages returned from a server in response
* attributes of the new entry
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @param cons Constraints specific to the operation.
* @return LDAPSearchListener Handler for messages returned from a server
* @param cons constraints specific to the operation
* @return LDAPSearchListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPEntry
@ -55,11 +54,11 @@ public interface LDAPAsynchronousConnection {
* <P>
*
* @param entry LDAPEntry object specifying the distinguished name and
* attributes of the new entry.
* @param listener Handler for messages returned from a server in response
* attributes of the new entry
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @param cons Constraints specific to the operation.
* @return LDAPResponseListener Handler for messages returned from a server
* @param cons constraints specific to the operation
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPEntry
@ -79,15 +78,15 @@ public interface LDAPAsynchronousConnection {
* reconnect to the server. If the object had already authenticated, the
* old authentication is discarded.
*
* @param dn If non-null and non-empty, specifies that the connection
* @param dn if non-null and non-empty, specifies that the connection
* and all operations through it should be authenticated with dn as the
* distinguished name.
* @param passwd If non-null and non-empty, specifies that the connection
* distinguished name
* @param passwd if non-null and non-empty, specifies that the connection
* and all operations through it should be authenticated with dn as the
* distinguished name and passwd as password.
* @param listener Handler for messages returned from a server in response
* distinguished name and passwd as password
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @return LDAPResponseListener Handler for messages returned from a server
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPResponseListener
@ -106,16 +105,16 @@ public interface LDAPAsynchronousConnection {
* reconnect to the server. If the object had already authenticated, the
* old authentication is discarded.
*
* @param dn If non-null and non-empty, specifies that the connection
* @param dn if non-null and non-empty, specifies that the connection
* and all operations through it should be authenticated with dn as the
* distinguished name.
* @param passwd If non-null and non-empty, specifies that the connection
* distinguished name
* @param passwd if non-null and non-empty, specifies that the connection
* and all operations through it should be authenticated with dn as the
* distinguished name and passwd as password.
* @param listener Handler for messages returned from a server in response
* distinguished name and passwd as password
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @param cons Constraints specific to the operation.
* @return LDAPResponseListener Handler for messages returned from a server
* @param cons constraints specific to the operation
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPResponseListener
@ -132,10 +131,10 @@ public interface LDAPAsynchronousConnection {
/**
* Deletes the entry for the specified DN from the directory.
*
* @param dn Distinguished name of the entry to delete.
* @param listener Handler for messages returned from a server in response
* @param dn distinguished name of the entry to delete
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @return LDAPResponseListener Handler for messages returned from a server
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPResponseListener
@ -148,11 +147,11 @@ public interface LDAPAsynchronousConnection {
/**
* Deletes the entry for the specified DN from the directory.
*
* @param dn Distinguished name of the entry to delete.
* @param listener Handler for messages returned from a server in response
* @param dn distinguished name of the entry to delete
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @param cons Constraints specific to the operation.
* @return LDAPResponseListener Handler for messages returned from a server
* @param cons constraints specific to the operation
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPResponseListener
@ -171,11 +170,11 @@ public interface LDAPAsynchronousConnection {
* The LDAPModification object specifies both the change to be made and
* the LDAPAttribute value to be changed.
*
* @param dn Distinguished name of the entry to modify.
* @param mod A single change to be made to an entry.
* @param listener Handler for messages returned from a server in response
* @param dn distinguished name of the entry to modify
* @param mod a single change to make to an entry
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @return LDAPResponseListener Handler for messages returned from a server
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPModification
@ -193,12 +192,12 @@ public interface LDAPAsynchronousConnection {
* The LDAPModification object specifies both the change to be made and
* the LDAPAttribute value to be changed.
*
* @param dn Distinguished name of the entry to modify.
* @param mod A single change to be made to an entry.
* @param listener Handler for messages returned from a server in response
* @param dn distinguished name of the entry to modify
* @param mod a single change to make to an entry
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @param cons Constraints specific to the operation.
* @return LDAPResponseListener Handler for messages returned from a server
* @param cons constraints specific to the operation
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPModification
@ -216,11 +215,11 @@ public interface LDAPAsynchronousConnection {
* example, changes attribute values, adds new attribute values, or
* removes existing attribute values).
* <P>
* @param dn Distinguished name of the entry to modify.
* @param mods A set of modifications to be made to the entry.
* @param listener Handler for messages returned from a server in response
* @param dn distinguished name of the entry to modify
* @param mods a set of modifications to make to the entry
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @return LDAPResponseListener Handler for messages returned from a server
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPModificationSet
@ -236,12 +235,12 @@ public interface LDAPAsynchronousConnection {
* example, changes attribute values, adds new attribute values, or
* removes existing attribute values).
*
* @param dn Distinguished name of the entry to modify.
* @param mods A set of modifications to be made to the entry.
* @param listener Handler for messages returned from a server in response
* @param dn distinguished name of the entry to modify
* @param mods a set of modifications to make to the entry
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @param cons Constraints specific to the operation.
* @return LDAPResponseListener Handler for messages returned from a server
* @param cons constraints specific to the operation
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPModificationSet
@ -258,13 +257,13 @@ public interface LDAPAsynchronousConnection {
/**
* Renames an existing entry in the directory.
*
* @param dn Current distinguished name of the entry.
* @param newRdn New relative distinguished name for the entry.
* @param deleteOldRdn If true, the old name is not retained as an
* attribute value.
* @param listener Handler for messages returned from a server in response
* @param dn current distinguished name of the entry
* @param newRdn new relative distinguished name for the entry
* @param deleteOldRdn if <code>true</code>, the old name is not retained as an
* attribute value
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @return LDAPResponseListener Handler for messages returned from a server
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPResponseListener
@ -278,13 +277,14 @@ public interface LDAPAsynchronousConnection {
/**
* Renames an existing entry in the directory.
*
* @param dn Current distinguished name of the entry.
* @param newRdn New relative distinguished name for the entry.
* @param deleteOldRdn If true, the old name is not retained as an
* @param listener Handler for messages returned from a server in response
* @param dn current distinguished name of the entry
* @param newRdn new relative distinguished name for the entry
* @param deleteOldRdn if <code>true</code>, the old name is not retained as an
* attribute value
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @param cons Constraints specific to the operation.
* @return LDAPResponseListener Handler for messages returned from a server
* @param cons constraints specific to the operation
* @return LDAPResponseListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPResponseListener
@ -301,26 +301,25 @@ public interface LDAPAsynchronousConnection {
* Performs the search specified by the criteria that you enter. <P>
* To abandon the search, use the <CODE>abandon</CODE> method.
*
* @param base The base distinguished name to search from
* @param scope The scope of the entries to search. You can specify one
* @param base the base distinguished name from which to search
* @param scope the scope of the entries to search. You can specify one
* of the following: <P>
* <UL>
* <LI><CODE>LDAPv2.SCOPE_BASE</CODE> (search only the base DN) <P>
* <LI><CODE>LDAPv2.SCOPE_ONE</CODE>
* (search only entries under the base DN) <P>
* (search only those entries that are one level below the base DN) <P>
* <LI><CODE>LDAPv2.SCOPE_SUB</CODE>
* (search the base DN and all entries within its subtree) <P>
* </UL>
* <P>
* @param filter Search filter specifying the search criteria.
* @param attrs List of attributes that you want returned in the
* search results.
* @param typesOnly If true, returns the names but not the values of the
* attributes found. If false, returns the names and values for
* attributes found
* @param listener Handler for messages returned from a server in response
* @param filter search filter specifying the search criteria
* @param attrs list of attributes to return in the search results
* @param typesOnly if <code>true</code>, returns the names but not the values of the
* attributes found. If <code>false</code>, returns the names and values of the
* attributes found.
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @return LDAPSearchListener Handler for messages returned from a server
* @return LDAPSearchListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPAsynchronousConnection#abandon(netscape.ldap.LDAPSearchListener)
@ -340,28 +339,27 @@ public interface LDAPAsynchronousConnection {
* maximum time to wait for search results). <P>
* To abandon the search, use the <CODE>abandon</CODE> method.
*
* @param base The base distinguished name to search from
* @param scope The scope of the entries to search. You can specify one
* @param base the base distinguished name from which to search
* @param scope the scope of the entries to search. You can specify one
* of the following: <P>
* <UL>
* <LI><CODE>LDAPv2.SCOPE_BASE</CODE> (search only the base DN) <P>
* <LI><CODE>LDAPv2.SCOPE_ONE</CODE>
* (search only entries under the base DN) <P>
* (search only those entries that are one level below the base DN) <P>
* <LI><CODE>LDAPv2.SCOPE_SUB</CODE>
* (search the base DN and all entries within its subtree) <P>
* </UL>
* <P>
* @param filter Search filter specifying the search criteria.
* @param attrs List of attributes that you want returned in the search
* results.
* @param typesOnly If true, returns the names but not the values of the
* attributes found. If false, returns the names and values for
* @param filter search filter specifying the search criteria
* @param attrs list of attributes to return in the search results
* @param typesOnly if <code>true</code>, returns the names but not the values of the
* attributes found. If <code>false</code>, returns the names and values for
* attributes found.
* @param listener Handler for messages returned from a server in response
* @param listener handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @param cons Constraints specific to this search (for example, the
* maximum number of entries to return).
* @return LDAPSearchListener Handler for messages returned from a server
* @param cons constraints specific to this search (for example, the
* maximum number of entries to return)
* @return LDAPSearchListener handler for messages returned from a server
* in response to this request.
* @exception LDAPException Failed to send request.
* @see netscape.ldap.LDAPAsynchronousConnection#abandon(netscape.ldap.LDAPSearchListener)
@ -376,18 +374,18 @@ public interface LDAPAsynchronousConnection {
throws LDAPException;
/**
* Compare an attribute value with one in the directory. The result can
* be obtained by calling <CODE>getResultCode</CODE> on the
* Compares an attribute value with one in the directory. The result
* is obtained by calling <CODE>getResultCode</CODE> on the
* <CODE>LDAPResponse</CODE> from the <CODE>LDAPResponseListener</CODE>.
* The code will be <CODE>LDAPException.COMPARE_TRUE</CODE> or
* <CODE>LDAPException.COMPARE_FALSE</CODE>.
*
* @param dn Distinguished name of the entry to compare.
* @param attr Attribute with a value to compare.
* @param listener Handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @return LDAPResponseListener Handler for messages returned from a server
* in response to this request.
* @param dn distinguished name of the entry to compare
* @param attr attribute with a value to compare
* @param listener handler for messages returned from a server in response
* to the specified request. If it is null, a listener object is created internally.
* @return LDAPResponseListener handler for messages returned from a server
* in response to the specified request.
* @exception LDAPException Failed to send request.
*/
public LDAPResponseListener compare(String dn,
@ -396,19 +394,19 @@ public interface LDAPAsynchronousConnection {
throws LDAPException;
/**
* Compare an attribute value with one in the directory. The result can
* be obtained by calling <CODE>getResultCode</CODE> on the
* Compares an attribute value with one in the directory. The result
* is obtained by calling <CODE>getResultCode</CODE> on the
* <CODE>LDAPResponse</CODE> from the <CODE>LDAPResponseListener</CODE>.
* The code will be <CODE>LDAPException.COMPARE_TRUE</CODE> or
* <CODE>LDAPException.COMPARE_FALSE</CODE>.
*
* @param dn Distinguished name of the entry to compare.
* @param attr Attribute with a value to compare.
* @param listener Handler for messages returned from a server in response
* to this request. If it is null, a listener object is created internally.
* @param cons Constraints specific to this operation.
* @return LDAPResponseListener Handler for messages returned from a server
* in response to this request.
* @param dn distinguished name of the entry to compare
* @param attr attribute with a value to compare
* @param listener handler for messages returned from a server in response
* to the specified request. If it is null, a listener object is created internally.
* @param cons constraints specific to this operation
* @return LDAPResponseListener handler for messages returned from a server
* in response to the specified request.
* @exception LDAPException Failed to send request.
*/
public LDAPResponseListener compare(String dn,
@ -421,7 +419,7 @@ public interface LDAPAsynchronousConnection {
* Cancels the ldap request with the specified id and discards
* any results already received.
*
* @param id A LDAP request id
* @param id an LDAP request ID
* @exception LDAPException Failed to send request.
*/
public void abandon(int id) throws LDAPException;
@ -430,7 +428,7 @@ public interface LDAPAsynchronousConnection {
* Cancels all outstanding search requests associated with this
* LDAPSearchListener object and discards any results already received.
*
* @param searchlistener A search listener returned from a search.
* @param searchlistener a search listener returned from a search
* @exception LDAPException Failed to send request.
*/
public void abandon(LDAPSearchListener searchlistener)

Просмотреть файл

@ -32,14 +32,14 @@ public class LDAPAttribute {
private String name = null;
private byte[] nameBuf = null;
/**
* Internally, it is a list of "byte[]"-based attribute values.
* Internally, this is a list of "byte[]"-based attribute values.
*/
private Object values[] = new Object[0];
/**
* Constructs an attribute from another existing attribute.
* Effectively, this makes a copy of the existing attribute.
* @param attr The attribute to copy
* @param attr the attribute to copy
*/
public LDAPAttribute( LDAPAttribute attr ) {
name = attr.name;
@ -54,7 +54,7 @@ public class LDAPAttribute {
/**
* Constructs an attribute with no values.
* @param attrName Name of the attribute.
* @param attrName name of the attribute
*/
public LDAPAttribute( String attrName ) {
name = attrName;
@ -62,8 +62,8 @@ public class LDAPAttribute {
/**
* Constructs an attribute with a byte-formatted value.
* @param attrName Name of the attribute.
* @param attrValue Value of the attribute in byte format.
* @param attrName name of the attribute
* @param attrValue value of the attribute in byte format
*/
public LDAPAttribute( String attrName, byte[] attrValue ) {
name = attrName;
@ -72,8 +72,8 @@ public class LDAPAttribute {
/**
* Constructs an attribute that has a single string value.
* @param attrName Name of the attribute.
* @param attrValue Value of the attribute in String format.
* @param attrName name of the attribute
* @param attrValue value of the attribute in String format
*/
public LDAPAttribute( String attrName, String attrValue ) {
name = attrName;
@ -82,8 +82,8 @@ public class LDAPAttribute {
/**
* Constructs an attribute that has an array of string values.
* @param attrName Name of the attribute.
* @param attrValues The list of string values for this attribute.
* @param attrName name of the attribute
* @param attrValues the list of string values for this attribute
*/
public LDAPAttribute( String attrName, String[] attrValues ) {
name = attrName;
@ -96,7 +96,7 @@ public class LDAPAttribute {
* Constructs an attribute from a BER (Basic Encoding Rules) element.
* (The protocol elements of LDAP are encoded for exchange using the
* Basic Encoding Rules.)
* @param element Element that you want translated into an attribute.
* @param element element that you want translated into an attribute
* @exception IOException The attribute could not be created from
* the specified element.
*/
@ -116,7 +116,7 @@ public class LDAPAttribute {
/**
* Returns the number of values of the attribute.
* @return Number of values for this attribute.
* @return number of values for this attribute.
*/
public int size() {
return values.length;
@ -124,7 +124,7 @@ public class LDAPAttribute {
/**
* Returns an enumerator for the string values of an attribute.
* @return Enumerator for the string values.
* @return enumerator for the string values.
*/
public Enumeration getStringValues() {
Vector v = new Vector();
@ -144,10 +144,11 @@ public class LDAPAttribute {
return v.elements();
}
/**
* Returns a array for the values of the attribute as <CODE>String</CODE> objects.
* @return Array of attribute values. Each element in the array
* will be a <CODE>String</CODE> object.
/**
* Returns the values of the attribute as an array of <CODE>String</CODE>
* objects.
* @return array of attribute values. Each element in the array
* is a <CODE>String</CODE> object.
*/
public String[] getStringValueArray() {
@ -171,8 +172,8 @@ public class LDAPAttribute {
/**
* Returns an enumerator for the values of the attribute in <CODE>byte[]</CODE>
* format.
* @return A set of attribute values. Each element in the enumeration
* will be of type <CODE>byte[]</CODE>.
* @return a set of attribute values. Each element in the enumeration
* is of type <CODE>byte[]</CODE>.
*/
public Enumeration getByteValues() {
Vector v = new Vector();
@ -188,10 +189,10 @@ public class LDAPAttribute {
return v.elements();
}
/**
* Returns an array for the values of the attribute in <CODE>byte[]</CODE>
/**
* Returns the values of the attribute in an array of <CODE>byte[]</CODE>
* format.
* @return Array of attribute values. Each element in the array
* @return array of attribute values. Each element in the array
* will be of type <CODE>byte[]</CODE>.
*/
public byte[][] getByteValueArray() {
@ -213,7 +214,7 @@ public class LDAPAttribute {
/**
* Returns the name of the attribute.
* @return Name of the attribute.
* @return name of the attribute.
*/
public String getName() {
if ((name == null) && (nameBuf != null)) {
@ -231,8 +232,8 @@ public class LDAPAttribute {
* and <CODE>phonetic</CODE>.
* <P>
*
* @param attrName Name of the attribute to extract the subtypes from
* @return Array of subtypes, or null (if the name has no subtypes)
* @param attrName name of the attribute from which to extract the subtypes
* @return array of subtypes, or null (if the name has no subtypes).
* @see netscape.ldap.LDAPAttribute#getBaseName
*/
public static String[] getSubtypes(String attrName) {
@ -257,7 +258,7 @@ public class LDAPAttribute {
* containing <CODE>lang-ja</CODE> and <CODE>phonetic</CODE>.
*<P>
*
* @return Array of subtypes, or null (if the name has no subtypes)
* @return array of subtypes, or null (if the name has no subtypes).
*/
public String[] getSubtypes() {
return getSubtypes(getName());
@ -270,7 +271,7 @@ public class LDAPAttribute {
* returns the String <CODE>lang-ja</CODE>.
*<P>
*
* @return The language subtype, or null (if the name has no
* @return the language subtype, or null (if the name has no
* language subtype).
*/
public String getLangSubtype() {
@ -291,8 +292,8 @@ public class LDAPAttribute {
* this method returns <CODE>cn</CODE>.
* <P>
*
* @param attrName Name of the attribute from which to extract the base name
* @return Base name (the attribute name without any subtypes)
* @param attrName name of the attribute from which to extract the base name
* @return base name (the attribute name without any subtypes).
* @see netscape.ldap.LDAPAttribute#getSubtypes
*/
public static String getBaseName(String attrName) {
@ -311,7 +312,7 @@ public class LDAPAttribute {
* <CODE>cn</CODE>.
* <P>
*
* @return Base name (the attribute name without any subtypes)
* @return base name (the attribute name without any subtypes).
* @see netscape.ldap.LDAPAttribute#getSubtypes
*/
public String getBaseName() {
@ -319,14 +320,14 @@ public class LDAPAttribute {
}
/**
* Report if the attribute name contains the specified subtype.
* Reports whether the attribute name contains the specified subtype.
* For example, if you check for the subtype <CODE>lang-en</CODE>
* and the attribute name is <CODE>cn;lang-en</CODE>, this method
* returns <CODE>true</CODE>.
* <P>
*
* @param subtype The single subtype that you want to check for
* @return true if the attribute name contains the specified subtype
* @param subtype the single subtype for which you want to check
* @return true if the attribute name contains the specified subtype.
* @see netscape.ldap.LDAPAttribute#getSubtypes
*/
public boolean hasSubtype(String subtype) {
@ -339,14 +340,14 @@ public class LDAPAttribute {
}
/**
* Report if the attribute name contains all specified subtypes
* Reports if the attribute name contains all specified subtypes
* For example, if you check for the subtypes <CODE>lang-en</CODE>
* and <CODE>phonetic</CODE> and if the attribute name is
* and <CODE>phonetic</CODE> and the attribute name is
* <CODE>cn;lang-en;phonetic</CODE>, this method returns <CODE>true</CODE>.
* If the attribute name is <CODE>cn;phonetic</CODE> or
* <CODE>cn;lang-en</CODE>, this method returns <CODE>false</CODE>.
* <P>
* @param subtypes An array of subtypes to check
* @param subtypes an array of subtypes to check
* @return true if the attribute name contains all subtypes
* @see netscape.ldap.LDAPAttribute#getSubtypes
*/
@ -360,7 +361,7 @@ public class LDAPAttribute {
/**
* Adds a string value to the attribute.
* @param attrValue The string value that you want to add to the attribute.
* @param attrValue the string value to add to the attribute
*/
public synchronized void addValue( String attrValue ) {
if (attrValue != null) {
@ -374,7 +375,7 @@ public class LDAPAttribute {
/**
* Sets the string values as the attribute's values.
* @param attrValues The string values that you want to use in the attribute.
* @param attrValues the string values to use in the attribute
*/
protected void setValues( String[] attrValues ) {
Object[] vals;
@ -394,8 +395,8 @@ public class LDAPAttribute {
/**
* Adds a <CODE>byte[]</CODE>-formatted value to the attribute.
* @param attrValue The <CODE>byte[]</CODE>-formatted value that you
* want to add to the attribute.
* @param attrValue the <CODE>byte[]</CODE>-formatted value to
* add to the attribute
*/
public synchronized void addValue( byte[] attrValue ) {
if (attrValue != null) {
@ -409,7 +410,7 @@ public class LDAPAttribute {
/**
* Sets the byte[] values as the attribute's values.
* @param attrValues The values that you want to use in the attribute.
* @param attrValues the values to use in the attribute
*/
protected synchronized void setValues( Object[] attrValues ) {
values = attrValues;
@ -417,7 +418,7 @@ public class LDAPAttribute {
/**
* Removes a string value from the attribute.
* @param attrValue The string value that you want removed.
* @param attrValue the string value to remove
*/
public synchronized void removeValue( String attrValue) {
if (attrValue != null) {
@ -431,7 +432,7 @@ public class LDAPAttribute {
/**
* Removes a <CODE>byte[]</CODE>-formatted value from the attribute.
* @param attrValue <CODE>byte[]</CODE>-formatted value that you want removed.
* @param attrValue <CODE>byte[]</CODE>-formatted value to remove
*/
public synchronized void removeValue( byte[] attrValue) {
if ((attrValue == null) || (values == null)|| (values.length < 1))
@ -467,10 +468,10 @@ public class LDAPAttribute {
}
/**
* Retrieves the BER (Basic Encoding Rules) representation of attribute.
* Retrieves the BER (Basic Encoding Rules) representation of an attribute.
* (The protocol elements of LDAP are encoded for exchange using the
* Basic Encoding Rules.)
* @return The BER representation of the attribute.
* @return the BER representation of the attribute.
*/
public BERElement getBERElement() {
try {
@ -489,7 +490,7 @@ public class LDAPAttribute {
/**
* Retrieves the string representation of attribute parameters.
* @return string representation parameters
* @return string representation parameters.
*/
private String getParamString() {
StringBuffer sb = new StringBuffer();
@ -517,12 +518,12 @@ public class LDAPAttribute {
}
/**
* Retrieves the string representation of attribute
* Retrieves the string representation of an attribute
* in an LDAP entry. For example:
*
* <PRE>LDAPAttribute {type='cn', values='Barbara Jensen,Babs Jensen'}</PRE>
*
* @return String representation of the attribute.
* @return string representation of the attribute.
*/
public String toString() {
return "LDAPAttribute " + getParamString();

Просмотреть файл

@ -21,12 +21,11 @@ import java.util.*;
/**
* The definition of an attribute type in the schema.
* <A HREF="http://ds.internic.net/rfc/rfc2252.txt"
* <A HREF="http://www.ietf.org/rfc/rfc2252.txt"
* TARGET="_blank">RFC 2252, Lightweight Directory Access Protocol (v3):
* Attribute Syntax Definitions</A> covers the types of information
* that need to be specified in the definition of an attribute type.
* According to the RFC, the description of an attribute type can
* include the following information:
* to specify when defining an attribute type. According to the RFC,
* the description of an attribute type can include the following:
* <P>
*
* <UL>
@ -36,7 +35,7 @@ import java.util.*;
* <LI>the name of the parent attribute type
* <LI>the syntax used by the attribute (for example,
* <CODE>cis</CODE> or <CODE>int</CODE>)
* <LI>an indication of whether or not the attribute type is single-valued
* <LI>an indication of whether the attribute type is single-valued
* or multi-valued
* </UL>
* <P>
@ -48,7 +47,7 @@ import java.util.*;
* returns schema information as an object with attribute values in this
* format.
* <P>
*
* There a number of additional optional description fields which
* are not explicitly accessible through LDAPAttributeSchema, but which
* can be managed with setQualifier, getQualifier, and getQualifierNames:
@ -65,8 +64,8 @@ import java.util.*;
* </UL>
* <P>
*
* You can get the name, OID, and description of this attribute type
* definition by using the <CODE>getName</CODE>, <CODE>getOID</CODE>, and
* To get the name, OID, and description of this attribute type
* definition, use the <CODE>getName</CODE>, <CODE>getOID</CODE>, and
* <CODE>getDescription</CODE> methods inherited from the abstract class
* <CODE>LDAPSchemaElement</CODE>. Optional and custom qualifiers are
* accessed with <CODE>getQualifier</CODE> and <CODE>getQualifierNames</CODE>
@ -201,13 +200,13 @@ public class LDAPAttributeSchema extends LDAPSchemaElement {
/**
* Constructs an attribute type definition based on a description in
* the AttributeTypeDescription format. For information on this format,
* (see <A HREF="http://ds.internic.net/rfc/rfc2252.txt"
* (see <A HREF="http://www.ietf.org/rfc/rfc2252.txt"
* TARGET="_blank">RFC 2252, Lightweight Directory Access Protocol (v3):
* Attribute Syntax Definitions</A>. This is the format that LDAP servers
* and clients use to exchange schema information. (For example, when
* you search an LDAP server for its schema, the server returns an entry
* with the attributes "objectclasses" and "attributetypes". The
* values of the "attributetypes" attribute are attribute type descriptions
* values of "attributetypes" are attribute type descriptions
* in this format.)
* <P>
*
@ -227,7 +226,7 @@ public class LDAPAttributeSchema extends LDAPSchemaElement {
/**
* Determines if the attribute type is single-valued.
* @return <code>true</code> if single-valued,
* <code>false</code> if multi-valued
* <code>false</code> if multi-valued.
*/
public boolean isSingleValued() {
return (properties != null) ? properties.containsKey( SINGLE ) :
@ -237,8 +236,8 @@ public class LDAPAttributeSchema extends LDAPSchemaElement {
/**
* Gets the name of the attribute that this attribute inherits from,
* if any.
* @return the name of the attribute that this attribute
* inherits from, or <CODE>null</CODE> if it does not have a superior
* @return the name of the attribute from which this attribute
* inherits, or <CODE>null</CODE> if it does not have a superior.
*/
public String getSuperior() {
String[] val = getQualifier( SUPERIOR );
@ -247,7 +246,7 @@ public class LDAPAttributeSchema extends LDAPSchemaElement {
/**
* Gets the syntax of the schema element
* @return One of the following values:
* @return one of the following values:
* <UL>
* <LI><CODE>cis</CODE> (case-insensitive string)
* <LI><CODE>ces</CODE> (case-exact string)
@ -273,11 +272,11 @@ public class LDAPAttributeSchema extends LDAPSchemaElement {
}
/**
* Prepare a value in RFC 2252 format for submitting to a server
* Prepares a value in RFC 2252 format for submission to a server
*
* @param quotingBug <CODE>true</CODE> if SUP and SYNTAX values are to
* be quoted; that is to satisfy bugs in certain LDAP servers.
* @return a String ready to be submitted to an LDAP server
* be quoted. This is required to work with bugs in certain LDAP servers.
* @return a String ready for submission to an LDAP server.
*/
String getValue( boolean quotingBug ) {
String s = getValuePrefix();
@ -315,8 +314,8 @@ public class LDAPAttributeSchema extends LDAPSchemaElement {
/**
* Gets the definition of the attribute type in a user friendly format.
* This is the format that the attribute type definition uses when
* you print the attribute type or the schema.
* @return definition of the attribute type in a user friendly format
* printing the attribute type or the schema.
* @return definition of the attribute type in a user friendly format.
*/
public String toString() {
String s = "Name: " + name + "; OID: " + oid + "; Type: ";

Просмотреть файл

@ -45,7 +45,7 @@ public class LDAPAttributeSet implements Cloneable
/**
* Constructs an attribute set.
* @param attrs The list of attributes.
* @param attrs the list of attributes
*/
public LDAPAttributeSet( LDAPAttribute[] attrs ) {
this.attrs = attrs;
@ -66,7 +66,7 @@ public class LDAPAttributeSet implements Cloneable
/**
* Returns an enumeration of the attributes in this attribute set.
* @return Enumeration of the attributes in this set.
* @return enumeration of the attributes in this set.
*/
public Enumeration getAttributes () {
Vector v = new Vector();
@ -103,17 +103,17 @@ public class LDAPAttributeSet implements Cloneable
* sn;phonetic;lang-ja
* </PRE>
*
* @param subtype Semi-colon delimited list of subtypes
* that you want to find in attribute names.
* @param subtype semi-colon delimited list of subtypes
* to find within attribute names.
* For example:
*<PRE>
* <PRE>
* "lang-ja" // Only Japanese language subtypes
* "binary" // Only binary subtypes
* "binary;lang-ja" // Only Japanese language subtypes
* which also are binary
*</PRE>
* @return Attribute set containing the attributes that have
* the specified subtypes
* </PRE>
* @return attribute set containing the attributes that have
* the specified subtypes.
* @see netscape.ldap.LDAPAttribute
* @see netscape.ldap.LDAPAttributeSet#getAttribute
* @see netscape.ldap.LDAPEntry#getAttributeSet
@ -143,13 +143,13 @@ public class LDAPAttributeSet implements Cloneable
/**
* Returns a single attribute that exactly matches the specified attribute
* name.
* @param attrName Name of attribute to return.
* @param attrName name of attribute to return
* For example:
*<PRE>
* "cn" // Only a non-subtyped version of cn
* "cn;lang-ja" // Only a Japanese version of cn
*</PRE>
* @return Attribute that has exactly the same name, or null
* @return attribute that has exactly the same name, or null
* (if no attribute in the set matches the specified name).
* @see netscape.ldap.LDAPAttribute
*/
@ -168,7 +168,7 @@ public class LDAPAttributeSet implements Cloneable
}
/**
* Prepare hashtable for fast attribute lookups
* Prepares hashtable for fast attribute lookups.
*/
private void prepareHashtable() {
if ((attrHash == null) && (attrs.length >= ATTR_COUNT_REQUIRES_HASH)) {
@ -193,8 +193,8 @@ public class LDAPAttributeSet implements Cloneable
* they contain the specified <CODE>lang</CODE> subtype and if
* the set contains no attribute having only the <CODE>lang</CODE>
* subtype. (For example, <CODE>getAttribute( "cn", "lang-ja" )</CODE>
* returns the <CODE>cn;lang-ja;phonetic</CODE> attribute only if
* the <CODE>cn;lang-ja</CODE> attribute does not exist.)
* returns <CODE>cn;lang-ja;phonetic</CODE> only if the
* <CODE>cn;lang-ja</CODE> attribute does not exist.)
* <P>
*
* If null is specified for the <CODE>lang</CODE> argument,
@ -222,9 +222,9 @@ public class LDAPAttributeSet implements Cloneable
* <LI><CODE>getAttribute( "sn", "lang-en" )</CODE> returns the "<CODE>sn</CODE>" attribute.
*</UL>
* <P>
* @param attrName Name of attribute to find in the entry.
* @param lang A language specification.
* @return The attribute that matches the base name and that best
* @param attrName name of attribute to find in the entry
* @param lang a language specification
* @return the attribute that matches the base name and that best
* matches any specified language subtype.
* @see netscape.ldap.LDAPAttribute
*/
@ -302,23 +302,23 @@ public class LDAPAttributeSet implements Cloneable
}
/**
* Returns the attribute at the position specified by the index
* (for example, if you specify the index 0, the method returns the
* first attribute in the set). The index is 0-based.
* Returns the attribute at the position specified by the index.
* For example, if you specify the index 0, the method returns the
* first attribute in the set. The index is 0-based.
*
* @param index Index of the attribute that you want to get.
* @return Attribute at the position specified by the index.
* @param index index of the attribute to obtain
* @return attribute at the position specified by the index.
*/
public LDAPAttribute elementAt (int index) {
return attrs[index];
}
/**
* Removes attribute at the position specified by the index
* (for example, if you specify the index 0, the method removes the
* first attribute in the set). The index is 0-based.
* Removes the attribute at the position specified by the index.
* For example, if you specify the index 0, the method removes the
* first attribute in the set. The index is 0-based.
*
* @param index Index of the attribute that you want to remove.
* @param index index of the attribute to remove
*/
public void removeElementAt (int index) {
if ((index >= 0) && (index < attrs.length)) {
@ -337,7 +337,7 @@ public class LDAPAttributeSet implements Cloneable
/**
* Returns the number of attributes in this set.
* @return Number of attributes in this attribute set.
* @return number of attributes in this attribute set.
*/
public int size () {
return attrs.length;
@ -345,7 +345,7 @@ public class LDAPAttributeSet implements Cloneable
/**
* Adds the specified attribute to this attribute set.
* @param attr Attribute that you want to add to this set.
* @param attr attribute to add to this set
*/
public synchronized void add( LDAPAttribute attr ) {
if (attr != null) {
@ -362,7 +362,7 @@ public class LDAPAttributeSet implements Cloneable
/**
* Removes the specified attribute from the set.
* @param name Name of the attribute that you want removed.
* @param name name of the attribute to remove
*/
public synchronized void remove( String name ) {
for( int i = 0; i < attrs.length; i++ ) {
@ -385,7 +385,7 @@ public class LDAPAttributeSet implements Cloneable
* values='Product Development,People'}
* </PRE>
*
* @return String representation of all attributes in the set.
* @return string representation of all attributes in the set.
*/
public String toString() {
StringBuffer sb = new StringBuffer("LDAPAttributeSet: ");

Просмотреть файл

@ -18,9 +18,9 @@
package netscape.ldap;
/**
* Used to do explicit bind processing on a referral. A client may
* specify an instance of this class to be used on a single operation
* (through the <CODE>LDAPConstraints</CODE> object) or for all operations
* Performs explicit bind processing on a referral. A client may
* specify an instance of this class for use on a single operation
* (through the <CODE>LDAPConstraints</CODE> object) or all operations
* (through <CODE>LDAPConnection.setOption()</CODE>). It is typically used
* to control the authentication mechanism used on implicit referral
* handling.
@ -30,13 +30,14 @@ public interface LDAPBind {
/**
* This method is called by <CODE>LDAPConnection</CODE> when
* authenticating. An implementation may access the host, port,
* credentials, and other information in the <CODE>LDAPConnection</CODE>
* to decide on an appropriate authentication mechanism, and/or may
* interact with a user or external module.
* authenticating. An implementation of <CODE>LDAPBind</CODE> may access
* the host, port, credentials, and other information in the
* <CODE>LDAPConnection</CODE> in order to decide on an appropriate
* authentication mechanism.<BR>
* The bind method can also interact with a user or external module.
* @exception netscape.ldap.LDAPException
* @see netscape.ldap.LDAPConnection#bind
* @param conn An established connection to an LDAP server.
* @param conn an established connection to an LDAP server
*/
public void bind(LDAPConnection conn) throws LDAPException;

Просмотреть файл

@ -24,9 +24,8 @@ import netscape.ldap.util.*;
import java.util.zip.CRC32;
/**
* <CODE>LDAPCache</CODE> is the class that represents an
* in-memory cache that you can use to reduce the number of
* search requests sent to the LDAP server.
* <CODE>LDAPCache</CODE> represents an in-memory cache that you can use
* to reduce the number of search requests sent to the LDAP server.
* <P>
*
* Each item in the cache represents a search request and
@ -47,7 +46,7 @@ import java.util.zip.CRC32;
* <P>
*
* After a search request is cached, the results of any
* subsequent search requests using the same criteria are 8
* subsequent search requests using the same criteria are
* read from the cache. Note that if any part of the
* criteria differs (for example, if a different DN is used
* when binding to the server or if a different set of
@ -84,6 +83,9 @@ import java.util.zip.CRC32;
* the same <CODE>LDAPCache</CODE> object.
* <P>
*
* Note that search requests that return referrals are not cached.
* <P>
*
* The <CODE>LDAPCache</CODE> class includes methods for
* getting statistics (such as hit rates) from the cache and
* for flushing entries from the cache.
@ -92,7 +94,7 @@ import java.util.zip.CRC32;
* @see netscape.ldap.LDAPConnection#setCache(netscape.ldap.LDAPCache)
* @see netscape.ldap.LDAPConnection#getCache
*/
public class LDAPCache implements TimerEventListener {
public class LDAPCache {
private Hashtable m_cache;
private long m_timeToLive;
private long m_maxSize;
@ -104,14 +106,23 @@ public class LDAPCache implements TimerEventListener {
* for the cache.
*/
public static final String DELIM = "#";
private Timer m_timer = null;
private static long TIMEOUT = 60000;
private TTLTimer m_timer = null;
private long m_totalOpers = 0;
private static final boolean m_debug = false;
private long m_hits = 0;
private long m_flushes = 0;
// Debug can be activated by defining debug.cache property
private static boolean m_debug = false;
static {
try {
String traceProp = System.getProperty("debug.cache");
m_debug = (traceProp != null);
}
catch (Exception e) {
;// In browser access to property might not be allowed
}
}
/**
* Constructs a new <CODE>LDAPCache</CODE> object, using the
* specified maximum size of the cache (in bytes) and the maximum
@ -119,9 +130,9 @@ public class LDAPCache implements TimerEventListener {
* exceed this age, they are removed from the cache.
* <P>
*
* @param ttl The maximum amount of time that an item can be cached
* @param ttl the maximum amount of time that an item can be cached
* (in seconds)
* @param size The maximum size of the cache (in bytes)
* @param size the maximum size of the cache (in bytes)
*/
public LDAPCache(long ttl, long size)
{
@ -138,10 +149,10 @@ public class LDAPCache implements TimerEventListener {
* request is <CODE>o=Airius.com</CODE>.)
* <P>
*
* @param ttl The maximum amount of time that an item can be cached
* @param ttl the maximum amount of time that an item can be cached
* (in seconds)
* @param size The maximum size of the cache (in bytes)
* @param dns The list of base DNs of searches that you want to cache.
* @param size the maximum size of the cache (in bytes)
* @param dns the list of base DNs of searches that you want to cache.
*/
public LDAPCache(long ttl, long size, String[] dns)
{
@ -158,7 +169,7 @@ public class LDAPCache implements TimerEventListener {
* Gets the maximum size of the cache (in bytes).
* <P>
*
* @return The maximum size of the cache (in bytes)
* @return the maximum size of the cache (in bytes).
*/
public long getSize()
{
@ -171,7 +182,7 @@ public class LDAPCache implements TimerEventListener {
* removed from the cache.)
* <P>
*
* @return The maximum age of items in the cache (in
* @return the maximum age of items in the cache (in
* seconds).
*/
public long getTimeToLive()
@ -184,7 +195,7 @@ public class LDAPCache implements TimerEventListener {
* (Search requests with these base DNs are cached.)
* <P>
*
* @return The array of base DNs.
* @return the array of base DNs.
*/
public String[] getBaseDNs()
{
@ -195,12 +206,12 @@ public class LDAPCache implements TimerEventListener {
* Flush the entries identified by DN and scope from the cache.
* <P>
*
* @param dn The distinguished name (or base DN) of the entries
* @param dn the distinguished name (or base DN) of the entries
* to be removed from the cache. Use this parameter in conjunction
* with <CODE>scope</CODE> to identify the entries that you want
* removed from the cache. If this parameter is <CODE>null</CODE>,
* the entire cache is flushed.
* @param scope The scope identifying the entries that you want
* @param scope the scope identifying the entries that you want
* removed from the cache. The value of this parameter can be
* one of the following:
* <UL>
@ -212,8 +223,8 @@ public class LDAPCache implements TimerEventListener {
* subtree under <CODE>dn</CODE> in the directory)
* </UL>
* <P>
* @return <CODE>true</CODE> if the entry is removed from the cache,
* or <CODE>false</CODE> if the entry is not removed.
* @return <CODE>true</CODE> if the entry is removed from the cache;
* <CODE>false</CODE> if the entry is not removed.
*/
public synchronized boolean flushEntries(String dn, int scope) {
@ -227,6 +238,9 @@ public class LDAPCache implements TimerEventListener {
m_remainingSize = m_maxSize;
m_cache.clear();
m_orderedStruct.removeAllElements();
// reset stats
m_totalOpers = m_hits = m_flushes = 0;
return true;
}
@ -282,23 +296,11 @@ public class LDAPCache implements TimerEventListener {
return false;
}
/**
* Gets invoked when the timer expires.
* @param e The timer event containing the timer itself.
*/
public void timerExpired(TimerEvent e)
{
flushEntries();
Timer t = (Timer)e.getSource();
t.start();
}
/**
* Gets the amount of available space (in bytes) left in the cache.
* <P>
*
* @return The available space (in bytes) in the cache.
* @return the available space (in bytes) in the cache.
*/
public long getAvailableSize() {
return m_remainingSize;
@ -310,7 +312,7 @@ public class LDAPCache implements TimerEventListener {
* the cache and items not found in the cache.
* <P>
*
* @return The total number of requests for retrieving items from
* @return the total number of requests for retrieving items from
* the cache.
*/
public long getTotalOperations() {
@ -322,7 +324,7 @@ public class LDAPCache implements TimerEventListener {
* retrieve an item from the cache.
* <P>
*
* @return The number of requests that did not find and retrieve
* @return the number of requests that did not find and retrieve
* an item in the cache.
*/
public long getNumMisses() {
@ -332,7 +334,7 @@ public class LDAPCache implements TimerEventListener {
/**
* Gets the total number of requests which successfully found and
* retrieved an item from the cache.
* @return The number of requests that successfully found and
* @return the number of requests that successfully found and
* retrieved an item from the cache.
*/
public long getNumHits() {
@ -344,7 +346,7 @@ public class LDAPCache implements TimerEventListener {
* and <CODE>flushEntries</CODE> is called.
* <P>
*
* @return The total number of entries that are flushed when timer
* @return the total number of entries that are flushed when timer
* expires.
*/
public long getNumFlushes() {
@ -353,7 +355,7 @@ public class LDAPCache implements TimerEventListener {
/**
* Create a key for a cache entry by concatenating all input parameters
* @return The key for a cache entry
* @return the key for a cache entry
* @exception LDAPException Thrown when failed to create key.
*/
Long createKey(String host, int port, String baseDN, String filter,
@ -400,8 +402,9 @@ public class LDAPCache implements TimerEventListener {
String[] objID = new String[serverControls.length];
for (int i=0; i<serverControls.length; i++) {
long val = getCRC32(serverControls[i].getValue());
objID[i] = new Long(val).toString();
LDAPControl ctrl = serverControls[i];
long val = getCRC32(ctrl.getValue());
objID[i] = ctrl.getID() + ctrl.isCritical() + new Long(val).toString();
}
key = key + appendString(objID);
}
@ -413,8 +416,10 @@ public class LDAPCache implements TimerEventListener {
String[] objID = new String[clientControls.length];
for (int i=0; i<clientControls.length; i++) {
long val = getCRC32(clientControls[i].getValue());
objID[i] = new Long(val).toString();
LDAPControl ctrl = clientControls[i];
long val = getCRC32(ctrl.getValue());
objID[i] = ctrl.getID() + ctrl.isCritical() + new Long(val).toString();
}
key = key + appendString(objID);
}
@ -422,13 +427,16 @@ public class LDAPCache implements TimerEventListener {
key = key+appendString(0);
long val = getCRC32(key.getBytes());
if(m_debug) {
System.out.println("key="+val + " for "+key);
}
return new Long(val);
}
/**
* Gets the cache entry based on the specified key.
* @param key The key for the cache entry.
* @return The cache entry
* @param key the key for the cache entry
* @return the cache entry.
*/
synchronized Object getEntry(Long key) {
Object obj = null;
@ -453,15 +461,14 @@ public class LDAPCache implements TimerEventListener {
}
/**
* Flush entries which stays longer or equal to the time-to-live.
* Flush entries which stay longer or equal to the time-to-live.
*/
synchronized void flushEntries()
{
Vector v = null;
boolean delete = false;
Date date = new Date();
long currTime = date.getTime();
long currTime = System.currentTimeMillis();
m_flushes = 0;
while(true) {
@ -475,7 +482,6 @@ public class LDAPCache implements TimerEventListener {
if (m_debug)
System.out.println("DEBUG: Timer flush entry whose key is "+key);
Vector entry = (Vector)m_cache.remove(key);
m_remainingSize = m_remainingSize + ((Long)entry.firstElement()).longValue();
@ -496,28 +502,27 @@ public class LDAPCache implements TimerEventListener {
/**
* Add the entry to the hashtable cache and to the vector respectively.
* The vector is used to keep track of the order of the entries being added.
* @param key The key for the cache entry.
* @param value The cache entry being added to the cache for the specified
* key.
* @exception LDAPException Get thrown when failed to add the entry.
* @param key the key for the cache entry
* @param value the cache entry being added to the cache for the specified
* key
* @return a flag indicating whether the entry was added.
*/
synchronized void addEntry(Long key, Object value) throws LDAPException
synchronized boolean addEntry(Long key, Object value)
{
// if entry exists, dont perform add operation
if (m_cache.get(key) != null)
return;
return false;
Vector v = (Vector)value;
// assume the size of the key is 4 bytes
long size = ((Long)v.elementAt(0)).longValue()+4;
long size = ((Long)v.elementAt(0)).longValue();
if (size > m_maxSize) {
throw new LDAPException("Failed to add an entry to the cache since the new entry exceeds the cache size", LDAPException.OTHER);
if (m_debug) {
System.out.println("Failed to add an entry to the cache since the new entry exceeds the cache size");
}
return false;
}
v.setElementAt(new Long(size), 0);
// if the size of entry being added is bigger than the spare space in the
// cache
if (size > m_remainingSize) {
@ -542,32 +547,67 @@ public class LDAPCache implements TimerEventListener {
m_cache.put(key, v);
Vector element = new Vector();
element.addElement(key);
Date date = new Date();
element.addElement(new Long(date.getTime()));
element.addElement(new Long(System.currentTimeMillis()));
m_orderedStruct.addElement(element);
// Start TTL Timer if first entry is added
if (m_orderedStruct.size() == 1) {
scheduleTTLTimer();
}
if (m_debug)
{
System.out.println("DEBUG: Adding a new entry whose key -> "+key);
System.out.println("DEBUG: The current number of keys in the cache "+
m_cache.size());
}
return true;
}
/**
* Gets the number of entries being cached.
* @return The number of entries being cached.
* Flush entries which stayed longer or equal to the time-to-live, and
* Set up the TTLTimer for the next flush. Called when first entry is
* added to the cache and when the TTLTimer expires.
*/
int size()
synchronized void scheduleTTLTimer() {
if (m_orderedStruct.size() <= 0) {
return;
}
if (m_timer == null) {
m_timer = new TTLTimer(this);
}
Vector v = (Vector)m_orderedStruct.firstElement();
long currTime = System.currentTimeMillis();
long creationTime = ((Long)v.elementAt(1)).longValue();
long timeout = creationTime + m_timeToLive - currTime;
if (timeout > 0) {
m_timer.start(timeout);
}
else {
flushEntries();
scheduleTTLTimer();
}
}
/**
* Gets the number of entries being cached.
* @return the number of entries being cached.
*/
public int getNumEntries()
{
return m_cache.size();
}
/**
* Clean up
* Cleans up
*/
void cleanup() {
flushEntries(null, 0);
m_timer.stop();
m_timer = null;
}
/**
@ -581,15 +621,12 @@ public class LDAPCache implements TimerEventListener {
m_remainingSize = size;
m_dns = null;
m_orderedStruct = new Vector();
m_timer = new Timer(TIMEOUT);
m_timer.addTimerExpiredEventListener((TimerEventListener)this);
m_timer.start();
}
/**
* Concatenate the specified integer with the delimiter.
* @param str The string which concatenate with the delimiter.
* @return The concatenated string
* Concatenates the specified integer with the delimiter.
* @param str the String to concatenate with the delimiter
* @return the concatenated string.
*/
private String appendString(String str) {
if (str == null)
@ -599,9 +636,9 @@ public class LDAPCache implements TimerEventListener {
}
/**
* Concatenate the specified integer with the delimiter.
* @param num The integer which concatenate with the delimiter.
* @return The concatenated string
* Concatenates the specified integer with the delimiter.
* @param num the integer to concatenate with the delimiter
* @return the concatenated string.
*/
private String appendString(int num) {
return num+DELIM;
@ -609,8 +646,8 @@ public class LDAPCache implements TimerEventListener {
/**
* Concatenate the specified string array with the delimiter.
* @param str A string array.
* @return The concatenated string
* @param str a string array
* @return the concatenated string.
*/
private String appendString(String[] str) {
@ -630,7 +667,7 @@ public class LDAPCache implements TimerEventListener {
/**
* Sorts the array of strings using bubble sort.
* @param str The array of string being sorted. The str parameter contains
* @param str the array of strings to sort. The str parameter contains
* the sorted result.
*/
private void sortStrings(String[] str) {
@ -654,6 +691,9 @@ public class LDAPCache implements TimerEventListener {
* Create a 32 bits CRC from the given byte array.
*/
private long getCRC32(byte[] barray) {
if (barray==null) {
return 0;
}
CRC32 crcVal = new CRC32();
crcVal.update(barray);
return crcVal.getValue();
@ -662,30 +702,31 @@ public class LDAPCache implements TimerEventListener {
/**
* Represents a timer which will timeout for every certain interval. It
* provides methods to start, stop, or restart timer. It also provides
* methods to register/deregister the event listeners.
* provides methods to start, stop, or restart timer.
*/
class Timer {
class TTLTimer implements Runnable{
private long m_timeout;
private LDAPCache m_cache;
private Thread t = null;
private TimerEventListener listener;
protected TimerEventListener stopListener = null;
/**
* Constructor with the specified timout.
* @param timeout The timeout value in milliseconds.
* @param timeout the timeout value in milliseconds
*/
Timer(long timeout) {
m_timeout = timeout;
TTLTimer(LDAPCache cache) {
m_cache = cache;
}
/**
* Start the timer.
* (Re)start the timer.
*/
void start() {
TimerRunnable trun = new TimerRunnable(this);
t = new Thread(trun);
void start(long timeout) {
m_timeout = timeout;
if (Thread.currentThread() != t) {
stop();
}
t = new Thread(this, "LDAPCache-TTLTimer");
t.setDaemon(true);
t.start();
}
@ -694,61 +735,11 @@ class Timer {
* Stop the timer.
*/
void stop() {
t.interrupt();
}
/**
* Get the timeout value.
* @return the timeout value.
*/
long getTimeout() {
return m_timeout;
}
/**
* Notify the listener when the timer expires.
*/
void fireExpiredEvent() {
TimerEvent event;
if (stopListener != null)
{
event = new TimerEvent(this);
stopListener.timerExpired(event);
if (t !=null) {
t.interrupt();
}
}
/**
* Add the listener to the queue who wants to be notified when the timer
* expires.
*/
void addTimerExpiredEventListener(TimerEventListener listener) {
stopListener = listener;
}
/**
* Remove the listener from the queue who will not get notified when the
* timer expires.
*/
void removeTimerExpiredEventListener(TimerEventListener listener) {
stopListener = null;
}
}
/**
* Represents the starting point for the timer thread to execute.
*/
class TimerRunnable implements Runnable {
Timer m_timer;
/**
* Constructor with the specified timer object.
* @param t The timer
*/
TimerRunnable(Timer t) {
m_timer = t;
}
/**
* The runnable waits until the timeout period has elapsed. It then notify
* the registered listener who listens for the timeout event.
@ -757,42 +748,13 @@ class TimerRunnable implements Runnable {
synchronized(this) {
try {
this.wait(m_timer.getTimeout());
this.wait(m_timeout);
} catch (InterruptedException e) {
// This happens if the timer is stopped
return;
}
}
m_timer.fireExpiredEvent();
m_cache.scheduleTTLTimer();
}
}
/**
* Represents the timer event. When the timer expires, it will notify
* all the registered listeners which receive the timer event. The
* listener can retrieve the source of the event from the timer event.
*/
class TimerEvent extends EventObject {
/**
* Constructor with the specified source of the timer event.
* @param source The source of the timer event.
*/
TimerEvent(Object source) {
super(source);
}
}
/**
* The timer client needs to implement this interface if it wants to
* receive the timeout event.
*/
interface TimerEventListener extends EventListener {
/**
* Gets invoked when the timer expires.
* @param timeout Timeout event contains the source of the event which is
* the timer.
*/
void timerExpired(TimerEvent timeout);
}
}

Просмотреть файл

@ -18,18 +18,19 @@
package netscape.ldap;
/**
* This static class checks if the caller is the applet running in the
* communicator. If so, then it returns the appropriate method.
* This static class checks if the caller is an applet running in
* Netscape Communicator. If so, it returns the appropriate method.
*/
class LDAPCheckComm {
/**
* It returns the method whose name matches the specified argument.
* @param classPackage The class package
* @param name The method name
* @return The method
* @exception LDAPException Gets thrown it the method is not found or
* the caller is not an applet running in the communicator
* Returns the method whose name matches the specified argument.
* @param classPackage the class package
* @param name the method name
* @return the method.
* @exception LDAPException Gets thrown if the method is not found or
* the caller is not an applet running in Netscape
* Communicator.
*/
static java.lang.reflect.Method getMethod(String classPackage, String name) throws LDAPException {
SecurityManager sec = System.getSecurityManager();

Просмотреть файл

@ -48,7 +48,7 @@ public class LDAPCompareAttrNames implements LDAPEntryComparator {
* ascending order.
* <P>
*
* @param attribute Name of attribute for comparisons.
* @param attribute name of attribute for comparisons
*/
public LDAPCompareAttrNames (String attribute) {
m_attrs = new String[1];
@ -58,13 +58,13 @@ public class LDAPCompareAttrNames implements LDAPEntryComparator {
}
/**
* Constructs a comparator that compares the string values in
* Constructs a comparator that compares the string values of
* a named attribute in LDAP entries and that allows you to sort
* entries either in ascending or descending order.
* <P>
*
* @param attribute Name of attribute for comparisons.
* @param ascendingFlag If <CODE>true</CODE>, sort in ascending order.
* @param attribute name of attribute for comparisons
* @param ascendingFlag if <CODE>true</CODE>, sort in ascending order
*/
public LDAPCompareAttrNames (String attribute,
boolean ascendingFlag) {
@ -75,25 +75,25 @@ public class LDAPCompareAttrNames implements LDAPEntryComparator {
}
/**
* Constructs a comparator that compares the string values in
* Constructs a comparator that compares the string values of
* a set of named attributes in LDAP entries and that sort
* the entries in ascending order.
* <P>
*
* Use an array of strings to specify the set of attributes
* that you want to use for sorting. If the values of the
* first attribute (the name specified in <CODE>attribute[0]</CODE>)
* are equal, then the values of the next attribute are compared.
* to use for sorting. If the values of the first attribute
* (the name specified in <CODE>attribute[0]</CODE>) are equal,
* then the values of the next attribute are compared.
* <P>
*
* For example, if <CODE>attributes[0] = "cn"</CODE> and
* <CODE>attributes[1]="uid"</CODE>, results are first sorted
* <CODE>attributes[1]="uid"</CODE>, results are first sorted
* by the <CODE>cn</CODE> attribute. If two entries have the
* same value for the <CODE>cn</CODE>, then the <CODE>uid</CODE>
* same value for <CODE>cn</CODE>, then the <CODE>uid</CODE>
* attribute is used to sort the entries.
* <P>
*
* @param attributes Array of the attribute names used for comparisons.
* @param attributes array of the attribute names used for comparisons
*/
public LDAPCompareAttrNames (String[] attributes) {
m_attrs = attributes;
@ -103,14 +103,14 @@ public class LDAPCompareAttrNames implements LDAPEntryComparator {
}
/**
* Constructs a comparator that compares the string values in
* a set of named attributes in LDAP entries and that allows you
* Constructs a comparator that compares the string values of
* a set of named attributes in LDAP entries and allows you
* to sort the entries in ascending or descending order.
* <P>
*
* Use an array of strings to specify the set of attributes
* that you want to use for sorting. If the values of the
* first attribute (the name specified in <CODE>attribute[0]</CODE>)
* to use for sorting. If the values of the first attribute
* (the name specified in <CODE>attribute[0]</CODE>)
* are equal, then the values of the next attribute are compared.
* <P>
*
@ -136,10 +136,10 @@ public class LDAPCompareAttrNames implements LDAPEntryComparator {
* <CODE>LDAPException</CODE> is thrown.
* <P>
*
* @param attribute Array of the attribute names to use for comparisons.
* @param ascendingFlags Array of boolean values specifying ascending
* @param attribute array of the attribute names to use for comparisons
* @param ascendingFlags array of boolean values specifying ascending
* or descending order to use for each attribute name. If
* <CODE>true</CODE>, sort the attributes in ascending order.
* <CODE>true</CODE>, the attributes are sorted in ascending order.
*/
public LDAPCompareAttrNames (String[] attributes,
boolean[] ascendingFlags) {
@ -153,20 +153,20 @@ public class LDAPCompareAttrNames implements LDAPEntryComparator {
}
/**
* Get the locale used for collation, if any. If it is null,
* an ordinary string comparison will be used for sorting.
* Gets the locale, if any, used for collation. If the locale is null,
* an ordinary string comparison is used for sorting.
*
* @return The locale used for collation, or null.
* @return the locale used for collation, or null.
*/
public Locale getLocale() {
return m_locale;
}
/**
* Set the locale used for collation, if any. If it is null,
* an ordinary string comparison will be used for sorting.
* Set the locale, if any, used for collation. If the locale is null,
* an ordinary string comparison is used for sorting.
*
* @param locale The locale used for collation, or null.
* @param locale the locale used for collation, or null.
*/
public void setLocale( Locale locale ) {
m_locale = locale;
@ -178,8 +178,8 @@ public class LDAPCompareAttrNames implements LDAPEntryComparator {
}
/**
* If the value of the attribute in the first entry is greater
* than the attribute in the second entry, returns <CODE>true</CODE>.
* Returns <CODE>true</CODE> if the value of the attribute in the first entry is greater
* than the value of the attribute in the second entry.
* <P>
*
* If one of the entries is missing the attribute, the other is
@ -190,8 +190,8 @@ public class LDAPCompareAttrNames implements LDAPEntryComparator {
* is used for comparisons.
* <P>
*
* @param greater Entry to be tested against.
* @param less Entry to test.
* @param greater entry against which to test
* @param less entry to test
* @return <CODE>true</CODE> if (<CODE>greater &gt; less</CODE>).
*/
public boolean isGreater (LDAPEntry greater, LDAPEntry less) {
@ -202,9 +202,9 @@ public class LDAPCompareAttrNames implements LDAPEntryComparator {
/**
* Compares a particular attribute in both entries. If equal,
* moves on to the next.
* @param greater Greater arg from isGreater
* @param less Less param is isGreater
* @param attrPos Index into array of attributes, indicating
* @param greater greater arg from isGreater
* @param less less arg from isGreater
* @param attrPos the index in an array of attributes, indicating
* the attribute to compare
* @return (greater > less)
*/

Просмотреть файл

@ -22,7 +22,7 @@ import java.io.*;
import java.net.*;
/**
* Make a connection to a server from a list using "smart" failover.
* Makes a connection to a server from a list using "smart" failover.
* Connection attempts can be made serially from the same thread, or
* in parallel by creating a separate thread after the specified delay.
* Connection setup status is preserved for later attempts, so that servers
@ -109,9 +109,9 @@ class LDAPConnSetupMgr implements Cloneable{
/**
* Constructor
* @param host List of host names to connect to
* @param port List of port numbers corresponding to the host list
* @param factory Socket factory for SSL connections
* @param host list of host names to which to connect
* @param port list of port numbers corresponding to the host list
* @param factory socket factory for SSL connections
* @param delay delay in seconds for the parallel connection setup policy.
* Possible values are: <br>(delay=-1) use serial policy,<br>
* (delay=0) start immediately concurrent threads to each specified server
@ -162,7 +162,7 @@ class LDAPConnSetupMgr implements Cloneable{
}
/**
* To be called when the current connection is lost.
* Called when the current connection is lost.
* Put the connected server at the end of the server list for
* the next connect attempt.
*/
@ -187,7 +187,7 @@ class LDAPConnSetupMgr implements Cloneable{
}
/**
* To be called when the current connection is terminated by the user
* Called when the current connection is terminated by the user.
* Mark the connected server status as DISCONNECTED. This will
* put it at top of the server list for the next connect attempt.
*/
@ -363,7 +363,7 @@ class LDAPConnSetupMgr implements Cloneable{
/**
* Sort Server List so that servers which are more likely to be available
* Sorts Server List so that servers which are more likely to be available
* are tried first. The likelihood of making a successful connection
* is determined by the connSetupStatus. Lower values have higher
* likelihood. Thus, the order of server access is (1) disconnected by
@ -382,7 +382,22 @@ class LDAPConnSetupMgr implements Cloneable{
}
}
}
/**
* This is used only by the ldapjdk test libaray to simulate a
* server problem and to test fail-over and rebind
* @return A flag whether the connection was closed
*/
boolean breakConnection() {
try {
m_socket.close();
return true;
}
catch (Exception e) {
return false;
}
}
public String toString() {
String str = "dsIdx="+m_dsIdx+ " dsList=";
for (int i=0; i < m_dsList.length; i++) {

Просмотреть файл

@ -428,10 +428,10 @@ class LDAPConnThread extends Thread {
* When a response arrives from the LDAP server, it is processed by
* this routine. It will pass the message on to the listening object
* associated with the LDAP msgId.
* @param incoming New message from LDAP server
* @param msg New message from LDAP server
*/
private void processResponse (LDAPMessage incoming, int size) {
Integer messageID = new Integer (incoming.getID());
private void processResponse (LDAPMessage msg, int size) {
Integer messageID = new Integer (msg.getID());
LDAPMessageQueue l = (LDAPMessageQueue)m_requests.get (messageID);
if (l == null) {
@ -445,9 +445,9 @@ class LDAPConnThread extends Thread {
if ( ! l.isAsynchOp()) {
/* Were there any controls for this client? */
LDAPControl[] con = incoming.getControls();
LDAPControl[] con = msg.getControls();
if (con != null) {
int msgid = incoming.getID();
int msgid = msg.getID();
LDAPConnection ldc = l.getConnection(msgid);
if (ldc != null) {
ldc.setResponseControls( this,
@ -456,19 +456,30 @@ class LDAPConnThread extends Thread {
}
}
if ((l instanceof LDAPSearchListener) && m_cache != null) {
cacheSearchResult((LDAPSearchListener)l, incoming, size);
if (m_cache != null && (l instanceof LDAPSearchListener)) {
cacheSearchResult((LDAPSearchListener)l, msg, size);
}
l.addMessage (incoming);
l.addMessage (msg);
if (incoming instanceof LDAPResponse) {
if (msg instanceof LDAPResponse) {
m_requests.remove (messageID);
}
}
private synchronized void cacheSearchResult (LDAPSearchListener l, LDAPMessage incoming, int size) {
Integer messageID = new Integer (incoming.getID());
/**
* Collect search results to be added to the LDAPCache. Search results are
* packaged in a vector and temporary stored into a hashtable m_messages
* using the message id as the key. The vector first element (at index 0)
* is a Long integer representing the total size of all LDAPEntries entries.
* It is followed by the actual LDAPEntries.
* If the total size of entries exceeds the LDAPCache max size, or a referral
* has been received, caching of search results is disabled and the entry is
* not added to the LDAPCache. A disabled search request is denoted by setting
* the entry size to -1.
*/
private synchronized void cacheSearchResult (LDAPSearchListener l, LDAPMessage msg, int size) {
Integer messageID = new Integer (msg.getID());
Long key = l.getKey();
Vector v = null;
@ -476,59 +487,75 @@ class LDAPConnThread extends Thread {
return;
}
if ((incoming instanceof LDAPSearchResult)/* ||
(incoming instanceof LDAPSearchResultReference)*/) {
if (msg instanceof LDAPSearchResult) {
// get the vector containing the LDAPMessages for the specified messageID
v = (Vector)m_messages.get(messageID);
if (v == null) {
v = new Vector();
// keeps track of the total size of all LDAPMessages belonging to the
// same messageID, now the size is 0
m_messages.put(messageID, v = new Vector());
v.addElement(new Long(0));
}
// Return if the entry size is -1, i.e. the caching is disabled
if (((Long)v.firstElement()).longValue() == -1L) {
return;
}
// add the size of the current LDAPMessage to the lump sum
// assume the size of LDAPMessage is more or less the same as the size
// of LDAPEntry. Eventually LDAPEntry object gets stored in the cache
// instead of LDAPMessage object.
long entrySize = ((Long)v.firstElement()).longValue() + size;
// If the entrySize exceeds the cache size, discard the collected
// entries and disble collecting of entries for this search request
// by setting the entry size to -1.
if (entrySize > m_cache.getSize()) {
v.removeAllElements();
v.addElement(new Long(-1L));
return;
}
// update the lump sum located in the first element of the vector
v.setElementAt(new Long(entrySize), 0);
// convert LDAPMessage object into LDAPEntry which is stored to the
// end of the Vector
v.addElement(((LDAPSearchResult)incoming).getEntry());
v.addElement(((LDAPSearchResult)msg).getEntry());
// replace the entry
m_messages.put(messageID, v);
} else if (msg instanceof LDAPSearchResultReference) {
} else if (incoming instanceof LDAPResponse) {
// If a search reference is received disable caching of
// this search request
v = (Vector)m_messages.get(messageID);
if (v == null) {
m_messages.put(messageID, v = new Vector());
}
else {
v.removeAllElements();
}
v.addElement(new Long(-1L));
boolean fail = ((LDAPResponse)incoming).getResultCode() > 0;
} else if (msg instanceof LDAPResponse) {
// The search request has completed. Store the cache entry
// in the LDAPCache if the operation has succeded and caching
// is not disabled due to the entry size or referrals
boolean fail = ((LDAPResponse)msg).getResultCode() > 0;
v = (Vector)m_messages.remove(messageID);
if (!fail) {
// Collect all the LDAPMessages for the specified messageID
// no need to keep track of this entry. Remove it.
v = (Vector)m_messages.remove(messageID);
// If v is null, meaning there are no search results from the
// server
if (v == null) {
v = new Vector();
// set the entry size to be 0
v.addElement(new Long(0));
}
try {
// add the new entry with key and value (a vector of
// LDAPEntry objects)
// add the new entry if the entry size is not -1 (caching diabled)
if (((Long)v.firstElement()).longValue() != -1L) {
m_cache.addEntry(key, v);
} catch (LDAPException e) {
System.out.println("Exception: "+e.toString());
}
}
}
@ -540,6 +567,10 @@ class LDAPConnThread extends Thread {
*/
void abandon (int id ) {
LDAPMessageQueue l = (LDAPMessageQueue)m_requests.remove(new Integer(id));
// Clean up cache if enabled
if (m_messages != null) {
m_messages.remove(new Integer(id));
}
if (l != null) {
l.removeRequest(id);
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -55,21 +55,21 @@ public class LDAPConstraints implements Cloneable {
* Constructs a new <CODE>LDAPConstraints</CODE> object and allows you
* to specify the constraints in that object.
* <P>
* @param msLimit Maximum time in milliseconds to wait for results (0
* @param msLimit maximum time in milliseconds to wait for results (0
* by default, which means that there is no maximum time limit)
* @param doReferrals Specify <CODE>true</CODE> to follow referrals
* @param doReferrals specify <CODE>true</CODE> to follow referrals
* automatically, or <CODE>False</CODE> to throw an
* <CODE>LDAPReferralException</CODE> error if the server sends back
* a referral (<CODE>False</CODE> by default)
* @param rebind_proc Specifies the object that
* @param rebind_proc specifies the object that
* implements the <CODE>LDAPRebind</CODE> interface (you need to
* define this class). The object will be used when the client
* follows referrals automatically. The object provides the client
* with a method for getting the distinguished name and password
* used to authenticate to another LDAP server during a referral.
* (This field is <CODE>null</CODE> by default.)
* @param hop_limit Maximum number of referrals to follow in a
* sequence when attempting to resolve a request.
* @param hop_limit maximum number of referrals to follow in a
* sequence when attempting to resolve a request
* @see netscape.ldap.LDAPConnection#setOption(int, java.lang.Object)
*/
public LDAPConstraints( int msLimit, boolean doReferrals,
@ -87,18 +87,18 @@ public class LDAPConstraints implements Cloneable {
* Constructs a new <CODE>LDAPConstraints</CODE> object and allows you
* to specify the constraints in that object.
* <P>
* @param msLimit Maximum time in milliseconds to wait for results (0
* @param msLimit Mmaximum time in milliseconds to wait for results (0
* by default, which means that there is no maximum time limit)
* @param doReferrals Specify <CODE>true</CODE> to follow referrals
* @param doReferrals specify <CODE>true</CODE> to follow referrals
* automatically, or <CODE>False</CODE> to throw an
* <CODE>LDAPReferralException</CODE> error if the server sends back
* a referral (<CODE>False</CODE> by default)
* @param bind_proc Specifies the object that
* @param bind_proc specifies the object that
* implements the <CODE>LDAPBind</CODE> interface (you need to
* define this class). The object will be used to authenticate to the
* server on referrals. (This field is <CODE>null</CODE> by default.)
* @param hop_limit Maximum number of referrals to follow in a
* sequence when attempting to resolve a request.
* @param hop_limit maximum number of referrals to follow in a
* sequence when attempting to resolve a request
* @see netscape.ldap.LDAPConnection#setOption(int, java.lang.Object)
*/
public LDAPConstraints( int msLimit, boolean doReferrals,
@ -116,7 +116,7 @@ public class LDAPConstraints implements Cloneable {
* Returns the maximum number of milliseconds to wait for any operation
* under these constraints. If 0, there is no maximum time limit
* on waiting for the operation results.
* @return Maximum number of milliseconds to wait for operation results.
* @return maximum number of milliseconds to wait for operation results.
*/
public int getTimeLimit() {
return m_time_limit;
@ -129,7 +129,7 @@ public class LDAPConstraints implements Cloneable {
* or <CODE>false</CODE> if referrals throw an
* <CODE>LDAPReferralException</CODE>.
* @return <CODE>true</CODE> if referrals are followed automatically,
* <CODE>False</CODE> if referrals throw an
* <CODE>false</CODE> if referrals throw an
* <CODE>LDAPReferralException</CODE>.
*/
public boolean getReferrals() {
@ -140,7 +140,7 @@ public class LDAPConstraints implements Cloneable {
* Returns the object that provides the mechanism for authenticating to the
* server on referrals. This object must implement the <CODE>LDAPBind</CODE>
* interface.
* @return Object to be used to authenticate to the server on referrals.
* @return object to use to authenticate to the server on referrals.
* @see netscape.ldap.LDAPBind
*/
public LDAPBind getBindProc() {
@ -151,7 +151,7 @@ public class LDAPConstraints implements Cloneable {
* Returns the object that provides the method for getting
* authentication information. This object must
* implement the <CODE>LDAPRebind</CODE> interface.
* @return Object to be used to obtain information for
* @return object to use to obtain information for
* authenticating to other LDAP servers during referrals.
* @see netscape.ldap.LDAPRebind
* @see netscape.ldap.LDAPRebindAuth
@ -162,7 +162,7 @@ public class LDAPConstraints implements Cloneable {
/**
* Returns the maximum number of hops to follow during a referral.
* @return Maximum number of hops to follow during a referral.
* @return maximum number of hops to follow during a referral.
*/
public int getHopLimit() {
return m_hop_limit;
@ -171,7 +171,7 @@ public class LDAPConstraints implements Cloneable {
/**
* Returns any client controls to be applied by the client
* to LDAP operations.
* @return Client controls to be applied by the client to LDAP operations.
* @return client controls for the client to apply to LDAP operations.
* @see netscape.ldap.LDAPControl
* @see netscape.ldap.LDAPConnection#getOption
* @see netscape.ldap.LDAPConnection#setOption
@ -183,7 +183,7 @@ public class LDAPConstraints implements Cloneable {
/**
* Returns any server controls to be applied by the server
* to LDAP operations.
* @return Server controls to be applied by the server to LDAP operations.
* @return server controls for the server to apply to LDAP operations.
* @see netscape.ldap.LDAPControl
* @see netscape.ldap.LDAPConnection#getOption
* @see netscape.ldap.LDAPConnection#setOption
@ -199,8 +199,8 @@ public class LDAPConstraints implements Cloneable {
* an LDAPException with the result code <CODE>LDAPException.TIME_LIMIT
* </CODE> is thrown.
* @param msLimit Maximum number of milliseconds to wait for operation
* results.
* (0 by default, which means that there is no maximum time limit.)
* results (0 by default, which means that there is no maximum time
* limit.)
* @see netscape.ldap.LDAPException#LDAP_TIMEOUT
*/
public void setTimeLimit( int msLimit ) {
@ -209,9 +209,9 @@ public class LDAPConstraints implements Cloneable {
/**
* Specifies whether nor not referrals are followed automatically.
* Returns <CODE>true</CODE> if referrals are to be followed automatically,
* or <CODE>false</CODE> if referrals throw an
* Specifies whether or not referrals are followed automatically.
* Specify <CODE>true</CODE> if referrals are to be followed automatically,
* or <CODE>false</CODE> if referrals are to throw an
* <CODE>LDAPReferralException</CODE>.
* (By default, this is set to <CODE>false</CODE>.)
* <P>
@ -225,9 +225,9 @@ public class LDAPConstraints implements Cloneable {
* authentication mechanism to be used instead of the default
* authentication mechanism when following referrals. This
* object should be passed to the <CODE>setBindProc</CODE> method.
* @param doReferrals Set to <CODE>true</CODE> if referrals should be
* @param doReferrals set to <CODE>true</CODE> if referrals should be
* followed automatically, or <CODE>False</CODE> if referrals should throw
* an <CODE>LDAPReferralException</CODE>.
* an <CODE>LDAPReferralException</CODE>
* @see netscape.ldap.LDAPBind
* @see netscape.ldap.LDAPRebind
* @see netscape.ldap.LDAPRebindAuth
@ -242,8 +242,8 @@ public class LDAPConstraints implements Cloneable {
* the <CODE>LDAPBind</CODE> interface.(By default, this is
* <CODE>null</CODE>.) This method sets the <CODE>LDAPRebind</CODE>
* object to null for this constraint.
* @param bind_proc Object to be used to authenticate to the server
* on referrals.
* @param bind_proc object to use to authenticate to the server
* on referrals
* @see netscape.ldap.LDAPBind
*/
public void setBindProc( LDAPBind bind_proc ) {
@ -259,8 +259,8 @@ public class LDAPConstraints implements Cloneable {
* that implements the <CODE>LDAPRebind</CODE> interface.
* (By default, this is <CODE>null</CODE>.) This method sets the
* <CODE>LDAPBind</CODE> object to null for this constraint.
* @param rebind_proc Object to be used to obtain information for
* authenticating to other LDAP servers during referrals.
* @param rebind_proc object to use to obtain information for
* authenticating to other LDAP servers during referrals
*/
public void setRebindProc( LDAPRebind rebind_proc ) {
m_rebind_proc = rebind_proc;
@ -272,7 +272,7 @@ public class LDAPConstraints implements Cloneable {
/**
* Sets maximum number of hops to follow in sequence during a referral.
* (By default, this is 5.)
* @param hop_limit Maximum number of hops to follow during a referral.
* @param hop_limit maximum number of hops to follow during a referral
*/
public void setHopLimit( int hop_limit ) {
m_hop_limit = hop_limit;
@ -280,7 +280,7 @@ public class LDAPConstraints implements Cloneable {
/**
* Sets a client control for LDAP operations.
* @param control Client control for LDAP operations.
* @param control client control for LDAP operations
* @see netscape.ldap.LDAPControl
*/
public void setClientControls( LDAPControl control ) {
@ -290,7 +290,7 @@ public class LDAPConstraints implements Cloneable {
/**
* Sets an array of client controls for LDAP operations.
* @param controls Array of client controls for LDAP operations.
* @param controls array of client controls for LDAP operations
* @see netscape.ldap.LDAPControl
*/
public void setClientControls( LDAPControl[] controls ) {
@ -299,7 +299,7 @@ public class LDAPConstraints implements Cloneable {
/**
* Sets a server control for LDAP operations.
* @param control Server control for LDAP operations.
* @param control server control for LDAP operations
* @see netscape.ldap.LDAPControl
*/
public void setServerControls( LDAPControl control ) {
@ -309,16 +309,53 @@ public class LDAPConstraints implements Cloneable {
/**
* Sets an array of server controls for LDAP operations.
* @param controls An array of server controls for LDAP operations.
* @param controls an array of server controls for LDAP operations
* @see netscape.ldap.LDAPControl
*/
public void setServerControls( LDAPControl[] controls ) {
m_serverControls = controls;
}
/**
* Return a string representation of the object for debugging
*
* @return A string representation of the object
*/
public String toString() {
StringBuffer sb = new StringBuffer("LDAPConstraints {");
sb.append("time limit " + getTimeLimit() + ", ");
sb.append("referrals " + getReferrals() + ", ");
sb.append("hop limit " + getHopLimit() + ", ");
sb.append("bind_proc " + getBindProc() + ", ");
sb.append("rebind_proc " + getRebindProc());
LDAPControl[] controls = getClientControls();
if ( controls != null ) {
sb.append(", client controls ");
for (int i =0; i < controls.length; i++) {
sb.append(controls[i].toString());
if ( i < (controls.length - 1) ) {
sb.append(" ");
}
}
}
controls = getServerControls();
if ( controls != null ) {
sb.append(", server controls ");
for (int i =0; i < controls.length; i++) {
sb.append(controls[i].toString());
if ( i < (controls.length - 1) ) {
sb.append(" ");
}
}
}
sb.append('}');
return sb.toString();
}
/**
* Makes a copy of an existing set of constraints.
* @returns A copy of an existing set of constraints.
* @returns a copy of an existing set of constraints
*/
public Object clone() {
LDAPConstraints o = new LDAPConstraints();

Просмотреть файл

@ -176,11 +176,11 @@ public class LDAPControl implements Cloneable {
* data to be used by the control.
* <P>
*
* @param id The object ID (OID) identifying the control.
* @param id the object ID (OID) identifying the control
* @param critical <CODE>true</CODE> if the LDAP operation should be
* cancelled when the server does not support this control (in other
* words, this control is critical to the LDAP operation).
* @param vals Control-specific data.
* words, this control is critical to the LDAP operation)
* @param vals control-specific data
* @see netscape.ldap.LDAPConstraints#setClientControls
* @see netscape.ldap.LDAPConstraints#setServerControls
*/
@ -194,7 +194,7 @@ public class LDAPControl implements Cloneable {
/**
* Gets the object ID (OID) of the control.
* @return Object ID (OID) of the control.
* @return object ID (OID) of the control.
*/
public String getID() {
return m_oid;
@ -211,7 +211,7 @@ public class LDAPControl implements Cloneable {
/**
* Gets the data in the control.
* @return Returns the data in the control as a byte array.
* @return the data in the control as a byte array.
*/
public byte[] getValue() {
return m_value;
@ -219,7 +219,7 @@ public class LDAPControl implements Cloneable {
/**
* Gets the ber representation of control.
* @return ber representation of control
* @return ber representation of control.
*/
BERElement getBERElement() {
BERSequence seq = new BERSequence();
@ -238,9 +238,9 @@ public class LDAPControl implements Cloneable {
* <CODE>LDAPControl</CODE>, and should implement the <CODE>LDAPControl(
* String oid, boolean critical, byte[] value)</CODE> constructor to
* instantiate the control.
* @param oid The string representation of the oid.
* @param controlClass The class that instantatiates the control associated
* with oid.
* @param oid the string representation of the oid
* @param controlClass the class that instantatiates the control associated
* with oid
* @exception netscape.ldap.LDAPException If the class parameter is not
* a subclass of <CODE>LDAPControl</CODE> or the class parameter does not
* implement the <CODE>LDAPControl(String oid, boolean critical, byte[] value)
@ -284,8 +284,8 @@ public class LDAPControl implements Cloneable {
/**
* Returns the <CODE>Class</CODE> that has been registered to oid.
* @param oid A String that associates the control class to a control.
* @return A <CODE>Class</CODE> that can instantiate a control of the
* @param oid a String that associates the control class to a control
* @return a <CODE>Class</CODE> that can instantiate a control of the
* type specified by oid.
* @see netscape.ldap.LDAPControl#register
*
@ -304,10 +304,10 @@ public class LDAPControl implements Cloneable {
* no Class is found for the given control, or an exception occurs when
* attempting to instantiate the control, a basic <CODE>LDAPControl</CODE>
* is instantiated using the parameters.
* @param oid The oid of the control to be instantiated.
* @param critical <CODE>true</CODE> if this is a critical control.
* @param value the byte value for the control.
* @return A newly instantiated <CODE>LDAPControl</CODE>.
* @param oid the oid of the control to instantiate
* @param critical <CODE>true</CODE> if this is a critical control
* @param value the byte value for the control
* @return a newly instantiated <CODE>LDAPControl</CODE>.
* @see netscape.ldap.LDAPControl#register
*/
protected static LDAPControl createControl(String oid, boolean critical,
@ -359,13 +359,13 @@ public class LDAPControl implements Cloneable {
* no Class is found for the given control, or an exception occurs when
* attempting to instantiate the control, a basic <CODE>LDAPControl</CODE>
* is instantiated using the parameters.
* @param el The <CODE>BERElement</CODE> containing the control.
* @return A newly instantiated <CODE>LDAPControl</CODE>.
* @param el the <CODE>BERElement</CODE> containing the control
* @return a newly instantiated <CODE>LDAPControl</CODE>.
* @see netscape.ldap.LPAPControl#register
*
* Note:
* This code was extracted from <CODE>JDAPControl(BERElement el)</CODE>
* constructor
* constructor.
*/
static LDAPControl parseControl(BERElement el) {
BERSequence s = (BERSequence)el;
@ -400,8 +400,8 @@ public class LDAPControl implements Cloneable {
* <P>
* If an exception occurs when instantiating a control, that control is
* returned as a basic <CODE>LDAPControl</CODE>.
* @param data The LDAP message fragment in raw BER format.
* @return A <CODE>LDAPControl</CODE> array containing all of the controls
* @param data the LDAP message fragment in raw BER format
* @return an <CODE>LDAPControl</CODE> array containing all of the controls
* from the message fragment.
* @exception java.lang.IOException If the data passed to this method
* is not a valid LDAP message fragment.
@ -438,7 +438,7 @@ public class LDAPControl implements Cloneable {
/**
* Creates a copy of the control.
* @return Copy of the control.
* @return copy of the control.
*/
public Object clone() {
byte[] vals = null;
@ -455,8 +455,8 @@ public class LDAPControl implements Cloneable {
/**
* Create a "flattened" BER encoding from a BER,
* and return it as a byte array.
* @param ber A BER encoded sequence.
* @return The byte array of encoded data.
* @param ber a BER encoded sequence
* @return the byte array of encoded data.
*/
protected byte[] flattenBER( BERSequence ber ) {
/* Suck out the data and return it */
@ -472,7 +472,7 @@ public class LDAPControl implements Cloneable {
/**
* Return a string representation of the control for debugging
*
* @return A string representation of the control
* @return a string representation of the control.
*/
public String toString() {
String s = getID() + ' ' + isCritical();

Просмотреть файл

@ -36,10 +36,10 @@ public class LDAPDN {
/**
* Returns the individual components of a distinguished name (DN).
* @param dn Distinguished name that you want to get the components of.
* @param noTypes If <CODE>true</CODE>, returns only the values of the
* components and not the names (such as 'cn=').
* @return An array of strings representing the components of the DN.
* @param dn distinguished name of which you want to get the components.
* @param noTypes if <CODE>true</CODE>, returns only the values of the
* components and not the names (such as 'cn=')
* @return an array of strings representing the components of the DN.
* @see netscape.ldap.LDAPDN#explodeRDN(java.lang.String, boolean)
*/
public static String[] explodeDN (String dn, boolean noTypes) {
@ -49,10 +49,10 @@ public class LDAPDN {
/**
* Returns the individual components of a relative distinguished name (RDN).
* @param rdn Relative distinguished name that you want to get the components of.
* @param noTypes If <CODE>true</CODE>, returns only the values of the
* components and not the names (such as 'cn=').
* @return An array of strings representing the components of the RDN.
* @param rdn relative distinguished name of which you want to get the components.
* @param noTypes if <CODE>true</CODE>, returns only the values of the
* components and not the names (such as 'cn=')
* @return an array of strings representing the components of the RDN.
* @see netscape.ldap.LDAPDN#explodeDN(java.lang.String, boolean)
*/
public static String[] explodeRDN (String rdn, boolean noTypes) {
@ -65,8 +65,8 @@ public class LDAPDN {
* by <CODE>netscape.ldap.util.DN.ESCAPED_CHAR</CODE>.
* <P>
*
* @param rdn The RDN that you want escaped.
* @return The RDN with the characters escaped.
* @param rdn the RDN to escape
* @return the RDN with the characters escaped.
* @see netscape.ldap.util.DN#ESCAPED_CHAR
* @see netscape.ldap.LDAPDN#unEscapeRDN(java.lang.String)
*/
@ -98,8 +98,8 @@ public class LDAPDN {
* DN, see <CODE>netscape.ldap.LDAPDN.ESCAPED_CHAR</CODE>.
* <P>
*
* @param rdn The RDN that you want unescaped.
* @return The unescaped RDN.
* @param rdn the RDN to unescape
* @return the unescaped RDN.
* @see netscape.ldap.util.DN#ESCAPED_CHAR
* @see netscape.ldap.LDAPDN#escapeRDN(java.lang.String)
*/

Просмотреть файл

@ -40,7 +40,7 @@ public class LDAPEntry {
/**
* Constructs a new entry with the specified distinguished name and with
* an empty attribute set.
* @param distinguishedName The distinguished name of the new entry.
* @param distinguishedName the distinguished name of the new entry
*/
public LDAPEntry( String distinguishedName ) {
dn = distinguishedName;
@ -50,8 +50,8 @@ public class LDAPEntry {
/**
* Constructs a new entry with the specified distinguished name and
* set of attributes.
* @param distinguishedName The distinguished name of the new entry.
* @param attrs The set of attributes that you want assigned to the new entry.
* @param distinguishedName the distinguished name of the new entry
* @param attrs the set of attributes to assign to the new entry
* @see netscape.ldap.LDAPAttributeSet
*/
public LDAPEntry( String distinguishedName, LDAPAttributeSet attrs ) {
@ -61,7 +61,7 @@ public class LDAPEntry {
/**
* Returns the distinguished name of the current entry.
* @return Distinguished name of the current entry.
* @return distinguished name of the current entry.
*/
public String getDN() {
return dn;
@ -73,7 +73,7 @@ public class LDAPEntry {
/**
* Returns the attribute set of the entry.
* @return Set of attributes in the entry.
* @return set of attributes in the entry.
* @see netscape.ldap.LDAPAttributeSet
*/
public LDAPAttributeSet getAttributeSet() {
@ -105,7 +105,7 @@ public class LDAPEntry {
* sn;phonetic;lang-ja
* </PRE>
*
* @param subtype Semi-colon delimited list of subtypes
* @param subtype semi-colon delimited list of subtypes
* that you want to find in attribute names.
*<PRE>
* "lang-ja" // Only Japanese language subtypes
@ -113,8 +113,8 @@ public class LDAPEntry {
* "binary;lang-ja" // Only Japanese language subtypes
* which also are binary
*</PRE>
* @return Attribute set containing the attributes that have
* the specified subtypes
* @return attribute set containing the attributes that have
* the specified subtypes.
* @see netscape.ldap.LDAPAttributeSet
* @see netscape.ldap.LDAPAttributeSet#getSubset
*/
@ -125,14 +125,14 @@ public class LDAPEntry {
/**
* In an entry, returns the single attribute that exactly matches the
* specified attribute name.
* @param attrName Name of attribute to return.
* @param attrName name of attribute to return
* For example:
*<PRE>
* "cn" // Only a non-subtyped version of cn
* "cn;lang-ja" // Only a Japanese version of cn, will not
* // return "cn;lang-ja-JP-kanji", for example
*</PRE>
* @return Attribute in the current entry that has exactly the same name,
* @return attribute in the current entry that has exactly the same name,
* or null (if no attribute in the entry matches the specified name).
* @see netscape.ldap.LDAPAttribute
*/
@ -161,9 +161,9 @@ public class LDAPEntry {
* getAttribute( "sn", "lang-en" ) returns the "<CODE>sn</CODE>" attribute.
*</PRE>
* <P>
* @param attrName Name of attribute to find in the entry.
* @param lang A language specification (for example, <CODE>lang-en</CODE>).
* @return The attribute that matches the base name and that best
* @param attrName name of attribute to find in the entry
* @param lang a language specification (for example, <CODE>lang-en</CODE>)
* @return the attribute that matches the base name and that best
* matches any specified language subtype.
* @see netscape.ldap.LDAPAttribute
*/
@ -185,7 +185,7 @@ public class LDAPEntry {
* values='Product Development,People'}
* </PRE>
*
* @return String representation of the entry's DN and its attributes.
* @return string representation of the entry's DN and its attributes.
*/
public String toString() {
StringBuffer sb = new StringBuffer("LDAPEntry: ");

Просмотреть файл

@ -577,7 +577,7 @@ public class LDAPException extends java.lang.Exception {
* thrown, any code that catches the exception may need to extract
* the result code from the exception.)
* <P>
* @param message The additional error information.
* @param message the additional error information
* @see netscape.ldap.LDAPException#toString()
*/
public LDAPException( String message ) {
@ -592,10 +592,9 @@ public class LDAPException extends java.lang.Exception {
* <CODE>getLDAPResultCode()</CODE> method.
* <P>
*
* @param message The additional error information that you
* want to specify.
* @param resultCode The result code returned from the
* operation that caused this exception.
* @param message the additional error information to specify
* @param resultCode the result code returned from the
* operation that caused this exception
* @see netscape.ldap.LDAPException#toString()
* @see netscape.ldap.LDAPException#getLDAPResultCode()
*/
@ -627,12 +626,11 @@ public class LDAPException extends java.lang.Exception {
*
* Use this form of the constructor
* for higher-level LDAP operational errors.
* @param message The additional error information that you
* want to specify.
* @param resultCode The result code returned from the
* operation that caused this exception.
* @param serverErrorMessage Error message specifying additional
* information returned from the server.
* @param message the additional error information to specify
* @param resultCode the result code returned from the
* operation that caused this exception
* @param serverErrorMessage error message specifying additional
* information returned from the server
* @see netscape.ldap.LDAPException#toString()
* @see netscape.ldap.LDAPException#getLDAPResultCode()
* @see netscape.ldap.LDAPException#getLDAPErrorMessage()
@ -673,12 +671,12 @@ public class LDAPException extends java.lang.Exception {
* <P>
*
* This form is used for higher-level LDAP operational errors.
* @param message The additional error information.
* @param resultCode The result code returned.
* @param serverErrorMessage Error message specifying additional information
* returned from the server.
* @param matchedDN Maximal subset of a specified DN which could be
* matched by the server.
* @param message the additional error information
* @param resultCode the result code returned
* @param serverErrorMessage error message specifying additional information
* returned from the server
* @param matchedDN maximal subset of a specified DN which could be
* matched by the server
* @see netscape.ldap.LDAPException#toString()
* @see netscape.ldap.LDAPException#getLDAPResultCode()
* @see netscape.ldap.LDAPException#getLDAPErrorMessage()
@ -697,7 +695,7 @@ public class LDAPException extends java.lang.Exception {
* This result code is defined as a public final static int member
* of this class. Note that this value is not always valid.
* -1 indicates that the result code is invalid.
* @return The LDAP result code of the last operation.
* @return the LDAP result code of the last operation.
*/
public int getLDAPResultCode () {
return resultCode;
@ -721,7 +719,7 @@ public class LDAPException extends java.lang.Exception {
* method instead.
* <P>
*
* @return The error message of the last error (or <CODE>null</CODE>
* @return the error message of the last error (or <CODE>null</CODE>
* if no message was set).
* @see netscape.ldap.LDAPException#toString()
*/
@ -747,7 +745,7 @@ public class LDAPException extends java.lang.Exception {
*
* If the exception does not specify a matching DN,
* this method returns <CODE>null</CODE>.
* @return The maximal subset of a DN which could be matched,
* @return the maximal subset of a DN which could be matched,
* or <CODE>null</CODE> if the error is not one of the above.
*/
public String getMatchedDN () {
@ -781,7 +779,7 @@ public class LDAPException extends java.lang.Exception {
* a current locale.
* <P>
*
* @return String representation of exception
* @return string representation of exception.
* @see netscape.ldap.LDAPException#errorCodeToString(int)
*/
public String toString() {
@ -808,8 +806,8 @@ public class LDAPException extends java.lang.Exception {
* and delimited by an underscore) of the default locale. For example:
* <PRE>netscape/ldap/error/ErrorCodes_en_US.props</PRE>
*
* @return The error message describing the error code for this
* exception in the default locale
* @return the error message describing the error code for this
* exception in the default locale.
*/
public String errorCodeToString() {
return errorCodeToString(resultCode, m_locale);
@ -824,10 +822,10 @@ public class LDAPException extends java.lang.Exception {
* and delimited by an underscore) of the default locale. For example:
* <PRE>netscape/ldap/error/ErrorCodes_en_US.props</PRE>
*
* @param l The <CODE>java.util.Locale</CODE> object representing the
* locale of the error message that you want to retrieve.
* @return The error message describing the current error code
* in the specified locale.
* @param l the <CODE>java.util.Locale</CODE> object representing the
* locale of the error message to retrieve
* @return the error message describing the current error code
* in the specified locale.
*/
public String errorCodeToString(Locale l) {
return errorCodeToString(resultCode, l);
@ -844,10 +842,10 @@ public class LDAPException extends java.lang.Exception {
* and delimited by an underscore) of the default locale. For example:
* <PRE>netscape/ldap/error/ErrorCodes_en_US.props</PRE>
*
* @param code The error code that you want to get the
* corresponding error message for.
* @return Error message describing the specified error code for
* the default locale.
* @param code the error code for which to get the
* corresponding error message
* @return error message describing the specified error code for
* the default locale.
*/
public static String errorCodeToString(int code) {
return errorCodeToString(code, Locale.getDefault());
@ -862,12 +860,12 @@ public class LDAPException extends java.lang.Exception {
* and delimited by an underscore) of the default locale. For example:
* <PRE>netscape/ldap/error/ErrorCodes_en_US.props</PRE>
*
* @param code The error code that you want to get the
* corresponding error message for.
* @param locale The <CODE>java.util.Locale</CODE> object representing the
* locale of the error message that you want to retrieve.
* @return Error message describing the specified error code for
* the specified locale.
* @param code the error code for which to get the
* corresponding error
* @param locale the <CODE>java.util.Locale</CODE> object representing the
* locale of the error message that you want to retrieve
* @return error message describing the specified error code for
* the specified locale.
*/
public synchronized static String errorCodeToString(int code, Locale locale) {
try {

Просмотреть файл

@ -123,8 +123,8 @@ public class LDAPExtendedOperation {
/**
* Construct an object
* @param oid Identifier for the particular operation.
* @param vals Operation-specific data.
* @param oid identifier for the particular operation
* @param vals operation-specific data
*/
public LDAPExtendedOperation( String oid, byte[] vals ) {
m_oid = oid;
@ -133,7 +133,7 @@ public class LDAPExtendedOperation {
/**
* Get the identifier for this operation.
* @return oid Identifier for the particular operation.
* @return oid identifier for the particular operation.
*/
public String getID() {
return m_oid;
@ -141,7 +141,7 @@ public class LDAPExtendedOperation {
/**
* Get the data for this operation.
* @return vals Operation-specific data.
* @return vals operation-specific data.
*/
public byte[] getValue() {
return m_vals;

Просмотреть файл

@ -30,8 +30,8 @@ public class LDAPExtendedResponse extends LDAPResponse {
* Constructor
*
* @param msgid message identifier
* @param rsp Extended operation response
* @paarm controls Array of controls of null
* @param rsp extended operation response
* @paarm controls array of controls or null
*/
LDAPExtendedResponse(int msgid, JDAPExtendedResponse rsp, LDAPControl controls[]) {
super(msgid, rsp, controls);
@ -40,7 +40,7 @@ public class LDAPExtendedResponse extends LDAPResponse {
/**
* Returns the OID of the response.
*
* @return The response OID
* @return the response OID.
*/
public String getOID() {
JDAPExtendedResponse result = (JDAPExtendedResponse)getProtocolOp();
@ -50,7 +50,7 @@ public class LDAPExtendedResponse extends LDAPResponse {
/**
* Returns the raw bytes of the value part of the response.
*
* @return Response as a raw array of bytes
* @return response as a raw array of bytes.
*/
public byte[] getValue() {
JDAPExtendedResponse result = (JDAPExtendedResponse)getProtocolOp();

Просмотреть файл

@ -32,7 +32,7 @@ public class LDAPInterruptedException extends LDAPException {
* the <CODE>toString()</CODE> method.
* <P>
*
* @param message The additional information.
* @param message the additional information
* @see netscape.ldap.LDAPInterruptedException#toString()
*/
LDAPInterruptedException( String message ) {

Просмотреть файл

@ -225,7 +225,7 @@ public class LDAPMatchingRuleSchema extends LDAPSchemaElement {
* Gets the list of the OIDs of the attribute types which can be used
* with the matching rule.
* @return array of the OIDs of the attribute types which can be used
* with the matching rule
* with the matching rule.
*/
public String[] getAttributes() {
return attributes;
@ -368,7 +368,7 @@ public class LDAPMatchingRuleSchema extends LDAPSchemaElement {
* Gets the definition of the matching rule in a user friendly format.
* This is the format that the matching rule definition uses when
* you print the matching rule or the schema.
* @return definition of the matching rule in a user friendly format
* @return definition of the matching rule in a user friendly format.
*/
public String toString() {
String s = "Name: " + name + "; OID: " + oid + "; Type: ";

Просмотреть файл

@ -187,7 +187,7 @@ public class LDAPMessage {
/**
* Returns the message identifer.
* @return message identifer
* @return message identifer.
*/
public int getID(){
return m_msgid;
@ -195,7 +195,7 @@ public class LDAPMessage {
/**
* Returns the LDAP operation type of the message
* @return message type
* @return message type.
*/
public int getType(){
return m_protocolOp.getType();
@ -203,7 +203,7 @@ public class LDAPMessage {
/**
* Retrieves the protocol operation.
* @return protocol operation
* @return protocol operation.
*/
JDAPProtocolOp getProtocolOp() {
return m_protocolOp;
@ -211,7 +211,7 @@ public class LDAPMessage {
/**
* Retrieves list of controls.
* @return controls
* @return controls.
*/
public LDAPControl[] getControls() {
return m_controls;
@ -242,8 +242,8 @@ public class LDAPMessage {
}
/**
* Returns string representation of a ldap message.
* @return ldap message
* Returns string representation of an LDAP message.
* @return LDAP message.
*/
public String toString() {
StringBuffer sb = new StringBuffer("[LDAPMessage] ");

Просмотреть файл

@ -64,8 +64,8 @@ class LDAPMessageQueue {
/**
* Constructor
* @param asynchOp A flag whether the object is used for asynchronous
* LDAP operations
* @param asynchOp a boolean flag that is true if the object is used
* for asynchronous LDAP operations
* @see netscape.ldap.LDAPAsynchronousConnection
*/
LDAPMessageQueue (boolean asynchOp) {
@ -75,7 +75,7 @@ class LDAPMessageQueue {
/**
* Returns a flag whether the listener is used for asynchronous LDAP
* operations
* @return Asynchronous operation flag
* @return asynchronous operation flag.
* @see netscape.ldap.LDAPAsynchronousConnection
*/
boolean isAsynchOp() {
@ -85,7 +85,7 @@ class LDAPMessageQueue {
/**
* Blocks until a response is available or until all operations
* associated with the object have completed or been canceled.
* @return LDAP message or null if there is no more outstanding requests
* @return LDAP message or null if there are no more outstanding requests.
* @exception LDAPException Network error exception
* @exception LDAPInterruptedException The invoking thread was interrupted
*/
@ -123,7 +123,7 @@ class LDAPMessageQueue {
* Wait for request to complete. This method blocks until a message of
* type LDAPResponse has been received. Used by synchronous search
* with batch size of zero (block until all results are received)
* @return LDAPResponse message or null if there is no more outstanding requests
* @return LDAPResponse message or null if there are no more outstanding requests.
* @exception LDAPException Network error exception
* @exception LDAPInterruptedException The invoking thread was interrupted
*/
@ -225,7 +225,7 @@ class LDAPMessageQueue {
* The proper way to handle this scenario is to create a separate listener
* for each new request, and after l.getIDs() has been invoked, merge the
* new request with the existing one.
* @param mq2 Message queue to be merged with this one.
* @param mq2 message queue to merge with this one
*/
synchronized void merge(LDAPMessageQueue mq2) {
synchronized (mq2) {
@ -248,7 +248,7 @@ class LDAPMessageQueue {
/**
* Retrieves all messages currently in the queue without blocking
* @returns Vector of messages
* @return vector of messages.
*/
synchronized Vector getAllMessages() {
Vector result = m_messageQueue;
@ -263,6 +263,14 @@ class LDAPMessageQueue {
*/
synchronized void addMessage (LDAPMessage msg) {
m_messageQueue.addElement(msg);
// Mark conn as bound for asych bind operations
if (isAsynchOp() && msg.getType() == msg.BIND_RESPONSE) {
if (((LDAPResponse) msg).getResultCode() == 0) {
getConnection(msg.getID()).markConnAsBound();
}
}
notifyAll ();
}
@ -281,7 +289,7 @@ class LDAPMessageQueue {
/**
* Checks if response message is received.
* @return true or false
* @return true or false.
*/
boolean isMessageReceived() {
return m_messageQueue.size() != 0;
@ -289,7 +297,7 @@ class LDAPMessageQueue {
/**
* Returns the count of queued messages
* @return message count
* @return message count.
*/
public int getMessageCount () {
return m_messageQueue.size();
@ -302,7 +310,7 @@ class LDAPMessageQueue {
* Not synchronized as its private and can be called only by
* abandon() and removeAllRequests()
*
* @return Count of removed messages
* @return count of removed messages.
*/
private int removeAllMessages(int id) {
int removeCount=0;
@ -331,8 +339,8 @@ class LDAPMessageQueue {
/**
* Returns the connection associated with the specified request id
* @parm id request id
* @return connection
* @param id request id
* @return connection.
*/
synchronized LDAPConnection getConnection(int id) {
for (int i=0; i < m_requestList.size(); i++) {
@ -347,8 +355,8 @@ class LDAPMessageQueue {
/**
* Returns the connection thread associated with the specified request id
* @parm id request id
* @return connection thread
* @param id request id.
* @return connection thread.
*/
synchronized LDAPConnThread getConnThread(int id) {
for (int i=0; i < m_requestList.size(); i++) {
@ -362,8 +370,8 @@ class LDAPMessageQueue {
}
/**
* Returns message id of the last request
* @return Message id.
* Returns message ID of the last request
* @return message ID.
*/
synchronized int getID() {
int reqCnt = m_requestList.size();
@ -377,8 +385,8 @@ class LDAPMessageQueue {
}
/**
* Returns a list of message ids for all outstanding requests
* @return Message id array
* Returns a list of message IDs for all outstanding requests
* @return message ID array.
*/
synchronized int[] getIDs() {
int[] ids = new int[m_requestList.size()];
@ -393,8 +401,8 @@ class LDAPMessageQueue {
* Registers a LDAP request
* @param id LDAP request message ID
* @param connection LDAP Connection for the message ID
* @param connThread A physical connection to the server
* @param timeLimit The maximum number of milliseconds to wait for
* @param connThread a physical connection to the server
* @param timeLimit the maximum number of milliseconds to wait for
* the request to complete
*/
synchronized void addRequest(int id, LDAPConnection connection,
@ -410,7 +418,7 @@ class LDAPMessageQueue {
/**
* Returns the number of outstanding requests.
* @return Outstanding request count.
* @return outstanding request count.
*/
public int getRequestCount() {
return m_requestList.size();
@ -421,7 +429,7 @@ class LDAPMessageQueue {
* Called when a LDAP operation is abandoned (called from
* LDAPConnThread), or terminated (called by nextMessage() when
* LDAPResponse message is received)
* @return Flag whether the request was removed
* @return flag indicating whether the request was removed.
*/
synchronized boolean removeRequest(int id) {
for (int i=0; i < m_requestList.size(); i++) {
@ -439,7 +447,7 @@ class LDAPMessageQueue {
/**
* Remove all requests associated with the specified connThread
* Called when a connThread has a network error
* @return Number of removed request
* @return number of removed requests.
*/
synchronized int removeAllRequests(LDAPConnThread connThread) {
int removeCount=0;

Просмотреть файл

@ -65,14 +65,14 @@ public class LDAPModification {
/**
* Specifies a modification to be made to an attribute.
* @param op The type of modification to make, which can be one of the following:
* @param op the type of modification to make. This can be one of the following:
* <P>
* <UL>
* <LI><CODE>LDAPModification.ADD</CODE> (the value should be added to the attribute)
* <LI><CODE>LDAPModification.DELETE</CODE> (the value should be removed from the attribute)
* <LI><CODE>LDAPModification.REPLACE</CODE> (the value should replace the existing value of the attribute)
* </UL><P>
* @param attr The attribute (possibly with values) to be modified.
* @param attr the attribute (possibly with values) to modify
* @see netscape.ldap.LDAPAttribute
*/
public LDAPModification( int op, LDAPAttribute attr ) {
@ -82,7 +82,7 @@ public class LDAPModification {
/**
* Returns the type of modification specified by this object.
* @return One of the following types of modifications:
* @return one of the following types of modifications:
* <P>
* <UL>
* <LI><CODE>LDAPModification.ADD</CODE> (the value should be added to the attribute)
@ -96,7 +96,7 @@ public class LDAPModification {
/**
* Returns the attribute (possibly with values) to be modified.
* @return The attribute to be modified.
* @return the attribute to be modified.
* @see netscape.ldap.LDAPAttribute
*/
public LDAPAttribute getAttribute() {
@ -124,7 +124,7 @@ public class LDAPModification {
* LDAPModification: ADD, LDAPAttribute {type='description', values='This entry was modified with the modattrs program'}
* </PRE>
*
* @return String representation of the current modification.
* @return string representation of the current modification.
*/
public String toString() {
String s = "LDAPModification: ";

Просмотреть файл

@ -51,7 +51,7 @@ public class LDAPModificationSet {
/**
* Retrieves the number of <CODE>LDAPModification</CODE>
* objects in this set.
* @return The number of <CODE>LDAPModification</CODE>
* @return the number of <CODE>LDAPModification</CODE>
* objects in this set.
*/
public int size () {
@ -61,10 +61,10 @@ public class LDAPModificationSet {
/**
* Retrieves a particular <CODE>LDAPModification</CODE> object at
* the position specified by the index.
* @param Index position of the <CODE>LDAPModification</CODE>
* @param index position of the <CODE>LDAPModification</CODE>
* object that you want to retrieve.
* @return <CODE>LDAPModification</CODE> object representing
* a change to be made to an attribute.
* a change to make to an attribute.
*/
public LDAPModification elementAt (int index) {
return (LDAPModification)modifications.elementAt(index);
@ -73,8 +73,8 @@ public class LDAPModificationSet {
/**
* Removes a particular <CODE>LDAPModification</CODE> object at
* the position specified by the index.
* @param Index position of the <CODE>LDAPModification</CODE>
* object that you want to remove.
* @param index position of the <CODE>LDAPModification</CODE>
* object that you want to remove
*/
public void removeElementAt( int index ) {
modifications.removeElementAt(index);
@ -82,7 +82,7 @@ public class LDAPModificationSet {
/**
* Specifies another modification to be added to the set of modifications.
* @param op The type of modification to make, which can be one of the following:
* @param op the type of modification to make. This can be one of the following:
* <P>
* <UL>
* <LI><CODE>LDAPModification.ADD</CODE> (the value should be added to the attribute)
@ -93,7 +93,7 @@ public class LDAPModificationSet {
* modification type with <CODE>LDAPModification.BVALUES</CODE>.
* <P>
*
* @param attr The attribute (possibly with values) to be modified.
* @param attr the attribute (possibly with values) to modify
*/
public synchronized void add( int op, LDAPAttribute attr ) {
LDAPModification mod = new LDAPModification( op, attr );
@ -102,7 +102,7 @@ public class LDAPModificationSet {
/**
* Removes the first attribute with the specified name in the set of modifications.
* @param name Name of the attribute to be removed.
* @param name name of the attribute to remove
*/
public synchronized void remove( String name ) {
for( int i = 0; i < modifications.size(); i++ ) {
@ -119,7 +119,7 @@ public class LDAPModificationSet {
* Retrieves the string representation of the
* modification set.
*
* @return String representation of the modification set.
* @return string representation of the modification set.
*/
public String toString() {
String s = "LDAPModificationSet: {";

Просмотреть файл

@ -103,7 +103,7 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
/**
* Constructs an object class definition, using the specified
* information. The type of the object class will be STRUCTURAL.
* @param name Name of the object class.
* @param name name of the object class
* @param oid object identifier (OID) of the object class
* in dotted-string format (for example, "1.2.3.4")
* @param description description of the object class
@ -143,9 +143,9 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
* (the object classes that this object class inherits from)
* @param required array of names of attributes required
* in this object class
* @param optional array names of optional attributes
* @param optional array of names of optional attributes
* allowed in this object class
* @param type Either ABSTRACT, STRUCTURAL, or AUXILIARY
* @param type either ABSTRACT, STRUCTURAL, or AUXILIARY
* @param aliases names which are to be considered aliases for this
* object class; <CODE>null</CODE> if there are no aliases
*/
@ -206,9 +206,9 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
}
/**
* Gets the name of the object class that this class inherits from.
* @return the name of the object class that this class
* inherits from. If it inherits from more than one class, only one
* Gets the name of the object class from which this class inherits.
* @return the name of the object class from which this class
* inherits. If it inherits from more than one class, only one
* is returned.
* @see netscape.ldap.LDAPObjectClassSchema#getSuperiors
*/
@ -221,8 +221,8 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
* Gets the names of all object classes that this class inherits
* from. Typically only one, but RFC 2252 allows multiple
* inheritance.
* @return the names of the object classes that this class
* inherits from
* @return the names of the object classes from which this class
* inherits.
*/
public String[] getSuperiors() {
return getQualifier( SUPERIOR );
@ -232,7 +232,7 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
* Gets an enumeration of the names of the required attributes for
* this object class.
* @return an enumeration of the names of the required attributes
* for this object class
* for this object class.
*/
public Enumeration getRequiredAttributes() {
return must.elements();
@ -242,7 +242,7 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
* Gets an enumeration of names of optional attributes allowed
* in this object class.
* @return an enumeration of the names of optional attributes
* allowed in this object class
* allowed in this object class.
*/
public Enumeration getOptionalAttributes() {
return may.elements();
@ -250,7 +250,7 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
/**
* Gets the type of the object class.
* @return STRUCTURAL, ABSTRACT, or AUXILIARY
* @return STRUCTURAL, ABSTRACT, or AUXILIARY.
*/
public int getType() {
int type = STRUCTURAL;
@ -267,7 +267,7 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
*
* @param quotingBug <CODE>true</CODE> if SUP and SYNTAX values are to
* be quoted. That is to satisfy bugs in certain LDAP servers.
* @return a String ready to be submitted to an LDAP server
* @return a String ready for submission to an LDAP server.
*/
String getValue( boolean quotingBug ) {
String s = getValuePrefix();
@ -303,7 +303,7 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
* Gets the definition of the object class in a user friendly format.
* This is the format that the object class definition uses when
* you print the object class or the schema.
* @return definition of the object class in a user friendly format
* @return definition of the object class in a user friendly format.
*/
public String toString() {
String s = "Name: " + name + "; OID: " + oid +
@ -351,7 +351,7 @@ public class LDAPObjectClassSchema extends LDAPSchemaElement {
* Creates a list within parentheses, with $ as delimiter
*
* @param vals values for list
* @return a String with a list of values
* @return a String with a list of values.
*/
protected String vectorToList( Vector vals ) {
String val = "( ";

Просмотреть файл

@ -21,19 +21,19 @@ import java.util.*;
import java.io.*;
/**
* Specifies how you can retrieve authentication information automatically
* Specifies how to retrieve authentication information automatically
* for referrals. If you have set up the search constraints (or the options
* in the <CODE>LDAPConnection</CODE> object) so that automatic referral is
* used, you must define a class that implements this interface.
* in the <CODE>LDAPConnection</CODE> object) to use automatic referral,
* you must define a class that implements this interface.
* <P>
*
* If no class implements this interface, clients that follow automatic
* referrals are authenticated anonymously with subsequent LDAP servers.
* referrals are authenticated anonymously to subsequent LDAP servers.
* The following example is a simple class that implements this interface.
* Objects of this class check the host and port of the LDAP server that is
* being referred to. If the host and port are "alway.mcom.com:389", the
* directory manager's name and password will be used to authenticate to that
* server. For all other LDAP servers, anonymous authentication is used.
* Objects of the myLDAPRebind class check the host and port of the
* referred LDAP server. If the host and port are "alway.mcom.com:389",
* the directory manager's name and password are used to authenticate.
* For all other LDAP servers, anonymous authentication is used.
*
* <PRE>
* public class myLDAPRebind implements netscape.ldap.LDAPRebind

Просмотреть файл

@ -57,10 +57,10 @@ public class LDAPRebindAuth {
/**
* Constructs information that is used by the client
* for authentication when following referrals automatically.
* @param dn Distinguished name to use for authenticating to
* @param dn distinguished name to use for authenticating to
* the LDAP server during an automatic referral (if the client
* is set up to follow referrals automatically)
* @param password Password to use for authenticating to
* @param password password to use for authenticating to
* the LDAP server during an automatic referral (if the client
* is set up to follow referrals automatically)
*/
@ -72,7 +72,7 @@ public class LDAPRebindAuth {
/**
* Returns the distinguished name to be used for reauthentication,
* if the client is set up to follow referrals automatically.
* @return Distinguished name to be used for authenticating to
* @return distinguished name to use when authenticating to
* other LDAP servers during referrals.
*/
public String getDN() {
@ -82,7 +82,7 @@ public class LDAPRebindAuth {
/**
* Returns the password to be used for reauthentication,
* if the client is set up to follow referrals automatically.
* @return Password to be used for authenticating to other
* @return password to use when authenticating to other
* LDAP servers during referrals.
*/
public String getPassword() {

Просмотреть файл

@ -44,7 +44,7 @@ public class LDAPReferralException extends LDAPException {
/**
* Constructs a default exception with a specified string as
* additional information. This form is used for lower-level errors.
* @param message The additional error information
* @param message the additional error information
*/
public LDAPReferralException( String message ) {
super( message );
@ -54,7 +54,7 @@ public class LDAPReferralException extends LDAPException {
* Constructs a default exception with a specified string as
* additional information. This form is used for higher-level LDAP
* operational errors.
* @param message The additional error information
* @param message the additional error information
* @param resultCode result code
* @param serverErrorMessage error message
*/
@ -67,10 +67,10 @@ public class LDAPReferralException extends LDAPException {
* Constructs an exception with a list of LDAP URLs to other LDAP servers.
* This list of referrals points the client to LDAP servers that may
* contain the requested entries.
* @param message The additional error information
* @param message the additional error information
* @param resultCode result code
* @param referrals Array of LDAP URLs identifying other LDAP servers that
* may contain the requested entries.
* @param referrals array of LDAP URLs identifying other LDAP servers that
* may contain the requested entries
*/
public LDAPReferralException( String message, int resultCode,
String referrals[] ) {
@ -86,7 +86,7 @@ public class LDAPReferralException extends LDAPException {
* to follow referrals automatically, any operation that results in a referral will use
* this list to create new connections to the LDAP servers in this list.
*
* @return List of LDAP URLs to other LDAP servers.
* @return list of LDAP URLs to other LDAP servers.
*/
public LDAPUrl[] getURLs() {
if (getLDAPErrorMessage() == null) {

Просмотреть файл

@ -48,7 +48,7 @@ class LDAPResourceBundle {
* Return the property resource bundle according to the base name of the
* property file and the locale. The class loader will find the closest match
* with the given locale.
* @return The property resource bundle
* @return the property resource bundle.
* @exception IOException Gets thrown when failed to open the resource
* bundle file.
*/
@ -62,10 +62,10 @@ class LDAPResourceBundle {
* Return the property resource bundle according to the base name of the
* property file and the locale. The class loader will find the closest match
* with the given locale.
* @param baseName The base name of the property file, ie, the name contains
* no locale context and no . suffix
* @param l The locale
* @return The property resource bundle
* @param baseName the base name of the property file. The base name contains
* no locale context and no . suffix.
* @param l the locale
* @return the property resource bundle.
* @exception IOException Gets thrown when failed to create a property
* resource
*/
@ -94,10 +94,10 @@ class LDAPResourceBundle {
/**
* Constructs the whole absolute path name of a property file and retrieves
* an input stream on the file.
* @param baseName The base name of the property file, ie, the name contains
* no locale context and no . suffix
* @param The locale string being inserted within the file name.
* @return The input stream on the property file.
* @param baseName the base name of the property file. The base name contains
* no locale context and no . suffix.
* @param the locale string to insert into the file name
* @return the input stream of the property file.
*/
private static InputStream getStream(String baseName, String locale) {
String fStr = baseName+locale+m_suffix;
@ -106,7 +106,7 @@ class LDAPResourceBundle {
/**
* Prints debug messages if the debug mode is on.
* @param str The given message being printed.
* @param str the message that is printed
*/
private static void printDebug(String str) {
if (m_debug)

Просмотреть файл

@ -31,8 +31,8 @@ public class LDAPResponse extends LDAPMessage {
* Constructor
*
* @param msgid message identifier
* @param rsp Operation response
* @param controls Array of controls of null
* @param rsp operation response
* @param controls array of controls or null
*/
LDAPResponse(int msgid, JDAPProtocolOp rsp, LDAPControl controls[]) {
super(msgid, rsp, controls);
@ -41,7 +41,7 @@ public class LDAPResponse extends LDAPMessage {
/**
* Returns any error message in the response.
*
* @return The error message of the last error (or <CODE>null</CODE>
* @return the error message of the last error (or <CODE>null</CODE>
* if no message was set).
*/
public String getErrorMessage() {
@ -52,7 +52,7 @@ public class LDAPResponse extends LDAPMessage {
/**
* Returns the partially matched DN field, if any, in a server response.
*
* @return The maximal subset of a DN which could be matched,
* @return the maximal subset of a DN to match,
* or <CODE>null</CODE>.
*/
public String getMatchedDN() {
@ -63,7 +63,7 @@ public class LDAPResponse extends LDAPMessage {
/**
* Returns all referrals, if any, in a server response.
*
* @return A list of referrals or <CODE>null</CODE>.
* @return a list of referrals or <CODE>null</CODE>.
*/
public String[] getReferrals() {
JDAPResult result = (JDAPResult) getProtocolOp();
@ -73,7 +73,7 @@ public class LDAPResponse extends LDAPMessage {
/**
* Returns the result code in a server response.
*
* @return The result code.
* @return the result code.
*/
public int getResultCode() {
JDAPResult result = (JDAPResult) getProtocolOp();

Просмотреть файл

@ -27,8 +27,8 @@ public class LDAPResponseListener extends LDAPMessageQueue{
/**
* Constructor
* @param asynchOp A flag whether the object is used for asynchronous
* LDAP operations
* @param asynchOp a boolean flag that is true if the object is used for
* asynchronous LDAP operations
* @see netscape.ldap.LDAPAsynchronousConnection
*/
LDAPResponseListener(boolean asynchOp) {
@ -40,8 +40,8 @@ public class LDAPResponseListener extends LDAPMessageQueue{
* associated with the object have completed or been canceled, and
* returns the response.
*
* @return A response for a LDAP operation or null if there is no
* more outstanding requests
* @return a response for an LDAP operation or null if there are no
* more outstanding requests.
* @exception LDAPException Network error exception
* @exception LDAPInterruptedException The invoking thread was interrupted
*/
@ -66,7 +66,7 @@ public class LDAPResponseListener extends LDAPMessageQueue{
* The proper way to handle this scenario is to create a separate listener
* for each new request, and after l.getIDs() has been invoked, merge the
* new request with the existing one.
* @param listener2 The listener to be merged with.
* @param listener2 the listener with which to merge
*/
public void merge(LDAPSearchListener listener2) {
super.merge(listener2);
@ -75,15 +75,15 @@ public class LDAPResponseListener extends LDAPMessageQueue{
/**
* Reports true if a response has been received from the server.
*
* @return A flag whether the response message queue is empty
* @return a flag indicating whether the response message queue is empty.
*/
public boolean isResponseReceived() {
return super.isMessageReceived();
}
/**
* Returns message ids for all outstanding requests
* @return Message id array
* Returns message IDs for all outstanding requests
* @return message ID array.
*/
public int[] getIDs() {
return super.getIDs();

Просмотреть файл

@ -83,12 +83,12 @@ public class LDAPSSLSocketFactory implements LDAPSSLSocketFactoryExt {
* Constructs an <CODE>LDAPSSLSocketFactory</CODE> object using
* the specified class. The class must implement the interface
* <CODE>javax.net.ssl.SSLSocket</CODE>.
* @param className The name of a class implementing
* @param className the name of a class implementing
* the <CODE>javax.net.ssl.SSLSocket</CODE> interface.
* Pass <code>null</code> for this parameter to use the
* default SSL socket implementation,
* <CODE>netscape.net.SSLSocket</CODE>, which is included with
* Netscape Communicator 4.05 and up.
* Netscape Communicator 4.05 and higher.
*/
public LDAPSSLSocketFactory(String className) {
m_packageName = new String(className);
@ -98,12 +98,12 @@ public class LDAPSSLSocketFactory implements LDAPSSLSocketFactoryExt {
* Constructs an <CODE>LDAPSSLSocketFactory</CODE> object using
* the specified class. The class must implement the interface
* <CODE>javax.net.ssl.SSLSocket</CODE>.
* @param className The name of a class implementing
* @param className the name of a class implementing
* the <CODE>javax.net.ssl.SSLSocket</CODE> interface.
* Pass <code>null</code> for this parameter to use the
* default SSL socket implementation,
* <CODE>netscape.net.SSLSocket</CODE>, which is included with
* Netscape Communicator 4.05 and up.
* Netscape Communicator 4.05 and higher.
* @param clientAuth <CODE>true</CODE> if certificate-based client
* authentication is desired. By default, client authentication is
* not used.
@ -116,13 +116,13 @@ public class LDAPSSLSocketFactory implements LDAPSSLSocketFactoryExt {
/**
* The constructor with the specified package for security and the specified
* cipher suites.
* @param className The name of a class implementing the interface
* <CODE>javax.net.ssl.SSLSocket</CODE>
* @param className the name of a class implementing the interface
* <CODE>javax.net.ssl.SSLSocket</CODE>.
* Pass <code>null</code> for this parameter to use the
* default SSL socket implementation,
* <CODE>netscape.net.SSLSocket</CODE>, which is included with
* Netscape Communicator 4.05 and up.
* @param cipherSuites The cipher suites to use for SSL connections.
* Netscape Communicator 4.05 and higher.
* @param cipherSuites the cipher suites to use for SSL connections
*/
public LDAPSSLSocketFactory(String className, Object cipherSuites) {
m_packageName = new String(className);
@ -132,13 +132,13 @@ public class LDAPSSLSocketFactory implements LDAPSSLSocketFactoryExt {
/**
* The constructor with the specified package for security and the specified
* cipher suites.
* @param className The name of a class implementing the interface
* <CODE>javax.net.ssl.SSLSocket</CODE>
* @param className the name of a class implementing the interface
* <CODE>javax.net.ssl.SSLSocket</CODE>.
* Pass <code>null</code> for this parameter to use the
* default SSL socket implementation,
* <CODE>netscape.net.SSLSocket</CODE>, which is included with
* Netscape Communicator 4.05.
* @param cipherSuites The cipher suites to use for SSL connections.
* Netscape Communicator 4.05 and higher.
* @param cipherSuites the cipher suites to use for SSL connections
* @param clientAuth <CODE>true</CODE> if certificate-based client
* authentication is desired. By default, client authentication is
* not used.
@ -175,11 +175,11 @@ public class LDAPSSLSocketFactory implements LDAPSSLSocketFactoryExt {
* Enables client authentication for an application that uses
* an external (file-based) certificate database.
* Call this method before you call <CODE>makeSocket</CODE>.
* @param certdb The pathname for certificate database
* @param keydb The pathname for private key database
* @param keypwd The password for private key database
* @param certnickname The alias for certificate
* @param keynickname The alias for key
* @param certdb the pathname for the certificate database
* @param keydb the pathname for the private key database
* @param keypwd the password for the private key database
* @param certnickname the alias for the certificate
* @param keynickname the alias for the key
* @see netscape.ldap.LDAPSSLSocketFactory#isClientAuth
* @see netscape.ldap.LDAPSSLSocketFactory#makeSocket
* @exception LDAPException Since this method is not yet implemented,
@ -207,7 +207,7 @@ public class LDAPSSLSocketFactory implements LDAPSSLSocketFactoryExt {
/**
* Returns the name of the class that implements SSL sockets for this factory.
*
* @return The name of the class that implements SSL sockets for this factory.
* @return the name of the class that implements SSL sockets for this factory.
*/
public String getSSLSocketImpl() {
return m_packageName;
@ -217,7 +217,7 @@ public class LDAPSSLSocketFactory implements LDAPSSLSocketFactoryExt {
* Returns the suite of ciphers used for SSL connections made through
* sockets created by this factory.
*
* @return The suite of ciphers used.
* @return the suite of ciphers used.
*/
public Object getCipherSuites() {
return m_cipherSuites;
@ -226,9 +226,9 @@ public class LDAPSSLSocketFactory implements LDAPSSLSocketFactoryExt {
/**
* Returns a socket to the LDAP server with the specified
* host name and port number.
* @param host The host to connect to
* @param port The port number
* @return The socket to the host name and port number.
* @param host the host to connect to
* @param port the port number
* @return the socket to the host name and port number.
* @exception LDAPException A socket to the specified host and port
* could not be created.
* @see netscape.ldap.LDAPSSLSocketFactory

Просмотреть файл

@ -18,9 +18,9 @@
package netscape.ldap;
/**
* Represents a SSL socket connection that you can use to connect to an
* Represents an SSL socket connection that you can use to connect to an
* LDAP server. This interface extends the base interface LDAPSocketFactory
* and it provides the methods for SSL specific matters.
* and provides SSL-specific methods.
* <P>
*
* @version 1.0
@ -29,18 +29,18 @@ package netscape.ldap;
*/
public interface LDAPSSLSocketFactoryExt extends LDAPSocketFactory {
/**
* Returns the suite of ciphers used for SSL connections. These connections
* are made through sockets created by the LDAPSSLSocketFactory.
*
* @return the suite of ciphers used.
*/
public Object getCipherSuites();
/**
* Returns <code>true</code> if client authentication is enabled.
* @see netscape.ldap.LDAPSSLSocketFactory#enableClientAuth
*/
public boolean isClientAuth();
/**
* Returns the suite of ciphers used for SSL connections made through
* sockets created by this factory.
*
* @return The suite of ciphers used.
*/
public Object getCipherSuites();
}

Просмотреть файл

@ -40,8 +40,8 @@ public class LDAPSSLSocketWrapFactory implements LDAPSSLSocketFactoryExt {
/**
* The constructor with the specified package for security
* @param className The name of a class which has an implementation
* of SSL Socket extending Object class.
* @param className the name of a class which has an implementation
* of the SSL Socket extending Object class
*/
public LDAPSSLSocketWrapFactory(String className) {
m_packageName = new String(className);
@ -50,9 +50,9 @@ public class LDAPSSLSocketWrapFactory implements LDAPSSLSocketFactoryExt {
/**
* The constructor with the specified package for security and the
* specified cipher suites.
* @param className The name of a class which has an implementation
* of SSL Socket extending Object class.
* @param cipherSuites The cipher suites.
* @param className the name of a class which has an implementation
* of the SSL Socket extending Object class
* @param cipherSuites the cipher suites
*/
public LDAPSSLSocketWrapFactory(String className, Object cipherSuites) {
m_packageName = new String(className);
@ -61,9 +61,9 @@ public class LDAPSSLSocketWrapFactory implements LDAPSSLSocketFactoryExt {
/**
* Returns socket to the specified host name and port number.
* @param host The host to connect to
* @param port The port number
* @return The socket to the host name and port number as passed in.
* @param host the host to connect to
* @param port the port number
* @return the socket to the host name and port number as passed in.
* @exception LDAPException A socket to the specified host and port
* could not be created.
*/
@ -87,8 +87,8 @@ public class LDAPSSLSocketWrapFactory implements LDAPSSLSocketFactoryExt {
/**
* Returns <code>true</code> if client authentication is to be used.
* @return true if client authentication is enabled, otherwise, false if
* client authentication is disabled.
* @return <code>true</code> if client authentication is enabled;
* <code>false</code>if client authentication is disabled.
*/
public boolean isClientAuth() {
return m_clientAuth;
@ -110,7 +110,7 @@ public class LDAPSSLSocketWrapFactory implements LDAPSSLSocketFactoryExt {
/**
* Returns the name of the class that implements SSL sockets for this factory.
*
* @return The name of the class that implements SSL sockets for this factory.
* @return the name of the class that implements SSL sockets for this factory.
*/
public String getSSLSocketImpl() {
return m_packageName;
@ -120,7 +120,7 @@ public class LDAPSSLSocketWrapFactory implements LDAPSSLSocketFactoryExt {
* Returns the suite of ciphers used for SSL connections made through
* sockets created by this factory.
*
* @return The suite of ciphers used.
* @return the suite of ciphers used.
*/
public Object getCipherSuites() {
return m_cipherSuites;

Просмотреть файл

@ -24,7 +24,7 @@ import netscape.ldap.ber.stream.*;
import netscape.ldap.util.*;
import java.io.*;
import java.net.*;
import javax.security.auth.callback.CallbackHandler;
//import javax.security.auth.callback.CallbackHandler;
/**
* Authenticates to a server using SASL
@ -34,25 +34,31 @@ public class LDAPSaslBind implements LDAPBind, Serializable {
* Construct an object which can authenticate to an LDAP server
* using the specified name and a specified SASL mechanism.
*
* @param dn If non-null and non-empty, specifies that the connection and
* all operations through it should be authenticated with dn as the
* distinguished name.
* @param mechanisms Array of mechanism names, e.g. { "GSSAPI", "SKEY" }
* @param props Optional additional properties of the desired
* authentication mechanism, e.g. minimum security level.
* @param cbh A class which may be called by the SASL framework to
* obtain additional information required.
* @param dn if non-null and non-empty, specifies that the connection and
* all operations through it should authenticate with dn as the
* distinguished name
* @param mechanisms array of mechanism names, e.g. { "GSSAPI", "SKEY" }
* @param props optional additional properties of the desired
* authentication mechanism, e.g. minimum security level
* @param cbh a class which may be called by the SASL framework to
* obtain additional required information
*/
public LDAPSaslBind( String dn,
String[] mechanisms,
String packageName,
Hashtable props,
CallbackHandler cbh ) {
/*CallbackHandler*/ Object cbh ) {
_dn = dn;
_mechanisms = mechanisms;
_packageName = packageName;
_props = props;
_cbh = cbh;
if ( (cbh != null) &&
!(cbh instanceof javax.security.auth.callback.CallbackHandler) ) {
throw new IllegalArgumentException(
"Callback argument must implement " +
"javax.security.auth.callback.CallbackHandler" );
}
}
/**
@ -64,8 +70,8 @@ public class LDAPSaslBind implements LDAPBind, Serializable {
* to the server. If the object had already authenticated, the old
* authentication is discarded.
*
* @param ldc An active connection to a server, which will have
* the new authentication state on return from the method.
* @param ldc an active connection to a server, which will have
* the new authentication state on return from the method
* @exception LDAPException Failed to authenticate to the LDAP server.
*/
public void bind( LDAPConnection ldc ) throws LDAPException {
@ -89,10 +95,10 @@ public class LDAPSaslBind implements LDAPBind, Serializable {
/**
* Get a SaslClient object from the Sasl framework
*
* @param ldc Contains the host name
* @param packageName Package containing a ClientFactory
* @return A SaslClient supporting one of the mechanisms
* of the member variable _mechanisms
* @param ldc contains the host name
* @param packageName package containing a ClientFactory
* @return a SaslClient supporting one of the mechanisms
* of the member variable _mechanisms.
* @exception LDAPException on error producing a client
*/
private Object getClient( LDAPConnection ldc, String packageName )
@ -207,7 +213,7 @@ public class LDAPSaslBind implements LDAPBind, Serializable {
_saslClient,
mechanismName, "getOutputStream", args, argNames);
ldc.setOutputStream(os);
ldc.updateThreadConnTable();
ldc.markConnAsBound();
} catch (LDAPException e) {
throw e;
} catch (Exception e) {
@ -268,6 +274,6 @@ public class LDAPSaslBind implements LDAPBind, Serializable {
private String[] _mechanisms;
private String _packageName;
private Hashtable _props;
private CallbackHandler _cbh;
private /*CallbackHandler*/ Object _cbh;
private Object _saslClient = null;
}

Просмотреть файл

@ -199,8 +199,7 @@ public class LDAPSchema {
* <P>
*
* @param objectSchema <CODE>LDAPObjectClassSchema</CODE> object
* representing the object class schema definition that you want
* to add.
* representing the object class schema definition to add
* @see netscape.ldap.LDAPObjectClassSchema
* @see netscape.ldap.LDAPSchemaElement#add
* @see netscape.ldap.LDAPSchemaElement#remove
@ -230,8 +229,7 @@ public class LDAPSchema {
* <P>
*
* @param attrSchema <CODE>LDAPAttributeSchema</CODE> object
* representing the attribute type schema definition that you
* want to add.
* representing the attribute type schema definition to add
* @see netscape.ldap.LDAPAttributeSchema
* @see netscape.ldap.LDAPSchemaElement#add
* @see netscape.ldap.LDAPSchemaElement#remove
@ -260,8 +258,7 @@ public class LDAPSchema {
* <P>
*
* @param matchSchema <CODE>LDAPMatchingRuleSchema</CODE> object
* representing the matching rule schema definition that you want
* to add.
* representing the matching rule schema definition to add
* @see netscape.ldap.LDAPMatchingRuleSchema
* @see netscape.ldap.LDAPSchemaElement#add
* @see netscape.ldap.LDAPSchemaElement#remove
@ -272,7 +269,7 @@ public class LDAPSchema {
/**
* Gets an enumeration ofthe object class definitions in this schema.
* @return An enumeration ofobject class definitions.
* @return an enumeration of object class definitions.
*/
public Enumeration getObjectClasses() {
return objectClasses.elements();
@ -280,7 +277,7 @@ public class LDAPSchema {
/**
* Gets an enumeration ofthe attribute type definitions in this schema.
* @return An enumeration ofattribute type definitions.
* @return an enumeration of attribute type definitions.
*/
public Enumeration getAttributes() {
return attributes.elements();
@ -288,7 +285,7 @@ public class LDAPSchema {
/**
* Gets an enumeration ofthe matching rule definitions in this schema.
* @return An enumeration ofmatching rule definitions.
* @return an enumeration of matching rule definitions.
*/
public Enumeration getMatchingRules() {
return matchingRules.elements();
@ -296,8 +293,8 @@ public class LDAPSchema {
/**
* Gets the definition of the object class with the specified name.
* @param name Name of the object class that you want to find.
* @return An <CODE>LDAPObjectClassSchema</CODE> object representing
* @param name name of the object class to find
* @return an <CODE>LDAPObjectClassSchema</CODE> object representing
* the object class definition, or <CODE>null</CODE> if not found.
*/
public LDAPObjectClassSchema getObjectClass( String name ) {
@ -306,8 +303,8 @@ public class LDAPSchema {
/**
* Gets the definition of the attribute type with the specified name.
* @param name Name of the attribute type that you want to find.
* @return An <CODE>LDAPAttributeSchema</CODE> object representing
* @param name name of the attribute type to find
* @return an <CODE>LDAPAttributeSchema</CODE> object representing
* the attribute type definition, or <CODE>null</CODE> if not found.
*/
public LDAPAttributeSchema getAttribute( String name ) {
@ -316,8 +313,8 @@ public class LDAPSchema {
/**
* Gets the definition of a matching rule with the specified name.
* @param name Name of the matching rule that you want to find.
* @return An <CODE>LDAPMatchingRuleSchema</CODE> object representing
* @param name name of the matching rule to find
* @return an <CODE>LDAPMatchingRuleSchema</CODE> object representing
* the matching rule definition, or <CODE>null</CODE> if not found.
*/
public LDAPMatchingRuleSchema getMatchingRule( String name ) {
@ -326,7 +323,7 @@ public class LDAPSchema {
/**
* Get an enumeration of the names of the object classes in this schema.
* @return An enumeration of object class names (all lower-case).
* @return an enumeration of object class names (all lower-case).
*/
public Enumeration getObjectClassNames() {
return objectClasses.keys();
@ -334,7 +331,7 @@ public class LDAPSchema {
/**
* Get an enumeration of the names of the attribute types in this schema.
* @return An enumeration of attribute names (all lower-case).
* @return an enumeration of attribute names (all lower-case).
*/
public Enumeration getAttributeNames() {
return attributes.keys();
@ -342,7 +339,7 @@ public class LDAPSchema {
/**
* Get an enumeration of the names of the matching rules in this schema.
* @return An enumeration of matching rule names (all lower-case).
* @return an enumeration of matching rule names (all lower-case).
*/
public Enumeration getMatchingRuleNames() {
return matchingRules.keys();
@ -350,8 +347,8 @@ public class LDAPSchema {
/**
* Retrieve the schema for a specific entry.
* @param ld An active connection to a Directory Server.
* @param dn The entry for which to fetch schema.
* @param ld an active connection to a Directory Server
* @param dn the entry for which to fetch schema
* @exception LDAPException on failure.
*/
public void fetchSchema( LDAPConnection ld, String dn )
@ -415,7 +412,7 @@ public class LDAPSchema {
/**
* Retrieve the entire schema from the root of a Directory Server.
* @param ld An active connection to a Directory Server.
* @param ld an active connection to a Directory Server
* @exception LDAPException on failure.
*/
public void fetchSchema( LDAPConnection ld ) throws LDAPException {
@ -426,8 +423,8 @@ public class LDAPSchema {
* Read one attribute definition from a server to determine if
* attribute syntaxes are quoted (a bug, present in Netscape
* and Novell servers).
* @param ld An active connection to a Directory Server.
* @return <CODE>true</CODE> if standards-compliant
* @param ld an active connection to a Directory Server
* @return <CODE>true</CODE> if standards-compliant.
* @exception LDAPException on failure.
*/
static boolean isAttributeSyntaxStandardsCompliant( LDAPConnection ld )
@ -491,7 +488,7 @@ public class LDAPSchema {
* classes, attribute types, and matching rules) in an easily
* readable format (not the same as the format expected by
* an LDAP server).
* @return A string containing the schema in printable format.
* @return a string containing the schema in printable format.
*/
public String toString() {
String s = "Object classes:\n";
@ -517,8 +514,8 @@ public class LDAPSchema {
/**
* Retrieve the DN of the schema definitions for a specific entry.
* @param ld An active connection to a Directory Server.
* @param dn The entry for which to fetch schema.
* @param ld an active connection to a Directory Server
* @param dn the entry for which to fetch schema
* @exception LDAPException on failure.
*/
static String getSchemaDN( LDAPConnection ld, String dn )
@ -562,7 +559,7 @@ public class LDAPSchema {
/**
* Helper for "main" to print out schema elements.
* @param en Enumeration of schema elements.
* @param en enumeration of schema elements
*/
private static void printEnum( Enumeration en ) {
while( en.hasMoreElements() ) {
@ -583,9 +580,9 @@ public class LDAPSchema {
* java netscape.ldap.LDAPSchema myhost.mydomain.com 389
* </PRE>
*
* @param args The host name and the port number of the LDAP server
* @param args the host name and the port number of the LDAP server
* (for example, <CODE>netscape.ldap.LDAPSchema directory.netscape.com
* 389</CODE>).
* 389</CODE>)
*/
public static void main( String[] args ) {
if ( args.length < 2 ) {

Просмотреть файл

@ -99,7 +99,7 @@ public abstract class LDAPSchemaElement {
/**
* Gets the name of the object class, attribute type, or matching rule.
* @return the name of the object class, attribute type, or
* matching rule
* matching rule.
*/
public String getName() {
return name;
@ -109,7 +109,7 @@ public abstract class LDAPSchemaElement {
* Gets the object ID (OID) of the object class, attribute type,
* or matching rule in dotted-string format (for example, "1.2.3.4").
* @return the OID of the object class, attribute type,
* or matching rule
* or matching rule.
*/
public String getOID() {
return oid;
@ -119,7 +119,7 @@ public abstract class LDAPSchemaElement {
* Gets the description of the object class, attribute type,
* or matching rule.
* @return the description of the object class, attribute type,
* or matching rule
* or matching rule.
*/
public String getDescription() {
return description;
@ -147,7 +147,7 @@ public abstract class LDAPSchemaElement {
* connection must have been authenticated to add a definition.
* @param op type of modification to make
* @param attrs attributes in the schema entry to modify
* @exception LDAPException if the definition can't be added/removed
* @exception LDAPException if the definition can't be added/removed.
*/
protected void update( LDAPConnection ld, int op, LDAPAttribute[] attrs,
String dn )
@ -201,7 +201,7 @@ public abstract class LDAPSchemaElement {
* @param ld the <CODE>LDAPConnection</CODE> object representing
* a connection to an LDAP server
* @exception LDAPException if the specified definition cannot be
* added to the schema
* added to the schema.
*/
public void add( LDAPConnection ld ) throws LDAPException {
add( ld, "" );
@ -217,7 +217,7 @@ public abstract class LDAPSchemaElement {
* @param newValue the new value
* @param dn the entry at which to modify the schema definition
* @exception LDAPException if the specified definition cannot be
* modified
* modified.
*/
public void modify( LDAPConnection ld, LDAPSchemaElement newValue,
String dn )
@ -244,7 +244,7 @@ public abstract class LDAPSchemaElement {
* a connection to an LDAP server
* @param newValue the new value
* @exception LDAPException if the specified definition cannot be
* modified
* modified.
*/
public void modify( LDAPConnection ld, LDAPSchemaElement newValue )
throws LDAPException {
@ -260,7 +260,7 @@ public abstract class LDAPSchemaElement {
* a connection to an LDAP server
* @param dn the entry at which to remove the schema definition
* @exception LDAPException if the specified definition cannot be
* removed from the schema
* removed from the schema.
*/
public void remove( LDAPConnection ld, String dn ) throws LDAPException {
update( ld, LDAPModification.DELETE, attrName, dn );
@ -290,7 +290,7 @@ public abstract class LDAPSchemaElement {
/**
* Parses a raw schema value into OID, name, description, and
* a Hashtable of other qualifiers and values
* a Hashtable of other qualifiers and values.
*
* @param raw a raw schema definition
*/
@ -381,7 +381,10 @@ public abstract class LDAPSchemaElement {
if ( (ind < last) && (last <= l) ) {
if ( list ) {
Vector v = new Vector();
val = new String( ch, ind+1, last-ind-1 );
if ( ch[ind] == ' ' ) {
ind++;
}
val = new String( ch, ind, last-ind-1 );
// Is this a quoted list? If so, use ' as delimiter,
// otherwise use ' '. The space between quoted
// values will be returned as tokens containing only
@ -439,7 +442,7 @@ public abstract class LDAPSchemaElement {
* <P>
* @param quotingBug <CODE>true</CODE> if single quotes are to be
* supplied around the SYNTAX and SUP value
* @return a formatted String for defining a schema element
* @return a formatted String for defining a schema element.
*/
public String getValue() {
return getValue( false );
@ -454,7 +457,7 @@ public abstract class LDAPSchemaElement {
* RFC 2252 format for submitting to a server
*
* @return the OID, name, description, and possibly OBSOLETE
* fields of a schema element definition
* fields of a schema element definition.
*/
String getValuePrefix() {
String s = "( " + oid + ' ';
@ -482,9 +485,10 @@ public abstract class LDAPSchemaElement {
/**
* Gets qualifiers which may or may not be present
*
* @param names list of qualifiers to look up
* @return String in RFC 2252 format containing any values
* found, not terminated with ' '
* found, not terminated with ' '.
*/
protected String getOptionalValues( String[] names ) {
String s = "";
@ -500,8 +504,8 @@ public abstract class LDAPSchemaElement {
/**
* Gets any qualifiers marked as custom (starting with "X-")
*
* @return String in RFC 2252 format, without a terminating
* ' '
* @return string in RFC 2252 format, without a terminating
* ' '.
*/
protected String getCustomValues() {
String s = "";
@ -530,7 +534,7 @@ public abstract class LDAPSchemaElement {
* @param doDollar <CODE>true</CODE> if a list of values should use
* " $ " as separator; that is true for object class attribute lists
* @return String in RFC 2252 format, without a terminating
* ' '
* ' '.
*/
String getValue( String key, boolean doQuote, boolean doDollar ) {
String s = "";
@ -567,18 +571,19 @@ public abstract class LDAPSchemaElement {
}
s += ')';
}
return s;
}
/**
* Gets a qualifier's value or values, if present, and format
* the String according to RFC 2252
* the String according to RFC 2252.
*
* @param key the qualifier to get
* @param doQuote <CODE>true</CODE> if values should be enveloped
* with single quotes
* @return String in RFC 2252 format, without a terminating
* ' '
* ' '.
*/
String getValue( String key, boolean doQuote ) {
return getValue( key, doQuote, true );
@ -603,7 +608,7 @@ public abstract class LDAPSchemaElement {
/**
* Keeps track of qualifiers which are not predefined.
* @param name Name of qualifier
* @param name name of qualifier
* @param values array of values
*/
public void setQualifier( String name, String[] values ) {
@ -624,7 +629,7 @@ public abstract class LDAPSchemaElement {
* Gets the value of a qualifier which is not predefined.
* @param name name of qualifier
* @return value or values of qualifier; <CODE>null</CODE> if not
* present, a zero-length array if present but with no value
* present, a zero-length array if present but with no value.
*/
public String[] getQualifier( String name ) {
if ( properties == null ) {
@ -650,7 +655,7 @@ public abstract class LDAPSchemaElement {
/**
* Gets an enumeration of all qualifiers which are not predefined.
* @return Enumeration of qualifiers
* @return enumeration of qualifiers.
*/
public Enumeration getQualifierNames() {
return properties.keys();
@ -669,7 +674,7 @@ public abstract class LDAPSchemaElement {
* Creates a string for use in toString with any qualifiers of the element.
*
* @param ignore any qualifiers to NOT include
* @return a String with any known qualifiers
* @return a String with any known qualifiers.
*/
String getQualifierString( String[] ignore ) {
Hashtable toIgnore = null;

Просмотреть файл

@ -52,30 +52,30 @@ public class LDAPSearchConstraints extends LDAPConstraints
* Constructs a new <CODE>LDAPSearchConstraints</CODE> object and allows you
* to specify the search constraints in that object.
* <P>
* @param msLimit Maximum time in milliseconds to wait for results (0
* @param msLimit maximum time in milliseconds to wait for results (0
* by default, which means that there is no maximum time limit)
* @param dereference Either <CODE>LDAPv2.DEREF_NEVER</CODE>,
* @param dereference either <CODE>LDAPv2.DEREF_NEVER</CODE>,
* <CODE>LDAPv2.DEREF_FINDING</CODE>,
* <CODE>LDAPv2.DEREF_SEARCHING</CODE>, or
* <CODE>LDAPv2.DEREF_ALWAYS</CODE> (see LDAPConnection.setOption).
* <CODE>LDAPv2.DEREF_NEVER</CODE> is the default.
* @param maxResults Maximum number of search results to return
* @param maxResults maximum number of search results to return
* (1000 by default)
* @param doReferrals Specify <CODE>true</CODE> to follow referrals
* automatically, or <CODE>False</CODE> to throw an
* @param doReferrals specify <CODE>true</CODE> to follow referrals
* automatically, or <CODE>false</CODE> to throw an
* <CODE>LDAPReferralException</CODE> error if the server sends back
* a referral (<CODE>False</CODE> by default)
* @param batchSize Specify the number of results to return at a time
* a referral (<CODE>false</CODE> by default)
* @param batchSize specify the number of results to return at a time
* (1 by default)
* @param rebind_proc Specifies the object of the class that
* @param rebind_proc specifies the object of the class that
* implements the <CODE>LDAPRebind</CODE> interface (you need to
* define this class). The object will be used when the client
* follows referrals automatically. The object provides the client
* with a method for getting the distinguished name and password
* used to authenticate to another LDAP server during a referral.
* (This field is <CODE>null</CODE> by default.)
* @param hop_limit Maximum number of referrals to follow in a
* sequence when attempting to resolve a request.
* @param hop_limit maximum number of referrals to follow in a
* sequence when attempting to resolve a request
* @see netscape.ldap.LDAPConnection#setOption(int, java.lang.Object)
* @see netscape.ldap.LDAPConnection#search(netscape.ldap.LDAPUrl, netscape.ldap.LDAPSearchConstraints)
* @see netscape.ldap.LDAPConnection#search(java.lang.String, int, java.lang.String, java.lang.String[], boolean, netscape.ldap.LDAPSearchConstraints)
@ -93,32 +93,33 @@ public class LDAPSearchConstraints extends LDAPConstraints
* Constructs a new <CODE>LDAPSearchConstraints</CODE> object and allows you
* to specify the search constraints in that object.
* <P>
* @param msLimit Maximum time in milliseconds to wait for results (0
* @param msLimit maximum time in milliseconds to wait for results (0
* by default, which means that there is no maximum time limit)
* @param timeLimit Maximum time in seconds for the server to spend
* processing a search request (0 by default for no limit)
* @param dereference Either <CODE>LDAPv2.DEREF_NEVER</CODE>,
* @param timeLimit maximum time in seconds for the server to spend
* processing a search request (the default value is 0, indicating that there
* is no limit)
* @param dereference either <CODE>LDAPv2.DEREF_NEVER</CODE>,
* <CODE>LDAPv2.DEREF_FINDING</CODE>,
* <CODE>LDAPv2.DEREF_SEARCHING</CODE>, or
* <CODE>LDAPv2.DEREF_ALWAYS</CODE> (see LDAPConnection.setOption).
* <CODE>LDAPv2.DEREF_NEVER</CODE> is the default.
* @param maxResults Maximum number of search results to return
* @param maxResults maximum number of search results to return
* (1000 by default)
* @param doReferrals Specify <CODE>true</CODE> to follow referrals
* automatically, or <CODE>False</CODE> to throw an
* @param doReferrals specify <CODE>true</CODE> to follow referrals
* automatically, or <CODE>false</CODE> to throw an
* <CODE>LDAPReferralException</CODE> error if the server sends back
* a referral (<CODE>False</CODE> by default)
* @param batchSize Specify the number of results to return at a time
* a referral (<CODE>false</CODE> by default)
* @param batchSize specify the number of results to return at a time
* (1 by default)
* @param rebind_proc Specifies the object that
* @param rebind_proc specifies the object that
* implements the <CODE>LDAPRebind</CODE> interface.
* The object will be used when the client
* follows referrals automatically. The object provides the client
* with a method for getting the distinguished name and password
* used to authenticate to another LDAP server during a referral.
* (This field is <CODE>null</CODE> by default.)
* @param hop_limit Maximum number of referrals to follow in a
* sequence when attempting to resolve a request.
* @param hop_limit maximum number of referrals to follow in a
* sequence when attempting to resolve a request
* @see netscape.ldap.LDAPConnection#setOption(int, java.lang.Object)
* @see netscape.ldap.LDAPConnection#search(netscape.ldap.LDAPUrl, netscape.ldap.LDAPSearchConstraints)
* @see netscape.ldap.LDAPConnection#search(java.lang.String, int, java.lang.String, java.lang.String[], boolean, netscape.ldap.LDAPSearchConstraints)
@ -140,30 +141,31 @@ public class LDAPSearchConstraints extends LDAPConstraints
* Constructs a new <CODE>LDAPSearchConstraints</CODE> object and allows you
* to specify the search constraints in that object.
* <P>
* @param msLimit Maximum time in milliseconds to wait for results (0
* @param msLimit maximum time in milliseconds to wait for results (0
* by default, which means that there is no maximum time limit)
* @param timeLimit Maximum time in seconds for the server to spend
* processing a search request (0 by default for no limit)
* @param dereference Either <CODE>LDAPv2.DEREF_NEVER</CODE>,
* @param timeLimit maximum time in seconds for the server to spend
* processing a search request (the default value is 0, indicating that there
* is no limit)
* @param dereference either <CODE>LDAPv2.DEREF_NEVER</CODE>,
* <CODE>LDAPv2.DEREF_FINDING</CODE>,
* <CODE>LDAPv2.DEREF_SEARCHING</CODE>, or
* <CODE>LDAPv2.DEREF_ALWAYS</CODE> (see LDAPConnection.setOption).
* <CODE>LDAPv2.DEREF_NEVER</CODE> is the default.
* @param maxResults Maximum number of search results to return
* @param maxResults maximum number of search results to return
* (1000 by default)
* @param doReferrals Specify <CODE>true</CODE> to follow referrals
* automatically, or <CODE>False</CODE> to throw an
* @param doReferrals specify <CODE>true</CODE> to follow referrals
* automatically, or <CODE>false</CODE> to throw an
* <CODE>LDAPReferralException</CODE> error if the server sends back
* a referral (<CODE>False</CODE> by default)
* @param batchSize Specify the number of results to return at a time
* a referral (<CODE>false</CODE> by default)
* @param batchSize specify the number of results to return at a time
* (1 by default)
* @param bind_proc Specifies the object that
* @param bind_proc specifies the object that
* implements the <CODE>LDAPBind</CODE> interface (you need to
* define this class). The object will be used to authenticate
* to the server on referrals.
* (This field is <CODE>null</CODE> by default.)
* @param hop_limit Maximum number of referrals to follow in a
* sequence when attempting to resolve a request.
* @param hop_limit maximum number of referrals to follow in a
* sequence when attempting to resolve a request
* @see netscape.ldap.LDAPConnection#setOption(int, java.lang.Object)
* @see netscape.ldap.LDAPConnection#search(netscape.ldap.LDAPUrl, netscape.ldap.LDAPSearchConstraints)
* @see netscape.ldap.LDAPConnection#search(java.lang.String, int, java.lang.String, java.lang.String[], boolean, netscape.ldap.LDAPSearchConstraints)
@ -184,7 +186,7 @@ public class LDAPSearchConstraints extends LDAPConstraints
/**
* Returns the maximum number of seconds to wait for the server to
* spend on a search operation.If 0, there is no time limit.
* @return Maximum number of seconds for the server to spend.
* @return maximum number of seconds for the server to spend.
*/
public int getServerTimeLimit() {
return serverTimeLimit;
@ -207,9 +209,9 @@ public class LDAPSearchConstraints extends LDAPConstraints
}
/**
* Returns the maximum number of search results to be returned; 0 means
* no limit.
* @return Maximum number of search results to be returned.
* Returns the maximum number of search results that are to be returned; 0 means
* there is no limit.
* @return maximum number of search results to be returned.
*/
public int getMaxResults() {
return maxRes;
@ -219,7 +221,7 @@ public class LDAPSearchConstraints extends LDAPConstraints
* Returns the suggested number of results to return at a time during
* search. This should be 0 if intermediate results are not needed, and
* 1 if results are to be processed as they come in.
* @return Number of results to return at a time.
* @return number of results to return at a time.
*/
public int getBatchSize() {
return batch;
@ -228,7 +230,7 @@ public class LDAPSearchConstraints extends LDAPConstraints
/**
* Sets the maximum number of seconds for the server to spend
* returning search results. If 0, there is no time limit.
* @param limit Maximum number of seconds for the server to spend.
* @param limit maximum number of seconds for the server to spend.
* (0 by default, which means that there is no maximum time limit.)
*/
public void setServerTimeLimit( int limit ) {
@ -245,16 +247,16 @@ public class LDAPSearchConstraints extends LDAPConstraints
* to dereference when searching the entries beneath the
* starting point of the search (but not when finding the starting
* entry), or <CODE>LDAPv2.DEREF_ALWAYS</CODE> to always
* dereference aliases.
* dereference aliases
*/
public void setDereference( int dereference ) {
deref = dereference;
}
/**
* Sets the maximum number of search results to be returned; 0 means
* no limit. (By default, this is set to 1000.)
* @param maxResults Maximum number of search results to be returned.
* Sets the maximum number of search results to return; 0 means
* there is no limit. (By default, this is set to 1000.)
* @param maxResults maximum number of search results to return
*/
public void setMaxResults( int maxResults ) {
maxRes = maxResults;
@ -264,7 +266,7 @@ public class LDAPSearchConstraints extends LDAPConstraints
* Sets the suggested number of results to return at a time during search.
* This should be 0 if intermediate results are not needed, and 1 if
* results are to be processed as they come in. (By default, this is 1.)
* @param batchSize Number of results to return at a time.
* @param batchSize number of results to return at a time
*/
public void setBatchSize( int batchSize ) {
batch = batchSize;
@ -273,7 +275,7 @@ public class LDAPSearchConstraints extends LDAPConstraints
/**
* Set the maximum number of unread entries any search listener can
* have before we stop reading from the server.
* @param backlog The maximum number of unread entries per listener
* @param backlog the maximum number of unread entries per listener
* @deprecated Use <CODE>LDAPConnection.getOption()</CODE>
*/
public void setMaxBacklog( int backlog ) {
@ -283,7 +285,7 @@ public class LDAPSearchConstraints extends LDAPConstraints
/**
* Get the maximum number of unread entries any search listener can
* have before we stop reading from the server.
* @return The maximum number of unread entries per listener
* @return the maximum number of unread entries per listener.
* @deprecated Use <CODE>LDAPConnection.setOption()</CODE>
*/
public int getMaxBacklog() {
@ -292,7 +294,7 @@ public class LDAPSearchConstraints extends LDAPConstraints
/**
* Makes a copy of an existing set of search constraints.
* @returns A copy of an existing set of search constraints.
* @return a copy of an existing set of search constraints.
*/
public Object clone() {
LDAPSearchConstraints o = new LDAPSearchConstraints();
@ -302,7 +304,7 @@ public class LDAPSearchConstraints extends LDAPConstraints
o.maxRes = this.maxRes;
o.batch = this.batch;
o.setHopLimit(this.getTimeLimit());
o.setHopLimit(this.getHopLimit());
o.setReferrals(this.getReferrals());
o.setTimeLimit(this.getTimeLimit());
@ -336,4 +338,21 @@ public class LDAPSearchConstraints extends LDAPConstraints
return o;
}
/**
* Return a string representation of the object for debugging
*
* @return A string representation of the object
*/
public String toString() {
StringBuffer sb = new StringBuffer("LDAPSearchConstraints {");
sb.append( super.toString() + ' ' );
sb.append("size limit " + maxRes + ", ");
sb.append("server time limit " + serverTimeLimit + ", ");
sb.append("aliases " + deref + ", ");
sb.append("batch size " + batch);
sb.append('}');
return sb.toString();
}
}

Просмотреть файл

@ -33,9 +33,9 @@ public class LDAPSearchListener extends LDAPMessageQueue {
/**
* Constructs a LDAP search listener.
* @param asynchOp A flag whether the object is used for asynchronous
* LDAP operations
* @param cons LDAP Search Constraints
* @param asynchOp a boolean flag indicating whether the object is used
* for asynchronous LDAP operations
* @param cons LDAP search constraints
* @see netscape.ldap.LDAPAsynchronousConnection
*/
LDAPSearchListener ( boolean asynchOp,
@ -47,7 +47,7 @@ public class LDAPSearchListener extends LDAPMessageQueue {
/**
* Block until all results are in. Used for synchronous search with
* batch size of zero.
* @return search response message
* @return search response message.
* @exception Network exception error
*/
LDAPResponse completeSearchOperation () throws LDAPException{
@ -58,8 +58,8 @@ public class LDAPSearchListener extends LDAPMessageQueue {
/**
* Blocks until a search result, reference or response is available, * or until all operations associated with the object have completed * or been canceled.
*
* @return A search result, search reference, or search response message
* or null if there is no more outstanding requests
* @return a search result, search reference, search response message,
* or null if there are no more outstanding requests.
* @exception LDAPException Network error exception
* @exception LDAPInterruptedException The invoking thread was interrupted
* @see LDAPResponse
@ -67,7 +67,16 @@ public class LDAPSearchListener extends LDAPMessageQueue {
* @see LDAPSearchResultReference
*/
public LDAPMessage getResponse () throws LDAPException{
LDAPMessage result = nextMessage();
return nextMessage();
}
/**
* Override nextMessage to wake up the LDAPConnThread if
* backlog limit has been reached
*/
LDAPMessage nextMessage() throws LDAPException{
LDAPMessage result = super.nextMessage();
// Notify LDAPConnThread to wake up if backlog limit has been reached
if (result instanceof LDAPSearchResult || result instanceof LDAPSearchResultReference) {
@ -97,7 +106,7 @@ public class LDAPSearchListener extends LDAPMessageQueue {
* The proper way to handle this scenario is to create a separate listener
* for each new request, and after l.getIDs() has been invoked, merge the
* new request with the existing one.
* @param listener2 The listener to be merged with.
* @param listener2 the listener with which to merge
*/
public void merge(LDAPSearchListener listener2) {
super.merge(listener2);
@ -106,23 +115,23 @@ public class LDAPSearchListener extends LDAPMessageQueue {
/**
* Reports true if a response has been received from the server.
*
* @return A flag whether the response message queue is empty
* @return a flag indicating whether the response message queue is empty.
*/
public boolean isResponseReceived() {
return super.isMessageReceived();
}
/**
* Returns message ids for all outstanding requests
* @return Message id array
* Returns message IDs for all outstanding requests
* @return message ID array.
*/
public int[] getIDs() {
return super.getIDs();
}
/**
* Return the search constraints used to create this object
* @return the search constraints used to create this object
* Return the search constraints used to create this object.
* @return the search constraints used to create this object.
*/
LDAPSearchConstraints getSearchConstraints() {
return m_constraints;
@ -133,7 +142,7 @@ public class LDAPSearchListener extends LDAPMessageQueue {
* when the results get processed in the queue. After the results have been
* saved in the vector, then the key and a vector of results are put in
* the cache.
* @param key The key of the cache entry
* @param key the key of the cache entry
*/
void setKey(Long key) {
m_key = key;
@ -141,7 +150,7 @@ public class LDAPSearchListener extends LDAPMessageQueue {
/**
* Get the key of the cache entry.
* @return The key of the cache entry
* @return the key of the cache entry.
*/
Long getKey() {
return m_key;

Просмотреть файл

@ -35,8 +35,8 @@ public class LDAPSearchResult extends LDAPMessage {
* Constructor
*
* @param msgid message identifier
* @param rsp Search operation response
* @param controls Array of controls of null
* @param rsp search operation response
* @param controls array of controls or null
* @see netscape.ldap.LDAPEntry
*/
LDAPSearchResult(int msgid, JDAPSearchResponse rsp, LDAPControl[]controls) {
@ -45,8 +45,8 @@ public class LDAPSearchResult extends LDAPMessage {
/**
* Returns the entry of a server search response.
* @return An entry returned by the server in response to a search
* request
* @return an entry returned by the server in response to a search
* request.
* @see netscape.ldap.LDAPEntry
*/
public LDAPEntry getEntry() {

Просмотреть файл

@ -27,7 +27,7 @@ import netscape.ldap.client.opers.JDAPSearchResultReference;
public class LDAPSearchResultReference extends LDAPMessage {
/**
* A lists of referred to Ldap URLs
* A list of LDAP URLs that are referred to.
*/
private String m_URLs[];
@ -35,8 +35,8 @@ public class LDAPSearchResultReference extends LDAPMessage {
* Constructor
*
* @param msgid message identifier
* @param resRef Search result reference response
* @param controls Array of controls of null
* @param resRef search result reference response
* @param controls array of controls or null
* @see netscape.ldap.LDAPEntry
*/
LDAPSearchResultReference(int msgid, JDAPSearchResultReference resRef, LDAPControl[]controls) {
@ -45,8 +45,8 @@ public class LDAPSearchResultReference extends LDAPMessage {
}
/**
* Returns a list of referred to LDAP URLs
* @return A list of URLs
* Returns a list of LDAP URLs that are referred to.
* @return a list of URLs.
*/
public String[] getUrls() {
return m_URLs;

Просмотреть файл

@ -53,7 +53,7 @@ public class LDAPSearchResults implements Enumeration {
private boolean currAttrsOnly;
private Vector referralResults = new Vector();
private Vector exceptions;
private LDAPControl[] responseControls = null;
private int msgID = -1;
// only used for the persistent search
private boolean firstResult = false;
@ -86,7 +86,7 @@ public class LDAPSearchResults implements Enumeration {
/**
* Constructs an enumeration of search results. Used when returning results
* from a cache.
* @param v The vector containing LDAPEntries.
* @param v the vector containing LDAPEntries
* @see netscape.ldap.LDAPConnection#search(java.lang.String, int, java.lang.String, java.lang.String[], boolean)
*/
LDAPSearchResults(Vector v) {
@ -167,7 +167,7 @@ public class LDAPSearchResults implements Enumeration {
/**
* For asynchronous search, this mechanism allows the programmer to
* close a connection whenever the search completes.
* @param toClose Connection to close when the search terminates
* @param toClose connection to close when the search terminates
*/
void closeOnCompletion (LDAPConnection toClose) {
if (searchComplete) {
@ -213,11 +213,12 @@ public class LDAPSearchResults implements Enumeration {
}
/**
* Sets the response controls for this search result.
* @param controls The controls to be stored.
* Sets the message ID for this search request. msgID is used
* to retrieve response controls.
* @param msgID Message ID for this search request
*/
protected void setResponseControls(LDAPControl[] controls) {
responseControls = controls;
void setMsgID(int msgID) {
this.msgID = msgID;
}
/**
@ -225,11 +226,11 @@ public class LDAPSearchResults implements Enumeration {
* is registered with <CODE>LDAPControl</CODE>, an attempt is made to
* instantiate the control. If the instantiation fails, the control is
* returned as a basic <CODE>LDAPControl</CODE>.
* @return An array of type <CODE>LDAPControl</CODE>
* @return an array of type <CODE>LDAPControl</CODE>.
* @see netscape.ldap.LDAPControl#register
*/
public LDAPControl[] getResponseControls() {
return responseControls;
return currConn.getResponseControls(msgID);
}
/**
@ -262,7 +263,7 @@ public class LDAPSearchResults implements Enumeration {
* the cursor is reset to the (new) first element.
* <P>
*
* @param compare Comparator used to determine the sort order of the results.
* @param compare comparator used to determine the sort order of the results
* @see LDAPEntryComparator
*/
public synchronized void sort(LDAPEntryComparator compare) {
@ -323,7 +324,7 @@ public class LDAPSearchResults implements Enumeration {
* ...
* }
* </PRE>
* @return The next LDAP entry in the search results.
* @return the next LDAP entry in the search results.
* @exception LDAPReferralException A referral (thrown
* if the next result is a referral), or LDAPException
* if a limit on the number of entries or the time was
@ -367,7 +368,7 @@ public class LDAPSearchResults implements Enumeration {
* }
* }
* </PRE>
* @return The next element in the search results.
* @return the next element in the search results.
* @see netscape.ldap.LDAPSearchResults#hasMoreElements()
*/
public Object nextElement() {
@ -423,7 +424,7 @@ public class LDAPSearchResults implements Enumeration {
* ...
* }
* </PRE>
* @return <CODE>true</CODE> if there are more search results
* @return <CODE>true</CODE> if there are more search results.
* @see netscape.ldap.LDAPSearchResults#nextElement()
* @see netscape.ldap.LDAPSearchResults#next()
*/
@ -450,7 +451,7 @@ public class LDAPSearchResults implements Enumeration {
/**
* Returns a count of the entries in the search results.
* @return Count of entries found by the search.
* @return count of entries found by the search.
*/
public int getCount() {
int totalReferralEntries = 0;
@ -471,8 +472,8 @@ public class LDAPSearchResults implements Enumeration {
}
/**
* Returns message id.
* @return Message id.
* Returns message ID.
* @return Message ID.
*/
int getID() {
if ( resultSource == null )

Просмотреть файл

@ -31,9 +31,9 @@ import java.net.*;
* <P>
*
* When you construct a new <CODE>LDAPConnection</CODE>
* object, you can specify that the connection uses his socket by
* passing the constructor an object of the class that implements
* this interface.
* object, you can specify that the connection use this socket.
* To do this, pass the constructor an object of the class that
* implements this interface.
* <P>
*
* @version 1.0
@ -45,8 +45,8 @@ public interface LDAPSocketFactory {
* Returns a socket to the specified host name and port number.
* <P>
*
* @param host Name of the host that you want to connect to.
* @param port Port number that you want to connect to.
* @param host name of the host to which you want to connect
* @param port port number to which you want to connect
* @exception LDAPException Failed to create the socket.
* @see LDAPSSLSocketFactory#makeSocket(java.lang.String,int)
*/

Просмотреть файл

@ -28,7 +28,7 @@ public class LDAPSortKey {
/**
* Constructs a new <CODE>LDAPSortKey</CODE> object that will
* sort based on the specified instructions.
* @param keyDescription A single attribute specification to sort by.
* @param keyDescription a single attribute specification by which to sort
* If preceded by a hyphen ("-"), the attribute is sorted in reverse order.
* You can also specify the object ID (OID) of a matching rule after
* a colon (":"). For example:
@ -66,15 +66,15 @@ public class LDAPSortKey {
/**
* Constructs a new <CODE>LDAPSortKey</CODE> object that will
* sort based on the specified attribute and sort order.
* @param key A single attribute to sort by. For example:
* @param key a single attribute by which to sort. For example:
* <P>
* <UL>
* <LI><CODE>"cn"</CODE> (sort by the <CODE>cn</CODE> attribute)
* <LI><CODE>"givenname"</CODE> (sort by the <CODE>givenname</CODE>
* attribute)
* </UL>
* @param reverse If <CODE>true</CODE>, the sorting is done in
* descending order.
* @param reverse if <CODE>true</CODE>, the sorting is done in
* descending order
* @see netscape.ldap.controls.LDAPSortControl
* @see netscape.ldap.controls.LDAPVirtualListControl
*/
@ -89,17 +89,17 @@ public class LDAPSortKey {
* Constructs a new <CODE>LDAPSortKey</CODE> object that will
* sort based on the specified attribute, sort order, and matching
* rule.
* @param key A single attribute to sort by. For example:
* @param key a single attribute by which to sort. For example:
* <P>
* <UL>
* <LI><CODE>"cn"</CODE> (sort by the <CODE>cn</CODE> attribute)
* <LI><CODE>"givenname"</CODE> (sort by the <CODE>givenname</CODE>
* attribute)
* </UL>
* @param reverse If <CODE>true</CODE>, the sorting is done in
* descending order.
* @param matchRule Object ID (OID) of the matching rule for
* the attribute (for example, <CODE>1.2.3.4</CODE>).
* @param reverse if <CODE>true</CODE>, the sorting is done in
* descending order
* @param matchRule object ID (OID) of the matching rule for
* the attribute (for example, <CODE>1.2.3.4</CODE>)
* @see netscape.ldap.controls.LDAPSortControl
* @see netscape.ldap.controls.LDAPVirtualListControl
*/
@ -112,8 +112,8 @@ public class LDAPSortKey {
}
/**
* Returns the attribute to sort by.
* @return A single attribute to sort by.
* Returns the attribute by which to sort.
* @return a single attribute by which to sort.
*/
public String getKey() {
return m_key;
@ -130,7 +130,7 @@ public class LDAPSortKey {
/**
* Returns the object ID (OID) of the matching rule used for sorting.
* If no matching rule is specified, <CODE>null</CODE> is returned.
* @return The object ID (OID) of the matching rule, or <CODE>null</CODE>
* @return the object ID (OID) of the matching rule, or <CODE>null</CODE>
* if the sorting instructions specify no matching rule.
*/
public String getMatchRule() {

Просмотреть файл

@ -194,10 +194,10 @@ public class LDAPUrl {
/**
* Constructs with the specified host, port, and DN. This form is used to
* create URL references to a particular object in the directory.
* @param host Host name of LDAP server, or null for "nearest X.500/LDAP"
* @param port Port number for LDAP server (use LDAPv2.DEFAULT_PORT for
* default port)
* @param DN Distinguished name of object
* @param host host name of the LDAP server, or null for "nearest X.500/LDAP"
* @param port port number of the LDAP server (use LDAPv2.DEFAULT_PORT for
* the default port)
* @param DN distinguished name of the object
*/
public LDAPUrl (String host, int port, String DN) {
if (host != null) {
@ -219,16 +219,16 @@ public class LDAPUrl {
/**
* Constructs a full-blown LDAP URL to specify an LDAP search operation.
* @param host Host name of LDAP server, or null for "nearest X.500/LDAP"
* @param port Port number for LDAP server (use LDAPv2.DEFAULT_PORT for
* default port)
* @param DN Distinguished name of object
* @param attributes List of attributes to return. Use null for "all
* attributes"
* @param scope Depth of search (in DN namespace). Use one of SCOPE_BASE,
* SCOPE_ONE, SCOPE_SUB from LDAPv2
* @param filter LDAP fitler string (as defined in RFC 1558) use null for
* no filter (this effectively makes the URL reference a single object)
* @param host host name of the LDAP server, or null for "nearest X.500/LDAP"
* @param port port number of the LDAP server (use LDAPv2.DEFAULT_PORT for
* the default port)
* @param DN distinguished name of the object
* @param attributes list of attributes to return. Use null for "all
* attributes."
* @param scope depth of search (in DN namespace). Use one of the LDAPv2 scopes:
* SCOPE_BASE, SCOPE_ONE, or SCOPE_SUB.
* @param filter LDAP filter string (as defined in RFC 1558). Use null for
* no filter (this effectively makes the URL reference a single object).
*/
public LDAPUrl (String host, int port, String DN,
String attributes[], int scope, String filter) {
@ -246,16 +246,16 @@ public class LDAPUrl {
/**
* Constructs a full-blown LDAP URL to specify an LDAP search operation.
* @param host Host name of LDAP server, or null for "nearest X.500/LDAP"
* @param port Port number for LDAP server (use LDAPv2.DEFAULT_PORT for
* default port)
* @param DN Distinguished name of object
* @param attributes List of attributes to return. Use null for "all
* attributes"
* @param scope Depth of search (in DN namespace). Use one of SCOPE_BASE,
* SCOPE_ONE, SCOPE_SUB from LDAPv2
* @param filter LDAP fitler string (as defined in RFC 1558) use null for
* no filter (this effectively makes the URL reference a single object)
* @param host host name of the LDAP server, or null for "nearest X.500/LDAP"
* @param port port number of the LDAP server (use LDAPv2.DEFAULT_PORT for
* the default port)
* @param DN distinguished name of the object
* @param attributes list of the attributes to return. Use null for "all
* attributes."
* @param scope depth of the search (in DN namespace). Use one of the LDAPv2 scopes:
* SCOPE_BASE, SCOPE_ONE, or SCOPE_SUB.
* @param filter LDAP filter string (as defined in RFC 1558). Use null for
* no filter (this effectively makes the URL reference a single object).
*/
public LDAPUrl (String host, int port, String DN,
Enumeration attributes, int scope, String filter) {
@ -336,7 +336,7 @@ public class LDAPUrl {
/**
* Return the host name of the LDAP server
* @return LDAP host
* @return LDAP host.
*/
public String getHost () {
return hostName;
@ -344,7 +344,7 @@ public class LDAPUrl {
/**
* Return the port number for the LDAP server
* @return port number
* @return port number.
*/
public int getPort () {
return portNumber;
@ -352,7 +352,7 @@ public class LDAPUrl {
/**
* Return the distinguished name encapsulated in the URL
* @return target distinguished name
* @return target distinguished name.
*/
public String getDN () {
return DN;
@ -361,7 +361,7 @@ public class LDAPUrl {
/**
* Return the collection of attributes specified in the URL, or null
* for "every attribute"
* @return enumeration of attributes
* @return enumeration of attributes.
*/
public Enumeration getAttributes () {
if (attributes == null)
@ -373,7 +373,7 @@ public class LDAPUrl {
/**
* Return the collection of attributes specified in the URL, or null
* for "every attribute"
* @return string array of attribute
* @return string array of attributes.
*/
public String[] getAttributeArray () {
if (attributes == null)
@ -392,9 +392,9 @@ public class LDAPUrl {
/**
* Returns the scope of the search, according to the values
* SCOPE_BASE, SCOPE_ONE, SCOPE_SUB defined in LDAPv2. This refers
* to how deep in the directory namespace the search will look
* @return search scope
* SCOPE_BASE, SCOPE_ONE, SCOPE_SUB as defined in LDAPv2. This refers
* to how deep within the directory namespace the search will look
* @return search scope.
*/
public int getScope () {
return scope;
@ -403,9 +403,9 @@ public class LDAPUrl {
/**
* Returns the scope of the search. If the scope returned is -1, then
* the given string is not for the scope.
* @param str The string which compares with the scope type.
* @returns The scope of the search, -1 returns if the given string is
* not one of the values: sub, one or base.
* @param str the string against which to compare the scope type
* @returns the scope of the search, -1 is returned if the given string is
* not SUB, ONE or BASE (the acceptable LDAPv2 values for scope).
*/
private int getScope(String str) {
@ -423,7 +423,7 @@ public class LDAPUrl {
/**
* Returns the search filter (RFC 1558), or the default if none was
* specified.
* @return filter
* @return the search filter.
*/
public String getFilter () {
return filter;
@ -431,7 +431,7 @@ public class LDAPUrl {
/**
* Returns a valid string representation of this LDAP URL.
* @return LDAP search expression in URL form
* @return the LDAP search expression in URL form.
*/
public String getUrl () {
return URL;
@ -439,9 +439,9 @@ public class LDAPUrl {
/**
* Checks if the given string is a filter expression.
* @param The string which is checked if it is filter expression.
* @return true if the given string is a filter expression; otherwise,
* return false;
* @param the string which is checked
* @return <code>true</code> if the given string is a filter expression; otherwise,
* <code>false</code>.
*/
private boolean isFilter(String str) {
if (str.startsWith("("))
@ -453,9 +453,9 @@ public class LDAPUrl {
/**
* Checks if the given string is an attribute expression.
* @param The string which is checked if it is attribute expression.
* @return true if the given string is an attribute expression; otherwise,
* return false;
* @param the string which is checked
* @return <code>true</code> if the given string is an attribute expression; otherwise,
* <code>false</code>.
*/
private boolean isAttribute(String str) {
if ((!str.startsWith("(")) && (!str.equalsIgnoreCase("base")) &&
@ -467,8 +467,8 @@ public class LDAPUrl {
/**
* Reads next construct from the given string parser.
* @param parser The string parser
* @return The next construct which can be attribute, scope or filter.
* @param parser the string parser
* @return the next construct which can be an attribute, scope or filter.
* @exception java.net.MalformedURLException Get thrown when the url format
* is incorrect.
*/
@ -515,7 +515,7 @@ public class LDAPUrl {
* Decodes a URL-encoded string. Any occurences of %HH are decoded to the
* hex value represented. However, this routine does NOT decode "+"
* into " ". See RFC 1738 for full details about URL encoding/decoding.
* @param URLEncoded A segment of a URL which was encoded via the URL
* @param URLEncoded a segment of a URL which was encoded using the URL
* encoding rules
* @exception MalformedURLException failed to parse URL
*/
@ -556,7 +556,7 @@ public class LDAPUrl {
* thing, not a general URL thing). Note that, because Sun's URLEncoder
* does do this encoding, we can't use it.
* See RFC 1738 for full details about URL encoding/decoding.
* @param toEncode An arbitrary string to encode for embedding in a URL
* @param toEncode an arbitrary string to encode for embedding within a URL
*/
public static String encode (String toEncode) {
StringBuffer encoded = new StringBuffer (toEncode.length()+10);
@ -578,4 +578,65 @@ public class LDAPUrl {
return encoded.toString();
}
/**
* Returns the URL in String format
*
* @return the URL in String format
*/
public String toString() {
return getUrl();
}
/**
* Reports if the two objects represent the same URL
*
* @param url the object to be compared to
* @return <CODE>true</CODE> if the two are equivalent
*/
public boolean equals( LDAPUrl url ) {
if ( getHost() == null ) {
if ( url.getHost() != null ) {
return false;
}
} else if ( !getHost().equals( url.getHost() ) ) {
return false;
}
if ( getPort() != url.getPort() ) {
return false;
}
if ( getDN() == null ) {
if ( url.getDN() != null ) {
return false;
}
} else if ( !getDN().equals( url.getDN() ) ) {
return false;
}
if ( getFilter() == null ) {
if ( url.getFilter() != null ) {
return false;
}
} else if ( !getFilter().equals( url.getFilter() ) ) {
return false;
}
if ( getScope() != url.getScope() ) {
return false;
}
if ( attributes == null ) {
if ( url.attributes != null ) {
return false;
}
} else if ( attributes.size() != url.attributes.size() ) {
return false;
} else {
for( int i = 0; i < attributes.size(); i++ ) {
if ( attributes.elementAt( i ) !=
url.attributes.elementAt( i ) ) {
return false;
}
}
}
return true;
}
}

Просмотреть файл

@ -70,8 +70,8 @@ public interface LDAPv2 {
public static final int DEREF = 2;
/**
* Option specifying the maximum number of search results that
* can be returned.
* Option specifying the maximum number of search results to
* return.
* <P>
*
* @see netscape.ldap.LDAPConnection#getOption
@ -81,7 +81,7 @@ public interface LDAPv2 {
/**
* Option specifying the maximum number of milliseconds to
* wait for an operation to be completed.
* wait for an operation to complete.
* @see netscape.ldap.LDAPConnection#getOption
* @see netscape.ldap.LDAPConnection#setOption
*/
@ -89,7 +89,8 @@ public interface LDAPv2 {
/**
* Option specifying the maximum number of milliseconds the
* server should wait when returning search results.
* server should spend returning search results before aborting
* the search.
* @see netscape.ldap.LDAPConnection#getOption
* @see netscape.ldap.LDAPConnection#setOption
*/
@ -221,20 +222,20 @@ public interface LDAPv2 {
/**
* Connects to the LDAP server.
* @param host Hostname of the LDAP server.
* @param port Port number of the LDAP server. To specify the
* default, well-known port, use <CODE>DEFAULT_PORT</CODE>.
* @param host hostname of the LDAP server
* @param port port number of the LDAP server. To specify the
* default port, use <CODE>DEFAULT_PORT</CODE>.
* @exception LDAPException Failed to connect to the server.
*/
public void connect (String host, int port) throws LDAPException;
/**
* Connects and authenticates to the LDAP server.
* @param host Hostname of the LDAP server.
* @param port Port number of the LDAP server. To specify the
* default, well-known port, use <CODE>DEFAULT_PORT</CODE>.
* @param dn Distinguished name to use for authentication.
* @param passwd Password for authentication.
* @param host hostname of the LDAP server
* @param port port number of the LDAP server. To specify the
* default port, use <CODE>DEFAULT_PORT</CODE>.
* @param dn distinguished name to use for authentication
* @param passwd password for authentication
* @exception LDAPException Failed to connect and authenticate to the server.
*/
public void connect (String host, int port, String dn, String passwd)
@ -251,30 +252,30 @@ public interface LDAPv2 {
* Notifies the server to not send additional results associated with this
* <CODE>LDAPSearchResults</CODE> object, and discards any results already
* received.
* @param results LDAPSearchResults object returned from a search.
* @param results LDAPSearchResults object returned from a search
* @exception LDAPException Failed to notify the server.
*/
public void abandon(LDAPSearchResults results) throws LDAPException;
/**
* Authenticates user with the LDAP server.
* @param Dn Distinguished name to use for authentication.
* @param passwd Password for authentication.
* @param DN distinguished name to use for authentication
* @param passwd password for authentication
* @exception LDAPException Failed to authenticate to the server.
*/
public void authenticate (String DN, String passwd) throws LDAPException;
/**
* Authenticates user with the LDAP server.
* @param Dn Distinguished name to use for authentication.
* @param passwd Password for authentication.
* @param DN distinguished name to use for authentication
* @param passwd password for authentication
* @exception LDAPException Failed to authenticate to the server.
*/
public void bind (String DN, String passwd) throws LDAPException;
/**
* Read the entry corresponding to the specified distinguished name (DN).
* @param DN Distinguished name of the entry to retrieve.
* @param DN distinguished name of the entry to retrieve
* @exception LDAPException Failed to retrieve the specified entry.
*/
public LDAPEntry read (String DN) throws LDAPException;
@ -282,8 +283,8 @@ public interface LDAPv2 {
/**
* Read the entry corresponding to the specified distinguished name (DN),
* and retrieve only the specified attributes.
* @param DN Distinguished name of the entry to retrieve.
* @param attrs Names of attributes to retrieve.
* @param DN distinguished name of the entry to retrieve
* @param attrs names of attributes to retrieve
* @exception LDAPException Failed to retrieve the specified entry.
*/
public LDAPEntry read (String DN, String attrs[]) throws LDAPException;
@ -291,9 +292,9 @@ public interface LDAPv2 {
/**
* Read the entry corresponding to the specified distinguished name (DN),
* and retrieve only the specified attributes.
* @param DN Distinguished name of the entry to retrieve.
* @param attrs Names of attributes to retrieve.
* @param cons The constraints set for the read operation.
* @param DN distinguished name of the entry to retrieve
* @param attrs names of attributes to retrieve
* @param cons the constraints set for the read operation
* @exception LDAPException Failed to retrieve the specified entry.
*/
public LDAPEntry read (String DN, String attrs[], LDAPSearchConstraints cons)
@ -301,19 +302,19 @@ public interface LDAPv2 {
/**
* Searches for entries in the directory.
* @param base Starting point for the search in the directory
* (distinguished name).
* @param scope Indicates whether the scope of the search includes
* @param base starting point for the search in the directory
* (distinguished name)
* @param scope indicates whether the scope of the search includes
* only the base DN (equivalent to a read operation), only the entries
* one level below the base DN, or all entries at all levels beneath
* the base DN (including the base DN itself).
* the base DN (including the base DN itself)
* @param filter String which describes the search criteria. The format
* of the string is described fully in
* <A HREF="http://www.cis.ohio-state.edu/htbin/rfc/rfc1558.html" TARGET="_blank">RFC 1558</A>.
* @param attrs Names of the attributes to return for each matching
* @param attrs names of the attributes to return for each matching
* directory entry. If <CODE>null</CODE>, all attributes are returned.
* @param attrsOnly If <CODE>true</CODE>, the search will return only the names of
* the attributes (and not their values).
* @param attrsOnly if <CODE>true</CODE>, the search will return only the names of
* the attributes (and not their values)
* @exception LDAPException Failed to complete the requested search.
*/
public LDAPSearchResults search (String base, int scope, String filter,
@ -321,21 +322,21 @@ public interface LDAPv2 {
/**
* Searches for entries in the directory.
* @param base Starting point for the search in the directory
* (distinguished name).
* @param scope Indicates whether the scope of the search includes
* @param base starting point for the search in the directory
* (distinguished name)
* @param scope indicates whether the scope of the search includes
* only the base DN (equivalent to a read operation), only the entries
* one level below the base DN, or all entries at all levels beneath
* the base DN (including the base DN itself).
* the base DN (including the base DN itself)
* @param filter String which describes the search criteria. The format
* of the string is described fully in
* <A HREF="http://www.cis.ohio-state.edu/htbin/rfc/rfc1558.html" TARGET="_blank">RFC 1558</A>.
* @param attrs Names of the attributes to return for each matching
* @param attrs names of the attributes to return for each matching
* directory entry. If <CODE>null</CODE>, all attributes are returned.
* @param attrsOnly If <CODE>true</CODE>, the search will return only the names of
* the attributes (and not their values).
* @param cons Constraints specific to the search (for example, the maximum number
* of entries to return or the maximum time to wait for the search operation to complete).
* @param attrsOnly if <CODE>true</CODE>, the search will return only the names of
* the attributes (and not their values)
* @param cons constraints specific to the search (for example, the maximum number
* of entries to return or the maximum time to wait for the search operation to complete)
* @exception LDAPException Failed to complete the requested search.
*/
public LDAPSearchResults search (String base, int scope, String filter,
@ -345,9 +346,9 @@ public interface LDAPv2 {
/**
* Compares the given entry's attribute value to the specified
* attribute value.
* @param DN Distinguished name of the entry that you want compared
* against the specified attribute value.
* @param attr Attribute name and value to use in the comparison.
* @param DN distinguished name of the entry that you want compared
* against the specified attribute value
* @param attr attribute name and value to use in the comparison
* @exception LDAPException Failed to perform the comparison.
*/
public boolean compare (String DN, LDAPAttribute attr) throws LDAPException;
@ -355,10 +356,10 @@ public interface LDAPv2 {
/**
* Compares the given entry's attribute value to the specified
* attribute value.
* @param DN Distinguished name of the entry that you want compared
* against the specified attribute value.
* @param attr Attribute name and value to use in the comparison.
* @param cons The constraints set for the compare operation.
* @param DN distinguished name of the entry that you want compared
* against the specified attribute value
* @param attr attribute name and value to use in the comparison
* @param cons the constraints set for the compare operation
* @exception LDAPException Failed to perform the comparison.
*/
public boolean compare (String DN, LDAPAttribute attr,
@ -366,15 +367,15 @@ public interface LDAPv2 {
/**
* Adds an entry to the directory.
* @param entry New entry to add to the directory.
* @param entry new entry to add to the directory
* @exception LDAPException Failed to add the entry to the directory.
*/
public void add (LDAPEntry entry) throws LDAPException;
/**
* Adds an entry to the directory.
* @param entry New entry to add to the directory.
* @param cons The constraints set for the add operation.
* @param entry new entry to add to the directory
* @param cons the constraints set for the add operation
* @exception LDAPException Failed to add the entry to the directory.
*/
public void add (LDAPEntry entry, LDAPConstraints cons)
@ -382,17 +383,17 @@ public interface LDAPv2 {
/**
* Modifies an attribute of a directory entry.
* @param DN Distinguished name identifying the entry to be modified.
* @param mod The modification to be made.
* @param DN distinguished name identifying the entry to modify
* @param mod the modification to make
* @exception LDAPException Failed to modify the specified entry.
*/
public void modify (String DN, LDAPModification mod) throws LDAPException;
/**
* Modifies an attribute of a directory entry.
* @param DN Distinguished name identifying the entry to be modified.
* @param mod The modification to be made.
* @param cons The constraints set for the modify operation.
* @param DN distinguished name identifying the entry to modify
* @param mod the modification to make
* @param cons the constraints set for the modify operation
* @exception LDAPException Failed to modify the specified entry.
*/
public void modify (String DN, LDAPModification mod,
@ -400,17 +401,17 @@ public interface LDAPv2 {
/**
* Modifies the attributes of a directory entry.
* @param DN Distinguished name identifying the entry to be modified.
* @param mod List of the modifications to be made.
* @param DN distinguished name identifying the entry to modify
* @param mod list of the modifications to make
* @exception LDAPException Failed to modify the specified entry.
*/
public void modify (String DN, LDAPModificationSet mods ) throws LDAPException;
/**
* Modifies the attributes of a directory entry.
* @param DN Distinguished name identifying the entry to be modified.
* @param mod List of the modifications to be made.
* @param cons The constraints set for the modify operation.
* @param DN distinguished name identifying the entry to modify
* @param mod list of the modifications to make
* @param cons the constraints set for the modify operation
* @exception LDAPException Failed to modify the specified entry.
*/
public void modify (String DN, LDAPModificationSet mods,
@ -418,15 +419,15 @@ public interface LDAPv2 {
/**
* Removes an entry from the directory.
* @param DN Distinguished name identifying the entry to remove.
* @param DN distinguished name identifying the entry to remove
* @exception LDAPException Failed to remove the entry from the directory.
*/
public void delete( String DN ) throws LDAPException;
/**
* Removes an entry from the directory.
* @param DN Distinguished name identifying the entry to remove.
* @param cons The constraints set for the delete operation.
* @param DN distinguished name identifying the entry to remove
* @param cons the constraints set for the delete operation
* @exception LDAPException Failed to remove the entry from the directory.
*/
public void delete( String DN, LDAPConstraints cons )
@ -434,11 +435,10 @@ public interface LDAPv2 {
/**
* Changes the name of an entry in the directory.
* @param DN Original distinguished name (DN) of entry.
* @param newRDN New relative distinguished name (RDN) of the entry.
* @param deleteOldRDN Specifies whether or not the original RDN remains
* as an attribute of the entry. If <CODE>true</CODE>, the original RDN
* is no longer an attribute of the entry.
* @param DN distinguished name (DN) of entry
* @param newRDN the new relative distinguished name (RDN) of the entry
* @param deleteOldRDN <CODE>true</CODE> if the original RDN should no longer
* be an attribute of the entry; <CODE>false</CODE> if it should
* @exception LDAPException Failed to rename the entry in the directory.
*/
public void rename ( String DN, String newRDN, boolean deleteOldRDN )
@ -446,12 +446,12 @@ public interface LDAPv2 {
/**
* Changes the name of an entry in the directory.
* @param DN Original distinguished name (DN) of entry.
* @param newRDN New relative distinguished name (RDN) of the entry.
* @param deleteOldRDN Specifies whether or not the original RDN remains
* as an attribute of the entry. If <CODE>true</CODE>, the original RDN
* is no longer an attribute of the entry.
* @param cons The constraints set for the rename operation.
* @param DN distinguished name (DN) of entry
* @param newRDN new relative distinguished name (RDN) of the entry
* @param deleteOldRDN specifies whether or not the original RDN remains
* as an attribute of the entry. If <CODE>true</CODE>, the original RDN
* is no longer an attribute of the entry.
* @param cons the constraints set for the rename operation
* @exception LDAPException Failed to rename the entry in the directory.
*/
public void rename ( String DN, String newRDN, boolean deleteOldRDN,

Просмотреть файл

@ -36,34 +36,34 @@ import java.io.*;
public interface LDAPv3 extends LDAPv2 {
/**
* Connects and authenticates to the LDAP server with the specified LDAP
* protocol version.
* @param version LDAP protocol version requested: currently 2 or 3
* @param host Hostname of the LDAP server.
* @param port Port number of the LDAP server. To specify the
* default, well-known port, use <CODE>DEFAULT_PORT</CODE>.
* @param dn Distinguished name to use for authentication.
* @param passwd Password for authentication.
* Connects and authenticates to the LDAP server using the specified version of the
* LDAP protocol.
* @param version requested version of the LDAP protocol: currently 2 or 3
* @param host hostname of the LDAP server
* @param port port number of the LDAP server. To specify the
* default port, use <CODE>DEFAULT_PORT</CODE>.
* @param dn distinguished name to use for authentication
* @param passwd password for authentication
* @exception LDAPException Failed to connect and authenticate to the server.
*/
public void connect(int version, String host, int port, String dn,
String passwd) throws LDAPException;
/**
* Authenticates to the LDAP server (that the object is currently
* connected to) using the specified name and password, with the
* specified LDAP protocol version. If the server does not support
* the requested protocol version, an exception is thrown. If the
* object has been disconnected from an LDAP server, this method
* attempts to reconnect to the server. If the object had already
* authenticated, the old authentication is discarded.
* @param version LDAP protocol version requested: currently 2 or 3.
* @param dn If non-null and non-empty, specifies that the
* connection and all operations through it should be
* authenticated with dn as the distinguished name.
* @param passwd If non-null and non-empty, specifies that the
* connection and all operations through it should be
* authenticated with passwd as password.
* Authenticates to the LDAP server (to which the object is currently
* connected) using the specified name, password, and version
* of the LDAP protocol. If the server does not support the requested
* protocol version, an exception is thrown. If the object has been
* disconnected from an LDAP server, this method attempts to reconnect
* to the server. If the object had already authenticated, the old
* authentication is discarded.
* @param version requested LDAP protocol version: currently 2 or 3.
* @param dn if non-null and non-empty, specifies that the
* connection and all operations through it should
* authenticate with dn as the distinguished name
* @param passwd if non-null and non-empty, specifies that the
* connection and all operations through it should
* authenticated with passwd as password
* @exception LDAPException Failed to authenticate to the LDAP server.
*/
public void authenticate(int version,
@ -72,20 +72,20 @@ public interface LDAPv3 extends LDAPv2 {
throws LDAPException;
/**
* Authenticates to the LDAP server (that the object is currently
* connected to) using the specified name and password, with the
* specified LDAP protocol version. If the server does not support
* the requested protocol version, an exception is thrown. If the
* Authenticates to the LDAP server (to which the object is currently
* connected) using the specified name, password, and version of the
* LDAP protocol. If the server does not support the requested
* version of the protocol, an exception is thrown. If the
* object has been disconnected from an LDAP server, this method
* attempts to reconnect to the server. If the object had already
* authenticated, the old authentication is discarded.
* @param version LDAP protocol version requested: currently 2 or 3.
* @param dn If non-null and non-empty, specifies that the
* connection and all operations through it should be
* authenticated with dn as the distinguished name.
* @param passwd If non-null and non-empty, specifies that the
* connection and all operations through it should be
* authenticated with passwd as password.
* @param version requested LDAP protocol version: currently 2 or 3.
* @param dn if non-null and non-empty, specifies that the
* connection and all operations through it should authenticate
* with dn as the distinguished name
* @param passwd if non-null and non-empty, specifies that the
* connection and all operations through it should authenticate
* with passwd as password
* @exception LDAPException Failed to authenticate to the LDAP server.
*/
public void bind(int version,
@ -99,7 +99,7 @@ public interface LDAPv3 extends LDAPv2 {
* <P>
*
* @param op LDAPExtendedOperation object specifying the OID of the
* extended operation and the data to be used in the operation.
* extended operation and the data to use in the operation
* @exception LDAPException Failed to execute the operation
* @return LDAPExtendedOperation object representing the extended response
* returned by the server.
@ -110,10 +110,12 @@ public interface LDAPv3 extends LDAPv2 {
/**
* Renames and moves an entry in the directory.
* @param DN Original distinguished name (DN) for the entry.
* @param newRDN New relative distinguished name (RDN) for the entry.
* @param newParentDN Distinguished name of the new parent entry of the
* specified entry.
* @param DN original distinguished name (DN) for the entry
* @param newRDN new relative distinguished name (RDN) for the entry
* @param newParentDN distinguished name of the new parent entry of the
* specified entry
* @param deleteOldRDN specifies whether or not to remove the old RDN
* when renaming and moving the entry. If <code>true</code>, the old RDN will be deleted.
* @exception LDAPException Failed to rename the specified entry.
*/
public void rename( String DN, String newRDN, String newParentDN,
@ -121,19 +123,21 @@ public interface LDAPv3 extends LDAPv2 {
/**
* Renames and moves an entry in the directory.
* @param DN Original distinguished name (DN) for the entry.
* @param newRDN New relative distinguished name (RDN) for the entry.
* @param newParentDN Distinguished name of the new parent entry of the
* specified entry.
* @param cons The constraints set for the rename operation.
* @param DN original distinguished name (DN) for the entry
* @param newRDN new relative distinguished name (RDN) for the entry
* @param newParentDN distinguished name of the new parent entry of the
* specified entry
* @param deleteOldRDN specifies whether or not to remove the old RDN
* when renaming and moving the entry. If <code>true</code>, the old RDN will be deleted.
* @param cons the constraints set for the rename operation
* @exception LDAPException Failed to rename the specified entry.
*/
public void rename( String DN, String newRDN, String newParentDN,
boolean deleteOldRDN, LDAPConstraints cons ) throws LDAPException;
/**
* Returns an array of the latest controls (if any) from server.
* @return An array of the controls returned by an operation,
* Returns an array of the latest controls (if any) from the server.
* @return an array of the controls returned by an operation,
* or <CODE>null</CODE> if none.
* @see netscape.ldap.LDAPControl
*/

Просмотреть файл

@ -53,7 +53,7 @@ public class BERAny extends BERElement {
* implementation. The following method will never be called.
* @param stream input stream
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream.
* number of bytes read from stream
* @exception IOException failed to construct
*/
public BERAny(BERTagDecoder decoder, InputStream stream,
@ -79,7 +79,7 @@ public class BERAny extends BERElement {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
return "ANY {" + m_value + "}";

Просмотреть файл

@ -57,7 +57,7 @@ public class BERBitString extends BERElement {
* (for constructed encodings).
* @param stream source
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream.
* number of bytes read from stream
* @exception IOException failed to construct
*/
public BERBitString(BERTagDecoder decoder, InputStream stream,
@ -120,7 +120,7 @@ public class BERBitString extends BERElement {
* (for primitive encodings).
* @param stream source
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream.
* number of bytes read from stream
* @exception IOException failed to construct
*/
public BERBitString(InputStream stream, int[] bytes_read)
@ -230,7 +230,7 @@ public class BERBitString extends BERElement {
/**
* Gets the number of bits.
* @return bit numbers
* @return bit numbers.
*/
public int getSize() {
return m_value_num_bits;
@ -246,7 +246,7 @@ public class BERBitString extends BERElement {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
String hex_string = "";

Просмотреть файл

@ -56,7 +56,7 @@ public class BERBoolean extends BERElement {
* Constructs a boolean element from an input stream.
* @param stream source
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream.
* number of bytes read from stream
* @exception IOException failed to construct
*/
public BERBoolean(InputStream stream, int[] bytes_read) throws IOException {
@ -102,7 +102,7 @@ public class BERBoolean extends BERElement {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
return "Boolean {" + m_value + "}";

Просмотреть файл

@ -61,7 +61,7 @@ public abstract class BERCharacterString extends BERElement {
* Constructs a character string element from an input stream
* (for constructed encoding)
* @param stream input stream
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BERCharacterString(BERTagDecoder decoder, InputStream stream,
@ -114,7 +114,7 @@ public abstract class BERCharacterString extends BERElement {
* Constructs a character string element from an input stream
* (for primitive encoding)
* @param stream source
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BERCharacterString(InputStream stream, int[] bytes_read)
@ -171,7 +171,7 @@ public abstract class BERCharacterString extends BERElement {
/**
* Gets the string representation.
* @return string representation
* @return string representation.
*/
public abstract String toString();
}

Просмотреть файл

@ -40,7 +40,7 @@ public class BERChoice extends BERElement {
/**
* Constructs a choice element.
* @param value Any BERElement value
* @param value any BERElement value
*/
public BERChoice(BERElement value) {
m_value = value;
@ -53,7 +53,7 @@ public class BERChoice extends BERElement {
* chosen. The following method will never be called.
* @param stream input stream
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream.
* number of bytes read from stream
* @exception IOException failed to construct
*/
public BERChoice(BERTagDecoder decoder, InputStream stream,
@ -88,7 +88,7 @@ public class BERChoice extends BERElement {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
return "CHOICE {" + m_value + "}";

Просмотреть файл

@ -41,10 +41,10 @@ public abstract class BERConstruct extends BERElement {
/**
* Constructs a construct element from an input stream.
* @param decoder decoder for application specific ber
* @param decoder decoder for application specific BER
* @param stream input stream from socket
* @param bytes_read array of 1 int; value incremented by number
* of bytes read from stream.
* of bytes read from stream
* @exception IOException failed to construct
*/
public BERConstruct(BERTagDecoder decoder, InputStream stream,
@ -75,7 +75,7 @@ public abstract class BERConstruct extends BERElement {
/**
* Adds an element to the list.
* @return BER encoding of the element
* @return BER encoding of the element.
*/
public void addElement(BERElement element) {
m_elements.addElement(element);
@ -83,7 +83,7 @@ public abstract class BERConstruct extends BERElement {
/**
* Retrieves number of elements.
* @return number of element
* @return number of elements.
*/
public int size() {
return m_elements.size();
@ -91,8 +91,8 @@ public abstract class BERConstruct extends BERElement {
/**
* Gets ber element at specific position.
* @param index index of element to get
* @return ber element
* @param index index of the element to get
* @return BER element.
*/
public BERElement elementAt(int index) {
return (BERElement)m_elements.elementAt(index);
@ -124,7 +124,7 @@ public abstract class BERConstruct extends BERElement {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public abstract String toString();
}

Просмотреть файл

@ -84,10 +84,10 @@ public abstract class BERElement implements Serializable {
/**
* Gets a ber element from the input stream.
* @param decoder decoder for application specific ber
* @param decoder decoder for application specific BER
* @param stream source of ber encoding
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream.
* number of bytes read from stream
* @exception IOException failed to decode an element.
*/
public static BERElement getElement(BERTagDecoder decoder,
@ -152,9 +152,9 @@ public abstract class BERElement implements Serializable {
/**
* Reads and decodes a length byte and then that many octets
* from the input stream.
* @param stream input stream to read from
* @param stream input stream from which to read
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream.
* number of bytes read from stream
* @return length of contents or -1 if indefinite length.
* @exception IOException failed to read octets
*/
@ -187,8 +187,8 @@ public abstract class BERElement implements Serializable {
/**
* Writes length octets (definite length only) to stream.
* Uses shortform whenever possible.
* @param stream output stream to write to.
* @param num_content_octets value to be encode into length octets.
* @param stream output stream to write to
* @param num_content_octets value to be encode into length octets
* @return number of bytes sent to stream.
* @exception IOException failed to read octets
*/
@ -232,8 +232,8 @@ public abstract class BERElement implements Serializable {
* an integer..
* @param stream source of data
* @param bytes_read number of bytes read
* @param length number of bytes to be read (1 - 4)
* @return the value of the data as two's complement
* @param length number of bytes to be read (1 to 4)
* @return the value of the data as two's complement.
* @exception IOException failed to read octets
*/
protected int readUnsignedBinary(InputStream stream,
@ -256,7 +256,7 @@ public abstract class BERElement implements Serializable {
* @param stream source of data
* @param bytes_read number of bytes read
* @param length number of bytes to be read
* @return the integer value as two's complement
* @return the integer value as two's complement.
* @exception IOException failed to read octets
*/
protected int readTwosComplement(InputStream stream,
@ -299,20 +299,20 @@ public abstract class BERElement implements Serializable {
/**
* Sends the BER encoding directly to a stream.
* @param stream output stream.
* @param stream output stream
* @return bytes written to stream.
*/
public abstract void write(OutputStream stream) throws IOException;
/**
* Gets the element type.
* @return element type
* @return element type.
*/
public abstract int getType();
/**
* Gets the string representation.
* @return string representation of an element
* @return string representation of an element.
*/
public abstract String toString();
}

Просмотреть файл

@ -50,9 +50,9 @@ public class BEREnumerated extends BERIntegral {
/**
* Constructs an enumerated element with the input stream.
* @param stream input stream to decode from.
* @param stream input stream from which to decode
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from array.
* number of bytes read from array
* @exception IOException failed to construct
*/
public BEREnumerated(InputStream stream, int[] bytes_read)
@ -70,7 +70,7 @@ public class BEREnumerated extends BERIntegral {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
return "Enumerated {" + getValue() + "}";

Просмотреть файл

@ -58,7 +58,7 @@ public class BERInteger extends BERIntegral {
* Constructs an integer element with the input stream.
* @param stream input stream
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream
* number of bytes read from stream
* @exception IOException failed to construct
*/
public BERInteger(InputStream stream, int[] bytes_read) throws IOException {
@ -75,7 +75,7 @@ public class BERInteger extends BERIntegral {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
return "Integer {" + getValue() + "}";

Просмотреть файл

@ -63,7 +63,7 @@ public abstract class BERIntegral extends BERElement {
* Constructs an integral element from an input stream.
* @param stream source
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream
* number of bytes read from stream
* @exception IOException failed to construct
*/
public BERIntegral(InputStream stream, int[] bytes_read) throws IOException {
@ -95,7 +95,7 @@ public abstract class BERIntegral extends BERElement {
/**
* Writes BER to stream.
* @param stream output stream.
* @param stream output stream
* @exception IOException on failure to write
*/
public void write(OutputStream stream) throws IOException {
@ -154,7 +154,7 @@ public abstract class BERIntegral extends BERElement {
/**
* Gets the integral value.
* @return element value
* @return element value.
*/
public int getValue() {
return m_value;
@ -162,13 +162,13 @@ public abstract class BERIntegral extends BERElement {
/**
* Gets the element type.
* @return element type
* @return element type.
*/
public abstract int getType();
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public abstract String toString();
}

Просмотреть файл

@ -49,7 +49,7 @@ public class BERNull extends BERElement {
* Constructs a null element from an input stream.
* @param stream input stream from socket
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream
* number of bytes read from stream
* @exception IOException failed to construct
*/
public BERNull(InputStream stream, int[] bytes_read) throws IOException {
@ -71,7 +71,7 @@ public class BERNull extends BERElement {
/**
* Gets the element type.
* @return element type
* @return element type.
*/
public int getType() {
return BERElement.NULL;
@ -79,7 +79,7 @@ public class BERNull extends BERElement {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
return "Null {}";

Просмотреть файл

@ -56,7 +56,7 @@ public class BERNumericString extends BERCharacterString {
* Constructs a numeric string element from an input stream
* (for constructed encoding)
* @param stream source
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BERNumericString(BERTagDecoder decoder, InputStream stream,
@ -68,7 +68,7 @@ public class BERNumericString extends BERCharacterString {
* Constructs a numericstring element from an input stream
* (for primitive encoding)
* @param stream input stream
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BERNumericString(InputStream stream, int[] bytes_read)
@ -78,7 +78,7 @@ public class BERNumericString extends BERCharacterString {
/**
* Gets the element type.
* @return element type
* @return element type.
*/
public int getType() {
return BERElement.NUMERICSTRING;
@ -87,7 +87,7 @@ public class BERNumericString extends BERCharacterString {
/**
* Gets the string representation. Note that currently prints out
* values in decimal form.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
if (m_value == null)

Просмотреть файл

@ -34,8 +34,8 @@ public class BERObjectId extends BERElement {
private int[] m_value = null;
/**
* Constructs an object id element from an array of values.
* @param value object id value as array of components
* Constructs an object ID element from an array of values.
* @param value object ID value as array of components
*/
public BERObjectId(int[] value) {
m_value = new int[value.length];
@ -57,7 +57,7 @@ public class BERObjectId extends BERElement {
* Constructs an object id element from an input stream.
* @param stream source
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream.
* number of bytes read from stream
* @exception IOException failed to construct
*/
public BERObjectId(InputStream stream, int[] bytes_read) throws IOException {
@ -119,7 +119,7 @@ public class BERObjectId extends BERElement {
* Reads a sub identifier from stream.
* @param stream input stream
* @param bytes_read array of 1 int; value incremented by
* number of bytes read from stream.
* number of bytes read from stream
*/
private int readSubIdentifier(InputStream stream, int[] bytes_read)
throws IOException {
@ -156,7 +156,7 @@ public class BERObjectId extends BERElement {
/**
* Gets the element value.
* @return element value
* @return element value.
*/
public int[] getValue() {
return m_value;
@ -164,7 +164,7 @@ public class BERObjectId extends BERElement {
/**
* Gets the element type.
* @return element type
* @return element type.
*/
public int getType() {
return BERElement.OBJECTID;
@ -172,7 +172,7 @@ public class BERObjectId extends BERElement {
/**
* Gets the string representation.
* @return string representation of element
* @return string representation of element.
*/
public String toString() {
if (m_value == null)

Просмотреть файл

@ -44,7 +44,7 @@ public class BEROctetString extends BERElement {
/**
* Constructs an octet string element containing a copy of
* the contents of buffer.
* @param buffer A UCS-2 String.
* @param buffer a UCS-2 String
*/
public BEROctetString(String buffer) {
if (buffer == null)
@ -58,8 +58,8 @@ public class BEROctetString extends BERElement {
/**
* Constructs an octet string element containing a reference to
* buffer.
* @param buffer A byte array, which must be in UTF-8 format if
* it is string data.
* @param buffer a byte array, which must be in UTF-8 format if
* it is string data
*/
public BEROctetString(byte[] buffer) {
m_value = buffer;
@ -84,7 +84,7 @@ public class BEROctetString extends BERElement {
* (for constructed encoding)
* @param decoder a decode that understands the specific tags
* @param stream source
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BEROctetString(BERTagDecoder decoder, InputStream stream,
@ -130,7 +130,7 @@ public class BEROctetString extends BERElement {
* Constructs an octet string element from an input stream
* (for primitive encoding)
* @param stream source
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BEROctetString(InputStream stream, int[] bytes_read)
@ -181,7 +181,7 @@ public class BEROctetString extends BERElement {
/**
* Gets the string representation.
* NOTE: currently prints out values in decimal form.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
if (m_value == null)

Просмотреть файл

@ -56,7 +56,7 @@ public class BERPrintableString extends BERCharacterString {
* Constructs a printable string element from an input stream
* (for constructed encoding)
* @param stream source
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BERPrintableString(BERTagDecoder decoder, InputStream stream,
@ -68,7 +68,7 @@ public class BERPrintableString extends BERCharacterString {
* Constructs a printablestring element from an input stream
* (for primitive encoding)
* @param stream source
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BERPrintableString(InputStream stream, int[] bytes_read)
@ -78,7 +78,7 @@ public class BERPrintableString extends BERCharacterString {
/**
* Gets the element type.
* @return element type
* @return element type.
*/
public int getType() {
return BERElement.PRINTABLESTRING;
@ -87,7 +87,7 @@ public class BERPrintableString extends BERCharacterString {
/**
* Gets the string representation. Note that it prints out
* values in decimal form.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
if (m_value == null)

Просмотреть файл

@ -148,7 +148,7 @@ public class BERReal extends BERElement {
contents_length_left = length - 1 - num_exponent_octets;
number = readUnsignedBinary(stream, bytes_read, contents_length_left);
mantissa = sign * number * 2 * f;
mantissa = (int)(sign * number * Math.pow(2, f));
m_value = mantissa * (float)Math.pow((double)base,(double)exponent);
} else {
/* bits 8 + 7 = 00 */

Просмотреть файл

@ -42,10 +42,10 @@ public class BERSequence extends BERConstruct {
/**
* Constructs a sequence element from an input stream.
* @param decoder application specific ber decoder.
* @param stream input stream to read ber from.
* @param decoder application-specific BER decoder
* @param stream input stream from which to read BER
* @param bytes_read array of 1 int; value is incremented by
* number of bytes read from stream
* number of bytes read from stream
* @exception IOException failed to construct
*/
public BERSequence(BERTagDecoder decoder, InputStream stream,
@ -56,7 +56,7 @@ public class BERSequence extends BERConstruct {
/**
* Gets the element type.
* @return element type
* @return element type.
*/
public int getType() {
return BERElement.SEQUENCE;
@ -64,7 +64,7 @@ public class BERSequence extends BERConstruct {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
String elements = "";

Просмотреть файл

@ -42,10 +42,10 @@ public class BERSet extends BERConstruct {
/**
* Constructs a set element from an input stream.
* @param decoder decoder for application specific ber
* @param decoder decoder for application-specific BER
* @param stream source
* @param bytes_read array of 1 int; value incremented by number
* of bytes read from stream.
* of bytes read from stream
* @exception IOException failed to construct
*/
public BERSet(BERTagDecoder decoder, InputStream stream,
@ -64,7 +64,7 @@ public class BERSet extends BERConstruct {
/**
* Gets the element type.
* @return element type
* @return element type.
*/
public int getType() {
return BERElement.SET;
@ -72,7 +72,7 @@ public class BERSet extends BERConstruct {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
String elements = "";

Просмотреть файл

@ -61,11 +61,11 @@ public class BERTag extends BERElement {
/**
* Constructs a tag element from an input stream.
* @param decoder decoder object for application specific tags
* @param decoder decoder object for application-specific tags
* @param tag tag value; already stripped from stream
* @param stream source
* @param bytes_read array of 1 int; incremented by number
* ofbytes read from stream
* of bytes read from stream
* @exception IOException failed to construct
*/
public BERTag(BERTagDecoder decoder, int tag, InputStream stream,
@ -85,7 +85,7 @@ public class BERTag extends BERElement {
/**
* Gets the element from the tagged object.
* @return ber element
* @return BER element.
*/
public BERElement getValue() {
return m_element;
@ -127,7 +127,7 @@ public class BERTag extends BERElement {
/**
* Gets the element type.
* @return element type
* @return element type.
*/
public int getType() {
return BERElement.TAG;
@ -143,7 +143,7 @@ public class BERTag extends BERElement {
/**
* Gets the string representation.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
String s = "";

Просмотреть файл

@ -40,7 +40,7 @@ public abstract class BERTagDecoder {
* @param tag element tag
* @param stream source stream
* @param bytes_read array of 1 int; value incremented by number
* of bytes read from stream.
* of bytes read from stream
* @param implicit array of implicit flags
*/
public abstract BERElement getElement(BERTagDecoder decoder, int tag,

Просмотреть файл

@ -53,7 +53,7 @@ public class BERUTCTime extends BERElement {
* Constructs a UTCTime element from an input stream
* (for constructed encoding)
* @param stream source
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BERUTCTime(BERTagDecoder decoder, InputStream stream,
@ -96,7 +96,7 @@ public class BERUTCTime extends BERElement {
* Constructs a UTC time element from an input stream
* (for primitive encoding)
* @param stream source
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BERUTCTime(InputStream stream, int[] bytes_read) throws IOException {
@ -117,7 +117,7 @@ public class BERUTCTime extends BERElement {
}
/**
* Writes ber to a stream
* Writes BER to a stream.
* @return number of bytes written to stream.
* @exception IOException failed to write
*/
@ -157,7 +157,7 @@ public class BERUTCTime extends BERElement {
/**
* Gets the string representation.
* NOTE: currently prints out values in decimal form.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
if (m_value == null)

Просмотреть файл

@ -56,7 +56,7 @@ public class BERVisibleString extends BERCharacterString {
* Constructs a visiblestring element with the input stream.
* (for constructed encoding)
* @param stream input stream
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BERVisibleString(BERTagDecoder decoder, InputStream stream,
@ -68,7 +68,7 @@ public class BERVisibleString extends BERCharacterString {
* Constructs a visiblestring element with the input stream.
* (for primitive encoding)
* @param stream input stream
* @param bytes_read array of 1 int, incremented by number of bytes read.
* @param bytes_read array of 1 int, incremented by number of bytes read
* @exception IOException failed to construct
*/
public BERVisibleString(InputStream stream, int[] bytes_read)
@ -87,7 +87,7 @@ public class BERVisibleString extends BERCharacterString {
/**
* Gets the string representation. Note that currently prints out
* values in decimal form.
* @return string representation of tag
* @return string representation of tag.
*/
public String toString() {
if (m_value == null)

Просмотреть файл

@ -33,7 +33,7 @@ import java.net.*;
* success (0),
* ...
* },
* matchedND LDAPDN,
* matchedDN LDAPDN,
* errorMessage LDAPString
* }
* </pre>
@ -239,7 +239,7 @@ public class JDAPResult {
* @return string representation
*/
public String getParamString() {
return "{resultCode=" + m_result_code + ", matcheDN=" +
return "{resultCode=" + m_result_code + ", matchedDN=" +
m_matched_dn + ", errorMessage=" + m_error_message + "}";
}

Просмотреть файл

@ -74,11 +74,11 @@ public class LDAPEntryChangeControl extends LDAPControl {
* Contructs an <CODE>LDAPEntryChangedControl</CODE> object.
* This constructor is used by <CODE>LDAPControl.register</CODE> to
* instantiate entry change controls.
* @param oid This parameter must be
* @param oid this parameter must be
* <CODE>LDAPEntryChangeControl.ENTRYCHANGED</CODE>
* or a <CODE>LDAPException</CODE> is thrown.
* @param critical True if this control is critical.
* @param value The value associated with this control.
* or an <CODE>LDAPException</CODE> is thrown
* @param critical <code>true</code> if this control is critical
* @param value the value associated with this control
* @exception netscape.ldap.LDAPException If oid is not
* <CODE>LDAPEntryChangeControl.ENTRYCHANGED</CODE>.
* @exception java.io.IOException If value is not a valid BER sequence.
@ -129,7 +129,7 @@ public class LDAPEntryChangeControl extends LDAPControl {
* Sets the change number (which identifies the record of the change
* in the server's change log) in this "entry change notification"
* control.
* @param num Change number that you want to set.
* @param num change number to set
* @see netscape.ldap.controls.LDAPEntryChangeControl#getChangeNumber
*/
public void setChangeNumber(int num) {
@ -139,7 +139,7 @@ public class LDAPEntryChangeControl extends LDAPControl {
/**
* Sets the change type (which identifies the type of change
* that occurred) in this "entry change notification" control.
* @param num Change type that you want to set. This can be one of
* @param num change type to set. This can be one of
* the following values:
* <P>
*
@ -164,7 +164,7 @@ public class LDAPEntryChangeControl extends LDAPControl {
/**
* Sets the previous DN of the entry (if the entry was renamed)
* in the "entry change notification control".
* @param dn The previous distinguished name of the entry.
* @param dn the previous distinguished name of the entry
* @see netscape.ldap.controls.LDAPEntryChangeControl#getPreviousDN
*/
public void setPreviousDN(String dn) {
@ -174,7 +174,7 @@ public class LDAPEntryChangeControl extends LDAPControl {
/**
* Gets the change number, which identifies the record of the change
* in the server's change log.
* @return Change number identifying the change made.
* @return change number identifying the change made.
* @see netscape.ldap.controls.LDAPEntryChangeControl#setChangeNumber
*/
public int getChangeNumber() {
@ -184,7 +184,7 @@ public class LDAPEntryChangeControl extends LDAPControl {
/**
* Gets the change type, which identifies the type of change
* that occurred.
* @returns Change type identifying the type of change that
* @returns change type identifying the type of change that
* occurred. This can be one of the following values:
* <P>
*
@ -208,7 +208,7 @@ public class LDAPEntryChangeControl extends LDAPControl {
/**
* Gets the previous DN of the entry (if the entry was renamed).
* @returns The previous distinguished name of the entry.
* @returns the previous distinguished name of the entry.
* @see netscape.ldap.controls.LDAPEntryChangeControl#setPreviousDN
*/
public String getPreviousDN() {

Просмотреть файл

@ -38,11 +38,11 @@ public class LDAPPasswordExpiredControl extends LDAPStringControl {
* instantiate password expired controls.
* <P>
* To retrieve the message from the server, call <CODE>getMessage</CODE>.
* @param oid This parameter must be equal to
* @param oid this parameter must be equal to
* <CODE>LDAPPasswordExpiredControl.EXPIRED</CODE>
* or a <CODE>LDAPException</CODE> is thrown.
* @param critical True if this control is critical.
* @param value The value associated with this control.
* or an <CODE>LDAPException</CODE> is thrown
* @param critical <code>true</code> if this control is critical
* @param value the value associated with this control
* @exception netscape.ldap.LDAPException If oid is not
* <CODE>LDAPPasswordExpiredControl.EXPIRED</CODE>.
* @see netscape.ldap.LDAPControl#register
@ -58,12 +58,12 @@ public class LDAPPasswordExpiredControl extends LDAPStringControl {
}
/**
* @param controls An array of <CODE>LDAPControl</CODE> objects,
* @param controls an array of <CODE>LDAPControl</CODE> objects,
* representing the controls returned by the server
* after a search. To get these controls, use the
* after a search. To get these controls, use the
* <CODE>getResponseControls</CODE> method of the
* <CODE>LDAPConnection</CODE> class.
* @return An error message string, or null if none is in the control.
* @return an error message string, or null if none is in the control.
* @see netscape.ldap.LDAPConnection#getResponseControls
* @deprecated LDAPPasswordExpiredControl controls are now automatically
* instantiated.
@ -73,8 +73,8 @@ public class LDAPPasswordExpiredControl extends LDAPStringControl {
}
/**
* Gets the message returned by the server with this control
* @return The message returned by the server
* Gets the message returned by the server with this control.
* @return the message returned by the server.
*/
public String getMessage() {
return m_msg;

Просмотреть файл

@ -39,11 +39,11 @@ public class LDAPPasswordExpiringControl extends LDAPStringControl {
* <P>
* To retrieve the number of seconds until this password expires,
* call <CODE>getSecondsToExpiration</CODE>.
* @param oid This parameter must be
* @param oid this parameter must be
* <CODE>LDAPPasswordExpiringControl.EXPIRING</CODE>
* or an <CODE>LDAPException</CODE> is thrown.
* @param critical True if this control is critical.
* @param value The value associated with this control.
* or an <CODE>LDAPException</CODE> is thrown
* @param critical <code>true</code> if this control is critical
* @param value the value associated with this control
* @exception netscape.ldap.LDAPException If oid is not
* <CODE>LDAPPasswordExpiringControl.EXPIRING.</CODE>
* @see netscape.ldap.LDAPControl#register
@ -60,7 +60,7 @@ public class LDAPPasswordExpiringControl extends LDAPStringControl {
/**
* Gets the number of seconds until the password expires returned by the
* server.
* @return int The number of seconds until the password expires.
* @return int the number of seconds until the password expires.
* @exception java.lang.NumberFormatException If the server returned an
* undecipherable message. In this case, use <CODE>getMessage</CODE> to
* retrieve the message as a string.
@ -71,19 +71,19 @@ public class LDAPPasswordExpiringControl extends LDAPStringControl {
/**
* Gets the value associated with this control parsed as a string.
* @return The value associated with this control parsed as a string.
* @return the value associated with this control parsed as a string.
*/
public String getMessage() {
return m_msg;
}
/**
* @param controls An array of <CODE>LDAPControl</CODE> objects,
* representing the controls returned by the server
* @param controls an array of <CODE>LDAPControl</CODE> objects,
* representing the controls returned by the server.
* after a search. To get these controls, use the
* <CODE>getResponseControls</CODE> method of the
* <CODE>LDAPConnection</CODE> class.
* @return An error message string, or null if none is in the control.
* @return an error message string, or null if none is in the control.
* @see netscape.ldap.LDAPConnection#getResponseControls
* @deprecated LDAPPasswordExpiringControl controls are now automatically
* instantiated.

Просмотреть файл

@ -121,7 +121,7 @@ public class LDAPPersistSearchControl extends LDAPControl {
* Constructs an <CODE>LDAPPersistSearchControl</CODE> object
* that specifies a persistent search.
*
* @param changeTypes The change types to be monitored. You can perform
* @param changeTypes the change types to monitor. You can perform
* a bitwise OR on any of the following values and specify the result as
* the change types:
* <UL>
@ -136,11 +136,12 @@ public class LDAPPersistSearchControl extends LDAPControl {
* </UL>
* @param changesOnly <code>true</code> if you do not want the server
* to return all existing entries in the directory that match the
* search criteria. (You just want the changed entries to be returned.)
* @param returnControls <code>true</code> you want the server to return
* entry change controls with each entry in the search results.
* search criteria. (Use this if you just want the changed entries
* to be returned.)
* @param returnControls <code>true</code> if you want the server to return
* entry change controls with each entry in the search results
* @param isCritical <code>true</code> if this control is critical to
* the search operation (for example, if the server does not support
* the search operation. (If the server does not support
* this control, you may not want the server to perform the search
* at all.)
* @see netscape.ldap.LDAPControl
@ -158,7 +159,7 @@ public class LDAPPersistSearchControl extends LDAPControl {
/**
* Gets the change types monitored by this control.
* @return Integer representing the change types that you want monitored.
* @return integer representing the change types to monitor.
* This value can be the bitwise OR of <code>ADD, DELETE, MODIFY,</code>
* and/or <code>MODDN</code>. If the change type is unknown,
* this method returns -1.
@ -172,7 +173,7 @@ public class LDAPPersistSearchControl extends LDAPControl {
* Indicates whether you want the server to send any existing
* entries that already match the search criteria or only the
* entries that have changed.
* @return If <code>true</code>, the server returns only the
* @return if <code>true</code>, the server returns only the
* entries that have changed. If <code>false</code>, the server
* also returns any existing entries that match the search criteria
* but have not changed.
@ -198,7 +199,7 @@ public class LDAPPersistSearchControl extends LDAPControl {
/**
* Sets the change types that you want monitored by this control.
* @param types Integer representing the change types that you want monitored.
* @param types integer representing the change types to monitor
* This value can be the bitwise OR of <code>ADD, DELETE, MODIFY,</code>
* and/or <code>MODDN</code>.
* @see netscape.ldap.controls.LDAPPersistSearchControl#getChangeTypes
@ -211,7 +212,7 @@ public class LDAPPersistSearchControl extends LDAPControl {
* Specifies whether you want the server to send any existing
* entries that already match the search criteria or only the
* entries that have changed.
* @param changesOnly If <code>true</code>, the server returns only the
* @param changesOnly if <code>true</code>, the server returns only the
* entries that have changed. If <code>false</code>, the server
* also returns any existing entries that match the search criteria
* but have not changed.
@ -225,9 +226,9 @@ public class LDAPPersistSearchControl extends LDAPControl {
* Specifies whether you want the server to include an "entry change
* notification" control with each entry it sends back to the client
* during the persistent search.
* @param returnControls If <code>true</code>, the server includes
* @param returnControls if <code>true</code>, the server includes
* "entry change notification" controls with the entries it sends
* during the persistent search.
* during the persistent search
* @see netscape.ldap.controls.LDAPEntryChangeControl
* @see netscape.ldap.controls.LDAPPersistSearchControl#setReturnControls
*/
@ -239,8 +240,8 @@ public class LDAPPersistSearchControl extends LDAPControl {
* Takes an input byte array and extracts the ber elements, assigning
* them to appropriate fields in the entry change control.
*
* @param c Byte array that contains BER elements.
* @return The entry change control.
* @param c byte array that contains BER elements
* @return the entry change control.
* @deprecated LDAPEntryChangeControl controls are now automatically
* instantiated.
*/
@ -363,12 +364,12 @@ public class LDAPPersistSearchControl extends LDAPControl {
*
* </PRE>
*
* @param controls An array of <CODE>LDAPControl</CODE> objects,
* @param controls an array of <CODE>LDAPControl</CODE> objects,
* representing the controls returned by the server
* with an entry. To get these controls, use the
* with an entry. To get these controls, use the
* <CODE>getResponseControls</CODE> method of the
* <CODE>LDAPConnection</CODE> class.
* @return An <CODE>LDAPEntryChangeControl</CODE> object representing
* @return an <CODE>LDAPEntryChangeControl</CODE> object representing
* the entry change control sent by the server. If no entry change
* control was sent, this method returns null.
* @see netscape.ldap.controls.LDAPEntryChangeControl
@ -394,11 +395,11 @@ public class LDAPPersistSearchControl extends LDAPControl {
/**
* Creates a "flattened" BER encoding of the persistent search
* specifications and returns it as a byte array.
* @param changeTypes The change types to be monitored on the server.
* @param changesOnly <code>true</code> to skip the initial search.
* @param changeTypes the change types to monitor on the server
* @param changesOnly <code>true</code> to skip the initial search
* @param returnECs <code>true</code> if entry change controls are to be
* returned with the search results.
* @return The BER-encoded data.
* returned with the search results
* @return the BER-encoded data.
*/
private byte[] createPersistSearchSpecification(int changeTypes,
boolean changesOnly, boolean returnECs) {

Просмотреть файл

@ -79,10 +79,10 @@ public class LDAPProxiedAuthControl extends LDAPControl {
/**
* Constructs an <CODE>LDAPProxiedAuthControl</CODE> object with a
* DN to use as identity.
* @param dn DN to use as identity for execution of a request.
* @param dn DN to use as identity for execution of a request
* @param critical <CODE>true</CODE> if the LDAP operation should be
* discarded when the server does not support this control (in other
* words, this control is critical to the LDAP operation).
* words, this control is critical to the LDAP operation)
* @see netscape.ldap.LDAPControl
*/
public LDAPProxiedAuthControl( String dn,
@ -94,8 +94,8 @@ public class LDAPProxiedAuthControl extends LDAPControl {
/**
* Create a "flattened" BER encoding of the requested contents,
* and return it as a byte array.
* @param dn The DN to use as identity.
* @return The byte array of encoded data.
* @param dn the DN to use as an identity
* @return the byte array of encoded data.
*/
private byte[] createSpecification( String dn ) {
/* A sequence */

Просмотреть файл

@ -233,11 +233,11 @@ public class LDAPSortControl extends LDAPControl {
* <P>
* To retrieve the attribute that caused the sort operation to fail, call
* <CODE>getFailedAttribute</CODE>.
* @param oid The oid for this control. This must be
* <CODE>LDAPSortControl.SORTRESPONSE</CODE> or a <CODE>LDAPException</CODE>
* @param oid the oid for this control. This must be
* <CODE>LDAPSortControl.SORTRESPONSE</CODE> or an <CODE>LDAPException</CODE>
* is thrown.
* @param critical True if this control is critical to the operation.
* @param value The value associated with this control.
* @param critical <code>true</code> if this control is critical to the operation
* @param value the value associated with this control
* @exception netscape.ldap.LDAPException If oid is not
* <CODE>LDAPSortControl.SORTRESPONSE</CODE>.
* @exception java.io.IOException If value contains an invalid BER sequence.
@ -276,14 +276,14 @@ public class LDAPSortControl extends LDAPControl {
}
/**
* @return The attribute that caused the sort operation to fail.
* @return the attribute that caused the sort operation to fail.
*/
public String getFailedAttribute() {
return m_failedAttribute;
}
/**
* @return The result code from the search operation.
* @return the result code from the search operation.
*/
public int getResultCode() {
return m_resultCode;
@ -292,10 +292,10 @@ public class LDAPSortControl extends LDAPControl {
/**
* Constructs an <CODE>LDAPSortControl</CODE> object with a single
* sorting key.
* @param key A single attribute to sort by.
* @param key a single attribute by which to sort
* @param critical <CODE>true</CODE> if the LDAP operation should be
* discarded when the server does not support this control (in other
* words, this control is critical to the LDAP operation).
* words, this control is critical to the LDAP operation)
* @see netscape.ldap.LDAPControl
* @see netscape.ldap.LDAPSortKey
*/
@ -311,10 +311,10 @@ public class LDAPSortControl extends LDAPControl {
/**
* Constructs an <CODE>LDAPSortControl</CODE> object with an array of
* sorting keys.
* @param keys The attributes to sort by.
* @param keys the attributes by which to sort
* @param critical <CODE>true</CODE> if the LDAP operation should be
* discarded when the server does not support this control (in other
* words, this control is critical to the LDAP operation).
* words, this control is critical to the LDAP operation)
* @see netscape.ldap.LDAPControl
* @see netscape.ldap.LDAPSortKey
*/
@ -485,14 +485,14 @@ public class LDAPSortControl extends LDAPControl {
* </TABLE>
* <P>
*
* @param controls An array of <CODE>LDAPControl</CODE> objects,
* @param controls an array of <CODE>LDAPControl</CODE> objects,
* representing the controls returned by the server
* after a search. To get these controls, use the
* after a search. To get these controls, use the
* <CODE>getResponseControls</CODE> method of the
* <CODE>LDAPConnection</CODE> class.
* @param results An array of integers. The first element of this array
* @param results an array of integers. The first element of this array
* specifies the result code of the sorting operation.
* @return The attribute that caused the error, or null if the server did
* @return the attribute that caused the error, or null if the server did
* not specify which attribute caused the error.
* @see netscape.ldap.LDAPConnection#getResponseControls
* @deprecated LDAPSortControl response controls are now automatically
@ -538,8 +538,8 @@ public class LDAPSortControl extends LDAPControl {
/**
* Create a "flattened" BER encoding of the requested sort keys,
* and return it as a byte array.
* @param keys The attributes to sort by.
* @return The byte array of encoded data.
* @param keys the attributes by which to sort
* @return the byte array of encoded data.
*/
private byte[] createSortSpecification( LDAPSortKey[] keys ) {
/* A sequence of sequences */

Просмотреть файл

@ -31,12 +31,12 @@ abstract class LDAPStringControl extends LDAPControl {
}
/**
* Constructs a <CODE>LDAPStringControl</CODE> object, and stores the
* Constructs an <CODE>LDAPStringControl</CODE> object, and stores the
* value as a string. To retrieve this string value, use
* <CODE>getMsg()</CODE>.
* @param oid The oid of defining this control.
* @param critical True if this control is critical.
* @param value The value associated with this control.
* @param oid the oid of this control
* @param critical <code>true</code> if this control is critical to the search
* @param value the value associated with this control
* @see netscape.ldap.LDAPcontrol
*/
public LDAPStringControl( String oid, boolean critical, byte[] value ) {
@ -60,13 +60,13 @@ abstract class LDAPStringControl extends LDAPControl {
* <CODE>LDAPConnection</CODE> class.
* <P>
*
* @param controls An array of <CODE>LDAPControl</CODE> objects,
* @param controls an array of <CODE>LDAPControl</CODE> objects,
* representing the controls returned by the server
* after a search. To get these controls, use the
* after a search. To get these controls, use the
* <CODE>getResponseControls</CODE> method of the
* <CODE>LDAPConnection</CODE> class.
* @param type The OID of the control to look for.
* @return A message string, or null if the server did
* @param type the OID of the control to look for
* @return a message string, or null if the server did
* not return a string.
* @see netscape.ldap.LDAPConnection#getResponseControls
*/

Просмотреть файл

@ -234,11 +234,11 @@ public class LDAPVirtualListControl extends LDAPControl {
* Constructs a new <CODE>LDAPVirtualListControl</CODE> object. Use this
* constructor on an initial search operation, specifying the first
* entry to be matched, or the initial part of it.
* @param jumpTo An LDAP search expression defining the result set.
* @param beforeCount The number of results before the top/center to
* return per page.
* @param afterCount The number of results after the top/center to
* return per page.
* @param jumpTo an LDAP search expression defining the result set
* @param beforeCount the number of results before the top/center to
* return per page
* @param afterCount the number of results after the top/center to
* return per page
* @see netscape.ldap.LDAPControl
*/
public LDAPVirtualListControl( String jumpTo, int beforeCount,
@ -257,12 +257,12 @@ public class LDAPVirtualListControl extends LDAPControl {
* Constructs a new <CODE>LDAPVirtualListControl</CODE> object. Use this
* constructor on a subsquent search operation, after we know the
* size of the virtual list, to fetch a subset.
* @param startIndex The index into the virtual list of an entry to
* return.
* @param beforeCount The number of results before the top/center to
* return per page.
* @param afterCount The number of results after the top/center to
* return per page.
* @param startIndex the index into the virtual list of an entry to
* return
* @param beforeCount the number of results before the top/center to
* return per page
* @param afterCount the number of results after the top/center to
* return per page
* @see netscape.ldap.LDAPControl
*/
public LDAPVirtualListControl( int startIndex, int beforeCount,
@ -283,12 +283,12 @@ public class LDAPVirtualListControl extends LDAPControl {
* Sets the starting index, and the number of entries before and after
* to return. Apply this method to a control returned from a previous
* search, to specify what result range to return on the next search.
* @param startIndex The index into the virtual list of an entry to
* return.
* @param beforeCount The number of results before startIndex to
* return per page.
* @param afterCount The number of results after startIndex to
* return per page.
* @param startIndex the index into the virtual list of an entry to
* return
* @param beforeCount the number of results before startIndex to
* return per page
* @param afterCount the number of results after startIndex to
* return per page
* @see netscape.ldap.LDAPControl
*/
public void setRange( int startIndex, int beforeCount, int afterCount ) {
@ -302,12 +302,12 @@ public class LDAPVirtualListControl extends LDAPControl {
/**
* Sets the search expression, and the number of entries before and after
* to return.
* @param jumpTo An LDAP search expression defining the result set.
* @param jumpTo an LDAP search expression defining the result set
* return.
* @param beforeCount The number of results before startIndex to
* return per page.
* @param afterCount The number of results after startIndex to
* return per page.
* @param beforeCount the number of results before startIndex to
* return per page
* @param afterCount the number of results after startIndex to
* return per page
* @see netscape.ldap.LDAPControl
*/
public void setRange( String jumpTo, int beforeCount, int afterCount ) {
@ -318,7 +318,7 @@ public class LDAPVirtualListControl extends LDAPControl {
/**
* Gets the size of the virtual result set.
* @return The size of the virtual result set, or -1 if not known.
* @return the size of the virtual result set, or -1 if not known.
*/
public int getIndex() {
return m_listIndex;
@ -326,7 +326,7 @@ public class LDAPVirtualListControl extends LDAPControl {
/**
* Gets the size of the virtual result set.
* @return The size of the virtual result set, or -1 if not known.
* @return the size of the virtual result set, or -1 if not known.
*/
public int getListSize() {
return m_listSize;
@ -334,7 +334,7 @@ public class LDAPVirtualListControl extends LDAPControl {
/**
* Sets the size of the virtual result set.
* @param listSize The virtual result set size.
* @param listSize the virtual result set size
*/
public void setListSize( int listSize ) {
m_listSize = listSize;
@ -342,7 +342,7 @@ public class LDAPVirtualListControl extends LDAPControl {
/**
* Gets the number of results before the top/center to return per page.
* @return The number of results before the top/center to return per page.
* @return the number of results before the top/center to return per page.
*/
public int getBeforeCount() {
return m_beforeCount;
@ -350,23 +350,23 @@ public class LDAPVirtualListControl extends LDAPControl {
/**
* Gets the number of results after the top/center to return per page.
* @return The number of results after the top/center to return per page.
* @return the number of results after the top/center to return per page.
*/
public int getAfterCount() {
return m_afterCount;
}
/**
* Gets the optional context cookie
* @return The optional context cookie
* Gets the optional context cookie.
* @return the optional context cookie.
*/
public String getContext() {
return m_context;
}
/**
* Sets the optional context cookie
* @param context The optional context cookie
* Sets the optional context cookie.
* @param context the optional context cookie
*/
public void setContext( String context ) {
m_context = context;
@ -375,10 +375,10 @@ public class LDAPVirtualListControl extends LDAPControl {
/**
* Creates a "flattened" BER encoding of the requested page
* specifications and return it as a byte array.
* @param subFilter Filter expression for generating the results.
* @param beforeCount Number of entries before first match to return.
* @param afterCount Number of entries ager first match to return.
* @return The byte array of encoded data.
* @param subFilter filter expression for generating the results
* @param beforeCount number of entries before first match to return
* @param afterCount number of entries after first match to return
* @return the byte array of encoded data.
*/
private byte[] createPageSpecification( String subFilter,
int beforeCount,
@ -399,11 +399,11 @@ public class LDAPVirtualListControl extends LDAPControl {
/**
* Creates a "flattened" BER encoding of the requested page
* specifications and return it as a byte array.
* @param listIndex The center or starting entry to return.
* @param listSize The virtual list size.
* @param beforeCount Number of entries before first match to return.
* @param afterCount Number of entries after first match to return.
* @return The byte array of encoded data.
* @param listIndex the center or starting entry to return
* @param listSize the virtual list size
* @param beforeCount number of entries before the first match to return
* @param afterCount number of entries after the first match to return
* @return the byte array of encoded data.
*/
private byte[] createPageSpecification( int listIndex,
int listSize,

Просмотреть файл

@ -62,11 +62,11 @@ public class LDAPVirtualListResponse extends LDAPControl {
/**
* Contructs an <CODE>LDAPVirtualListResponse</CODE> object.
* @param oid This parameter must be equal to
* <CODE>LDAPVirtualListResponse.VIRTUALLISTRESPONSE</CODE> or a
* <CODE>LDAPException</CODE>is thrown.
* @param critical True if this control is critical.
* @param value The value associated with this control.
* @param oid this parameter must be equal to
* <CODE>LDAPVirtualListResponse.VIRTUALLISTRESPONSE</CODE> or an
* <CODE>LDAPException</CODE>is thrown
* @param critical <code>true</code> if this control is critical
* @param value the value associated with this control
* @exception netscape.ldap.LDAPException If oid is not
* <CODE>LDAPVirtualListResponse.VIRTUALLISTRESPONSE</CODE>.
* @see netscape.ldap.LDAPControl#register
@ -85,7 +85,7 @@ public class LDAPVirtualListResponse extends LDAPControl {
/**
* Constructs a new <CODE>LDAPVirtualListResponse</CODE> object.
* @param value A BER encoded byte array.
* @param value a BER encoded byte array
* @see netscape.ldap.LDAPControl
*/
public LDAPVirtualListResponse( byte[] value ) {
@ -96,7 +96,7 @@ public class LDAPVirtualListResponse extends LDAPControl {
/**
* Gets the size of the virtual result set.
* @return The size of the virtual result set, or -1 if not known.
* @return the size of the virtual result set, or -1 if not known.
*/
public int getContentCount() {
return m_contentCount;
@ -104,7 +104,7 @@ public class LDAPVirtualListResponse extends LDAPControl {
/**
* Gets the index of the first entry returned.
* @return The index of the first entry returned.
* @return the index of the first entry returned.
*/
public int getFirstPosition() {
return m_firstPosition;
@ -112,7 +112,7 @@ public class LDAPVirtualListResponse extends LDAPControl {
/**
* Gets the result code.
* @return The result code.
* @return the result code.
*/
public int getResultCode() {
return m_resultCode;
@ -120,7 +120,7 @@ public class LDAPVirtualListResponse extends LDAPControl {
/**
* Gets the context cookie, if any.
* @return The result context cookie.
* @return the result context cookie.
*/
public String getContext() {
return m_context;
@ -131,7 +131,7 @@ public class LDAPVirtualListResponse extends LDAPControl {
* "this" should be a control returned on a previous paged results
* search, so it contains information on the virtual result set
* size.
* @return A control useful for subsequent paged results searches.
* @return a control useful for subsequent paged results searches.
*/
private void parseResponse() {
/* Suck out the data and parse it */
@ -161,9 +161,9 @@ public class LDAPVirtualListResponse extends LDAPControl {
/**
* Returns a control returned on a VLV search.
* @param controls An array of controls that may include a VLV
* results control.
* @return The control, if any; otherwise null.
* @param controls an array of controls that may include a VLV
* results control
* @return the control, if any; otherwise null.
* @deprecated LDAPVirtualListResponse controls are now automatically
* instantiated.
*/

Просмотреть файл

@ -65,7 +65,7 @@ public final class ByteBuf implements Serializable {
/**
* Constructs an empty byte buffer with the specified initial length.
* @param length Initial number of bytes that this buffer should hold.
* @param length initial number of bytes that this buffer should hold
*/
public ByteBuf(int length) {
value = new byte[length];
@ -74,7 +74,7 @@ public final class ByteBuf implements Serializable {
/**
* Constructs a byte buffer with the specified initial value.
* The new byte buffer is 16 bytes longer than the initial value.
* @param str Initial value that this buffer should hold.
* @param str initial value that this buffer should hold
*/
public ByteBuf(String str) {
this(str.length() + 16);
@ -85,12 +85,9 @@ public final class ByteBuf implements Serializable {
* Constructs a byte buffer with the specified length.
* An initial value is stored in this buffer, starting
* at the specified offset.
* @param bytes Array of bytes that you want to store in
* the buffer initially.
* @param offset Index in the array where you want the
* initial value to start.
* @param length Length of the buffer that you want to
* allocate.
* @param bytes array of bytes to initially store in the buffer
* @param offset index where you want the initial value to start in the array
* @param length length of the buffer to allocate
*/
public ByteBuf(byte bytes[], int offset, int length) {
value = new byte[length];
@ -117,8 +114,8 @@ public final class ByteBuf implements Serializable {
/**
* Ensures that the capacity of the buffer is at least equal to the
* specified minimum capacity.
* @param minimumCapacity The minimum number of bytes that you want
* the byte buffer to hold.
* @param minimumCapacity the minimum number of bytes that you want
* the byte buffer to hold
*/
public void ensureCapacity(int minimumCapacity) {
int maxCapacity = value.length;
@ -140,7 +137,7 @@ public final class ByteBuf implements Serializable {
* shorter than the current length, bytes at the end of the buffer
* are lost. If you increase the length of the buffer, the values
* of the new bytes in the buffer are set to 0.
* @param newLength The new length of the buffer
* @param newLength the new length of the buffer
* @exception StringIndexOutOfBoundsException You have specified
* an invalid length.
*/
@ -160,7 +157,7 @@ public final class ByteBuf implements Serializable {
/**
* Returns the byte at the specified index. The value of an index
* can range from 0 to length - 1.
* @param index Index of the byte you want to find.
* @param index index of the byte to find
* @exception StringIndexOutOfBoundsException You have specified an
* invalid index.
*/
@ -178,14 +175,14 @@ public final class ByteBuf implements Serializable {
* bytes are inserted in the byte array at the index specified by
* <CODE>dstBegin</CODE>. Both <CODE>srcBegin</CODE> and
* <CODE>srcEnd</CODE> must be valid indexes in the buffer.
* @param srcBegin Index identifying the start of the section
* of the byte buffer that you want to copy.
* @param srcEnd Index identifying the end of the section
* of the byte buffer that you want to copy. (Copy all bytes
* @param srcBegin index identifying the start of the section
* of the byte buffer to copy
* @param srcEnd index identifying the end of the section
* of the byte buffer to copy. (Copy all bytes
* before the byte identified by this index.)
* @param dst The byte array to copy the data to
* @param dstBegin Index of the byte array identifying the
* location where you want the byte buffer copied to.
* @param dst the byte array to copy the data to
* @param dstBegin index of the byte array identifying the
* location to which the byte buffer is copied
* @exception StringIndexOutOfBoundsException You specified an invalid index into the buffer.
*/
public void getBytes(int srcBegin, int srcEnd, byte dst[], int dstBegin) {
@ -202,8 +199,8 @@ public final class ByteBuf implements Serializable {
/**
* Sets the value of the byte at the specified index.
* @param index The index of the byte that you want to set.
* @param b The new value that you want to set.
* @param index the index of the byte to set
* @param b the new value to set
* @exception StringIndexOutOfBoundsException You have specified
* an invalid index.
*/
@ -216,8 +213,8 @@ public final class ByteBuf implements Serializable {
/**
* Appends an object to the end of this byte buffer.
* @param obj The object that you want appended to the buffer.
* @return The same <CODE>ByteBuf</CODE> object (not a new object)
* @param obj the object to append to the buffer
* @return the same <CODE>ByteBuf</CODE> object (not a new object)
* with the string representation of the specified object appended.
*/
public ByteBuf append(Object obj) {
@ -233,9 +230,9 @@ public final class ByteBuf implements Serializable {
* If you want to retain all bits in the character (not just
* the lower 8 bits), use <CODE>append(String.getBytes())</CODE>
* instead.
* @param str The string that you want appended to the buffer.
* @return The same <CODE>ByteBuf</CODE> object (not a new object)
* with the specified string appended.
* @param str the string that you want appended to the buffer
* @return the same <CODE>ByteBuf</CODE> object (not a new object)
* with the specified string appended
*/
public ByteBuf append(String str) {
if (str == null) {
@ -252,8 +249,8 @@ public final class ByteBuf implements Serializable {
/**
* Appends an array of bytes to the end of this byte buffer.
* @param str The array of bytes that you want appended to this buffer.
* @return The same <CODE>ByteBuf</CODE> object (not a new object)
* @param str the array of bytes to append to this buffer
* @return the same <CODE>ByteBuf</CODE> object (not a new object)
* with the specified bytes appended.
*/
public ByteBuf append(byte str[]) {
@ -266,12 +263,12 @@ public final class ByteBuf implements Serializable {
/**
* Appends a part of an array of bytes to the end of this byte buffer.
* @param str The array of bytes that you want appended to this buffer.
* @param offset The index in the array marking the start of the
* section that you want to copy.
* @param len The number of bytes that you want to add.
* @return The same <CODE>ByteBuf</CODE> object (not a new object)
* with the specified section of the byte array appended.
* @param str the array of bytes to append to this buffer
* @param offset the index in the array marking the start of the
* section to copy
* @param len the number of bytes to add
* @return the same <CODE>ByteBuf</CODE> object (not a new object)
* with the specified section of the byte array appended
*/
public ByteBuf append(byte str[], int offset, int len) {
ensureCapacity(count + len);
@ -282,8 +279,8 @@ public final class ByteBuf implements Serializable {
/**
* Appends a byte buffer to the end of this byte buffer.
* @param buf The byte buffer that you want appended to this buffer.
* @return The original <CODE>ByteBuf</CODE> object (not a new object)
* @param buf the byte buffer to append to this buffer
* @return the original <CODE>ByteBuf</CODE> object (not a new object)
* with bytes from the specified byte buffer appended.
*/
public ByteBuf append(ByteBuf buf) {
@ -293,8 +290,8 @@ public final class ByteBuf implements Serializable {
/**
* Appends a boolean to the end of this byte buffer.
* @param b The boolean value that you want appended to this buffer.
* @return The original <CODE>ByteBuf</CODE> object (not a new object)
* @param b the boolean value that you want appended to this buffer
* @return the original <CODE>ByteBuf</CODE> object (not a new object)
* with bytes from the string representation of the boolean value appended.
*/
public ByteBuf append(boolean b) {
@ -303,8 +300,8 @@ public final class ByteBuf implements Serializable {
/**
* Appends a byte to the end of this byte buffer.
* @param ch The byte that you want appended to this buffer.
* @return The original <CODE>ByteBuf</CODE> object (not a new object)
* @param ch the byte to append to this buffer
* @return the original <CODE>ByteBuf</CODE> object (not a new object)
* with the specified byte appended.
*/
public ByteBuf append(byte b) {
@ -315,8 +312,8 @@ public final class ByteBuf implements Serializable {
/**
* Appends an integer to the end of this byte buffer.
* @param i The integer that you want appended to this byte buffer.
* @return The original <CODE>ByteBuf</CODE> object (not a new object)
* @param i the integer to append to this byte buffer
* @return the original <CODE>ByteBuf</CODE> object (not a new object)
* with the string representation of the specified integer appended.
*/
public ByteBuf append(int i) {
@ -325,9 +322,8 @@ public final class ByteBuf implements Serializable {
/**
* Appends a <CODE>long</CODE> value to the end of this byte buffer.
* @param l The <CODE>long</CODE> value that you want appended
* to this buffer.
* @return The original <CODE>ByteBuf</CODE> object (not a new object)
* @param l the <CODE>long</CODE> value to append to this buffer
* @return the original <CODE>ByteBuf</CODE> object (not a new object)
* with the string representation of the specified <CODE>long</CODE>
* value appended.
*/
@ -337,9 +333,8 @@ public final class ByteBuf implements Serializable {
/**
* Appends a <CODE>float</CODE> to the end of this byte buffer.
* @param f The <CODE>float</CODE> value that you want appended
* to this buffer.
* @return The original <CODE>ByteBuf</CODE> object (not a new object)
* @param f the <CODE>float</CODE> value to append to this buffer
* @return the original <CODE>ByteBuf</CODE> object (not a new object)
* with the string representation of the specified <CODE>float</CODE>
* value appended.
*/
@ -349,9 +344,8 @@ public final class ByteBuf implements Serializable {
/**
* Appends a <CODE>double</CODE> to the end of this byte buffer.
* @param d The <CODE>double</CODE> value that you want appended to
* this buffer.
* @return The original <CODE>ByteBuf</CODE> object (not a new object)
* @param d the <CODE>double</CODE> value to append to this buffer
* @return the original <CODE>ByteBuf</CODE> object (not a new object)
* with the string representation of the specified <CODE>double</CODE>
* value appended.
*/
@ -361,7 +355,7 @@ public final class ByteBuf implements Serializable {
/**
* Returns the data in the byte buffer to a string.
* @return The string representation of the data in the byte buffer.
* @return the string representation of the data in the byte buffer.
*/
public String toString() {
return new String(value, 0, count);
@ -369,7 +363,7 @@ public final class ByteBuf implements Serializable {
/**
* Returns the data in the byte buffer as a byte array.
* @return The byte array containing data in the byte buffer.
* @return the byte array containing data in the byte buffer.
*/
public byte[] toBytes() {
byte[] b = new byte[count];
@ -380,11 +374,11 @@ public final class ByteBuf implements Serializable {
/**
* Invokes the <CODE>InputStream.read</CODE> method and appends the
* the bytes read to this byte buffer.
* @param file The input stream that you want to read the bytes from.
* @param max_bytes The maximum number of bytes to read into the
* byte buffer.
* @return The number of bytes read, or -1 if there is no more data
* to be read.
* @param file the input stream from which to read the bytes
* @param max_bytes the maximum number of bytes to read into the
* byte buffer
* @return the number of bytes read, or -1 if there is no more data
* to read.
* @exception IOException An I/O error has occurred.
*/
public int read(InputStream file, int max_bytes)
@ -398,12 +392,12 @@ public final class ByteBuf implements Serializable {
/**
* Invokes the <CODE>RandomAccessFile.read</CODE> method, appending
* the bytes read to this byte buffer.
* @param file The <CODE>RandomAccessFile</CODE> object that you want
* to read the bytes from.
* @param max_bytes The maximum number of bytes to read into the
* byte buffer.
* @return The number of bytes read, or -1 if there is no more data
* to be read.
* @param file the <CODE>RandomAccessFile</CODE> object from which
* to read the bytes
* @param max_bytes the maximum number of bytes to read into the
* byte buffer
* @return the number of bytes read, or -1 if there is no more data
* to read.
* @exception IOException An I/O error has occurred.
*/
public int read(RandomAccessFile file, int max_bytes)
@ -416,7 +410,7 @@ public final class ByteBuf implements Serializable {
/**
* Writes the contents of the byte buffer to the specified output stream.
* @param out The output stream.
* @param out the output stream
* @exception IOException An I/O error has occurred.
*/
public void write(OutputStream out) throws IOException {
@ -426,8 +420,8 @@ public final class ByteBuf implements Serializable {
/**
* Writes the contents of the byte buffer to the specified
* <CODE>RandomAccessFile</CODE> object.
* @param out The <CODE>RandomAccessFile</CODE> object.
* @exception IOException An I/O error has occurred.
* @param out the <CODE>RandomAccessFile</CODE> object
* dexception IOException An I/O error has occurred.
*/
public void write(RandomAccessFile out) throws IOException {
out.write(value, 0, count);

Просмотреть файл

@ -65,12 +65,12 @@ public class ConnectionPool {
/**
* Constructor for specifying all parameters
*
* @param min Initial number of connections
* @param max Maximum number of connections
* @param host Hostname of LDAP server
* @param port Port number of LDAP server
* @param min initial number of connections
* @param max maximum number of connections
* @param host hostname of LDAP server
* @param port port number of LDAP server
* @param authdn DN to authenticate as
* @param authpw Password for authentication
* @param authpw password for authentication
* @exception LDAPException on failure to create connections
*/
public ConnectionPool( int min, int max,
@ -84,10 +84,10 @@ public class ConnectionPool {
* Constructor for specifying all parameters, anonymous
* identity
*
* @param min Initial number of connections
* @param max Maximum number of connections
* @param host Hostname of LDAP server
* @param port Port number of LDAP server
* @param min initial number of connections
* @param max maximum number of connections
* @param host hostname of LDAP server
* @param port port number of LDAP server
* @exception LDAPException on failure to create connections
*/
public ConnectionPool( int min, int max,
@ -99,8 +99,8 @@ public class ConnectionPool {
/**
* Constructor for using default parameters, anonymous identity
*
* @param host Hostname of LDAP server
* @param port Port number of LDAP server
* @param host hostname of LDAP server
* @param port port number of LDAP server
* @exception LDAPException on failure to create connections
*/
public ConnectionPool( String host, int port )
@ -114,9 +114,9 @@ public class ConnectionPool {
* Constructor for using an existing connection to clone
* from
*
* @param min Initial number of connections
* @param max Maximum number of connections
* @param ldc Connection to clone
* @param min initial number of connections
* @param max maximum number of connections
* @param ldc connection to clone
* @exception LDAPException on failure to create connections
*/
public ConnectionPool( int min, int max, LDAPConnection ldc )
@ -130,13 +130,13 @@ public class ConnectionPool {
* Constructor for using an existing connection to clone
* from
*
* @param min Initial number of connections
* @param max Maximum number of connections
* @param host Hostname of LDAP server
* @param port Port number of LDAP server
* @param min initial number of connections
* @param max maximum number of connections
* @param host hostname of LDAP server
* @param port port number of LDAP server
* @param authdn DN to authenticate as
* @param authpw Password for authentication
* @param ldc Connection to clone
* @param authpw password for authentication
* @param ldc connection to clone
* @exception LDAPException on failure to create connections
*/
private ConnectionPool( int min, int max,
@ -167,14 +167,14 @@ public class ConnectionPool {
}
/**
* Get a connection from the pool
* Gets a connection from the pool
*
* If no connections are available, the pool will be
* extended if the number of connections is less than
* the maximum; if the pool cannot be extended, the method
* blocks until a free connection becomes available.
*
* @return An active connection
* @return an active connection.
*/
public LDAPConnection getConnection() {
LDAPConnection con;
@ -191,14 +191,14 @@ public class ConnectionPool {
}
/**
* Get a connection from the pool
* Gets a connection from the pool
*
* If no connections are available, the pool will be
* extended if the number of connections is less than
* the maximum; if the pool cannot be extended, the method
* returns null.
*
* @return An active connection or null
* @return an active connection or null.
*/
protected synchronized LDAPConnection getConnFromPool() {
LDAPConnection con = null;
@ -248,9 +248,9 @@ public class ConnectionPool {
/**
* This is our soft close - all we do is mark
* the connection available for others to use
* the connection as available for others to use.
*
* @param ld A connection to be returned to the pool
* @param ld a connection to return to the pool
*/
public synchronized void close( LDAPConnection ld ) {
@ -380,18 +380,18 @@ public class ConnectionPool {
}
/**
* Set the debug printout mode
* Sets the debug printout mode.
*
* @param mode Debug mode to use
* @param mode debug mode to use
*/
public synchronized void setDebug( boolean mode ) {
debugMode = mode;
}
/**
* Report the debug printout mode
* Reports the debug printout mode.
*
* @return Debug mode in use
* @return debug mode in use.
*/
public boolean getDebug() {
return debugMode;
@ -416,9 +416,9 @@ public class ConnectionPool {
class LDAPConnectionObject{
/**
* Returns the associated LDAPConnection
* Returns the associated LDAPConnection.
*
* @return the LDAPConnection
* @return the LDAPConnection.
*
*/
LDAPConnection getLDAPConn() {
@ -438,7 +438,7 @@ public class ConnectionPool {
/**
* Marks a connection in use or available
*
* @param inUse true to mark in use, false available
* @param inUse <code>true</code> to mark in use, <code>false</code> if available
*
*/
void setInUse( boolean inUse ) {
@ -449,7 +449,7 @@ public class ConnectionPool {
* Returns whether the connection is available
* for use by another user.
*
* @return true if available
* @return <code>true</code> if available.
*/
boolean isAvailable() {
return !inUse;
@ -458,7 +458,7 @@ public class ConnectionPool {
/**
* Debug method
*
* @return A user-friendly rendering of the object
* @return s user-friendly rendering of the object.
*/
public String toString() {
return "LDAPConnection=" + ld + ",inUse=" + inUse;

Просмотреть файл

@ -86,7 +86,7 @@ public final class DN implements Serializable {
* can be in RFC 1485 or OSF format.
* <P>
*
* @param dn String representation of the distinguished name.
* @param dn string representation of the distinguished name
*/
public DN(String dn) {
if (dn == null)
@ -163,8 +163,8 @@ public final class DN implements Serializable {
* beginning of the current DN.
* <P>
*
* @param rdn The relative distinguished name that you want
* to add to the beginning of the current DN.
* @param rdn the relative distinguished name to add to the
* beginning of the current DN
* @see netscape.ldap.util.RDN
*/
public void addRDNToFront(RDN rdn) {
@ -176,8 +176,7 @@ public final class DN implements Serializable {
* end of the current DN.
* <P>
*
* @param rdn The relative distinguished name that you want
* to append to the current DN.
* @param rdn the relative distinguished name to append to the current DN
* @see netscape.ldap.util.RDN
*/
public void addRDNToBack(RDN rdn) {
@ -191,8 +190,7 @@ public final class DN implements Serializable {
* end of the DN.
* <P>
*
* @param rdn The relative distinguished name that you want to add to
* the current DN.
* @param rdn the relative distinguished name to add to the current DN
* @see netscape.ldap.util.RDN
*/
public void addRDN(RDN rdn) {
@ -207,8 +205,8 @@ public final class DN implements Serializable {
* Sets the type of format used for the DN (RFC format or OSF format).
* <P>
*
* @param type One of the following constants: <CODE>DN.RFC</CODE>
* (to use the RFC format) or <CODE>DN.OSF</CODE> (to use the OSF format).
* @param type one of the following constants: <CODE>DN.RFC</CODE>
* (to use the RFC format) or <CODE>DN.OSF</CODE> (to use the OSF format)
* @see netscape.ldap.util.DN#getDNType
* @see netscape.ldap.util.DN#RFC
* @see netscape.ldap.util.DN#OSF
@ -221,7 +219,7 @@ public final class DN implements Serializable {
* Gets the type of format used for the DN (RFC format or OSF format).
* <P>
*
* @return One of the following constants: <CODE>DN.RFC</CODE>
* @return one of the following constants: <CODE>DN.RFC</CODE>
* (if the DN is in RFC format) or <CODE>DN.OSF</CODE>
* (if the DN is in OSF format).
* @see netscape.ldap.util.DN#setDNType
@ -234,7 +232,7 @@ public final class DN implements Serializable {
/**
* Returns the number of components that make up the current DN.
* @return The number of components in this DN.
* @return the number of components in this DN.
*/
public int countRDNs() {
return m_rdns.size();
@ -243,7 +241,7 @@ public final class DN implements Serializable {
/**
* Returns a list of the components (<CODE>RDN</CODE> objects)
* that make up the current DN.
* @return A list of the components of this DN.
* @return a list of the components of this DN.
* @see netscape.ldap.util.RDN
*/
public Vector getRDNs() {
@ -253,8 +251,8 @@ public final class DN implements Serializable {
/**
* Returns an array of the individual components that make up
* the current distinguished name.
* @param noTypes Specify true to remove the attribute type
* and equals sign (for example, "cn=") from each component.
* @param noTypes specify <code>true</code> to remove the attribute type
* and equals sign (for example, "cn=") from each component
*/
public String[] explodeDN(boolean noTypes) {
if (m_rdns.size() == 0)
@ -271,7 +269,7 @@ public final class DN implements Serializable {
/**
* Determines if the DN is in RFC 1485 format.
* @return true if the DN is in RFC 1485 format.
* @return <code>true</code> if the DN is in RFC 1485 format.
*/
public boolean isRFC() {
return (m_dnType == RFC);
@ -279,7 +277,7 @@ public final class DN implements Serializable {
/**
* Returns the DN in RFC 1485 format.
* @return The DN in RFC 1485 format.
* @return the DN in RFC 1485 format.
*/
public String toRFCString() {
String dn = "";
@ -293,7 +291,7 @@ public final class DN implements Serializable {
/**
* Returns the DN in OSF format.
* @return The DN in OSF format.
* @return the DN in OSF format.
*/
public String toOSFString() {
String dn = "";
@ -313,7 +311,7 @@ public final class DN implements Serializable {
* <CODE>DN</CODE> object was constructed from a DN
* in RFC 1485 format, this method returns the DN
* in RFC 1485 format.
* @return The string representation of the DN.
* @return the string representation of the DN.
*/
public String toString() {
if (m_dnType == RFC)
@ -326,7 +324,7 @@ public final class DN implements Serializable {
* Determines if the given string is an distinguished name or
* not.
* @param dn distinguished name
* @return true or false
* @return <code>true</code> or <code>false</code>.
*/
public static boolean isDN(String dn) {
if ( dn.equals( "" ) ) {
@ -338,8 +336,8 @@ public final class DN implements Serializable {
/**
* Determines if the current DN is equal to the specified DN.
* @param dn DN that you want to compare against the current DN.
* @return true if the two DNs are the same.
* @param dn DN to compare against the current DN
* @return <code>true</code> if the two DNs are the same.
*/
public boolean equals(DN dn) {
return (dn.toRFCString().toUpperCase().equals(toRFCString().toUpperCase()));
@ -386,8 +384,8 @@ public final class DN implements Serializable {
* the value of <CODE>isContain</CODE> is true.
* <P>
*
* @param dn The DN of a subtree that you want to check.
* @return true if the current DN belongs to the subtree
* @param dn the DN of a subtree to check
* @return <code>true</code> if the current DN belongs to the subtree
* specified by <CODE>dn</CODE>.
* @deprecated Please use isDescendantOf() instead.
*/
@ -418,8 +416,8 @@ public final class DN implements Serializable {
* In the case where the given DN is equal to this DN
* it returns false.
*
* @param dn The DN of a subtree that you want to check.
* @return true if the current DN is a descendant of the DN
* @param dn the DN of a subtree to check
* @return <code>true</code> if the current DN is a descendant of the DN
* specified by <CODE>dn</CODE>.
*/

Просмотреть файл

@ -134,12 +134,12 @@ public class GetOpt implements java.io.Serializable {
/**
* Constructs a <CODE>GetOpt</CODE> object.
* @param strControl A string specifying the letters of
* @param strControl a string specifying the letters of
* all available options. If an option requires an argument
* (for example, "-h <hostname>"), use a colon after the
* letter for that option (for example, "h:p:D:w:H").
* @param args An array of strings representing the list
* of arguments that you want parsed (for example, the
* @param args an array of strings representing the list
* of arguments to parse (for example, the
* array passed into Main).
*/
public GetOpt(String strControl, String args[]) {
@ -192,8 +192,8 @@ public class GetOpt implements java.io.Serializable {
* was specified.
* <P>
*
* @param c Letter of the option that you want to check.
* @return true if the option was specified.
* @param c letter of the option to check
* @return <code>true</code> if the option was specified.
*/
public boolean hasOption(char c) {
boolean fReturn = false;
@ -213,8 +213,8 @@ public class GetOpt implements java.io.Serializable {
* the -h option (such as "localhost" in "-h localhost").
* <P>
*
* @param c The letter of the option that you want to check.
* @return The argument specified for this option.
* @param c the letter of the option to check
* @return the argument specified for this option.
*/
public String getOptionParam(char c) {
char cOption[] = new char[1];
@ -227,7 +227,7 @@ public class GetOpt implements java.io.Serializable {
/**
* Gets a list of any additional parameters specified
* (not including the arguments for any options).
* @return A list of the additional parameters.
* @return a list of the additional parameters.
*/
public Vector getParameters() {
return(m_ParameterList);

Просмотреть файл

@ -65,7 +65,7 @@ public class LDIF implements Serializable {
/**
* Constructs an <CODE>LDIF</CODE> object to parse the
* LDIF data read from a specified file.
* @param file The name of the LDIF file that you want to parse.
* @param file the name of the LDIF file to parse
* @exception IOException An I/O error has occurred.
*/
public LDIF(String file) throws IOException {
@ -80,7 +80,7 @@ public class LDIF implements Serializable {
/**
* Constructs an <CODE>LDIF</CODE> object to parse the
* LDIF data read from an input stream.
* @param ds The input stream providing the LDIF data.
* @param dstThe input stream providing the LDIF data
* @exception IOException An I/O error has occurred.
*/
public LDIF(DataInputStream ds) throws IOException {
@ -94,7 +94,7 @@ public class LDIF implements Serializable {
* method repeatedly to iterate through all records in the LDIF data.
* <P>
*
* @return The next record as an <CODE>LDIFRecord</CODE>
* @return the next record as an <CODE>LDIFRecord</CODE>
* object or null if there are no more records.
* @exception IOException An I/O error has occurred.
* @see netscape.ldap.util.LDIFRecord
@ -119,7 +119,10 @@ public class LDIF implements Serializable {
Vector attrs = new Vector();
LDIFRecord rec = null;
line = d.readLine();
// Skip past any blank lines
while( ((line = d.readLine()) != null) &&
(line.length() < 1) ) {
}
if (line == null) {
return null;
}
@ -426,7 +429,7 @@ public class LDIF implements Serializable {
}
/**
* Parses moddn/modrdn modification
* Parses moddn/modrdn modification.
* @param d data input stream
*/
private LDIFModDNContent parse_moddn_spec(LineReader d)
@ -477,7 +480,7 @@ public class LDIF implements Serializable {
}
/**
* Parse the specification of a control<BR>
* Parses the specification of a control<BR>
*
* A control looks line one of the following:
*<BR>
@ -497,8 +500,8 @@ public class LDIF implements Serializable {
*<BR>
* control: 1.2.3.4.10.210:< file:///usr/local/directory/cont.dta
*
* @param line A line containing a control spec
* @return A parsed control
* @param line a line containing a control spec
* @return a parsed control.
* @exception IOException if the line could not be parsed
*/
protected LDAPControl parse_control_spec( String line )
@ -569,12 +572,12 @@ public class LDIF implements Serializable {
}
/**
* Return true if all the bytes in the given array are valid for output as a
* Returns true if all the bytes in the given array are valid for output as a
* String according to the LDIF specification. If not, the array should
* output base64-encoded.
* @return true if all the bytes in the given array are valid for output as a
* String according to the LDIF specification; otherwise, false.
* false.
* @return <code>true</code> if all the bytes in the given array are valid for
* output as a String according to the LDIF specification; otherwise,
* <code>false</code>.
*/
public static boolean isPrintable(byte[] b) {
for( int i = b.length - 1; i >= 0; i-- ) {
@ -589,9 +592,9 @@ public class LDIF implements Serializable {
/**
* Outputs the String in LDIF line-continuation format. No line will be longer
* than the given max. A continuation line starts with a single blank space.
* @param pw The printer writer.
* @param value The given string being printed out.
* @param max The maximum characters allowed in the line.
* @param pw the printer writer
* @param value the given string being printed out
* @param max the maximum characters allowed in the line
*/
public static void breakString( PrintWriter pw, String value, int max) {
int leftToGo = value.length();
@ -617,7 +620,7 @@ public class LDIF implements Serializable {
/**
* Gets the version of LDIF used in the data.
* @return Version of LDIF used in the data.
* @return version of LDIF used in the data.
*/
public int getVersion() {
return m_version;
@ -626,7 +629,7 @@ public class LDIF implements Serializable {
/**
* Gets the string representation of the
* entire LDIF file.
* @return The string representation of the entire LDIF data.
* @return the string representation of the entire LDIF data file.
*/
public String toString() {
return "LDIF {" + m_source + "}";
@ -649,7 +652,7 @@ public class LDIF implements Serializable {
}
/**
* Reads a non-comment line.
* @return A string, or null
* @return a string or null.
*/
String readLine() throws IOException {
String line = null;
@ -703,11 +706,11 @@ public class LDIF implements Serializable {
}
/**
* Convert a byte array to a printable string following
* Converts a byte array to a printable string following
* the LDIF rules (encode in base64 if necessary)
*
* @param b The byte array to convert
* @return A converted string which is printable
* @param b the byte array to convert
* @return a converted string which is printable.
*/
public static String toPrintableString( byte[] b ) {
String s = "";
@ -731,10 +734,10 @@ public class LDIF implements Serializable {
}
/**
* Test driver - just read and parse an LDIF file, printing
* Test driver - just reads and parses an LDIF file, printing
* each record as interpreted
*
* @param args Name of LDIF file to parse
* @param args name of the LDIF file to parse
*/
public static void main( String[] args ) {
if ( args.length != 1 ) {

Просмотреть файл

@ -45,8 +45,8 @@ public class LDIFAddContent extends LDIFBaseContent {
/**
* Constructs a new <CODE>LDIFAddContent</CODE> object with
* the specified attributes.
* @param attrs An array of <CODE>LDAPAttribute</CODE> objects
* representing the attributes of the entry to be added.
* @param attrs an array of <CODE>LDAPAttribute</CODE> objects
* representing the attributes of the entry to be added
*/
public LDIFAddContent(LDAPAttribute attrs[]) {
m_attrs = attrs;
@ -56,7 +56,7 @@ public class LDIFAddContent extends LDIFBaseContent {
* Returns the content type. You can use this with the
* <CODE>getContent</CODE> method of the <CODE>LDIFRecord</CODE>
* object to determine the type of content specified in the record.
* @return The content type (which is
* @return the content type (which is
* <CODE>LDIFContent.ADD_CONTENT</CODE>).
* @see netscape.ldap.util.LDIFRecord#getContent
*/
@ -67,7 +67,7 @@ public class LDIFAddContent extends LDIFBaseContent {
/**
* Retrieves the list of the attributes specified in the content
* of the LDIF record.
* @return An array of <CODE>LDAPAttribute</CODE> objects that
* @return an array of <CODE>LDAPAttribute</CODE> objects that
* represent the attributes specified in the content of the LDIF record.
*/
public LDAPAttribute[] getAttributes() {
@ -76,7 +76,7 @@ public class LDIFAddContent extends LDIFBaseContent {
/**
* Returns the string representation of the content of the LDIF record.
* @return The string representation of the content of the LDIF record.
* @return the string representation of the content of the LDIF record.
*/
public String toString() {
String s = "";

Просмотреть файл

@ -55,7 +55,7 @@ public class LDIFAttributeContent extends LDIFBaseContent {
* Returns the content type. You can use this with the
* <CODE>getContent</CODE> method of the <CODE>LDIFRecord</CODE>
* object to determine the type of content specified in the record.
* @return The content type (which is
* @return the content type (which is
* <CODE>LDIFContent.ATTRIBUTE_CONTENT</CODE>).
* @see netscape.ldap.util.LDIFRecord#getContent
*/
@ -65,7 +65,7 @@ public class LDIFAttributeContent extends LDIFBaseContent {
/**
* Adds an attribute to the content of the LDIF record.
* @param attr The attribute that you want to add.
* @param attr the attribute to add
*/
public void addElement(LDAPAttribute attr) {
m_attrs.addElement(attr);
@ -74,7 +74,7 @@ public class LDIFAttributeContent extends LDIFBaseContent {
/**
* Retrieves the list of the attributes specified in the content
* of the LDIF record.
* @return An array of <CODE>LDAPAttribute</CODE> objects that
* @return an array of <CODE>LDAPAttribute</CODE> objects that
* represent the attributes specified in the content of the LDIF record.
*/
public LDAPAttribute[] getAttributes() {
@ -87,7 +87,7 @@ public class LDIFAttributeContent extends LDIFBaseContent {
/**
* Returns the string representation of the content of the LDIF record.
* @return The string representation of the content of the LDIF record.
* @return the string representation of the content of the LDIF record.
*/
public String toString() {
String s = "";

Просмотреть файл

@ -48,7 +48,7 @@ public abstract class LDIFBaseContent
/**
* Retrieves the list of controls specified in the content
* of the LDIF record, if any
* @return An array of <CODE>LDAPControl</CODE> objects that
* @return an array of <CODE>LDAPControl</CODE> objects that
* represent any controls specified in the the LDIF record,
* or <CODE>null</CODE> if none were specified.
*/
@ -58,8 +58,8 @@ public abstract class LDIFBaseContent
/**
* Sets the list of controls
* @param controls An array of <CODE>LDAPControl</CODE> objects
* or <CODE>null</CODE> if none are to be specified.
* @param controls an array of <CODE>LDAPControl</CODE> objects
* or <CODE>null</CODE> if none are to be specified
*/
public void setControls( LDAPControl[] controls ) {
m_controls = controls;
@ -68,8 +68,8 @@ public abstract class LDIFBaseContent
/**
* Get the OIDs of all controls, if any, as a string
*
* @return The OIDs of all controls, if any, as a string,
* or an empty string if there are no controls
* @return the OIDs of all controls, if any, as a string,
* or an empty string if there are no controls.
*/
protected String getControlString() {
String s = "";

Просмотреть файл

@ -78,8 +78,8 @@ public interface LDIFContent {
public final static int MODDN_CONTENT = 4;
/**
* Determine the content type.
* @return The content type, identified by one of the following values:
* Determines the content type.
* @return the content type, identified by one of the following values:
* <UL>
* <LI>ATTRIBUTE_CONTENT (specifies an entry and its attributes)
* <LI>ADD_CONTENT (specifies a new entry to be added)
@ -93,7 +93,7 @@ public interface LDIFContent {
/**
* Retrieves the list of controls specified in the content
* of the LDIF record, if any
* @return An array of <CODE>LDAPControl</CODE> objects that
* @return an array of <CODE>LDAPControl</CODE> objects that
* represent any controls specified in the the LDIF record,
* or <CODE>null</CODE> if none were specified.
*/
@ -101,14 +101,14 @@ public interface LDIFContent {
/**
* Sets the list of controls
* @param controls An array of <CODE>LDAPControl</CODE> objects
* or <CODE>null</CODE> if none are to be specified.
* @param controls an array of <CODE>LDAPControl</CODE> objects
* or <CODE>null</CODE> if none are to be specified
*/
public void setControls( LDAPControl[] controls );
/**
* Returns the string representation of the content of the LDIF record.
* @return String representation of the content of the LDIF record.
* @return string representation of the content of the LDIF record.
*/
public String toString();
}

Просмотреть файл

@ -48,7 +48,7 @@ public class LDIFDeleteContent extends LDIFBaseContent {
* Returns the content type. You can use this with the
* <CODE>getContent</CODE> method of the <CODE>LDIFRecord</CODE>
* object to determine the type of content specified in the record.
* @return The content type (which is
* @return the content type (which is
* <CODE>LDIFContent.DELETE_CONTENT</CODE>).
* @see netscape.ldap.util.LDIFRecord#getContent
*/
@ -58,7 +58,7 @@ public class LDIFDeleteContent extends LDIFBaseContent {
/**
* Returns the string representation of the content of the LDIF record.
* @return The string representation of the content of the LDIF record.
* @return the string representation of the content of the LDIF record.
*/
public String toString() {
String s = "";

Просмотреть файл

@ -56,7 +56,7 @@ public class LDIFModDNContent extends LDIFBaseContent {
* Returns the content type. You can use this with the
* <CODE>getContent</CODE> method of the <CODE>LDIFRecord</CODE>
* object to determine the type of content specified in the record.
* @return The content type (which is
* @return the content type (which is
* <CODE>LDIFContent.MODDN_CONTENT</CODE>).
* @see netscape.ldap.util.LDIFRecord#getContent
*/
@ -66,7 +66,7 @@ public class LDIFModDNContent extends LDIFBaseContent {
/**
* Sets the new RDN that should be assigned to the entry.
* @param rdn The new RDN.
* @param rdn the new RDN
* @see netscape.ldap.util.LDIFModDNContent#getRDN
*/
public void setRDN(String rdn) {
@ -84,7 +84,7 @@ public class LDIFModDNContent extends LDIFBaseContent {
/**
* Sets the new parent DN that should be assigned to the entry.
* @param parent The new parent DN for the entry.
* @param parent the new parent DN for the entry
* @see netscape.ldap.util.LDIFModDNContent#getNewParent
*/
public void setNewParent(String parent) {
@ -94,7 +94,7 @@ public class LDIFModDNContent extends LDIFBaseContent {
/**
* Returns the entry's new parent DN, if specified in the content
* of the LDIF record.
* @return The new parent for the entry.
* @return the new parent of the entry.
* @see netscape.ldap.util.LDIFModDNContent#setNewParent
*/
public String getNewParent() {
@ -104,7 +104,7 @@ public class LDIFModDNContent extends LDIFBaseContent {
/**
* Sets whether or not the old RDN should be removed as an
* attribute in the entry.
* @param bool If <CODE>true</CODE>, remove the attribute representing
* @param bool if <CODE>true</CODE>, remove the attribute representing
* the RDN. If <CODE>false</CODE>, leave the attribute in the entry.
* @see netscape.ldap.util.LDIFModDNContent#getDeleteOldRDN
*/
@ -115,9 +115,9 @@ public class LDIFModDNContent extends LDIFBaseContent {
/**
* Determines if the content of the LDIF record specifies that
* the old RDN should be removed as an attribute in the entry.
* @return If <CODE>true</CODE>, the change specifies that the
* the attribute representing the RDN should be removed.
* If <CODE>false</CODE>, the change specifies that the attribute
* @return <CODE>true</CODE> if the change specifies that the
* the attribute representing the RDN should be removed,
* <CODE>false</CODE> if the change specifies that the attribute
* should be left in the entry.
* @see netscape.ldap.util.LDIFModDNContent#setDeleteOldRDN
*/
@ -127,7 +127,7 @@ public class LDIFModDNContent extends LDIFBaseContent {
/**
* Returns string representation of the content of the LDIF record.
* @return The string representation of the content of the LDIF record.
* @return the string representation of the content of the LDIF record.
*/
public String toString() {
String s = "";

Просмотреть файл

@ -54,7 +54,7 @@ public class LDIFModifyContent extends LDIFBaseContent {
* Returns the content type. You can use this with the
* <CODE>getContent</CODE> method of the <CODE>LDIFRecord</CODE>
* object to determine the type of content specified in the record.
* @return The content type (which is
* @return the content type (which is
* <CODE>LDIFContent.MODIFICATION_CONTENT</CODE>).
* @see netscape.ldap.util.LDIFRecord#getContent
*/
@ -66,7 +66,7 @@ public class LDIFModifyContent extends LDIFBaseContent {
* Specifies an additional modification that should be made to
* the entry.
* @param mod <CODE>LDAPModification</CODE> object representing
* the change to be made to the entry.
* the change to make to the entry
* @see netscape.ldap.LDAPModification
*/
public void addElement(LDAPModification mod) {
@ -76,7 +76,7 @@ public class LDIFModifyContent extends LDIFBaseContent {
/**
* Retrieves the list of the modifications specified in the content
* of the LDIF record.
* @return An array of <CODE>LDAPModification</CODE> objects that
* @return an array of <CODE>LDAPModification</CODE> objects that
* represent the modifications specified in the content of the LDIF record.
* @see netscape.ldap.LDAPModification
*/
@ -90,7 +90,7 @@ public class LDIFModifyContent extends LDIFBaseContent {
/**
* Returns the string representation of the content of the LDIF record.
* @return The string representation of the content of the LDIF record.
* @return the string representation of the content of the LDIF record.
*/
public String toString() {
String s = "";

Просмотреть файл

@ -70,9 +70,9 @@ public class LDIFRecord implements Serializable {
/**
* Constructs a new <CODE>LDIFRecord</CODE> object with the
* specified content.
* @param dn Distinguished name of the entry associated with
* the record.
* @param content Content of the LDIF record. You can specify
* @param dn distinguished name of the entry associated with
* the record
* @param content content of the LDIF record. You can specify
* an object of the <CODE>LDIFAttributeContent</CODE>,
* <CODE>LDIFAddContent</CODE>, <CODE>LDIFModifyContent</CODE>,
* or <CODE>LDIFDeleteContent</CODE> classes.
@ -88,7 +88,7 @@ public class LDIFRecord implements Serializable {
/**
* Retrieves the distinguished name of the LDIF record.
* @return The distinguished name of the LDIF record.
* @return the distinguished name of the LDIF record.
*/
public String getDN() {
return m_dn;
@ -162,7 +162,7 @@ public class LDIFRecord implements Serializable {
* ...
* </PRE>
*
* @return The content of the LDIF record.
* @return the content of the LDIF record.
* @see netscape.ldap.util.LDIFAddContent
* @see netscape.ldap.util.LDIFModifyContent
* @see netscape.ldap.util.LDIFDeleteContent
@ -174,9 +174,9 @@ public class LDIFRecord implements Serializable {
/**
* Retrieves the list of controls specified in the content
* of the LDIF record, if any
* @return An array of <CODE>LDAPControl</CODE> objects that
* represent any controls specified in the the LDIF record,
* of the LDIF record, if any.
* @return an array of <CODE>LDAPControl</CODE> objects that
* represent any controls specified in the LDIF record,
* or <CODE>null</CODE> if none were specified.
*/
public LDAPControl[] getControls() {
@ -186,7 +186,7 @@ public class LDIFRecord implements Serializable {
/**
* Gets the string representation of the <CODE>LDIFRecord</CODE>
* object.
* @return The string representation of the LDIF record.
* @return the string representation of the LDIF record.
*/
public String toString() {
return "LDIFRecord {dn=" + m_dn + ", content=" + m_content + "}";

Просмотреть файл

@ -52,7 +52,7 @@ public final class RDN implements java.io.Serializable {
/**
* Constructs a new <CODE>RDN</CODE> object from the specified
* DN component.
* @param rdn DN component.
* @param rdn DN component
*/
public RDN(String rdn) {
int index = rdn.indexOf("=");
@ -68,9 +68,9 @@ public final class RDN implements java.io.Serializable {
/**
* Returns the DN component as the first element in an
* array of strings.
* @param noType Specify true to ignore the attribute type and
* equals sign (for example, "cn=") and return only the value.
* @return An array of strings representing the DN component.
* @param noType specify <code>true</code> to ignore the attribute type and
* equals sign (for example, "cn=") and return only the value
* @return an array of strings representing the DN component.
*/
public String[] explodeRDN(boolean noType) {
if (m_type == null)
@ -86,7 +86,7 @@ public final class RDN implements java.io.Serializable {
/**
* Returns the attribute type of the DN component.
* @return rdn The attribute type of the DN component.
* @return rdn the attribute type of the DN component.
*/
public String getType() {
return m_type;
@ -94,7 +94,7 @@ public final class RDN implements java.io.Serializable {
/**
* Returns the value of the DN component.
* @return rdn The value of the DN component.
* @return rdn the value of the DN component.
*/
public String getValue() {
return m_value;
@ -102,7 +102,7 @@ public final class RDN implements java.io.Serializable {
/**
* Returns the string representation of the DN component.
* @return The string representation of the DN component.
* @return the string representation of the DN component.
*/
public String toString() {
return m_type + "=" + m_value;
@ -110,8 +110,8 @@ public final class RDN implements java.io.Serializable {
/**
* Determines if the specified string is an distinguished name component.
* @param dn The string that you want to check.
* @return true if the string is a distinguished name component.
* @param dn the string to check
* @return <code>true</code> if the string is a distinguished name component.
*/
public static boolean isRDN(String rdn) {
RDN newrdn = new RDN(rdn);
@ -121,9 +121,9 @@ public final class RDN implements java.io.Serializable {
/**
* Determines if the current DN component is equal to the specified
* DN component.
* @param rdn The DN component that you want compared against the
* @param rdn the DN component to compare against the
* current DN component.
* @return true if the two DN components are equal.
* @return <code>true</code> if the two DN components are equal.
*/
public boolean equals(RDN rdn) {
return(toString().toUpperCase().equals(rdn.toString().toUpperCase()));

Просмотреть файл

@ -3,14 +3,14 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Miodrag Kekic">
<meta name="GENERATOR" content="Mozilla/4.5 [en]C-NSCP (WinNT; U) [Netscape]">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (WinNT; U) [Netscape]">
<title>Netscape LDAP Service Provider - Readme</title>
</head>
<body>
<h2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Netscape LDAP Service Provider for JNDI (08-02-99)</h2>
Netscape LDAP Service Provider for JNDI (09-15-99)</h2>
The Netscape LDAP service provider for JNDI implements the JNDI DirContext
interface. It is implemented as a layer on top of the Netscape Directory
SDK for Java (ldapjdk.jar). While the ldapjdk uses the LDAP connection
@ -48,13 +48,13 @@ listed jar files are:
<tr>
<td>ldapjdk.jar</td>
<td>Netscape Directory SDK for Java 4.0 Beta</td>
<td>Netscape Directory SDK for Java 4.0</td>
</tr>
<tr>
<td>jndi.jar</td>
<td>JNDI 1.2 FCS</td>
<td>JNDI 1.2</td>
</tr>
</table>
@ -68,9 +68,11 @@ environment created for the initial context;
<br><tt>&nbsp;&nbsp;&nbsp; DirContext ctx = new InitialDirContext(env);</tt>
<p>(3) For storing of&nbsp; Java objects in a LDAP Directory, the JNDI
java object schema must be added to the directory. To enable the JNDI schema
copy the file <i>jndi-object-schema.conf</i>&nbsp; to your <i>&lt;server-root>/slapd-&lt;id>/config</i>
copy the file <i>java-object-schema.conf</i>&nbsp; to your <i>&lt;server-root>/slapd-&lt;id>/config</i>
directory, and include the file into your&nbsp; <i>&lt;server-root>/slapd-&lt;id>/config/ns-schema.conf</i>
schema configuration file.
schema configuration file. If you are using Netscape Directory Server 4.1,
you just need to replace the existing&nbsp; <i>java-object-schema.conf</i>&nbsp;
file.
<p>For examples of using JNDI please go to the official JNDI site.
<h3>
<a NAME="Env Props"></a>Environment Properties</h3>
@ -148,6 +150,9 @@ server at port 389 on the local host.</td>
<li>
&nbsp;&nbsp; <b>simple</b>&nbsp;&nbsp; - use weak authentication (clear
text password)</li>
<li>
<i>space separated list of sasl mechanisms</i></li>
</ul>
If this environment property has not been set but the&nbsp;&nbsp;&nbsp;&nbsp;
java.naming.security.principal environment property has been
@ -182,13 +187,37 @@ possible value is defined:&nbsp; <b>ssl</b> - use Secure Socket Layer
<p><tt>&nbsp;env.put(Context.SECURITY_PROTOCOL, "ssl");</tt>
<p>When this environment property has been set and the
<br>&nbsp;<i>java.naming.ldap.factory.socket</i> property has not been
set, then
<br>the ldapjdk default socket factory&nbsp; <i>netscape.net.SSLSocket</i>
set, then the ldapjdk default socket factory&nbsp; <i>netscape.net.SSLSocket</i>
is used. This class is provided with Netscape Communicator 4.05 and higher.
If java.naming.ldap.factory.socket property has been set, the
If <i>java.naming.ldap.factory.socket</i> property has been set, the
<br>socket factory specified therein is used.</td>
</tr>
<tr>
<td>java.naming.security.sasl.authorizationId</td>
<td>
<br>Specifies which user DN to use for SASL authentication.&nbsp;</td>
</tr>
<tr>
<td>java.naming.security.sasl.callback</td>
<td>
<br>Specifies a callback handler for SASL mechanisms. This value of this
property&nbsp; must be an instance of
<br>&nbsp;<i>javax.security.auth.callback.CallbackHandler</i>.</td>
</tr>
<tr>
<td>
<br>&nbsp; java.naming.security.sasl.client.pkgs</td>
<td>
<br>Specifies a "|"-separated list of packages. These packages are used
to located factories that produce SASL mechanism drivers.&nbsp;</td>
</tr>
<tr>
<td>java.naming.ldap.factory.socket</td>
@ -460,14 +489,14 @@ to search subtree */</tt>
String[] { "sn" });</tt>
<p><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // specify sort control</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>ctx.setRequestControls(</b></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>new Control[] {new LdapSortControl(</b></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>new
Control[] {new LdapSortControl(</b></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>new LdapSortKey[]{</b></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>new LdapSortKey("sn", true,null)},Control.CRITICAL)});</b></tt>
<p><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* search for all entries
with surname of Jensen */</tt>
of type person */</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NamingEnumeration results</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
= ctx.search("o=mcom.com", "(objectclass=person)", cons);</tt>
@ -529,12 +558,8 @@ Therefore, the class name specified with the <i>javaClassName</i> attribute
must be available in the local <i>CLASSPATH</i>.</li>
<li>
<i>search()</i> and <i>modifyAttribute()</i> methods for schema directory
contexts. Instead of <i>DirContext.search()</i>, the&nbsp; <i>Context.lookup()</i>
request should be used for a schema directory context. Instead of <i>DirContext.modifyAttribute()</i>,
<i>DirContext.deleteSubcontext()</i>
followed the <i>DirContext.craeteSubcontext()
</i>should be used.</li>
<i>search()</i>&nbsp; method for schema directory contexts. Instead, <i>Context.lookup()</i>
should be used..</li>
</ul>
</body>

Просмотреть файл

@ -2,310 +2,314 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.5 [en]C-NSCP (WinNT; U) [Netscape]">
<title>Java 4.0 BETA Release Notes</title>
<meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; I) [Netscape]">
<meta name="Author" content="Jacob Rosenschein">
<meta name="Description" content="Release Notes for version 4.0 of the Netscape Directory SDK 4.0 for Java">
<meta name="KeyWords" content="Java SDK, Directory SDK, LDAP SDK, SDK, LDAP, Directory, Netscape Directory, Netscape SDK, Java LDAP SDK">
<title>Directory SDK 4.0 for Java Source Code Release Notes</title>
</head>
<body text="#000000" bgcolor="#FFFFFF">
<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<center>
<h2>
<font face="Arial, Helvetica"><font size=+1>BETA<br>
Netscape Directory SDK 4.0 for Java&nbsp;<br>
Release Notes</font></font></h2></center>
<font face="Arial,Helvetica">Netscape Directory SDK 4.0 for Java Source
Code Release Notes</font></h2></center>
<center><b>Last updated August 03, 1999</b></center>
<center>Last Updated September 13, 1999</center>
<p><br>
<br>
<br>
<p><font face="Arial, Helvetica"><font size=-1>These release notes apply
to the Netscape Directory SDK 4.0 for Java. Please read these notes before
using the product.</font></font>
<p>These release notes contain information about:
<ul>
<li>
<font face="Arial, Helvetica"><font size=-1><a href="#new">What's New</a></font></font></li>
<a href="#new">What's New in Version 4.0</a></li>
<li>
<font face="Arial, Helvetica"><font size=-1><a href="#changes3">Bugs Fixed
Since 3.10</a></font></font></li>
<a href="#install">Downloading and Building the Source</a></li>
<li>
<font face="Arial, Helvetica"><font size=-1><a href="#report">Reporting
Problems</a></font></font></li>
<a href="#update">Updating Java Classes in Netscape Communicator</a></li>
<li>
<a href="#fixed">Bugs Fixed Since Version 3.05</a></li>
<li>
<a href="#report">Reporting Problems</a></li>
<li>
<a href="#newsgroup">Accessing the Directory Developers Newsgroup</a></li>
</ul>
<hr SIZE=1 NOSHADE WIDTH="100%"><a NAME="new"></a><font face="Arial, Helvetica"><font size=-1>Here
is a summary of new features:</font></font>
<h3>
<font face="Arial, Helvetica"><font size=-1>Changes to&nbsp; Java LDAP
API</font></font></h3>
<ul>
<li>
<font face="Arial, Helvetica"><font size=-1>Added&nbsp; </font></font><tt>LDAPBind
</tt><font face="Arial, Helvetica"><font size=-1>interface
for sophisticated client management of referral authentication.</font></font></li>
<li>
<tt>LDAPControl</tt><font face="Arial, Helvetica"><font size=-1> has new
methods </font></font><tt>register()</tt><font face="Arial, Helvetica"><font size=-1>
and </font></font><tt>newInstance()</tt><font face="Arial, Helvetica"><font size=-1>,
to support dynamic registration and instantiation of server response controls.</font></font></li>
<li>
<tt>LDAPConnection.getServerControls()</tt><font face="Arial, Helvetica"><font size=-1>
automatically parses controls.&nbsp; As a result, calling </font></font><tt>parseResponse()</tt><font face="Arial, Helvetica"><font size=-1>is
no longer necessary.</font></font></li>
<li>
<tt>LDAPSearchConstraints</tt><font face="Arial, Helvetica"><font size=-1>
has been divided into </font></font><tt>LDAPConstraints</tt><font face="Arial, Helvetica"><font size=-1>
and a subclass </font></font><tt>LDAPSearchConstraints</tt><font face="Arial, Helvetica"><font size=-1>.
</font></font><tt>LDAPConstraints</tt><font face="Arial, Helvetica"><font size=-1>
contains only methods implemented in the interface&nbsp; which apply to
all operations (not&nbsp; parameters passed to the server).&nbsp; </font></font><tt>LDAPSearchConstraints</tt><font face="Arial, Helvetica"><font size=-1>
is unchanged.&nbsp;&nbsp;&nbsp; All </font></font><tt>LDAPConnection</tt><font face="Arial, Helvetica"><font size=-1>
methods that take </font></font><tt>LDAPSearchConstraints</tt><font face="Arial, Helvetica"><font size=-1>
as an argument (except for read and search methods) change to pass </font></font><tt>LDAPConstraints</tt><font face="Arial, Helvetica"><font size=-1>
instead.</font></font></li>
<li>
<font face="Arial, Helvetica"><font size=-1>When searching from </font></font><tt>LDAPConnection</tt>,
<font size=-1><font face="Arial,Helvetica">r</font><font face="Arial, Helvetica">etrieval
of server response controls&nbsp; is moved to LDAPSearchResults.&nbsp;
So you would call</font></font></li>
<br><tt>LDAPSearchResults.getResponseControls()</tt><font face="Arial, Helvetica"><font size=-1>
instead of </font></font><tt>LDAPConnection.getResponseControls()</tt><font face="Arial, Helvetica"><font size=-1>.
For backwards compatibility, you can still get the controls from LDAPConnection,
but it is recommended for new code to get them from LDAPSearchResults.</font></font>
<li>
<font face="Arial, Helvetica"><font size=-1>Added support for transparent
failover connection policies. The available policies are: (1) serial ,
(2) parallel with no delay and (3) parallel&nbsp; with delay. See </font></font><tt>LDAPConnection.setConnSetupDelay()</tt><font face="Arial, Helvetica"><font size=-1>.</font></font></li>
<li>
<tt>LDAPConnection</tt><font face="Arial, Helvetica"><font size=-1> has
a new method </font></font><tt>reconnect()</tt><font size=-1><font face="Arial,Helvetica">
which first disconnects and then connects and binds again using the same
parameters and mechanisms</font><font face="Arial, Helvetica">.</font></font></li>
<li>
<font face="Arial, Helvetica"><font size=-1>Added support for connection
pools.&nbsp; See </font></font><tt>netscape.ldap.util.ConnectionPool</tt><font face="Arial, Helvetica"><font size=-1>
in the online JavaDocs.</font></font></li>
<li>
<font face="Arial, Helvetica"><font size=-1>Added </font></font><tt>LDAPInterruptedException</tt><font face="Arial, Helvetica"><font size=-1>
which is thrown if an LDAP operation is interrupted.</font></font></li>
<li>
<tt>LDAPSchema</tt><font face="Arial, Helvetica"><font size=-1> and the
associated schema element classes now fully support RFC2252.</font></font></li>
</ul>
<b><font face="Arial, Helvetica"><font size=-1>New asynchronous Java LDAP
API</font></font></b>
<p><font face="Arial, Helvetica"><font size=-1>This new API works at a
low level, close to the LDAP protocol, providing a means for mutiplexing
LDAP operations from the same thread.&nbsp; For detailed information, see
<a href="http://www.ietf.org/internet-drafts/draft-ietf-ldapext-ldap-java-api-05.txt">Internet
Draft for The Java LDAP Application Program Interface.</a></font></font>
<ul>
<li>
<font face="Arial, Helvetica"><font size=-1>New interface </font></font><tt>LDAPAsynchronousConnection</tt><font face="Arial, Helvetica"><font size=-1>
is defined.</font></font></li>
<li>
<tt>LDAPConnection</tt><font face="Arial, Helvetica"><font size=-1>&nbsp;
implements the asynchronous interface and supports both synchronous as
well as asynchronous programming models.</font></font></li>
<li>
<font face="Arial, Helvetica"><font size=-1>New classes for asynchronously
receiving server response messages: </font></font><tt>LDAPResponseListener</tt>,
<tt>LDAPSearchListener</tt><font face="Arial, Helvetica"><font size=-1>.</font></font></li>
<li>
<font face="Arial, Helvetica"><font size=-1>New classes for representing
LDAP messages: </font></font><tt>LDAPMessage</tt>,<tt> LDAPResponse</tt>,<tt>
LDAPExtendedResponse</tt>,<tt> LDAPSearchResult and LDAPSearchResponseReference.</tt></li>
</ul>
<b><font face="Arial, Helvetica"><font size=-1>Support for the Java Naming
and Directory Interface (JNDI) Service Provider</font></font></b>
<p><font face="Arial, Helvetica"><font size=-1>The JNDI service provider
support for event notification is implemented more efficiently on top of
the asynchronous Java LDAP API.&nbsp; For more information on JNDI, see
the <a href="http://java.sun.com/products/jndi/index.html">java.sun website
</a>and
the <a href="ldapsp-relnotes.htm">Release Notes for the Netscape LDAP Service
Provider for JNDI</a>.</font></font>
<p><b><font face="Arial, Helvetica"><font size=-1>Simple Authentication
and Security Layer (SASL) API changes</font></font></b>
<p><font face="Arial, Helvetica"><font size=-1>The new SASL API is rewritten
including&nbsp; new&nbsp; SASL interface classes.&nbsp; For more information,
see the&nbsp; <a href="http://www.ietf.org/rfc/rfc2222.txt">Internet Draft
for</a> <a href="http://www.ietf.org/rfc/rfc2222.txt">Simple Authentication
and Security Layer (SASL).</a> You will need to have </font></font><tt>jaas.jar</tt><font face="Arial, Helvetica"><font size=-1>
in your CLASSPATH if you are using SASL authentication.</font></font>
For the latest documentation, see the <i><a href="http://developer.netscape.com/docs/manuals/dirsdk/jsdk40/contents.htm" TARGET="_top">Netscape
Directory SDK 4.0 for Java Programmer's Guide</a></i>, which is available
on Netscape DevEdge Online.
<p>Reference materials for the Directory SDK 4.0 for Java are produced
using the Javadoc utility. They are available in the <tt>/dist/doc/</tt>
directory where you installed the SDK or online at: <tt><a href="http://developer.netscape.com/docs/manuals/dirsdk/jsdk40/reference/index.html">http://developer.netscape.com/docs/manuals/dirsdk/jsdk40/reference/index.html</a></tt>.
<p>If you only want the Netscape Directory SDK 4.0 for Java (not the source
code), you can dowload it from Netscape <a href="http://developer.netscape.com/tech/directory/downloads.html">DevEdge</a>.
<p>
<hr SIZE=1 NOSHADE WIDTH="100%">
<br><a NAME="changes3.05"></a><b><font face="Arial, Helvetica"><font size=-1>BUGS
FIXED SINCE 3.10</font></font></b>
<blockquote><font face="Arial, Helvetica"><font size=-1>355365&nbsp; </font></font><tt>LDAPSearchResults.getCount()</tt><font face="Arial, Helvetica"><font size=-1>
returns 0 for synchronous search</font></font>
<br><font face="Arial, Helvetica"><font size=-1>342196&nbsp;&nbsp; SmartUpdate
for java LDAP SDK doesn't work for Comm 4.5</font></font>
<br><font face="Arial, Helvetica"><font size=-1>346367&nbsp;&nbsp; -1 incorrectly
encoded in BERIntegral</font></font>
<br><font face="Arial, Helvetica"><font size=-1>357382&nbsp;&nbsp; Can't
compile JNDI SP with JDK 1.2</font></font>
<br><font face="Arial, Helvetica"><font size=-1>357361&nbsp;&nbsp; Filter
code doesn't work with JDK 1.2</font></font>
<br><font face="Arial, Helvetica"><font size=-1>351004&nbsp;&nbsp; Applet
in Communicator can't fetch error string</font></font>
<br><font face="Arial, Helvetica"><font size=-1>313834&nbsp;&nbsp; "rejects"
file on import (e.g. LDAPModify) contains binary</font></font>
<br><font face="Arial, Helvetica"><font size=-1>339833&nbsp;&nbsp; RFE:
smarter failover</font></font>
<br><font face="Arial, Helvetica"><font size=-1>325394&nbsp;&nbsp; </font></font><tt>getCount()</tt><font face="Arial, Helvetica"><font size=-1>
after sorting throws exception</font></font>
<br><font face="Arial, Helvetica"><font size=-1>330523&nbsp;&nbsp; </font></font><tt>DN.equals()</tt><font face="Arial, Helvetica"><font size=-1>
does not normalize</font></font>
<br><font face="Arial, Helvetica"><font size=-1>354615&nbsp;&nbsp; </font></font><tt>DN.contains()</tt><font face="Arial, Helvetica"><font size=-1>
implemented and documented incorrectly</font></font>
<br><font face="Arial, Helvetica"><font size=-1>339633&nbsp; The SDK should
catch </font></font><tt>Exception</tt><font face="Arial, Helvetica"><font size=-1>,
not </font></font><tt>Throwable</tt>
<br><font face="Arial, Helvetica"><font size=-1>352056&nbsp;&nbsp; </font></font><tt>LDAPModify</tt><font face="Arial, Helvetica"><font size=-1>
should support LDIF version 1</font></font>
<br><font face="Arial, Helvetica"><font size=-1>351022&nbsp;&nbsp; </font></font><tt>LDAPCompareAttrNames
</tt><font face="Arial, Helvetica"><font size=-1>should
allow specifying a locale</font></font>
<br><font face="Arial, Helvetica"><font size=-1>350624&nbsp;&nbsp; </font></font><tt>LDAPSearch</tt><font face="Arial, Helvetica"><font size=-1>
aborts on size limit exception</font></font>
<br><font face="Arial, Helvetica"><font size=-1>350998&nbsp;&nbsp;&nbsp;
Search timeout not handled correctly</font></font>
<br><font face="Arial, Helvetica"><font size=-1>350997&nbsp;&nbsp; </font></font><tt>LDAPSchemaElement
</tt><font face="Arial, Helvetica"><font size=-1>needs
modify() method</font></font>
<br><font face="Arial, Helvetica"><font size=-1>350996&nbsp;&nbsp; </font></font><tt>LDAPBasePropertySupport</tt><font face="Arial, Helvetica"><font size=-1>
should enable referrals</font></font>
<br><font face="Arial, Helvetica"><font size=-1>350995&nbsp;&nbsp; </font></font><tt>LDAPBasePropertySupport
</tt><font face="Arial, Helvetica"><font size=-1>should
enable referrals</font></font>
<br><font face="Arial, Helvetica"><font size=-1>347586&nbsp;&nbsp; Schema
interpretations are specific to Netscape</font></font>
<br><font face="Arial, Helvetica"><font size=-1>357772&nbsp;&nbsp; </font></font><tt>LDAPFilter</tt><font face="Arial, Helvetica"><font size=-1>
gets array bounds exception</font></font>
<br><font face="Arial, Helvetica"><font size=-1>357526&nbsp;&nbsp; Syntactically
incorrect filter is causing disconnect</font></font>
<br><font face="Arial, Helvetica"><font size=-1>355904&nbsp;&nbsp; Cannot
set cache after </font></font><tt>LDAPConnection</tt><font face="Arial, Helvetica"><font size=-1>
is connected</font></font>
<br><font face="Arial, Helvetica"><font size=-1>355942&nbsp;&nbsp; </font></font><tt>LDAPCache</tt><font face="Arial, Helvetica"><font size=-1>
changes contents of attributes to return</font></font>
<br><font face="Arial, Helvetica"><font size=-1>354503&nbsp;&nbsp; The
SDK calls </font></font><tt>Thread.stop()/suspend()/resume()</tt>
<br><font face="Arial, Helvetica"><font size=-1>355215&nbsp;&nbsp;&nbsp;
VLV controls don't support optional context field</font></font>
<br><font face="Arial, Helvetica"><font size=-1>354347&nbsp;&nbsp;&nbsp;
SDK doesn't support all schema options of RFC 2252</font></font>
<br><font face="Arial, Helvetica"><font size=-1>353306&nbsp;&nbsp;&nbsp;
LDAP Beans don't handle referrals</font></font>
<br><font face="Arial, Helvetica"><font size=-1>353305&nbsp;&nbsp;&nbsp;
LDAPIsMember doesn't handle dynamic groups</font></font>
<br><font face="Arial, Helvetica"><font size=-1>353187&nbsp;&nbsp;&nbsp;
Ensure that SDK works with Java 2</font></font>
<br><font face="Arial, Helvetica"><font size=-1>351926&nbsp;&nbsp;&nbsp;
Must call System.exit() to shutdown SDK</font></font>
<br><font face="Arial, Helvetica"><font size=-1>351719&nbsp;&nbsp;&nbsp;
LDAPModificationSet has no toString method</font></font>
<br><font face="Arial, Helvetica"><font size=-1>339632&nbsp;&nbsp;&nbsp;
The SDK should not use Thread.stop()</font></font>
<br><font face="Arial, Helvetica"><font size=-1>329534&nbsp;&nbsp; </font></font><tt>getCount</tt><font face="Arial, Helvetica"><font size=-1>
doesnt work in asynchronous search</font></font>
<br><font face="Arial, Helvetica"><font size=-1>330261&nbsp;&nbsp; </font></font><tt>StringIndexOutOfBoundsException</tt><font face="Arial, Helvetica"><font size=-1>
if searched for backslash " \ "</font></font>
<br><font face="Arial, Helvetica"><font size=-1>116611&nbsp;&nbsp;&nbsp;
SASLMechanismFactory is missing getMechanisms method</font></font>
<br><font face="Arial, Helvetica"><font size=-1>353307&nbsp;&nbsp; </font></font><tt>LDAPGetEntries</tt><font face="Arial, Helvetica"><font size=-1>
should allow choice of attributes to return</font></font>
<br><font face="Arial, Helvetica"><font size=-1>353308&nbsp;&nbsp; </font></font><tt>LDAPModificationSet
</tt><font face="Arial, Helvetica"><font size=-1>is
missing a toString method</font></font>
<br><font face="Arial, Helvetica"><font size=-1>358370&nbsp;&nbsp; Incorrect
tag written for </font></font><tt>UTCTime BER</tt>
<br><font face="Arial, Helvetica"><font size=-1>358371&nbsp;&nbsp; Missing
and incorrect javadocs for </font></font><tt>BER</tt>
<br><font face="Arial, Helvetica"><font size=-1>356470&nbsp;&nbsp; Should
support latest LDIF specification</font></font>
<br><font face="Arial, Helvetica"><font size=-1>324606&nbsp;&nbsp; RFE:
get attribute values as vector</font></font>
<br><font face="Arial, Helvetica"><font size=-1>354682&nbsp;&nbsp; Should
treat </font></font><tt>null</tt><font face="Arial, Helvetica"><font size=-1>
for filter as meaning </font></font><tt>objectclass=*</tt>
<br><font face="Arial, Helvetica"><font size=-1>354997&nbsp;&nbsp; Unneeded
public </font></font><tt>add</tt><font face="Arial, Helvetica"><font size=-1>
methods in </font></font><tt>LDAPSchema</tt>
<br><font face="Arial, Helvetica"><font size=-1>339831&nbsp;&nbsp; RFE:
connection pool support</font></font>
<br><font face="Arial, Helvetica"><font size=-1>359305&nbsp;&nbsp; Smart
Failover should not auto-connect after disconnect()</font></font>
<br><font face="Arial, Helvetica"><font size=-1>346368&nbsp;&nbsp; BERReal
incomplete and incorrect</font></font>
<br><font face="Arial, Helvetica"><font size=-1>352804&nbsp;&nbsp; netscape.ldap.util.DN
class does not consider "" a valid DN</font></font>
<br><font face="Arial, Helvetica"><font size=-1>344077&nbsp;&nbsp; Maybe
wrong tag used for extended operation</font></font>
<br><font face="Arial, Helvetica"><font size=-1>359855&nbsp;&nbsp; No way
to specify custom qualifiers in object class definition</font></font>
<br><font face="Arial, Helvetica"><font size=-1>359580&nbsp;&nbsp; LDAPConnection.setMaxBacklog()
doesn't work</font></font>
<br><font face="Arial, Helvetica"><font size=-1>359646&nbsp;&nbsp; modDN
doesn't work</font></font></blockquote>
<hr SIZE=1 NOSHADE WIDTH="100%"><a NAME="new"></a><b><font face="Arial,Helvetica"><font size=+1>What's
New in Version 4.0</font></font></b>
<p>The Netscape Directory SDK 4.0 for Java provides programmers with the
tools to develop directory-enabled software.&nbsp; This release includes:
<ul>
<li>
Application Program Interface (API) updates to match the newest LDAP (Lightweight
Directory Access Protocol) internet drafts</li>
<hr SIZE=0 WIDTH="100%"><a NAME="report"></a><b><font face="Arial, Helvetica"><font size=-1>REPORTING
PROBLEMS</font></font></b>
<p><font face="Arial, Helvetica"><font size=-1>Please submit your problem
via the the <a href="http://bugzilla.mozilla.org">Bugzilla bugsystem</a>
. Use the "LDAP Java SDK" component.</font></font>
<p><font face="Arial, Helvetica"><font size=-1>If you have additional questions
or need more information about the LDAP Java SDK, see the <a href="news://news.mozilla.org/netscape.public.mozilla.directory">directory
newsgroup at Mozilla</a> and the <a href="http://developer.netscape.com/support/newsgroups/index.html?content=newsgrp.html#directory" TARGET="_top">Directory
Developers newsgroup</a> at <a href="http://developer.netscape.com">Netscape
DevEdge</a>.</font></font>
<br>&nbsp;
<li>
an asynchronous interface to LDAP</li>
<li>
a new SASL (Simple Authentication and Security Layer) API</li>
<li>
the Netscape LDAP Service Provider for JNDI (Java Naming and Directory
Interface).</li>
</ul>
Additional improvements and changes to the Directory SDK are listed under
<a href="#fixed">Bugs
Fixed Since Version 3.05</a>.
<p><b><font face="Arial,Helvetica">API updates</font></b>
<p>The Netscape Directory SDK 4.0 for Java supports these changes to the
LDAP API:
<ul>
<li>
Sophisticated client-side management of referral authentication using the
<tt>LDAPBind</tt>
interface.</li>
<li>
Dynamic registration and instantiation of server response controls using
the <tt>register</tt> and <tt>newInstance</tt> methods of <tt>LDAPControl</tt>.</li>
<li>
The separation of the constraint class into <tt>LDAPConstraints</tt> and
its subclass <tt>LDAPSearchConstraints</tt>. <tt>LDAPConstraints</tt> contains
only those methods implemented in the interface that apply to <i>all </i>operations.
<tt>LDAPSearchConstraints</tt>
is unchanged. All <tt>LDAPConnection</tt> methods that used to take <tt>LDAPSearchConstraints</tt>
as an argument (except for read and search methods) now pass <tt>LDAPConstraints</tt>
instead.</li>
<li>
When using <tt>LDAPConnection</tt> for searching, retrieval of server response
controls is now handled by <tt>LDAPSearchResults</tt>. Although the SDK
is backward compatible, you should call <tt>LDAPSearchResults.getResponseControls()</tt>
instead of <tt>LDAPConnection.getResponseControls()</tt>when writing new
code.</li>
<li>
<tt>LDAPConnection.getServerControls()</tt> now automatically parses controls.
As a result, calling <tt>parseResponse()</tt> is no longer necessary.</li>
<li>
Support for transparent failover connection policies. The available policies
are: (1) serial, (2) parallel with no delay, and (3) parallel with delay.
For more information, see <tt>LDAPConnection.setConnSetupDelay()</tt> in
the javadocs.</li>
<li>
<tt>LDAPConnection</tt> has a new method called <tt>reconnect()</tt>. This
method first disconnects and then connects and binds again using the same
parameters and mechanisms as the original connection..</li>
<li>
Support for connection pools. For more information see <tt>netscape.ldap.util.ConnectionPool</tt>
in the javadocs.</li>
<li>
The addition of <tt>LDAPInterruptedException</tt>, which is thrown if an
LDAP operation is interrupted.</li>
<li>
The addition of <tt>LDAPProxiedAuthControl</tt>, which can execute operations,
using different credentials, without rebinding.</li>
<li>
<tt>LDAPConnection</tt> now runs as a daemon thread. You no longer need
to call <tt>System.exit</tt> when terminating your program.</li>
</ul>
<b><font face="Arial,Helvetica">Asynchronous API</font></b>
<p>The Netscape Directory SDK 4.0 for Java provides an interface called
<tt>LDAPAsynchronousConnection</tt>.
This interface contains methods for performing LDAP operations asynchronously.
Instead of blocking while waiting for a response, methods in <tt>LDAPAsynchronousConnection</tt>
return control to an application before they complete. For more information
on the asynchronous interface, see "<a href="http://developer.netscape.com/docs/manuals/dirsdk/jsdk40/asynch.htm">Using
the Asynchronous Interface</a>" in the <i><a href="http://developer.netscape.com/docs/manuals/dirsdk/jsdk40/contents.htm">Netscape
Directory SDK 4.0 for Java Programmer's Guide</a></i>.
<p><b><font face="Arial,Helvetica">SASL API</font></b>
<p>SASL allows clients and servers to communicate securely. The API accomplishes
this by finding a common authentication scheme and facilitating a series
of challenge and response interchanges between the client and server. If
these interchanges complete successfully, the client is authenticated.
For more information on SASL see "<a href="http://developer.netscape.com/docs/manuals/dirsdk/jsdk40/sasl.htm">Using
SASL Authentication</a>" in the <i><a href="http://developer.netscape.com/docs/manuals/dirsdk/jsdk40/contents.htm">Netscape
Directory SDK 4.0 for Java Programmer's Guide</a></i>.
<p><b><font face="Arial,Helvetica">JNDI Service Provider for LDAP</font></b>
<p>JNDI is a Java API that provides a common way for programmers to access
a variety of naming and directory services. This is accomplished via a
layer of software called a Service Provider. The Directory SDK includes
a Service Provider for LDAP.
<p>The following JNDI features are not implemented in this release of the
Netscape LDAP Service Provider:
<ul>
<li>
Support for federated names</li>
<li>
Support for the "code base" attribute for objects stored in an LDAP directory.
The class name specified by the <tt>javaClassName</tt> attribute must exist
in the local <tt>CLASSPATH</tt></li>
<li>
The <tt>search()</tt> method for schema directory contexts. To perform
searches in a schema directory context use a <tt>Context.lookup()</tt>
request instead of <tt>DirContext.search()</tt>.</li>
</ul>
For more information see "<a href="http://developer.netscape.com/docs/manuals/dirsdk/jsdk40/JNDIchap.htm">Using
the JNDI Service Provider</a>" in the <i><a href="http://developer.netscape.com/docs/manuals/dirsdk/jsdk40/contents.htm">Netscape
Directory SDK 4.0 for Java Programmer's Guide</a></i>.
<p>
<hr SIZE=1 NOSHADE WIDTH="100%"><a NAME="install"></a><b><font face="Arial,Helvetica"><font size=+1>Downloading
and Building the Source</font></font></b>
<p>The Directory SDK source code is available on the Mozilla website. You
can download it at <a href="http://www.mozilla.org/directory/javasdk.html">http://www.mozilla.org/directory/javasdk.html</a>.
<p>Follow the instructions at <a href="http://www.mozilla.org/directory/buildjsdk-4.0.txt">http://www.mozilla.org/directory/buildjsdk-4.0.txt</a>
to build the Netscape Directory SDK.
<p>
<hr SIZE=1 NOSHADE WIDTH="100%"><a NAME="update"></a><b><font face="Arial,Helvetica"><font size=+1>Updating
Java Classes in Netscape Communicator</font></font></b>
<p>The LDAP Java classes contained in Netscape Communicator 4.7 and earlier
are outdated. You can upgrade these class files to the latest versions
using Communicator's SmartUpdate feature.
<p>The SmartUpdate page for the LDAP Java classes is at: <a href="http://developer.netscape.com/software/ldap/ldap.html">http://developer.netscape.com/software/ldap/ldap.html</a>
<p><b>Note: </b>This page uses Communicator's SmartUpdate feature to update
the classes. Before visiting this page, you must enable SmartUpdate, Java,
JavaScript, and cookies in Communicator.
<p><b><font face="Arial,Helvetica">To enable SmartUpdate, Java, JavaScript,
and cookies:</font></b>
<ul>
<li>
Go to the Edit menu and choose Preferences.</li>
<li>
Select Advanced and make sure that Accept all cookies is active (it's radio
button is filled).</li>
<li>
Make sure that Enable Java and Enable JavaScript are checked.</li>
<li>
Choose Advanced | SmartUpdate from the left-hand panel.</li>
<li>
Make sure that Enable SmartUpdate is checked.</li>
<li>
Click OK.</li>
</ul>
<hr SIZE=1 NOSHADE WIDTH="100%"><a NAME="fixed"></a><b><font face="Arial,Helvetica"><font size=+1>Bugs
Fixed Since Version 3.05</font></font></b>
<p>The following bugs have been fixed since the release of the Directory
SDK 3.05 for Java. Bug numbers are shown in parentheses.
<ul>
<li>
<tt>LDAPSearchResults.getCount()</tt> returns 0 for synchronous searches.
(355365)</li>
<li>
Applets in Communicator can't fetch an error string. (351004)</li>
<li>
<tt>DN.contains()</tt> is implemented and documented incorrectly. (354615)</li>
<li>
Search timeout is not handled correctly. (350998)</li>
<li>
<tt>LDAPSchemaElement</tt> needs a <tt>modify()</tt> method. (350997)</li>
<li>
<tt>LDAPBasePropertySupport</tt> should enable referrals. (350996, 350995)</li>
<li>
Cannot set the cache once <tt>LDAPConnection</tt> has connected. (355904)</li>
<li>
<tt>LDAPCache</tt> changes the contents of returned attributes. (355942)</li>
<li>
The SDK calls <tt>Thread.stop()</tt>, <tt>suspend()</tt>, and <tt>resume()</tt>.
(354503)</li>
<li>
VLV controls don't support the optional context field. (355215)</li>
<li>
The SDK doesn't support all the schema options described in RFC 2252. (354347)</li>
<li>
LDAP Beans don't handle referrals. (353306)</li>
<li>
<tt>LDAPIsMember</tt> doesn't handle dynamic groups. (353305)</li>
<li>
The <tt>netscape.ldap.util.DN</tt> class does not consider <tt>""</tt>
to be a valid DN. (352804)</li>
<li>
<tt>LDAPCompareAttrNames</tt> should allow for the specification of a locale.
(351022)</li>
<li>
<tt>LDAPSearch</tt> aborts on a size limit exception. (350624)</li>
<li>
<tt>LDAPModificationSet</tt> is missing a <tt>toString</tt> method. (353308,
351719)</li>
<li>
<tt>LDAPGetEntries</tt> should allow a choice of which attributes to return.
(353307)</li>
<li>
The SDK should support the latest LDIF specification. (356470, 352056)</li>
<li>
The SDK should treat a <tt>"null"</tt> filter as meaning <tt>"objectclass=*"</tt>.
(354682)</li>
<li>
<tt>LDAPSchema</tt> contains unnecessary public <tt>"add"</tt> methods.
(354997)</li>
</ul>
<hr SIZE=1 NOSHADE WIDTH="100%"><a NAME="report"></a><b><font face="Arial,Helvetica"><font size=+1>Reporting
Problems</font></font></b>
<p>Please submit your problem via the the <a href="http://bugzilla.mozilla.org">Bugzilla</a>
bugsystem . Use the "LDAP Java SDK" component.
<p>
<hr SIZE=1 NOSHADE WIDTH="100%"><a NAME="newsgroup"></a><b><font face="Arial,Helvetica"><font size=+1>Accessing
the Directory Developers Newsgroup</font></font></b>
<p>If you have additional questions or need more information about the
Netscape Directory SDK 4.0 for Java, please visit the Mozilla <a href="news://news.mozilla.org/netscape.public.mozilla.directory">Directory
newsgroup</a> and the DevEdge <a href="http://developer.netscape.com/support/newsgroups/" TARGET="_top">Directory
Server newsgroups</a>.
<center>
<p><font face="Arial, Helvetica"><font size=-1>For more Internet development
resources, try <a href="http://home.netscape.com/computing/techsearch/index.html?cp=dev01bnts" TARGET="_top">Netscape
TechSearch</a></font></font></center>
<p>
<hr SIZE=1 NOSHADE WIDTH="100%"><font size=-1>Contains OROMatcher&reg;
regular expression software from ORO Java Software. <nobr>&copy; </nobr>Copyright
1997 by ORO Java Software.</font>
<br><font size=-1>Redistribution separate from Netscape Directory SDK for
Java or direct use of OROMatcher interfaces</font>
<br><font size=-1>requires a license from ORO Java Software. <a href="http://www.oroinc.com/" TARGET="_top">http://www.oroinc.com</a>.
OROMatcher&reg; is a trademark of Original Reusable Objects, Inc.</font>
<p><font size=-1>For more Internet development resources, try <a href="http://home.netscape.com/computing/techsearch/index.html?cp=dev01bnts" TARGET="_top">Netscape
TechSearch</a>.</font></center>
<hr SIZE=1>
<center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="460" >
<tr>
<td WIDTH="15"></td>
<td ALIGN=LEFT VALIGN=TOP WIDTH="165"><font face="Arial, Helvetica"><font size=-2><a href="/support/faqs/index.html?content=deofaq.html" TARGET="_top">DevEdge
Online FAQ</a></font></font>
<br><font face="Arial, Helvetica"><font size=-2><a href="/program/index_frame.html?content=contact.html" TARGET="_top">Developer
Response Center</a></font></font>
<br><font face="Arial, Helvetica"><font size=-2><a href="/program/index.html" TARGET="_top">Join
DevEdge Program</a></font></font></td>
<td WIDTH="5"></td>
<td ALIGN=LEFT VALIGN=TOP WIDTH="280"><font face="Arial, Helvetica"><font size=-2><nobr>Copyright
&copy; 1999 <a href="http://home.netscape.com/misc/trademarks.html" TARGET="_top">Netscape
Communications Corporation</a></nobr>.</font></font>
<br><font face="Arial, Helvetica"><font size=-2>This site powered by: <a href="http://home.netscape.com/servers/index.html" TARGET="_top">Netscape
Enterprise Server</a> and <a href="http://home.netscape.com/compass/v3.0/index.html" TARGET="_top">Netscape
Compass Server</a>.</font></font></td>
<td WIDTH="25"></td>
</tr>
</table></center>
<br>&nbsp;
<br>&nbsp;
<hr SIZE=0 WIDTH="100%">
</body>
</html>
GIF89a¤ÕÿÿÿÿÿÿÌÿÌÿÿÌÌõõùììòââìâ¹ìÙÙåÏÏßÌÿÿÌÿÌÌÌÿÌÌÌÌ™ÿÌ™ÌÅÅÙ¼¼Ò²²Ì©©Æ  ¿™Ìÿ™ÌÌ™™ÿ™™Ì™™™™fÌ™f™––¹ŒŒ³ƒƒ¬yy¦ppŸfÌÌf™Ìf™™ffÌff™fffff3f3™f3f3™Ì3™™3f™3ff33™33f3333f33™™f™fff33™3f33f3,¤@ÿÀpH,