You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2007/01/21 00:58:38 UTC
svn commit: r498214 - in
/directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model:
BookmarkParameter.java ConnectionParameter.java SearchParameter.java
Author: seelmann
Date: Sat Jan 20 15:58:37 2007
New Revision: 498214
URL: http://svn.apache.org/viewvc?view=rev&rev=498214
Log:
Added Javadocs, code cleaning.
Modified:
directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/BookmarkParameter.java
directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/ConnectionParameter.java
directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/SearchParameter.java
Modified: directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/BookmarkParameter.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/BookmarkParameter.java?view=diff&rev=498214&r1=498213&r2=498214
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/BookmarkParameter.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/BookmarkParameter.java Sat Jan 20 15:58:37 2007
@@ -24,21 +24,40 @@
import java.io.Serializable;
+/**
+ * A Bean class to hold the bookmark parameters.
+ * It is used to make bookmarks persistent.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
public class BookmarkParameter implements Serializable
{
+ /** The serialVersionUID. */
private static final long serialVersionUID = 105108281861642267L;
+ /** The target DN. */
private DN dn;
+ /** The symbolic name. */
private String name;
+ /**
+ * Creates a new instance of BookmarkParameter.
+ */
public BookmarkParameter()
{
}
+ /**
+ * Creates a new instance of BookmarkParameter.
+ *
+ * @param dn the target DN
+ * @param name the symbolic name
+ */
public BookmarkParameter( DN dn, String name )
{
this.dn = dn;
@@ -46,24 +65,44 @@
}
+ /**
+ * Gets the target DN.
+ *
+ * @return the target DN
+ */
public DN getDn()
{
return dn;
}
+ /**
+ * Sets the target DN.
+ *
+ * @param dn the target DN
+ */
public void setDn( DN dn )
{
this.dn = dn;
}
+ /**
+ * Gets the symbolic name.
+ *
+ * @return the symbolic name
+ */
public String getName()
{
return name;
}
+ /**
+ * Sets the symbolic name.
+ *
+ * @param name the symbolic name
+ */
public void setName( String name )
{
this.name = name;
Modified: directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/ConnectionParameter.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/ConnectionParameter.java?view=diff&rev=498214&r1=498213&r2=498214
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/ConnectionParameter.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/ConnectionParameter.java Sat Jan 20 15:58:37 2007
@@ -24,213 +24,399 @@
import java.io.Serializable;
+/**
+ * A Bean class to hold the connection parameters.
+ * It is used to make connections persistent.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
public class ConnectionParameter implements Serializable
{
+ /** The serialVersionUID. */
private static final long serialVersionUID = 3679909600732887964L;
+ /** The symbolic name. */
private String name;
+ /** The host name or IP address of the LDAP server. */
private String host;
+ /** The encryption method, one of IConnection.ENCYRPTION_NONE, IConnection.ENCYRPTION_LDAPS or IConnection.ENCYRPTION_STARTTLS. */
private int encryptionMethod;
+ /** The port of the LDAP server. */
private int port;
+ /** Flag indicating if base DNs should be fetched from namingContexts attribute of the Root DSE. */
private boolean fetchBaseDNs;
+ /** The user provided base DN. */
private DN baseDN;
+ /** The time limit im milliseconds. */
private int timeLimit;
+ /** The count limit. */
private int countLimit;
+ /** The alias dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING or IConnection.DEREFERENCE_ALIASES_SEARCH. */
private int aliasesDereferencingMethod;
+ /** The referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE or IConnection.HANDLE_REFERRALS_FOLLOW. */
private int referralsHandlingMethod;
+ /** The authentication method, one of IConnection.AUTH_ANONYMOUS or IConnection.AUTH_SIMPLE */
private int authMethod;
+ /** The bind principal, typically a DN. */
private String bindPrincipal;
+ /** The bind password. */
private String bindPassword;
+ /** The connection provider class name. */
private String connectionProviderClassName;
+ /**
+ * Creates a new instance of ConnectionParameter.
+ */
public ConnectionParameter()
{
}
+ /**
+ * Gets the user provided base DN.
+ *
+ * @return the user provided base DN
+ */
public DN getBaseDN()
{
return baseDN;
}
+ /**
+ * Sets the user provided base DN.
+ *
+ * @param baseDN the user provided base DN
+ */
public void setBaseDN( DN baseDN )
{
this.baseDN = baseDN;
}
+ /**
+ * Gets the count limit, 0 means no limit.
+ *
+ * @return the count limit
+ */
public int getCountLimit()
{
return countLimit;
}
+ /**
+ * Sets the count limit, 0 means no limit.
+ *
+ * @param countLimit the count limit
+ */
public void setCountLimit( int countLimit )
{
this.countLimit = countLimit;
}
+ /**
+ * Gets the host name or IP address of the LDAP server.
+ *
+ * @return the host
+ */
public String getHost()
{
return host;
}
+ /**
+ * Sets the host name or IP address of the LDAP server.
+ *
+ * @param host the host
+ */
public void setHost( String host )
{
this.host = host;
}
+ /**
+ * Gets the symbolic name.
+ *
+ * @return the name
+ */
public String getName()
{
return name;
}
+ /**
+ * Sets the symbolic name.
+ *
+ * @param name the name
+ */
public void setName( String name )
{
this.name = name;
}
+ /**
+ * Gets the port.
+ *
+ * @return the port
+ */
public int getPort()
{
return port;
}
+ /**
+ * Sets the port.
+ *
+ * @param port the port
+ */
public void setPort( int port )
{
this.port = port;
}
+ /**
+ * Gets the time limit in milliseconds, 0 means no limit.
+ *
+ * @return the time limit
+ */
public int getTimeLimit()
{
return timeLimit;
}
+ /**
+ * Sets the time limit in milliseconds, 0 means no limit.
+ *
+ * @param timeLimit the time limit
+ */
public void setTimeLimit( int timeLimit )
{
this.timeLimit = timeLimit;
}
+ /**
+ * Checks if base DNs should be fetched.
+ * If true the base DNs are fetched from the namingContexts
+ * attribute of the Root DSE.
+ *
+ * @return true, if base DNs should be fetched
+ */
public boolean isFetchBaseDNs()
{
return fetchBaseDNs;
}
+ /**
+ * Sets the fetch base DNs flag.
+ * If true the base DNs are fetched from the namingContexts
+ * attribute of the Root DSE.
+ *
+ * @param fetchBaseDNs the fetch base DNs flag
+ */
public void setFetchBaseDNs( boolean fetchBaseDNs )
{
this.fetchBaseDNs = fetchBaseDNs;
}
+ /**
+ * Sets the bind DN.
+ *
+ * @param bindDN the bind DN
+ *
+ * @deprecated use setBindPrincipal( String ) instead
+ */
public void setBindDN( DN bindDN )
{
this.setBindPrincipal( bindDN.toString() );
}
+ /**
+ * Gets the bind principal, typically a DN.
+ *
+ * @return the bind principal
+ */
public String getBindPrincipal()
{
return bindPrincipal;
}
+ /**
+ * Sets the bind principal, typically a DN.
+ *
+ * @param bindPrincipal the bind principal
+ */
public void setBindPrincipal( String bindPrincipal )
{
this.bindPrincipal = bindPrincipal;
}
+ /**
+ * Gets the bind password.
+ *
+ * @return the bind password
+ */
public String getBindPassword()
{
return bindPassword;
}
+ /**
+ * Sets the bind password.
+ *
+ * @param bindPassword the bind password
+ */
public void setBindPassword( String bindPassword )
{
this.bindPassword = bindPassword;
}
+ /**
+ * Gets the auth method, one of IConnection.AUTH_ANONYMOUS
+ * or IConnection.AUTH_SIMPLE.
+ *
+ * @return the auth method
+ */
public int getAuthMethod()
{
return authMethod;
}
+ /**
+ * Sets the auth method, one of IConnection.AUTH_ANONYMOUS
+ * or IConnection.AUTH_SIMPLE.
+ *
+ * @param authMethod the auth method
+ */
public void setAuthMethod( int authMethod )
{
this.authMethod = authMethod;
}
+ /**
+ * Gets the connection provider class name.
+ *
+ * @return the connection provider class name
+ */
public String getConnectionProviderClassName()
{
return connectionProviderClassName;
}
+ /**
+ * Sets the connection provider class name.
+ *
+ * @param connectionProviderClassName the connection provider class name
+ */
public void setConnectionProviderClassName( String connectionProviderClassName )
{
this.connectionProviderClassName = connectionProviderClassName;
}
+ /**
+ * Gets the encryption method, one of IConnection.ENCYRPTION_NONE,
+ * IConnection.ENCYRPTION_LDAPS or IConnection.ENCYRPTION_STARTTLS.
+ *
+ * @return the encryption method
+ */
public int getEncryptionMethod()
{
return encryptionMethod;
}
+ /**
+ * Sets the encryption method, one of IConnection.ENCYRPTION_NONE,
+ * IConnection.ENCYRPTION_LDAPS or IConnection.ENCYRPTION_STARTTLS.
+ *
+ * @param encryptionMethod the encryption method
+ */
public void setEncryptionMethod( int encryptionMethod )
{
this.encryptionMethod = encryptionMethod;
}
+ /**
+ * Gets the aliases dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER,
+ * IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING
+ * or IConnection.DEREFERENCE_ALIASES_SEARCH.
+ *
+ * @return the aliases dereferencing method
+ */
public int getAliasesDereferencingMethod()
{
return aliasesDereferencingMethod;
}
+ /**
+ * Sets the aliases dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER,
+ * IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING
+ * or IConnection.DEREFERENCE_ALIASES_SEARCH.
+ *
+ * @param aliasesDereferencingMethod the aliases dereferencing method
+ */
public void setAliasesDereferencingMethod( int aliasesDereferencingMethod )
{
this.aliasesDereferencingMethod = aliasesDereferencingMethod;
}
+ /**
+ * Gets the referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE
+ * or IConnection.HANDLE_REFERRALS_FOLLOW.
+ *
+ * @return the referrals handling method
+ */
public int getReferralsHandlingMethod()
{
return referralsHandlingMethod;
}
+ /**
+ * Sets the referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE or
+ * IConnection.HANDLE_REFERRALS_FOLLOW.
+ *
+ * @param referralsHandlingMethod the referrals handling method
+ */
public void setReferralsHandlingMethod( int referralsHandlingMethod )
{
this.referralsHandlingMethod = referralsHandlingMethod;
Modified: directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/SearchParameter.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/SearchParameter.java?view=diff&rev=498214&r1=498213&r2=498214
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/SearchParameter.java (original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/SearchParameter.java Sat Jan 20 15:58:37 2007
@@ -23,86 +23,169 @@
import java.io.Serializable;
-import org.apache.directory.ldapstudio.browser.core.utils.LdifUtils;
-
+/**
+ * A Bean class to hold the search parameters.
+ * It is used to make searches persistent.
+ *
+ * TODO: check problems with null searchBase, filter and returningAttributes!
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
public class SearchParameter implements Serializable
{
+ /** The serialVersionUID. */
private static final long serialVersionUID = 2447490121520960805L;
+ /** The symbolic name. */
private String name;
+ /** The search base. */
private DN searchBase;
- private String filter = ISearch.FILTER_TRUE;
-
- private String[] returningAttributes = null;
-
- private int scope = ISearch.SCOPE_OBJECT;
-
- private int timeLimit = 0;
-
- private int countLimit = 0;
-
- private int aliasesDereferencingMethod = IConnection.DEREFERENCE_ALIASES_NEVER;
-
- private int referralsHandlingMethod = IConnection.HANDLE_REFERRALS_IGNORE;
-
- private Control[] controls = null;
+ /** The filter. */
+ private String filter;
- private boolean initChildrenFlag = false;
-
- private boolean initAliasAndReferralFlag = false;
+ /** The returning attributes. */
+ private String[] returningAttributes;
+ /** The search scope, one of ISearch.SCOPE_OBJECT, ISearch.SCOPE_ONELEVEL or ISearch.SCOPE_SUBTREE. */
+ private int scope;
+ /** The time limit in milliseconds, 0 means no limit. */
+ private int timeLimit;
+
+ /** The count limit, 0 means no limit. */
+ private int countLimit;
+
+ /** The alias dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING or IConnection.DEREFERENCE_ALIASES_SEARCH. */
+ private int aliasesDereferencingMethod;
+
+ /** The referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE or IConnection.HANDLE_REFERRALS_FOLLOW. */
+ private int referralsHandlingMethod;
+
+ /** The controls */
+ private Control[] controls;
+
+ /** Flag indicating wether the hasChildren flag of IEntry should be initialized */
+ private boolean initChildrenFlag;
+
+ /** Flag indicating wether the isAlias and isReferral flag of IEntry should be initialized */
+ private boolean initAliasAndReferralFlag;
+
+
+ /**
+ * Creates a new instance of SearchParameter with default search parameters:
+ * <ul>
+ * <li>Filter (objectClass=*)
+ * <li>Object scope
+ * <li>No time limit
+ * <li<No count limit
+ * <li>Never dereference aliases
+ * <li>Ignore referrals
+ * <li>No controls
+ * <li>Don't initialize hasChildren flag
+ * <li>Don't initialize isAlias and isReferral flag
+ * </ul>
+ */
public SearchParameter()
{
+ filter = ISearch.FILTER_TRUE;
+ scope = ISearch.SCOPE_OBJECT;
+ timeLimit = 0;
+ countLimit = 0;
+ aliasesDereferencingMethod = IConnection.DEREFERENCE_ALIASES_NEVER;
+ referralsHandlingMethod = IConnection.HANDLE_REFERRALS_IGNORE;
+ controls = null;
+ initChildrenFlag = false;
+ initAliasAndReferralFlag = false;
}
+ /**
+ * Gets the count limit, 0 means no limit.
+ *
+ * @return the count limit
+ */
public int getCountLimit()
{
return countLimit;
}
+ /**
+ * Sets the count limit, 0 means no limit.
+ *
+ * @param countLimit the count limit
+ */
public void setCountLimit( int countLimit )
{
this.countLimit = countLimit;
}
+ /**
+ * Gets the filter.
+ *
+ * @return the filter
+ */
public String getFilter()
{
return filter;
}
+ /**
+ * Sets the filter.
+ *
+ * @param filter the filter
+ */
public void setFilter( String filter )
{
this.filter = filter;
}
+ /**
+ * Gets the symbolic name.
+ *
+ * @return the name
+ */
public String getName()
{
return name;
}
+ /**
+ * Sets the symbolic name.
+ *
+ * @param name the name
+ */
public void setName( String name )
{
this.name = name;
}
+ /**
+ * Gets the returning attributes.
+ *
+ * @return the returning attributes
+ */
public String[] getReturningAttributes()
{
return returningAttributes;
}
+ /**
+ * Sets the returning attributes.
+ *
+ * @param returningAttributes the returning attributes
+ */
public void setReturningAttributes( String[] returningAttributes )
{
if ( returningAttributes == null )
@@ -115,66 +198,127 @@
}
+ /**
+ * Gets the scope, one of ISearch.SCOPE_OBJECT,
+ * ISearch.SCOPE_ONELEVEL or ISearch.SCOPE_SUBTREE.
+ *
+ * @return the scope
+ */
public int getScope()
{
return scope;
}
+ /**
+ * Sets the scope, one of ISearch.SCOPE_OBJECT,
+ * ISearch.SCOPE_ONELEVEL or ISearch.SCOPE_SUBTREE.
+ *
+ * @param scope the scope
+ */
public void setScope( int scope )
{
this.scope = scope;
}
+ /**
+ * Gets the aliases dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER,
+ * IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING
+ * or IConnection.DEREFERENCE_ALIASES_SEARCH.
+ *
+ * @return the aliases dereferencing method
+ */
public int getAliasesDereferencingMethod()
{
return aliasesDereferencingMethod;
}
+ /**
+ * Sets the aliases dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER,
+ * IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING
+ * or IConnection.DEREFERENCE_ALIASES_SEARCH.
+ *
+ * @param aliasesDereferencingMethod the aliases dereferencing method
+ */
public void setAliasesDereferencingMethod( int aliasesDereferencingMethod )
{
this.aliasesDereferencingMethod = aliasesDereferencingMethod;
}
+ /**
+ * Gets the referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE
+ * or IConnection.HANDLE_REFERRALS_FOLLOW.
+ *
+ * @return the referrals handling method
+ */
public int getReferralsHandlingMethod()
{
return referralsHandlingMethod;
}
+ /**
+ * Sets the referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE or
+ * IConnection.HANDLE_REFERRALS_FOLLOW.
+ *
+ * @param referralsHandlingMethod the referrals handling method
+ */
public void setReferralsHandlingMethod( int referralsHandlingMethod )
{
this.referralsHandlingMethod = referralsHandlingMethod;
}
+ /**
+ * Gets the search base.
+ *
+ * @return the search base
+ */
public DN getSearchBase()
{
return searchBase;
}
+ /**
+ * Sets the search base.
+ *
+ * @param searchBase the search base
+ */
public void setSearchBase( DN searchBase )
{
this.searchBase = searchBase;
}
+ /**
+ * Gets the time limit in milliseconds, 0 means no limit.
+ *
+ * @return the time limit
+ */
public int getTimeLimit()
{
return timeLimit;
}
+ /**
+ * Sets the time limit in milliseconds, 0 means no limit.
+ *
+ * @param timeLimit the time limit
+ */
public void setTimeLimit( int timeLimit )
{
this.timeLimit = timeLimit;
}
+ /**
+ * {@inheritDoc}
+ */
public Object clone()
{
SearchParameter clone = new SearchParameter();
@@ -194,78 +338,66 @@
}
- public String getURL()
- {
- // ldap://host:port/dn?attributes?scope?filter?extensions
- StringBuffer sb = new StringBuffer();
-
- sb.append( LdifUtils.urlEncode( searchBase.toString() ) );
-
- sb.append( '?' );
-
- for ( int i = 0; returningAttributes != null && i < returningAttributes.length; i++ )
- {
- sb.append( LdifUtils.urlEncode( returningAttributes[i] ) );
- if ( i + 1 < returningAttributes.length )
- sb.append( ',' );
- }
-
- sb.append( '?' );
-
- if ( scope == ISearch.SCOPE_OBJECT )
- {
- sb.append( "base" ); //$NON-NLS-1$
- }
- else if ( scope == ISearch.SCOPE_ONELEVEL )
- {
- sb.append( "one" ); //$NON-NLS-1$
- }
- else if ( scope == ISearch.SCOPE_SUBTREE )
- {
- sb.append( "sub" ); //$NON-NLS-1$
- }
-
- sb.append( '?' );
-
- if ( filter != null )
- {
- sb.append( LdifUtils.urlEncode( filter ) );
- }
-
- return sb.toString();
- }
-
-
+ /**
+ * Checks if the hasChildren flag of IEntry should be initialized.
+ *
+ * @return true, if the hasChildren flag of IEntry should be initialized
+ */
public boolean isInitAliasAndReferralFlag()
{
return initAliasAndReferralFlag;
}
+ /**
+ * Sets if the hasChildren flag of IEntry should be initialized.
+ *
+ * @param initAliasAndReferralFlag the init alias and referral flag
+ */
public void setInitAliasAndReferralFlag( boolean initAliasAndReferralFlag )
{
this.initAliasAndReferralFlag = initAliasAndReferralFlag;
}
+ /**
+ * Checks if the hasChildren flag of IEntry should be initialized.
+ *
+ * @return true, if the hasChildren flag of IEntry should be initialized
+ */
public boolean isInitChildrenFlag()
{
return initChildrenFlag;
}
+ /**
+ * Sets if the hasChildren flag of IEntry should be initialized.
+ *
+ * @param initChildrenFlag the init children flag
+ */
public void setInitChildrenFlag( boolean initChildrenFlag )
{
this.initChildrenFlag = initChildrenFlag;
}
+ /**
+ * Gets the controls.
+ *
+ * @return the controls
+ */
public Control[] getControls()
{
return controls;
}
+ /**
+ * Sets the controls.
+ *
+ * @param controls the controls
+ */
public void setControls( Control[] controls )
{
this.controls = controls;