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 2008/09/01 23:48:26 UTC
svn commit: r691070 [2/3] - in /directory/studio/trunk:
connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/
ldapbrowser-common/resources/icons/
ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/comm...
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java Mon Sep 1 14:48:25 2008
@@ -32,15 +32,20 @@
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.SearchResult;
+import javax.naming.ldap.Control;
+import javax.naming.ldap.PagedResultsResponseControl;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
import org.apache.directory.studio.ldapbrowser.core.model.ConnectionException;
import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
+import org.apache.directory.studio.ldapbrowser.core.model.StudioPagedResultsControl;
import org.apache.directory.studio.ldapbrowser.core.utils.AttributeComparator;
import org.apache.directory.studio.ldapbrowser.core.utils.JNDIUtils;
import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
@@ -78,7 +83,8 @@
* @param browserConnection the browser connection
* @param searchParameter the search parameter
*/
- public ExportLdifJob( String exportLdifFilename, IBrowserConnection browserConnection, SearchParameter searchParameter )
+ public ExportLdifJob( String exportLdifFilename, IBrowserConnection browserConnection,
+ SearchParameter searchParameter )
{
this.exportLdifFilename = exportLdifFilename;
this.browserConnection = browserConnection;
@@ -140,15 +146,15 @@
}
-
- private static void export( IBrowserConnection browserConnection, SearchParameter searchParameter, BufferedWriter bufferedWriter,
- int count, StudioProgressMonitor monitor ) throws IOException, ConnectionException
+ private static void export( IBrowserConnection browserConnection, SearchParameter searchParameter,
+ BufferedWriter bufferedWriter, int count, StudioProgressMonitor monitor ) throws IOException,
+ ConnectionException
{
try
{
AttributeComparator comparator = new AttributeComparator( browserConnection );
JndiLdifEnumeration enumeration = search( browserConnection, searchParameter, monitor );
-
+
while ( !monitor.isCanceled() && enumeration.hasNext() )
{
LdifContainer container = enumeration.next();
@@ -182,8 +188,8 @@
}
catch ( ConnectionException ce )
{
- if ( ce.getLdapStatusCode() == ConnectionException.STAUS_CODE_TIMELIMIT_EXCEEDED
- || ce.getLdapStatusCode() == ConnectionException.STAUS_CODE_SIZELIMIT_EXCEEDED
+ if ( ce.getLdapStatusCode() == ConnectionException.STAUS_CODE_TIMELIMIT_EXCEEDED
+ || ce.getLdapStatusCode() == ConnectionException.STAUS_CODE_SIZELIMIT_EXCEEDED
|| ce.getLdapStatusCode() == ConnectionException.STAUS_CODE_ADMINLIMIT_EXCEEDED )
{
// ignore
@@ -201,31 +207,38 @@
return BrowserCoreMessages.jobs__export_ldif_error;
}
-
- static JndiLdifEnumeration search( IBrowserConnection browserConnection, SearchParameter parameter, StudioProgressMonitor monitor )
- throws ConnectionException
- {
- NamingEnumeration<SearchResult> result = SearchRunnable.search( browserConnection, parameter, monitor );
-
- if(monitor.errorsReported())
+
+ static JndiLdifEnumeration search( IBrowserConnection browserConnection, SearchParameter parameter,
+ StudioProgressMonitor monitor ) throws ConnectionException
+ {
+ StudioNamingEnumeration result = SearchRunnable.search( browserConnection, parameter, monitor );
+
+ if ( monitor.errorsReported() )
{
throw JNDIUtils.createConnectionException( null, monitor.getException() );
}
- return new JndiLdifEnumeration( result, parameter );
+ return new JndiLdifEnumeration( result, browserConnection, parameter, monitor );
}
-
+
static class JndiLdifEnumeration implements LdifEnumeration
{
- private NamingEnumeration<SearchResult> enumeration;
+ private StudioNamingEnumeration enumeration;
+
+ private IBrowserConnection browserConnection;
private SearchParameter parameter;
+ private StudioProgressMonitor monitor;
+
- public JndiLdifEnumeration( NamingEnumeration<SearchResult> enumeration, SearchParameter parameter )
+ public JndiLdifEnumeration( StudioNamingEnumeration enumeration, IBrowserConnection browserConnection,
+ SearchParameter parameter, StudioProgressMonitor monitor )
{
this.enumeration = enumeration;
+ this.browserConnection = browserConnection;
this.parameter = parameter;
+ this.monitor = monitor;
}
@@ -233,7 +246,42 @@
{
try
{
- return enumeration != null && enumeration.hasMore();
+ if ( enumeration != null )
+ {
+ if ( enumeration.hasMore() )
+ {
+ return true;
+ }
+
+ Control[] jndiControls = enumeration.getResponseControls();
+ if ( jndiControls != null )
+ {
+ for ( Control jndiControl : jndiControls )
+ {
+ if ( jndiControl instanceof PagedResultsResponseControl )
+ {
+ PagedResultsResponseControl prrc = ( PagedResultsResponseControl ) jndiControl;
+ byte[] cookie = prrc.getCookie();
+ if ( cookie != null )
+ {
+ // search again: pass the response cookie to the request control
+ for ( StudioControl studioControl : parameter.getControls() )
+ {
+ if ( studioControl instanceof StudioPagedResultsControl )
+ {
+ StudioPagedResultsControl sprc = ( StudioPagedResultsControl ) studioControl;
+ sprc.setCookie( cookie );
+ }
+ }
+ enumeration = SearchRunnable.search( browserConnection, parameter, monitor );
+ return enumeration != null && enumeration.hasMore();
+ }
+ }
+ }
+ }
+ }
+
+ return false;
}
catch ( NamingException e )
{
@@ -281,5 +329,5 @@
}
}
}
-
+
}
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesRunnable.java Mon Sep 1 14:48:25 2008
@@ -269,7 +269,7 @@
0, aliasesDereferencingMethod, referralsHandlingMethod, false, null );
SearchRunnable.searchAndUpdateModel( entry.getBrowserConnection(), search, monitor );
- // set initialized state
+ // we requested all attributes, set initialized state
entry.setAttributesInitialized( true );
}
}
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenRunnable.java Mon Sep 1 14:48:25 2008
@@ -26,21 +26,22 @@
import java.util.List;
import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
-import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
+import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
+import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
import org.apache.directory.studio.ldapbrowser.core.events.ChildrenInitializedEvent;
import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
-import org.apache.directory.studio.ldapbrowser.core.model.Control;
import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
+import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
+import org.apache.directory.studio.ldapbrowser.core.model.StudioPagedResultsControl;
import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
import org.apache.directory.studio.ldapbrowser.core.model.impl.AliasBaseEntry;
import org.apache.directory.studio.ldapbrowser.core.model.impl.Search;
@@ -58,6 +59,9 @@
/** The entries. */
private IEntry[] entries;
+ /** The paged search control, only used internally. */
+ private StudioControl pagedSearchControl;
+
/**
* Creates a new instance of InitializeChildrenRunnable.
@@ -71,6 +75,20 @@
/**
+ * Creates a new instance of InitializeChildrenRunnable.
+ *
+ * @param entry the entry
+ * @param pagedSearchControl the paged search control
+ */
+ private InitializeChildrenRunnable( IEntry entry, StudioControl pagedSearchControl )
+ {
+ this.entries = new IEntry[]
+ { entry };
+ this.pagedSearchControl = pagedSearchControl;
+ }
+
+
+ /**
* {@inheritDoc}
*/
public Connection[] getConnections()
@@ -122,15 +140,22 @@
monitor.beginTask( " ", entries.length + 2 ); //$NON-NLS-1$
monitor.reportProgress( " " ); //$NON-NLS-1$
- for ( int pi = 0; pi < entries.length && !monitor.isCanceled(); pi++ )
+ for ( IEntry entry : entries )
{
monitor.setTaskName( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_task, new String[]
- { this.entries[pi].getDn().getUpName() } ) );
+ { entry.getDn().getUpName() } ) );
monitor.worked( 1 );
- if ( entries[pi].getBrowserConnection() != null && entries[pi].isDirectoryEntry() )
+ IBrowserConnection browserConnection = entry.getBrowserConnection();
+ if ( browserConnection != null && entry.isDirectoryEntry() )
{
- initializeChildren( entries[pi], monitor );
+ if ( pagedSearchControl == null && browserConnection.isPagedSearch() )
+ {
+ pagedSearchControl = new StudioPagedResultsControl( browserConnection.getPagedSearchSize(), null,
+ false, browserConnection.isPagedSearchScrollMode() );
+ }
+
+ initializeChildren( entry, monitor, pagedSearchControl );
}
}
}
@@ -141,12 +166,11 @@
*/
public void runNotification()
{
- for ( int pi = 0; pi < entries.length; pi++ )
+ for ( IEntry entry : entries )
{
- IEntry parent = entries[pi];
- if ( parent.getBrowserConnection() != null && parent.isDirectoryEntry() )
+ if ( entry.getBrowserConnection() != null && entry.isDirectoryEntry() )
{
- EventRegistry.fireEntryUpdated( new ChildrenInitializedEvent( parent ), this );
+ EventRegistry.fireEntryUpdated( new ChildrenInitializedEvent( entry ), this );
}
}
}
@@ -157,8 +181,10 @@
*
* @param parent the parent
* @param monitor the progress monitor
+ * @param pagedSearchControl the paged search control
*/
- public static void initializeChildren( IEntry parent, StudioProgressMonitor monitor )
+ private static void initializeChildren( IEntry parent, StudioProgressMonitor monitor,
+ StudioControl pagedSearchControl )
{
if ( parent instanceof IRootDSE )
{
@@ -172,73 +198,95 @@
{ parent.getDn().getUpName() } ) );
// clear old children
- IEntry[] oldChildren = parent.getChildren();
- for ( int i = 0; oldChildren != null && i < oldChildren.length; i++ )
- {
- if ( oldChildren[i] != null )
- {
- parent.deleteChild( oldChildren[i] );
- }
- }
- parent.setChildrenInitialized( false );
+ clearParent( parent );
- // determine alias and referral handling
- SearchScope scope = SearchScope.ONELEVEL;
- AliasDereferencingMethod aliasesDereferencingMethod = parent.getBrowserConnection()
- .getAliasesDereferencingMethod();
- if ( parent.isAlias() )
- {
- aliasesDereferencingMethod = AliasDereferencingMethod.NEVER;
- }
- ReferralHandlingMethod referralsHandlingMethod = parent.getBrowserConnection().getReferralsHandlingMethod();
- if ( parent.isReferral() )
- {
- referralsHandlingMethod = ReferralHandlingMethod.MANAGE;
- }
- Control[] controls = null;
+ // create search
+ ISearch search = createSearch( parent, pagedSearchControl, false );
- // get children,
- ISearch search = new Search( null, parent.getBrowserConnection(), parent.getDn(), parent
- .getChildrenFilter(), ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(),
- parent.getBrowserConnection().getTimeLimit(), aliasesDereferencingMethod, referralsHandlingMethod,
- BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
- BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), controls );
- SearchRunnable.searchAndUpdateModel( parent.getBrowserConnection(), search, monitor );
- ISearchResult[] srs = search.getSearchResults();
- monitor.reportProgress( BrowserCoreMessages
- .bind( BrowserCoreMessages.jobs__init_entries_progress_subcount,
- new String[]
- { srs == null ? Integer.toString( 0 ) : Integer.toString( srs.length ),
- parent.getDn().getUpName() } ) );
+ // search
+ ISearchResult[] srs = executeSearch( parent, search, monitor );
// fill children in search result
if ( srs != null && srs.length > 0 )
{
// clearing old children before filling new children is
// necessary to handle aliases and referrals.
- IEntry[] connChildren = parent.getChildren();
- for ( int i = 0; connChildren != null && i < connChildren.length; i++ )
+ clearParent( parent );
+
+ do
{
- if ( connChildren[i] != null )
+ for ( ISearchResult searchResult : srs )
{
- parent.deleteChild( connChildren[i] );
+ if ( parent.isAlias() && !( searchResult.getEntry() instanceof AliasBaseEntry ) )
+ {
+ AliasBaseEntry aliasBaseEntry = new AliasBaseEntry( searchResult.getEntry()
+ .getBrowserConnection(), searchResult.getEntry().getDn() );
+ parent.addChild( aliasBaseEntry );
+ }
+ else
+ {
+ parent.addChild( searchResult.getEntry() );
+ }
}
- }
- parent.setChildrenInitialized( false );
+ srs = null;
- for ( int i = 0; srs != null && i < srs.length; i++ )
- {
- if ( parent.isAlias() && !( srs[i].getEntry() instanceof AliasBaseEntry ) )
+ StudioPagedResultsControl sprRequestControl = null;
+ StudioPagedResultsControl sprResponseControl = null;
+ for ( StudioControl responseControl : search.getResponseControls() )
{
- AliasBaseEntry aliasBaseEntry = new AliasBaseEntry( srs[i].getEntry().getBrowserConnection(),
- srs[i].getEntry().getDn() );
- parent.addChild( aliasBaseEntry );
+ if ( responseControl instanceof StudioPagedResultsControl )
+ {
+ sprResponseControl = ( StudioPagedResultsControl ) responseControl;
+ }
}
- else
+ for ( StudioControl requestControl : search.getControls() )
{
- parent.addChild( srs[i].getEntry() );
+ if ( requestControl instanceof StudioPagedResultsControl )
+ {
+ sprRequestControl = ( StudioPagedResultsControl ) requestControl;
+ }
+ }
+
+ if ( sprRequestControl != null && sprResponseControl != null )
+ {
+ if ( sprRequestControl.isScrollMode() )
+ {
+ if ( sprRequestControl.getCookie() != null )
+ {
+ // create top page search runnable, same as original search
+ InitializeChildrenRunnable topPageChildrenRunnable = new InitializeChildrenRunnable(
+ parent, null );
+ parent.setTopPageChildrenRunnable( topPageChildrenRunnable );
+ }
+
+ if ( sprResponseControl.getCookie() != null )
+ {
+ StudioPagedResultsControl newSprc = new StudioPagedResultsControl( sprRequestControl
+ .getSize(), sprResponseControl.getCookie(), sprRequestControl.isCritical(),
+ sprRequestControl.isScrollMode() );
+ InitializeChildrenRunnable nextPageChildrenRunnable = new InitializeChildrenRunnable(
+ parent, newSprc );
+ parent.setNextPageChildrenRunnable( nextPageChildrenRunnable );
+ }
+ }
+ else
+ {
+ // transparently continue search, till count limit is reached
+ if ( sprResponseControl.getCookie() != null
+ && ( search.getCountLimit() == 0 || search.getSearchResults().length < search
+ .getCountLimit() ) )
+ {
+
+ search.setSearchResults( new ISearchResult[0] );
+ search.getResponseControls().clear();
+ sprRequestControl.setCookie( sprResponseControl.getCookie() );
+
+ srs = executeSearch( parent, search, monitor );
+ }
+ }
}
}
+ while ( srs != null && srs.length > 0 );
}
else
{
@@ -246,29 +294,17 @@
}
// get sub-entries
- ISearch subSearch = new Search( null, parent.getBrowserConnection(), parent.getDn(), parent
- .getChildrenFilter() != null ? parent.getChildrenFilter() : ISearch.FILTER_SUBENTRY,
- ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(), parent
- .getBrowserConnection().getTimeLimit(), aliasesDereferencingMethod, referralsHandlingMethod,
- BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
- BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), new Control[]
- { Control.SUBENTRIES_CONTROL } );
+ ISearch subSearch = createSearch( parent, null, true );
if ( parent.getBrowserConnection().isFetchSubentries() )
{
- SearchRunnable.searchAndUpdateModel( parent.getBrowserConnection(), subSearch, monitor );
- ISearchResult[] subSrs = subSearch.getSearchResults();
- monitor.reportProgress( BrowserCoreMessages.bind(
- BrowserCoreMessages.jobs__init_entries_progress_subcount, new String[]
- { subSrs == null ? Integer.toString( 0 ) : Integer.toString( subSrs.length ),
- parent.getDn().getUpName() } ) );
+ ISearchResult[] subSrs = executeSearch( parent, subSearch, monitor );
// fill children in search result
if ( subSrs != null && subSrs.length > 0 )
{
-
- for ( int i = 0; subSrs != null && i < subSrs.length; i++ )
+ for ( ISearchResult searchResult : subSrs )
{
- parent.addChild( subSrs[i].getEntry() );
+ parent.addChild( searchResult.getEntry() );
}
}
}
@@ -282,4 +318,74 @@
}
}
+
+ private static ISearchResult[] executeSearch( IEntry parent, ISearch search, StudioProgressMonitor monitor )
+ {
+ SearchRunnable.searchAndUpdateModel( parent.getBrowserConnection(), search, monitor );
+ ISearchResult[] srs = search.getSearchResults();
+ monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_progress_subcount,
+ new String[]
+ { srs == null ? Integer.toString( 0 ) : Integer.toString( srs.length ), parent.getDn().getUpName() } ) );
+ return srs;
+ }
+
+
+ private static ISearch createSearch( IEntry parent, StudioControl pagedSearchControl, boolean isSubSearch )
+ {
+ // determine alias and referral handling
+ SearchScope scope = SearchScope.ONELEVEL;
+ AliasDereferencingMethod aliasesDereferencingMethod = parent.getBrowserConnection()
+ .getAliasesDereferencingMethod();
+ if ( parent.isAlias() )
+ {
+ aliasesDereferencingMethod = AliasDereferencingMethod.NEVER;
+ }
+ ReferralHandlingMethod referralsHandlingMethod = parent.getBrowserConnection().getReferralsHandlingMethod();
+ if ( parent.isReferral() )
+ {
+ referralsHandlingMethod = ReferralHandlingMethod.MANAGE;
+ }
+
+ if ( !isSubSearch )
+ {
+ ISearch search = new Search( null, parent.getBrowserConnection(), parent.getDn(), parent
+ .getChildrenFilter(), ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(),
+ parent.getBrowserConnection().getTimeLimit(), aliasesDereferencingMethod, referralsHandlingMethod,
+ BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
+ BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), null );
+ if ( pagedSearchControl != null )
+ {
+ search.getSearchParameter().getControls().add( pagedSearchControl );
+ }
+ return search;
+ }
+ else
+ {
+ ISearch subSearch = new Search( null, parent.getBrowserConnection(), parent.getDn(), parent
+ .getChildrenFilter() != null ? parent.getChildrenFilter() : ISearch.FILTER_SUBENTRY,
+ ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(), parent
+ .getBrowserConnection().getTimeLimit(), aliasesDereferencingMethod, referralsHandlingMethod,
+ BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
+ BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), null );
+ subSearch.getSearchParameter().getControls().add( StudioControl.SUBENTRIES_CONTROL );
+ return subSearch;
+ }
+ }
+
+
+ private static void clearParent( IEntry parent )
+ {
+ IEntry[] oldChildren = parent.getChildren();
+ for ( int i = 0; oldChildren != null && i < oldChildren.length; i++ )
+ {
+ if ( oldChildren[i] != null )
+ {
+ parent.deleteChild( oldChildren[i] );
+ }
+ }
+ parent.setChildrenInitialized( false );
+ parent.setTopPageChildrenRunnable( null );
+ parent.setNextPageChildrenRunnable( null );
+ }
+
}
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java Mon Sep 1 14:48:25 2008
@@ -36,16 +36,18 @@
import javax.naming.directory.SearchResult;
import javax.naming.ldap.BasicControl;
import javax.naming.ldap.Control;
+import javax.naming.ldap.PagedResultsResponseControl;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.studio.connection.core.Connection;
import org.apache.directory.studio.connection.core.DnUtils;
-import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
-import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
+import org.apache.directory.studio.connection.core.io.jndi.StudioNamingEnumeration;
import org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult;
+import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
+import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -59,6 +61,8 @@
import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
+import org.apache.directory.studio.ldapbrowser.core.model.StudioPagedResultsControl;
import org.apache.directory.studio.ldapbrowser.core.model.impl.BaseDNEntry;
import org.apache.directory.studio.ldapbrowser.core.model.impl.Entry;
import org.apache.directory.studio.ldapbrowser.core.model.impl.ReferralBaseEntry;
@@ -77,7 +81,10 @@
{
/** The searches. */
- private ISearch[] searches;
+ protected ISearch[] searches;
+
+ /** The searches to perform. */
+ protected ISearch[] searchesToPerform;
/**
@@ -88,6 +95,22 @@
public SearchRunnable( ISearch[] searches )
{
this.searches = searches;
+ this.searchesToPerform = searches;
+ }
+
+
+ /**
+ * Creates a new instance of SearchRunnable.
+ *
+ * @param search the search
+ * @param searchToPerform the search to perform
+ */
+ private SearchRunnable( ISearch search, ISearch searchToPerform )
+ {
+ this.searches = new ISearch[]
+ { search };
+ this.searchesToPerform = new ISearch[]
+ { searchToPerform };
}
@@ -136,6 +159,7 @@
for ( int pi = 0; pi < searches.length; pi++ )
{
ISearch search = searches[pi];
+ ISearch searchToPerform = searchesToPerform[pi];
monitor.setTaskName( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__search_task, new String[]
{ search.getName() } ) );
@@ -143,7 +167,99 @@
if ( search.getBrowserConnection() != null )
{
- searchAndUpdateModel( search.getBrowserConnection(), search, monitor );
+ // reset search results
+ search.setSearchResults( new ISearchResult[0] );
+ search.getResponseControls().clear();
+ search.setNextPageSearchRunnable( null );
+ search.setTopPageSearchRunnable( null );
+ searchToPerform.setSearchResults( new ISearchResult[0] );
+ searchToPerform.setNextPageSearchRunnable( null );
+ searchToPerform.setTopPageSearchRunnable( null );
+ searchToPerform.getResponseControls().clear();
+
+ do
+ {
+ // perform search
+ searchAndUpdateModel( searchToPerform.getBrowserConnection(), searchToPerform, monitor );
+
+ if ( search != searchToPerform )
+ {
+ // merge search results
+ ISearchResult[] sr1 = search.getSearchResults();
+ ISearchResult[] sr2 = searchToPerform.getSearchResults();
+ ISearchResult[] sr = new ISearchResult[sr1.length + sr2.length];
+ System.arraycopy( sr1, 0, sr, 0, sr1.length );
+ System.arraycopy( sr2, 0, sr, sr1.length, sr2.length );
+ search.setSearchResults( sr );
+ }
+ else
+ {
+ // set search results
+ search.setSearchResults( searchToPerform.getSearchResults() );
+ }
+
+ // check response controls
+ ISearch clonedSearch = ( ISearch ) searchToPerform.clone();
+ clonedSearch.getResponseControls().clear();
+ StudioPagedResultsControl sprResponseControl = null;
+ StudioPagedResultsControl sprRequestControl = null;
+ for ( StudioControl responseControl : searchToPerform.getResponseControls() )
+ {
+ if ( responseControl instanceof StudioPagedResultsControl )
+ {
+ sprResponseControl = ( StudioPagedResultsControl ) responseControl;
+ }
+ }
+ for ( Iterator<StudioControl> it = clonedSearch.getControls().iterator(); it.hasNext(); )
+ {
+ StudioControl requestControl = it.next();
+ if ( requestControl instanceof StudioPagedResultsControl )
+ {
+ sprRequestControl = ( StudioPagedResultsControl ) requestControl;
+ it.remove();
+ }
+ }
+ searchToPerform = null;
+
+ // paged search
+ if ( sprResponseControl != null && sprRequestControl != null )
+ {
+ StudioPagedResultsControl nextSpsc = new StudioPagedResultsControl(
+ sprRequestControl.getSize(), sprResponseControl.getCookie(),
+ sprRequestControl.isCritical(), sprRequestControl.isScrollMode() );
+ ISearch nextPageSearch = ( ISearch ) clonedSearch.clone();
+ nextPageSearch.getResponseControls().clear();
+ nextPageSearch.getControls().add( nextSpsc );
+ if ( sprRequestControl.isScrollMode() )
+ {
+ if ( sprRequestControl.getCookie() != null )
+ {
+ // create top page search runnable, same as original search
+ ISearch topPageSearch = ( ISearch ) search.clone();
+ topPageSearch.getResponseControls().clear();
+ SearchRunnable topPageSearchRunnable = new SearchRunnable( search, topPageSearch );
+ search.setTopPageSearchRunnable( topPageSearchRunnable );
+ }
+ if ( sprResponseControl.getCookie() != null )
+ {
+ // create next page search runnable
+ SearchRunnable nextPageSearchRunnable = new SearchRunnable( search, nextPageSearch );
+ search.setNextPageSearchRunnable( nextPageSearchRunnable );
+ }
+ }
+ else
+ {
+ // transparently continue search, till count limit is reached
+ if ( sprResponseControl.getCookie() != null
+ && ( search.getCountLimit() == 0 || search.getSearchResults().length < search
+ .getCountLimit() ) )
+ {
+ searchToPerform = nextPageSearch;
+ }
+ }
+ }
+ }
+ while ( searchToPerform != null );
}
}
}
@@ -184,10 +300,6 @@
{
if ( browserConnection.getConnection() == null )
{
- if ( search != null )
- {
- search.setSearchResults( new ISearchResult[0] );
- }
return;
}
@@ -199,31 +311,24 @@
SearchParameter searchParameter = getSearchParameter( search );
ArrayList<ISearchResult> searchResultList = new ArrayList<ISearchResult>();
+ StudioNamingEnumeration enumeration = null;
+ // search
try
{
- // search
- NamingEnumeration<SearchResult> enumeration = search( browserConnection, searchParameter, monitor );
+ enumeration = search( browserConnection, searchParameter, monitor );
// iterate through the search result
while ( !monitor.isCanceled() && enumeration != null && enumeration.hasMore() )
{
- SearchResult sr = enumeration.next();
+ StudioSearchResult sr = enumeration.next();
LdapDN dn = JNDIUtils.getDn( sr );
- boolean isReferral = false;
- IBrowserConnection resultBrowserConnection = browserConnection;
- if ( sr instanceof StudioSearchResult )
- {
- StudioSearchResult ssr = ( StudioSearchResult ) sr;
-
- isReferral = ssr.isReferral();
-
- Connection connection = ssr.getConnection();
- IBrowserConnection bc = BrowserCorePlugin.getDefault().getConnectionManager()
- .getBrowserConnection( connection );
- if ( bc != null )
- {
- resultBrowserConnection = bc;
- }
+ boolean isReferral = sr.isReferral();
+ Connection resultConnection = sr.getConnection();
+ IBrowserConnection resultBrowserConnection = BrowserCorePlugin.getDefault()
+ .getConnectionManager().getBrowserConnection( resultConnection );
+ if ( resultBrowserConnection == null )
+ {
+ resultBrowserConnection = browserConnection;
}
// get entry from cache or create it
@@ -268,6 +373,43 @@
}
}
+ // check for response controls
+ try
+ {
+ if ( enumeration != null )
+ {
+ Control[] jndiControls = enumeration.getResponseControls();
+ if ( jndiControls != null )
+ {
+ for ( Control jndiControl : jndiControls )
+ {
+ if ( jndiControl instanceof PagedResultsResponseControl )
+ {
+ PagedResultsResponseControl prrc = ( PagedResultsResponseControl ) jndiControl;
+ StudioPagedResultsControl studioControl = new StudioPagedResultsControl( prrc
+ .getResultSize(), prrc.getCookie(), prrc.isCritical(), false );
+ search.getResponseControls().add( studioControl );
+
+ search.setCountLimitExceeded( prrc.getCookie() != null );
+ }
+ else
+ {
+ StudioControl studioControl = new StudioControl();
+ studioControl.setOid( jndiControl.getID() );
+ studioControl.setCritical( jndiControl.isCritical() );
+ studioControl.setControlValue( jndiControl.getEncodedValue() );
+ search.getResponseControls().add( studioControl );
+ }
+ }
+ }
+ }
+ }
+ catch ( Exception e )
+ {
+ ConnectionException ce = JNDIUtils.createConnectionException( searchParameter, e );
+ monitor.reportError( ce );
+ }
+
monitor.reportProgress( searchResultList.size() == 1 ? BrowserCoreMessages.model__retrieved_1_entry
: BrowserCoreMessages.bind( BrowserCoreMessages.model__retrieved_n_entries, new String[]
{ Integer.toString( searchResultList.size() ) } ) );
@@ -288,7 +430,7 @@
}
- static NamingEnumeration<SearchResult> search( IBrowserConnection browserConnection, SearchParameter parameter,
+ static StudioNamingEnumeration search( IBrowserConnection browserConnection, SearchParameter parameter,
StudioProgressMonitor monitor )
{
if ( browserConnection == null )
@@ -324,19 +466,20 @@
AliasDereferencingMethod aliasesDereferencingMethod = parameter.getAliasesDereferencingMethod();
ReferralHandlingMethod referralsHandlingMethod = parameter.getReferralsHandlingMethod();
- Control[] ldapControls = null;
+ Control[] jndiControls = null;
if ( parameter.getControls() != null )
{
- org.apache.directory.studio.ldapbrowser.core.model.Control[] ctls = parameter.getControls();
- ldapControls = new Control[ctls.length];
- for ( int i = 0; i < ctls.length; i++ )
+ List<StudioControl> ctls = parameter.getControls();
+ jndiControls = new Control[ctls.size()];
+ for ( int i = 0; i < ctls.size(); i++ )
{
- ldapControls[i] = new BasicControl( ctls[i].getOid(), ctls[i].isCritical(), ctls[i].getControlValue() );
+ StudioControl ctl = ctls.get( i );
+ jndiControls[i] = new BasicControl( ctl.getOid(), ctl.isCritical(), ctl.getControlValue() );
}
}
- NamingEnumeration<SearchResult> result = browserConnection.getConnection().getJNDIConnectionWrapper().search(
- searchBase, filter, controls, aliasesDereferencingMethod, referralsHandlingMethod, ldapControls, monitor,
+ StudioNamingEnumeration result = browserConnection.getConnection().getJNDIConnectionWrapper().search(
+ searchBase, filter, controls, aliasesDereferencingMethod, referralsHandlingMethod, jndiControls, monitor,
null );
return result;
}
@@ -404,7 +547,7 @@
if ( searchParameter.getControls() != null )
{
IBrowserConnection connection = search.getBrowserConnection();
- Set<String> suppportedConrolSet = new HashSet<String>();
+ Set<String> supportedConrolSet = new HashSet<String>();
if ( connection.getRootDSE() != null
&& connection.getRootDSE().getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL ) != null )
{
@@ -413,21 +556,19 @@
String[] supportedControls = scAttribute.getStringValues();
for ( int i = 0; i < supportedControls.length; i++ )
{
- suppportedConrolSet.add( supportedControls[i].toLowerCase() );
+ supportedConrolSet.add( supportedControls[i].toLowerCase() );
}
}
- org.apache.directory.studio.ldapbrowser.core.model.Control[] controls = searchParameter.getControls();
- List<org.apache.directory.studio.ldapbrowser.core.model.Control> controlList = new ArrayList<org.apache.directory.studio.ldapbrowser.core.model.Control>();
- for ( int i = 0; i < controls.length; i++ )
+ List<StudioControl> controls = searchParameter.getControls();
+ for ( Iterator<StudioControl> it = controls.iterator(); it.hasNext(); )
{
- if ( suppportedConrolSet.contains( controls[i].getOid().toLowerCase() ) )
+ StudioControl control = it.next();
+ if ( !supportedConrolSet.contains( control.getOid().toLowerCase() ) )
{
- controlList.add( controls[i] );
+ it.remove();
}
}
- searchParameter.setControls( controlList
- .toArray( new org.apache.directory.studio.ldapbrowser.core.model.Control[controlList.size()] ) );
}
return searchParameter;
@@ -558,7 +699,7 @@
}
if ( ( searchParameter.getControls() != null && Arrays.asList( searchParameter.getControls() ).contains(
- org.apache.directory.studio.ldapbrowser.core.model.Control.SUBENTRIES_CONTROL ) )
+ StudioControl.SUBENTRIES_CONTROL ) )
|| ISearch.FILTER_SUBENTRY.equalsIgnoreCase( searchParameter.getFilter() ) )
{
entry.setSubentry( true );
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java Mon Sep 1 14:48:25 2008
@@ -68,6 +68,15 @@
/** The key for the connection parameter "Fetch Sub-entries". */
public static String CONNECTION_PARAMETER_FETCH_SUBENTRIES = "ldapbrowser.fetchSubentries";
+ /** The key for the connection parameter "Paged Search". */
+ public static String CONNECTION_PARAMETER_PAGED_SEARCH = "ldapbrowser.pagedSearch";
+
+ /** The key for the connection parameter "Paged Search Size". */
+ public static String CONNECTION_PARAMETER_PAGED_SEARCH_SIZE = "ldapbrowser.pagedSearchSize";
+
+ /** The key for the connection parameter "Paged Search Scroll Mode". */
+ public static String CONNECTION_PARAMETER_PAGED_SEARCH_SCROLL_MODE = "ldapbrowser.pagedSearchScrollMode";
+
/** The MangageDsaIT control OID. */
public static final String CONTROL_MANAGEDSAIT = "2.16.840.1.113730.3.4.2"; //$NON-NLS-1$
@@ -181,7 +190,7 @@
/**
- * Checks if subentries should be fetched
+ * Checks if subentries should be fetched.
*
* @return the true if subentries should be fetched
*/
@@ -197,6 +206,54 @@
/**
+ * Checks if paged search should be used.
+ *
+ * @return the true if paged search should be used
+ */
+ public abstract boolean isPagedSearch();
+
+
+ /**
+ * Sets if paged search should be used.
+ *
+ * @param pagedSearch true to use paged search
+ */
+ public abstract void setPagedSearch( boolean pagedSearch );
+
+
+ /**
+ * Gets the paged search size.
+ *
+ * @return the paged search size
+ */
+ public abstract int getPagedSearchSize();
+
+
+ /**
+ * Sets the paged search size.
+ *
+ * @param pagedSearchSize the new paged search size
+ */
+ public abstract void setPagedSearchSize( int pagedSearchSize );
+
+
+ /**
+ * Checks if paged search scroll mode should be used.
+ *
+ * @return the true if paged search scroll mode should be used
+ */
+ public abstract boolean isPagedSearchScrollMode();
+
+
+ /**
+ * Sets if paged search scroll mode should be used.
+ *
+ * @param pagedSearch true to use paged search scroll mode
+ */
+ public abstract void setPagedSearchScrollMode( boolean pagedSearchScrollMode );
+
+
+ /**
* Gets the root DSE.
*
* @return the root DSE
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java Mon Sep 1 14:48:25 2008
@@ -23,10 +23,11 @@
import java.io.Serializable;
-import org.apache.directory.shared.ldap.util.LdapURL;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.util.LdapURL;
import org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider;
+import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
import org.apache.directory.studio.ldapbrowser.core.model.schema.Subschema;
import org.apache.directory.studio.ldapbrowser.core.propertypageproviders.EntryPropertyPageProvider;
import org.eclipse.core.runtime.IAdaptable;
@@ -194,8 +195,8 @@
* @return the DN of this entry, never null.
*/
public abstract LdapDN getDn();
-
-
+
+
/**
* Gets the RDN of this entry, never null.
*
@@ -241,16 +242,16 @@
* @return true if this entry's attributes are initialized
*/
public abstract boolean isOperationalAttributesInitialized();
-
-
+
+
/**
* Sets a flag whether this entry's operational attributes are initialized.
*
* @param b the operational attributes initialized flag
*/
public abstract void setOperationalAttributesInitialized( boolean b );
-
-
+
+
/**
* Gets the attributes of the entry.
*
@@ -369,6 +370,38 @@
/**
+ * Gets the runnable used to fetch the top page of children.
+ *
+ * @return the runnable used to fetch the top page of children, null if none
+ */
+ public abstract StudioBulkRunnableWithProgress getTopPageChildrenRunnable();
+
+
+ /**
+ * Sets the runnable used to fetch the top page of children.
+ *
+ * @param moreChildrenRunnable the runnable used to fetch the top page of children
+ */
+ public abstract void setTopPageChildrenRunnable( StudioBulkRunnableWithProgress topPageChildrenRunnable );
+
+
+ /**
+ * Gets the runnable used to fetch the next page of children.
+ *
+ * @return the runnable used to fetch the next page of children, null if none
+ */
+ public abstract StudioBulkRunnableWithProgress getNextPageChildrenRunnable();
+
+
+ /**
+ * Sets the runnable used to fetch the next page of children.
+ *
+ * @param moreChildrenRunnable the runnable used to fetch the next page of children
+ */
+ public abstract void setNextPageChildrenRunnable( StudioBulkRunnableWithProgress nextPageChildrenRunnable );
+
+
+ /**
* Indicates whether this entry has a parent entry. Each entry except
* the root DSE and the base entries should have a parent entry.
*
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java Mon Sep 1 14:48:25 2008
@@ -22,11 +22,13 @@
import java.io.Serializable;
+import java.util.List;
-import org.apache.directory.shared.ldap.util.LdapURL;
import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.util.LdapURL;
import org.apache.directory.studio.connection.core.Connection;
import org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider;
+import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
import org.apache.directory.studio.ldapbrowser.core.propertypageproviders.SearchPropertyPageProvider;
import org.eclipse.core.runtime.IAdaptable;
@@ -145,7 +147,15 @@
*
* @return the controls
*/
- public abstract Control[] getControls();
+ public abstract List<StudioControl> getControls();
+
+
+ /**
+ * Gets the response controls.
+ *
+ * @return the response controls
+ */
+ public abstract List<StudioControl> getResponseControls();
/**
@@ -390,4 +400,36 @@
*/
public abstract void setSearchParameter( SearchParameter searchParameter );
+
+ /**
+ * Gets the next search runnable.
+ *
+ * @return the next search runnable, null if none
+ */
+ public abstract StudioBulkRunnableWithProgress getNextSearchRunnable();
+
+
+ /**
+ * Sets the next search runnable.
+ *
+ * @param nextSearchRunnable the next search runnable
+ */
+ public abstract void setNextPageSearchRunnable( StudioBulkRunnableWithProgress nextSearchRunnable );
+
+
+ /**
+ * Gets the top search runnable.
+ *
+ * @return the top search runnable, null if none
+ */
+ public abstract StudioBulkRunnableWithProgress getTopSearchRunnable();
+
+
+ /**
+ * Sets the top search runnable.
+ *
+ * @param nextSearchRunnable the top search runnable
+ */
+ public abstract void setTopPageSearchRunnable( StudioBulkRunnableWithProgress nextSearchRunnable );
+
}
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java Mon Sep 1 14:48:25 2008
@@ -22,6 +22,8 @@
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
import javax.naming.InvalidNameException;
@@ -72,7 +74,10 @@
private ReferralHandlingMethod referralsHandlingMethod;
/** The controls */
- private Control[] controls;
+ private List<StudioControl> controls;
+
+ /** The response controls */
+ private List<StudioControl> responseControls;
/** Flag indicating weather the hasChildren flag of IEntry should be initialized */
private boolean initHasChildrenFlag;
@@ -92,7 +97,8 @@
* <li>follow referrals
* <li>no initialization of hasChildren flag
* <li>no initialization of isAlias and isReferral flag
- * <li>no controls
+ * <li>no controls
+ * <li>no response controls
* </ul>
*/
public SearchParameter()
@@ -106,7 +112,8 @@
countLimit = 0;
aliasesDereferencingMethod = AliasDereferencingMethod.ALWAYS;
referralsHandlingMethod = ReferralHandlingMethod.FOLLOW;
- controls = null;
+ controls = new ArrayList<StudioControl>();
+ responseControls = new ArrayList<StudioControl>();
initHasChildrenFlag = false;
}
@@ -320,8 +327,8 @@
{
}
}
-
-
+
+
/**
* Gets the time limit in seconds, 0 means no limit.
*
@@ -360,7 +367,7 @@
clone.setAliasesDereferencingMethod( getAliasesDereferencingMethod() );
clone.setReferralsHandlingMethod( getReferralsHandlingMethod() );
clone.setInitHasChildrenFlag( isInitHasChildrenFlag() );
- clone.setControls( getControls() );
+ clone.getControls().addAll( getControls() );
return clone;
}
@@ -392,20 +399,20 @@
*
* @return the controls
*/
- public Control[] getControls()
+ public List<StudioControl> getControls()
{
return controls;
}
/**
- * Sets the controls.
+ * Gets the response controls.
*
- * @param controls the controls
+ * @return the response controls
*/
- public void setControls( Control[] controls )
+ public List<StudioControl> getResponseControls()
{
- this.controls = controls;
+ return responseControls;
}
}
Copied: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioControl.java (from r690676, directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioControl.java?p2=directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioControl.java&p1=directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java&r1=690676&r2=691070&rev=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioControl.java Mon Sep 1 14:48:25 2008
@@ -27,7 +27,7 @@
/**
- * The Control class represents a LDAP control as defined in RFC 4511
+ * The StudioControl class represents a LDAP control as defined in RFC 4511
* <pre>
* Control ::= SEQUENCE {
* controlType LDAPOID,
@@ -38,7 +38,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public class Control implements Serializable
+public class StudioControl implements Serializable
{
/** The serialVersionUID. */
@@ -47,39 +47,39 @@
/**
* The subentries control as defined in RFC 3672.
*/
- public static final Control SUBENTRIES_CONTROL = new Control( "Subentries Control", "1.3.6.1.4.1.4203.1.10.1",
+ public static final StudioControl SUBENTRIES_CONTROL = new StudioControl( "Subentries", "1.3.6.1.4.1.4203.1.10.1",
false, new byte[]
{ 0x01, 0x01, ( byte ) 0xFF } );
/**
* The Manage DSA IT control as defined in RFC 3296.
*/
- public static final Control MANAGEDSAIT_CONTROL = new Control( "Manage DSA IT Control", "2.16.840.1.113730.3.4.2",
- false, null );
+ public static final StudioControl MANAGEDSAIT_CONTROL = new StudioControl( "Manage DSA IT",
+ "2.16.840.1.113730.3.4.2", false, null );
/**
* The Tree Delete control as defined in draft-armijo-ldap-treedelete-02.
*/
- public static final Control TREEDELETE_CONTROL = new Control( "Tree Delete Control", "1.2.840.113556.1.4.805",
+ public static final StudioControl TREEDELETE_CONTROL = new StudioControl( "Tree Delete", "1.2.840.113556.1.4.805",
false, null );
/** The symbolic name. */
- private String name;
+ protected String name;
/** The oid. */
- private String oid;
+ protected String oid;
/** The critical. */
- private boolean critical;
+ protected boolean critical;
/** The control value. */
- private transient byte[] controlValue;
+ protected byte[] controlValue;
/**
* Creates a new instance of Control.
*/
- public Control()
+ public StudioControl()
{
}
@@ -92,7 +92,7 @@
* @param critical the criticality
* @param controlValue the control value
*/
- public Control( String name, String oid, boolean critical, byte[] controlValue )
+ public StudioControl( String name, String oid, boolean critical, byte[] controlValue )
{
super();
this.name = name == null ? "" : name;
@@ -151,7 +151,6 @@
*/
public String toString()
{
-
if ( oid == null )
{
return "";
@@ -163,7 +162,7 @@
s = s.substring( line.getRawControlType().length(), s.length() );
s = s.substring( 0, s.length() - line.getRawNewLine().length() );
- // System.out.println(s);
+ //System.out.println( s );
return s;
}
@@ -216,13 +215,25 @@
/**
* {@inheritDoc}
*/
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + toString().hashCode();
+ return result;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
public boolean equals( Object obj )
{
- if ( obj == null || !( obj instanceof Control ) )
+ if ( obj == null || !( obj instanceof StudioControl ) )
{
return false;
}
- Control other = ( Control ) obj;
+ StudioControl other = ( StudioControl ) obj;
return this.toString().equals( other.toString() );
}
Added: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioPagedResultsControl.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioPagedResultsControl.java?rev=691070&view=auto
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioPagedResultsControl.java (added)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioPagedResultsControl.java Mon Sep 1 14:48:25 2008
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.directory.studio.ldapbrowser.core.model;
+
+
+import java.io.IOException;
+
+import javax.naming.ldap.PagedResultsControl;
+
+
+/**
+ * Implementation of the RFC 2696 Paged Results Control.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class StudioPagedResultsControl extends StudioControl
+{
+
+ /** The serialVersionUID. */
+ private static final long serialVersionUID = -6219375680879062812L;
+
+ /** The OID of Simple Paged Search Control (1.2.840.113556.1.4.319) */
+ public static final String OID = "1.2.840.113556.1.4.319";
+
+ /** The name of Simple Paged Search Control. */
+ public static final String NAME = "Simple Paged Results";
+
+ /** The page size. */
+ private int size;
+
+ /** The cookie. */
+ private byte[] cookie;
+
+ /** The is scroll mode. */
+ private boolean isScrollMode;
+
+
+ /**
+ * Creates a new instance of StudioPagedResultsControl.
+ */
+ public StudioPagedResultsControl()
+ {
+ super();
+ }
+
+
+ /**
+ * Creates a new instance of SimplePagedSearchControl.
+ *
+ * @param size the page size
+ * @param cookie the cookie, may be null
+ * @param critical the critical flag
+ * @param isScrollMode the is scroll mode
+ */
+ public StudioPagedResultsControl( int size, byte[] cookie, boolean critical, boolean isScrollMode )
+ {
+ super( NAME, OID, critical, null );
+ this.size = size;
+ this.cookie = cookie;
+ this.isScrollMode = isScrollMode;
+
+ encode();
+ }
+
+
+ /**
+ * Gets the size.
+ *
+ * @return the size
+ */
+ public int getSize()
+ {
+ return size;
+ }
+
+
+ /**
+ * Sets the size.
+ *
+ * @param size the new size
+ */
+ public void setSize( int size )
+ {
+ this.size = size;
+ encode();
+ }
+
+
+ /**
+ * Gets the cookie.
+ *
+ * @return the cookie
+ */
+ public byte[] getCookie()
+ {
+ return cookie;
+ }
+
+
+ /**
+ * Sets the cookie.
+ *
+ * @param cookie the new cookie
+ */
+ public void setCookie( byte[] cookie )
+ {
+ this.cookie = cookie;
+ encode();
+ }
+
+
+ /**
+ * Checks if is scroll mode.
+ *
+ * @return true, if is scroll mode
+ */
+ public boolean isScrollMode()
+ {
+ return isScrollMode;
+ }
+
+
+ /**
+ * Sets the scroll mode.
+ *
+ * @param isScrollMode the new scroll mode
+ */
+ public void setScrollMode( boolean isScrollMode )
+ {
+ this.isScrollMode = isScrollMode;
+ }
+
+
+ /**
+ * Encodes the size and cookie values.
+ */
+ private void encode()
+ {
+ try
+ {
+ controlValue = new PagedResultsControl( size, cookie, critical ).getEncodedValue();
+ }
+ catch ( IOException e )
+ {
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ( isScrollMode ? 1231 : 1237 );
+ return result;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean equals( Object obj )
+ {
+ if ( obj == null || !( obj instanceof StudioPagedResultsControl ) )
+ {
+ return false;
+ }
+ StudioPagedResultsControl other = ( StudioPagedResultsControl ) obj;
+
+ return this.toString().equals( other.toString() ) && this.isScrollMode == other.isScrollMode;
+ }
+
+}
Propchange: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioPagedResultsControl.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java Mon Sep 1 14:48:25 2008
@@ -28,13 +28,14 @@
import java.util.List;
import java.util.Map;
-import org.apache.directory.shared.ldap.util.LdapURL;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.name.Rdn;
import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
import org.apache.directory.shared.ldap.schema.syntax.ObjectClassDescription;
+import org.apache.directory.shared.ldap.util.LdapURL;
import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
import org.apache.directory.studio.ldapbrowser.core.events.AttributeAddedEvent;
import org.apache.directory.studio.ldapbrowser.core.events.AttributeDeletedEvent;
@@ -195,7 +196,8 @@
}
else
{
- throw new IllegalArgumentException( BrowserCoreMessages.model__attribute_does_not_exist + ": " + attributeToDelete );
+ throw new IllegalArgumentException( BrowserCoreMessages.model__attribute_does_not_exist + ": "
+ + attributeToDelete );
}
}
@@ -460,8 +462,8 @@
AttributeInfo ai = getBrowserConnectionImpl().getAttributeInfo( this );
return ai != null && ai.operationalAttributesInitialized;
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -473,14 +475,14 @@
ai = new AttributeInfo();
getBrowserConnectionImpl().setAttributeInfo( this, ai );
}
-
+
if ( ai != null )
{
ai.operationalAttributesInitialized = b;
}
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -706,6 +708,64 @@
/**
* {@inheritDoc}
*/
+ public void setTopPageChildrenRunnable( StudioBulkRunnableWithProgress topPageChildrenRunnable )
+ {
+ ChildrenInfo ci = getBrowserConnectionImpl().getChildrenInfo( this );
+ if ( ci == null && topPageChildrenRunnable != null )
+ {
+ ci = new ChildrenInfo();
+ getBrowserConnectionImpl().setChildrenInfo( this, ci );
+ }
+
+ if ( ci != null )
+ {
+ ci.topPageChildrenRunnable = topPageChildrenRunnable;
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public StudioBulkRunnableWithProgress getTopPageChildrenRunnable()
+ {
+ ChildrenInfo ci = getBrowserConnectionImpl().getChildrenInfo( this );
+ return ci != null ? ci.topPageChildrenRunnable : null;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNextPageChildrenRunnable( StudioBulkRunnableWithProgress nextPageChildrenRunnable )
+ {
+ ChildrenInfo ci = getBrowserConnectionImpl().getChildrenInfo( this );
+ if ( ci == null && nextPageChildrenRunnable != null )
+ {
+ ci = new ChildrenInfo();
+ getBrowserConnectionImpl().setChildrenInfo( this, ci );
+ }
+
+ if ( ci != null )
+ {
+ ci.nextPageChildrenRunnable = nextPageChildrenRunnable;
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public StudioBulkRunnableWithProgress getNextPageChildrenRunnable()
+ {
+ ChildrenInfo ci = getBrowserConnectionImpl().getChildrenInfo( this );
+ return ci != null ? ci.nextPageChildrenRunnable : null;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
public void setHasChildrenHint( boolean b )
{
if ( b )
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java Mon Sep 1 14:48:25 2008
@@ -103,6 +103,10 @@
connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_FETCH_BASE_DNS, true );
connection.getConnectionParameter().setExtendedProperty( CONNECTION_PARAMETER_BASE_DN, "" );
connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_FETCH_SUBENTRIES, false );
+ connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_PAGED_SEARCH, false );
+ connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_PAGED_SEARCH_SIZE, 100 );
+ connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_PAGED_SEARCH_SCROLL_MODE,
+ true );
}
this.searchManager = new SearchManager( this );
@@ -155,6 +159,11 @@
*/
public IEntry getEntryFromCache( LdapDN dn )
{
+ if ( dn == null )
+ {
+ return null;
+ }
+
String oidDn = Utils.getNormalizedOidString( dn, getSchema() );
if ( dnToEntryCache != null && dnToEntryCache.containsKey( oidDn ) )
{
@@ -318,6 +327,66 @@
/**
* {@inheritDoc}
*/
+ public boolean isPagedSearch()
+ {
+ return connection.getConnectionParameter().getExtendedBoolProperty( CONNECTION_PARAMETER_PAGED_SEARCH );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPagedSearch( boolean pagedSearch )
+ {
+ connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_PAGED_SEARCH, pagedSearch );
+ ConnectionEventRegistry.fireConnectionUpdated( connection, this );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getPagedSearchSize()
+ {
+ return connection.getConnectionParameter().getExtendedIntProperty( CONNECTION_PARAMETER_PAGED_SEARCH_SIZE );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPagedSearchSize( int pagedSearchSize )
+ {
+ connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_PAGED_SEARCH_SIZE,
+ pagedSearchSize );
+ ConnectionEventRegistry.fireConnectionUpdated( connection, this );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isPagedSearchScrollMode()
+ {
+ return connection.getConnectionParameter().getExtendedBoolProperty(
+ CONNECTION_PARAMETER_PAGED_SEARCH_SCROLL_MODE );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPagedSearchScrollMode( boolean pagedSearchScrollMode )
+ {
+ connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_PAGED_SEARCH_SCROLL_MODE,
+ pagedSearchScrollMode );
+ ConnectionEventRegistry.fireConnectionUpdated( connection, this );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
public final IRootDSE getRootDSE()
{
return rootDSE;
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ChildrenInfo.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ChildrenInfo.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ChildrenInfo.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ChildrenInfo.java Mon Sep 1 14:48:25 2008
@@ -24,6 +24,7 @@
import java.io.Serializable;
import java.util.Set;
+import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
@@ -48,6 +49,12 @@
/** The has more children flag. */
protected volatile boolean hasMoreChildren = false;
+ /** The runnable used to fetch the top page of children. */
+ protected StudioBulkRunnableWithProgress topPageChildrenRunnable;
+
+ /** The runnable used to fetch the next page of children. */
+ protected StudioBulkRunnableWithProgress nextPageChildrenRunnable;
+
/**
* Creates a new instance of ChildrenInfo.
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java Mon Sep 1 14:48:25 2008
@@ -21,9 +21,10 @@
package org.apache.directory.studio.ldapbrowser.core.model.impl;
-import org.apache.directory.shared.ldap.util.LdapURL;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
import org.apache.directory.studio.ldapbrowser.core.events.AttributeAddedEvent;
import org.apache.directory.studio.ldapbrowser.core.events.AttributeDeletedEvent;
@@ -109,17 +110,17 @@
{
throw new IllegalStateException( "Connection " + connectionId + " does not exist." );
}
-
+
// always get the fresh entry from cache
delegate = browserConnection.getEntryFromCache( dn );
-
+
if ( delegate != null
&& !delegate.getBrowserConnection().getConnection().getJNDIConnectionWrapper().isConnected() )
{
entryDoesNotExist = false;
delegate = null;
}
-
+
return delegate;
}
@@ -227,8 +228,8 @@
return false;
}
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -477,6 +478,38 @@
/**
* {@inheritDoc}
*/
+ public StudioBulkRunnableWithProgress getTopPageChildrenRunnable()
+ {
+ if ( getDelegate() != null )
+ {
+ return getDelegate().getTopPageChildrenRunnable();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public StudioBulkRunnableWithProgress getNextPageChildrenRunnable()
+ {
+ if ( getDelegate() != null )
+ {
+ return getDelegate().getNextPageChildrenRunnable();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
public boolean hasParententry()
{
if ( getDelegate() != null )
@@ -586,8 +619,8 @@
}
}
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -615,6 +648,30 @@
/**
* {@inheritDoc}
*/
+ public void setTopPageChildrenRunnable( StudioBulkRunnableWithProgress topPageChildrenRunnable )
+ {
+ if ( getDelegate() != null )
+ {
+ getDelegate().setTopPageChildrenRunnable( topPageChildrenRunnable );
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setNextPageChildrenRunnable( StudioBulkRunnableWithProgress nextPageChildrenRunnable )
+ {
+ if ( getDelegate() != null )
+ {
+ getDelegate().setNextPageChildrenRunnable( nextPageChildrenRunnable );
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
public void setHasChildrenHint( boolean b )
{
if ( getDelegate() != null )
@@ -764,7 +821,7 @@
EventRegistry.removeEntryUpdateListener( this );
return;
}
-
+
if ( event.getModifiedEntry() == getDelegate() )
{
if ( event instanceof AttributeAddedEvent )
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java Mon Sep 1 14:48:25 2008
@@ -254,6 +254,57 @@
/**
* {@inheritDoc}
*/
+ public boolean isPagedSearch()
+ {
+ return false;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPagedSearch( boolean pagedSearch )
+ {
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getPagedSearchSize()
+ {
+ return 0;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPagedSearchSize( int pagedSearchSize )
+ {
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isPagedSearchScrollMode()
+ {
+ return false;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setPagedSearchScrollMode( boolean pagedSearchScrollMode )
+ {
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
public LdapURL getUrl()
{
return null;
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java?rev=691070&r1=691069&r2=691070&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java Mon Sep 1 14:48:25 2008
@@ -27,12 +27,13 @@
import java.util.List;
import java.util.Map;
-import org.apache.directory.shared.ldap.util.LdapURL;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.Rdn;
import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
import org.apache.directory.shared.ldap.schema.syntax.ObjectClassDescription;
+import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
import org.apache.directory.studio.ldapbrowser.core.events.AttributeAddedEvent;
import org.apache.directory.studio.ldapbrowser.core.events.AttributeDeletedEvent;
@@ -96,7 +97,8 @@
}
else
{
- this.connectionId = browserConnection.getConnection() != null ? browserConnection.getConnection().getId() : null;
+ this.connectionId = browserConnection.getConnection() != null ? browserConnection.getConnection().getId()
+ : null;
}
this.dn = dn;
@@ -300,6 +302,24 @@
/**
+ * This implementation always returns null.
+ */
+ public StudioBulkRunnableWithProgress getNextPageChildrenRunnable()
+ {
+ return null;
+ }
+
+
+ /**
+ * This implementation always returns null.
+ */
+ public StudioBulkRunnableWithProgress getTopPageChildrenRunnable()
+ {
+ return null;
+ }
+
+
+ /**
* This implementation always returns false.
*/
public boolean hasParententry()
@@ -475,6 +495,22 @@
/**
* This implementation does nothing.
*/
+ public void setTopPageChildrenRunnable( StudioBulkRunnableWithProgress topPageChildrenRunnable )
+ {
+ }
+
+
+ /**
+ * This implementation does nothing.
+ */
+ public void setNextPageChildrenRunnable( StudioBulkRunnableWithProgress nextPageChildrenRunnable )
+ {
+ }
+
+
+ /**
+ * This implementation does nothing.
+ */
public void setHasChildrenHint( boolean b )
{
}