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/06/07 16:17:30 UTC
svn commit: r664342 [2/7] - in /directory/sandbox/seelmann/testingframework:
./ apacheds-configuration-help/src/main/docbook/
apacheds-configuration-help/src/main/resources/html/images/
apacheds-configuration-help/src/main/resources/html/images/getting...
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/0_index.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/0_index.xml?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/0_index.xml (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/0_index.xml Sat Jun 7 07:17:06 2008
@@ -4,11 +4,22 @@
<!ENTITY gettingstarted SYSTEM "1_gettingstarted.xml">
<!ENTITY download_install SYSTEM "1.1_download_install.xml">
<!ENTITY configuration_editor SYSTEM "1.2_configuration_editor.xml">
- <!ENTITY configuration_editor_general SYSTEM "1.2.1_configuration_editor_general.xml">
- <!ENTITY configuration_editor_partitions SYSTEM "1.2.2_configuration_editor_partitions.xml">
- <!ENTITY configuration_editor_interceptors SYSTEM "1.2.3_configuration_editor_interceptors.xml">
- <!ENTITY configuration_editor_extended_operations SYSTEM "1.2.4_configuration_editor_extended_operations.xml">
- <!ENTITY configuration_editor_general SYSTEM "1.2.1_configuration_editor_general.xml">
+ <!ENTITY configuration_editor_1.5.0 SYSTEM "1.2.1_configuration_editor_1.5.0.xml">
+ <!ENTITY configuration_editor_1.5.0_general SYSTEM "1.2.1.1_configuration_editor_1.5.0_general.xml">
+ <!ENTITY configuration_editor_1.5.0_partitions SYSTEM "1.2.1.2_configuration_editor_1.5.0_partitions.xml">
+ <!ENTITY configuration_editor_1.5.0_interceptors SYSTEM "1.2.1.3_configuration_editor_1.5.0_interceptors.xml">
+ <!ENTITY configuration_editor_1.5.0_extended_operations SYSTEM "1.2.1.4_configuration_editor_1.5.0_extended_operations.xml">
+ <!ENTITY configuration_editor_1.5.1 SYSTEM "1.2.2_configuration_editor_1.5.1.xml">
+ <!ENTITY configuration_editor_1.5.1_general SYSTEM "1.2.2.1_configuration_editor_1.5.1_general.xml">
+ <!ENTITY configuration_editor_1.5.1_partitions SYSTEM "1.2.2.2_configuration_editor_1.5.1_partitions.xml">
+ <!ENTITY configuration_editor_1.5.1_interceptors SYSTEM "1.2.2.3_configuration_editor_1.5.1_interceptors.xml">
+ <!ENTITY configuration_editor_1.5.1_extended_operations SYSTEM "1.2.2.4_configuration_editor_1.5.1_extended_operations.xml">
+ <!ENTITY configuration_editor_1.5.2 SYSTEM "1.2.3_configuration_editor_1.5.2.xml">
+ <!ENTITY configuration_editor_1.5.2_general SYSTEM "1.2.3.1_configuration_editor_1.5.2_general.xml">
+ <!ENTITY configuration_editor_1.5.2_authentication SYSTEM "1.2.3.2_configuration_editor_1.5.2_authentication.xml">
+ <!ENTITY configuration_editor_1.5.2_partitions SYSTEM "1.2.3.3_configuration_editor_1.5.2_partitions.xml">
+ <!ENTITY configuration_editor_1.5.2_interceptors SYSTEM "1.2.3.4_configuration_editor_1.5.2_interceptors.xml">
+ <!ENTITY configuration_editor_1.5.2_extended_operations SYSTEM "1.2.3.5_configuration_editor_1.5.2_extended_operations.xml">
<!ENTITY tasks SYSTEM "2_tasks.xml">
<!ENTITY open_server_configuration SYSTEM "2.1_open_server_configuration.xml">
<!ENTITY create_new_server_configuration SYSTEM "2.2_create_new_server_configuration.xml">
@@ -45,29 +56,33 @@
</copyright>
<legalnotice>
<literallayout class="monospaced">
- 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
-
- <ulink url="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</ulink>
-
- 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.
- </literallayout>
- </legalnotice>
+ 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
+
+ <ulink
+ url="http://www.apache.org/licenses/LICENSE-2.0">
+ http://www.apache.org/licenses/LICENSE-2.0
+ </ulink>
+
+ 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.
+ </literallayout>
+ </legalnotice>
</bookinfo>
-
+
&gettingstarted;
&tasks;
&whats_new;
&release_notes;
-
+
</book>
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/1.2_configuration_editor.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/1.2_configuration_editor.xml?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/1.2_configuration_editor.xml (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/1.2_configuration_editor.xml Sat Jun 7 07:17:06 2008
@@ -19,55 +19,44 @@
<section id="configuration_editor">
<title>Configuration Editor</title>
<para>
- The Configuration Editor for Apache DS consists in a 4 pages
- Editor:
+ The Configuration Editor currently supports 3 version of Apache
+ DS. Each version having a specific associated editor.
<itemizedlist spacing="normal" mark="bullet">
<listitem>
The
<emphasis>
- <link linkend="configuration_editor_general">
- General
+ <link linkend="configuration_editor_1.5.0">
+ Editor for Apache DS 1.5.0
</link>
</emphasis>
- page allows you to set "general" settings about the
- server such as the server port, administrator DN,
- password, etc...
+ allows you to edit the 'server.xml' file of an Apache DS
+ version 1.5.0 installation.
</listitem>
<listitem>
The
<emphasis>
- <link linkend="configuration_editor_partitions">
- Partitions
+ <link linkend="configuration_editor_1.5.1">
+ Editor for Apache DS 1.5.1
</link>
</emphasis>
- page allows you to manage your server partitions.
+ allows you to edit the 'server.xml' file of an Apache DS
+ version 1.5.1 installation.
</listitem>
<listitem>
The
<emphasis>
- <link linkend="configuration_editor_interceptors">
- Interceptors
+ <link linkend="configuration_editor_1.5.2">
+ Editor for Apache DS 1.5.2
</link>
</emphasis>
- page allows you to manage your server interceptors.
- </listitem>
- <listitem>
- The
- <emphasis>
- <link
- linkend="configuration_editor_extended_operations">
- Extended Operations
- </link>
- </emphasis>
- page allows you to manage your server extended
- operations handlers.
+ allows you to edit the 'server.xml' file of an Apache DS
+ version 1.5.2 installation.
</listitem>
</itemizedlist>
</para>
- &configuration_editor_general;
- &configuration_editor_partitions;
- &configuration_editor_interceptors;
- &configuration_editor_extended_operations;
+ &configuration_editor_1.5.0;
+ &configuration_editor_1.5.1;
+ &configuration_editor_1.5.2;
</section>
\ No newline at end of file
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/2.2_create_new_server_configuration.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/2.2_create_new_server_configuration.xml?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/2.2_create_new_server_configuration.xml (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/2.2_create_new_server_configuration.xml Sat Jun 7 07:17:06 2008
@@ -52,4 +52,45 @@
</mediaobject>
</screenshot>
</para>
+ <para>The following wizard appears:</para>
+ <para>
+ <screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata scale="50"
+ fileref="images/gettingstarted/new_configuration_3.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </screenshot>
+ </para>
+ <para>Select the Apache DS target version.</para>
+ <para>
+ <informaltable frame="all">
+ <tgroup cols="3">
+ <colspec colname="Option" colwidth="1*" />
+ <colspec colname="Description" colwidth="2*" />
+ <colspec colname="Default" colwidth="1*" />
+ <thead>
+ <row>
+ <entry>Option</entry>
+ <entry>Description</entry>
+ <entry>Default</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Apache DS version</entry>
+ <entry>
+ Each version of Apache DS defines its
+ specific settings and 'server.xml' file
+ format. In order to display the right
+ editor, you need to provide the version of
+ Apache DS you're targeting.
+ </entry>
+ <entry>1.5.2</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
</section>
\ No newline at end of file
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/3_whats_new.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/3_whats_new.xml?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/3_whats_new.xml (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/3_whats_new.xml Sat Jun 7 07:17:06 2008
@@ -17,20 +17,20 @@
under the License.
-->
<chapter id="whats_new">
- <title>What's New</title>
+ <title>What's New in 1.2.0</title>
<simplesect>
- <title>Support for Apache DS 1.5.1</title>
+ <title>Support for Apache DS 1.5.2, 1.5.1 and 1.5.0</title>
<para>
- The Apache DS Configuration plugin now supports the 1.5.1 version of Apache Directory Server.
+ The Apache DS Configuration plugin now supports the 1.5.2,
+ 1.5.1 and 1.5.0 versions of Apache Directory Server.
</para>
<para>
<screenshot>
<mediaobject>
<imageobject>
<imagedata scale="50"
- fileref="images/whats_new_support_apache_ds_151.png"
- format="PNG" />
+ fileref="images/whats_new.png" format="PNG" />
</imageobject>
</mediaobject>
</screenshot>
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/4_release_notes.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/4_release_notes.xml?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/4_release_notes.xml (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration-help/src/main/docbook/4_release_notes.xml Sat Jun 7 07:17:06 2008
@@ -19,6 +19,22 @@
<chapter id="release_notes">
<title>Release notes</title>
<simplesect>
+ <title>Apache Directory Studio 1.2.0 - (2008, XXXXX XX)</title>
+ <para>
+ <emphasis>Task</emphasis>
+ </para>
+ <para>
+ <itemizedlist spacing="normal" mark="bullet">
+ <listitem>
+ <para>
+ [DIRSTUDIO-332] - Add support for 1.5.2 and
+ 1.5.0 server.xml configuration files
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </simplesect>
+ <simplesect>
<title>
Apache Directory Studio 1.1.0 - (2008, march 31st)
</title>
@@ -28,19 +44,36 @@
<para>
<itemizedlist spacing="normal" mark="bullet">
<listitem>
- <para>[DIRSTUDIO-286] - Update Site is not working, missing dependencies in ldifeditor, ldapbrower and schemaeditor feature</para>
+ <para>
+ [DIRSTUDIO-286] - Update Site is not working,
+ missing dependencies in ldifeditor, ldapbrower
+ and schemaeditor feature
+ </para>
</listitem>
<listitem>
- <para>[DIRSTUDIO-284] - Changing "Supported Authentication Mechanism" doesn't set the dirty flag.</para>
+ <para>
+ [DIRSTUDIO-284] - Changing "Supported
+ Authentication Mechanism" doesn't set the dirty
+ flag.
+ </para>
</listitem>
<listitem>
- <para>[DIRSTUDIO-281] - LDIF and Apache DS configuration files can't be saved in RCP mode</para>
+ <para>
+ [DIRSTUDIO-281] - LDIF and Apache DS
+ configuration files can't be saved in RCP mode
+ </para>
</listitem>
<listitem>
- <para>[DIRSTUDIO-253] - cant open server.xml with directory studio</para>
+ <para>
+ [DIRSTUDIO-253] - cant open server.xml with
+ directory studio
+ </para>
</listitem>
<listitem>
- <para>[DIRSTUDIO-239] - Apache DS Configuration Plugin cannot parse server.xml file correctly</para>
+ <para>
+ [DIRSTUDIO-239] - Apache DS Configuration Plugin
+ cannot parse server.xml file correctly
+ </para>
</listitem>
</itemizedlist>
</para>
@@ -50,17 +83,17 @@
<para>
<itemizedlist spacing="normal" mark="bullet">
<listitem>
- <para>[DIRSTUDIO-236] - Update the Apache DS Configuration plugin to work with the server.xml file of Apache DS 1.5.1</para>
+ <para>
+ [DIRSTUDIO-236] - Update the Apache DS
+ Configuration plugin to work with the server.xml
+ file of Apache DS 1.5.1
+ </para>
</listitem>
</itemizedlist>
</para>
</simplesect>
<simplesect>
- <title>
- Version 1.0.0 - (2007, september 3rd)
- </title>
- <para>
- Initial release.
- </para>
+ <title>Version 1.0.0 - (2007, september 3rd)</title>
+ <para>Initial release.</para>
</simplesect>
</chapter>
\ No newline at end of file
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration/META-INF/MANIFEST.MF?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration/META-INF/MANIFEST.MF Sat Jun 7 07:17:06 2008
@@ -3,7 +3,7 @@
Bundle-Name: Apache Directory Studio Apache DS Configuration
Bundle-SymbolicName: org.apache.directory.studio.apacheds.configuration;singleton:=true
Bundle-Version: 1.2.0.SNAPSHOT
-Bundle-Activator: org.apache.directory.studio.apacheds.configuration.Activator
+Bundle-Activator: org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPlugin
Bundle-Vendor: Apache Software Foundation
Bundle-Localization: plugin
Eclipse-LazyStart: true
@@ -14,4 +14,17 @@
org.eclipse.jface.text,
org.eclipse.ui.ide,
org.eclipse.core.resources
+Export-Package: org.apache.directory.studio.apacheds.configuration,
+ org.apache.directory.studio.apacheds.configuration.editor,
+ org.apache.directory.studio.apacheds.configuration.editor.v150,
+ org.apache.directory.studio.apacheds.configuration.editor.v150.dialogs,
+ org.apache.directory.studio.apacheds.configuration.editor.v151,
+ org.apache.directory.studio.apacheds.configuration.editor.v151.dialogs,
+ org.apache.directory.studio.apacheds.configuration.editor.v152,
+ org.apache.directory.studio.apacheds.configuration.editor.v152.dialogs,
+ org.apache.directory.studio.apacheds.configuration.model,
+ org.apache.directory.studio.apacheds.configuration.model.v150,
+ org.apache.directory.studio.apacheds.configuration.model.v151,
+ org.apache.directory.studio.apacheds.configuration.model.v152,
+ org.apache.directory.studio.apacheds.configuration.wizards
Bundle-ClassPath: .
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration/plugin.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration/plugin.xml?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration/plugin.xml (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration/plugin.xml Sat Jun 7 07:17:06 2008
@@ -47,10 +47,10 @@
<extension
point="org.eclipse.ui.newWizards">
<wizard
- canFinishEarly="true"
+ canFinishEarly="false"
category="org.apache.directory.studio.apacheds.configuration.newWizards"
class="org.apache.directory.studio.apacheds.configuration.wizards.NewApacheDSConfigurationFileWizard"
- hasPages="false"
+ hasPages="true"
icon="resources/icons/editor_new.gif"
id="org.apache.directory.studio.apacheds.configuration.NewApacheDSConfigurationFileWizard"
name="Apache DS Configuration File"
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationContentDescriber.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationContentDescriber.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationContentDescriber.java (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/ApacheDSConfigurationContentDescriber.java Sat Jun 7 07:17:06 2008
@@ -24,7 +24,7 @@
import java.io.InputStream;
import java.io.Reader;
-import org.apache.directory.studio.apacheds.configuration.model.ServerConfigurationContentTypeChecker;
+import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIO;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.ITextContentDescriber;
@@ -48,7 +48,7 @@
*/
public int describe( Reader contents, IContentDescription description ) throws IOException
{
- if ( ServerConfigurationContentTypeChecker.isValid( contents ) )
+ if ( isValid( contents ) )
{
return ITextContentDescriber.VALID;
}
@@ -64,7 +64,7 @@
*/
public int describe( InputStream contents, IContentDescription description ) throws IOException
{
- if ( ServerConfigurationContentTypeChecker.isValid( contents ) )
+ if ( isValid( contents ) )
{
return ITextContentDescriber.VALID;
}
@@ -82,4 +82,89 @@
{
return SUPPORTED_OPTIONS;
}
+
+
+ /**
+ * Indicates if the given {@link Reader} is a valid server configuration.
+ *
+ * @param contents
+ * the contents reader
+ * @return
+ * <code>true</code> if the given reader is a valid server
+ * configuration, <code>false</code> if not
+ */
+ private boolean isValid( Reader contents )
+ {
+ // Looping on the ServerXmlIO classes to find a corresponding one
+ ServerXmlIO[] serverXmlIOs = ApacheDSConfigurationPlugin.getDefault().getServerXmlIOs();
+ for ( ServerXmlIO validationServerXmlIO : serverXmlIOs )
+ {
+ // Marking the reader
+ try
+ {
+ contents.mark( -1 );
+ }
+ catch ( IOException e1 )
+ {
+ return false;
+ }
+
+ // Checking if the ServerXmlIO is valid
+ if ( validationServerXmlIO.isValid( contents ) )
+ {
+ return true;
+ }
+
+ // Reseting the reader to the mark
+ try
+ {
+ contents.reset();
+ }
+ catch ( IOException e )
+ {
+ return false;
+ }
+ }
+
+ return false;
+ }
+
+
+ /**
+ * Indicates if the given {@link InputStream} is a valid server configuration.
+ *
+ * @param contents
+ * the contents input stream
+ * @return
+ * <code>true</code> if the given input stream is a valid server
+ * configuration, <code>false</code> if not
+ */
+ private boolean isValid( InputStream contents )
+ {
+ // Looping on the ServerXmlIO classes to find a corresponding one
+ ServerXmlIO[] serverXmlIOs = ApacheDSConfigurationPlugin.getDefault().getServerXmlIOs();
+ for ( ServerXmlIO validationServerXmlIO : serverXmlIOs )
+ {
+ // Marking the input stream
+ contents.mark( -1 );
+
+ // Checking if the ServerXmlIO is valid
+ if ( validationServerXmlIO.isValid( contents ) )
+ {
+ return true;
+ }
+
+ // Reseting the input stream to the mark
+ try
+ {
+ contents.reset();
+ }
+ catch ( IOException e )
+ {
+ return false;
+ }
+ }
+
+ return false;
+ }
}
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/NonExistingServerConfigurationInput.java Sat Jun 7 07:17:06 2008
@@ -67,7 +67,17 @@
*/
public String getToolTipText()
{
- return "New Apache DS Configuration File";
+ switch ( serverConfiguration.getVersion() )
+ {
+ case VERSION_1_5_2:
+ return "New Apache DS 1.5.2 Configuration File";
+ case VERSION_1_5_1:
+ return "New Apache DS 1.5.1 Configuration File";
+ case VERSION_1_5_0:
+ return "New Apache DS 1.5.0 Configuration File";
+ default:
+ return "New Apache DS Configuration File";
+ }
}
@@ -76,7 +86,17 @@
*/
public String getName()
{
- return "Apache DS Configuration";
+ switch ( serverConfiguration.getVersion() )
+ {
+ case VERSION_1_5_2:
+ return "New Apache DS 1.5.2 Configuration File";
+ case VERSION_1_5_1:
+ return "New Apache DS 1.5.1 Configuration File";
+ case VERSION_1_5_0:
+ return "New Apache DS 1.5.0 Configuration File";
+ default:
+ return "New Apache DS Configuration File";
+ }
}
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java Sat Jun 7 07:17:06 2008
@@ -24,16 +24,20 @@
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
+import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
-import org.apache.directory.studio.apacheds.configuration.Activator;
-import org.apache.directory.studio.apacheds.configuration.PluginUtils;
+import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPlugin;
+import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPluginUtils;
import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration;
-import org.apache.directory.studio.apacheds.configuration.model.ServerConfigurationParser;
-import org.apache.directory.studio.apacheds.configuration.model.ServerConfigurationWriter;
-import org.apache.directory.studio.apacheds.configuration.model.ServerConfigurationWriterException;
+import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIO;
+import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException;
+import org.apache.directory.studio.apacheds.configuration.model.v150.ServerXmlIOV150;
+import org.apache.directory.studio.apacheds.configuration.model.v151.ServerXmlIOV151;
+import org.apache.directory.studio.apacheds.configuration.model.v152.ServerXmlIOV152;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -76,14 +80,21 @@
/** The Server Configuration */
private ServerConfiguration serverConfiguration;
+ /** The associated ServerXmlIO class */
+ private ServerXmlIO serverXmlIO;
+
/** The dirty flag */
private boolean dirty = false;
+ /** The error message */
+ private String errorMessage;
+
// The Pages
- private GeneralPage generalPage;
- private PartitionsPage partitionsPage;
- private InterceptorsPage interceptorsPage;
- private ExtendedOperationsPage extendedOperationsPage;
+ private SaveableFormPage generalPage;
+ private SaveableFormPage authenticationPage;
+ private SaveableFormPage partitionsPage;
+ private SaveableFormPage interceptorsPage;
+ private SaveableFormPage extendedOperationsPage;
/* (non-Javadoc)
@@ -94,50 +105,104 @@
super.init( site, input );
setPartName( input.getName() );
- String inputClassName = input.getClass().getName();
try
{
- if ( input instanceof FileEditorInput )
- // The 'FileEditorInput' class is used when the file is opened
- // from a project in the workspace.
- {
- ServerConfigurationParser parser = new ServerConfigurationParser();
- serverConfiguration = parser.parse( ( ( FileEditorInput ) input ).getFile().getContents() );
- }
- else if ( input instanceof IPathEditorInput )
- {
- ServerConfigurationParser parser = new ServerConfigurationParser();
- serverConfiguration = parser.parse( new FileInputStream( new File( ( ( IPathEditorInput ) input )
- .getPath().toOSString() ) ) );
- }
- else if ( inputClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" )
- || inputClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) )
- // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
- // is used when opening a file from the menu File > Open... in Eclipse 3.2.x
- // The class 'org.eclipse.ui.ide.FileStoreEditorInput' is used when
- // opening a file from the menu File > Open... in Eclipse 3.3.x
- {
- // We use the tooltip to get the full path of the file
- ServerConfigurationParser parser = new ServerConfigurationParser();
- serverConfiguration = parser.parse( new FileInputStream( new File( input.getToolTipText() ) ) );
+ readServerConfiguration( input );
+ }
+ catch ( Exception e )
+ {
+ errorMessage = e.getMessage();
+ }
+ }
+
+
+ /**
+ * Reads the server configuration from the given editor input.
+ *
+ * @param input
+ * the editor input
+ * @throws CoreException
+ * @throws FileNotFoundException
+ * @throws ServerXmlIOException
+ */
+ private void readServerConfiguration( IEditorInput input ) throws CoreException, FileNotFoundException,
+ ServerXmlIOException
+ {
+ // If the input is a NonExistingServerConfigurationInput, then we only
+ // need to get the server configuration and return
+ if ( input instanceof NonExistingServerConfigurationInput )
+ {
+ // The 'ServerConfigurationEditorInput' class is used when a
+ // new Server Configuration File is created.
+ serverConfiguration = ( ( NonExistingServerConfigurationInput ) input ).getServerConfiguration();
+ dirty = true;
+
+ // Setting the ServerXmlIO class
+ switch ( serverConfiguration.getVersion() )
+ {
+ case VERSION_1_5_2:
+ serverXmlIO = new ServerXmlIOV152();
+ break;
+ case VERSION_1_5_1:
+ serverXmlIO = new ServerXmlIOV151();
+ break;
+ case VERSION_1_5_0:
+ serverXmlIO = new ServerXmlIOV150();
+ break;
}
- else if ( input instanceof NonExistingServerConfigurationInput )
+ return;
+ }
+
+ // Looping on the ServerXmlIO classes to find a corresponding one
+ ServerXmlIO[] serverXmlIOs = ApacheDSConfigurationPlugin.getDefault().getServerXmlIOs();
+ for ( ServerXmlIO validationServerXmlIO : serverXmlIOs )
+ {
+ // Checking if the ServerXmlIO is valid
+ if ( validationServerXmlIO.isValid( getInputStream( input ) ) )
{
- // The 'ServerConfigurationEditorInput' class is used when a
- // new Server Configuration File is created.
- serverConfiguration = ( ( NonExistingServerConfigurationInput ) input ).getServerConfiguration();
- dirty = true;
+ serverXmlIO = validationServerXmlIO;
+ serverConfiguration = serverXmlIO.parse( getInputStream( input ) );
+ return;
}
}
- catch ( Exception e )
+ }
+
+
+ /**
+ * Gets an input stream from the editor input.
+ *
+ * @param input
+ * the editor input
+ * @return
+ * an input stream from the editor input, or <code>null</code>
+ * @throws CoreException
+ * @throws FileNotFoundException
+ */
+ private InputStream getInputStream( IEditorInput input ) throws CoreException, FileNotFoundException
+ {
+ String inputClassName = input.getClass().getName();
+ if ( input instanceof FileEditorInput )
+ // The 'FileEditorInput' class is used when the file is opened
+ // from a project in the workspace.
{
- MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- SWT.OK | SWT.ICON_ERROR );
- messageBox.setText( "Error!" );
- messageBox.setMessage( "An error occurred when reading the file." + "\n" + e.getMessage() );
- messageBox.open();
- return;
+ return ( ( FileEditorInput ) input ).getFile().getContents();
+ }
+ else if ( input instanceof IPathEditorInput )
+ {
+ return new FileInputStream( new File( ( ( IPathEditorInput ) input ).getPath().toOSString() ) );
+ }
+ else if ( inputClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" )
+ || inputClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) )
+ // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
+ // is used when opening a file from the menu File > Open... in Eclipse 3.2.x
+ // The class 'org.eclipse.ui.ide.FileStoreEditorInput' is used when
+ // opening a file from the menu File > Open... in Eclipse 3.3.x
+ {
+ // We use the tooltip to get the full path of the file
+ return new FileInputStream( new File( input.getToolTipText() ) );
}
+
+ return null;
}
@@ -148,22 +213,78 @@
{
try
{
- generalPage = new GeneralPage( this );
- addPage( generalPage );
-
- partitionsPage = new PartitionsPage( this );
- addPage( partitionsPage );
-
- interceptorsPage = new InterceptorsPage( this );
- addPage( interceptorsPage );
-
- extendedOperationsPage = new ExtendedOperationsPage( this );
- addPage( extendedOperationsPage );
+ if ( serverConfiguration == null )
+ {
+ ErrorPage errorPage = new ErrorPage( this );
+ addPage( errorPage );
+ }
+ else
+ {
+ switch ( serverConfiguration.getVersion() )
+ {
+ case VERSION_1_5_2:
+ generalPage = new org.apache.directory.studio.apacheds.configuration.editor.v152.GeneralPage(
+ this );
+ addPage( generalPage );
+
+ authenticationPage = new org.apache.directory.studio.apacheds.configuration.editor.v152.AuthenticationPage(
+ this );
+ addPage( authenticationPage );
+
+ partitionsPage = new org.apache.directory.studio.apacheds.configuration.editor.v152.PartitionsPage(
+ this );
+ addPage( partitionsPage );
+
+ interceptorsPage = new org.apache.directory.studio.apacheds.configuration.editor.v152.InterceptorsPage(
+ this );
+ addPage( interceptorsPage );
+
+ extendedOperationsPage = new org.apache.directory.studio.apacheds.configuration.editor.v152.ExtendedOperationsPage(
+ this );
+ addPage( extendedOperationsPage );
+ break;
+ case VERSION_1_5_1:
+ generalPage = new org.apache.directory.studio.apacheds.configuration.editor.v151.GeneralPage(
+ this );
+ addPage( generalPage );
+
+ partitionsPage = new org.apache.directory.studio.apacheds.configuration.editor.v151.PartitionsPage(
+ this );
+ addPage( partitionsPage );
+
+ interceptorsPage = new org.apache.directory.studio.apacheds.configuration.editor.v151.InterceptorsPage(
+ this );
+ addPage( interceptorsPage );
+
+ extendedOperationsPage = new org.apache.directory.studio.apacheds.configuration.editor.v151.ExtendedOperationsPage(
+ this );
+ addPage( extendedOperationsPage );
+ break;
+ case VERSION_1_5_0:
+ generalPage = new org.apache.directory.studio.apacheds.configuration.editor.v150.GeneralPage(
+ this );
+ addPage( generalPage );
+
+ partitionsPage = new org.apache.directory.studio.apacheds.configuration.editor.v150.PartitionsPage(
+ this );
+ addPage( partitionsPage );
+
+ interceptorsPage = new org.apache.directory.studio.apacheds.configuration.editor.v150.InterceptorsPage(
+ this );
+ addPage( interceptorsPage );
+
+ extendedOperationsPage = new org.apache.directory.studio.apacheds.configuration.editor.v150.ExtendedOperationsPage(
+ this );
+ addPage( extendedOperationsPage );
+ break;
+ }
+ }
}
catch ( PartInitException e )
{
- Activator.getDefault().getLog().log(
- new Status( Status.ERROR, Activator.PLUGIN_ID, Status.OK, e.getMessage(), e.getCause() ) );
+ ApacheDSConfigurationPlugin.getDefault().getLog().log(
+ new Status( Status.ERROR, ApacheDSConfigurationPlugin.PLUGIN_ID, Status.OK, e.getMessage(), e
+ .getCause() ) );
}
}
@@ -173,10 +294,10 @@
*/
public void doSave( IProgressMonitor monitor )
{
- monitor.beginTask( "Saving the Server Configuration", 5 );
+ monitor.beginTask( "Saving the Server Configuration", IProgressMonitor.UNKNOWN );
// Saving the editor pages
- saveEditorPages( monitor );
+ saveEditorPages();
try
{
@@ -217,7 +338,6 @@
success = doSaveAs( monitor );
}
- monitor.worked( 1 );
setDirty( !success );
monitor.done();
}
@@ -241,30 +361,33 @@
* @param monitor
* the monitor to use
*/
- private void saveEditorPages( IProgressMonitor monitor )
+ private void saveEditorPages()
{
- generalPage.save();
- if ( monitor != null )
- {
- monitor.worked( 1 );
- }
-
- partitionsPage.save();
- if ( monitor != null )
+ if ( serverConfiguration != null )
{
- monitor.worked( 1 );
- }
-
- interceptorsPage.save();
- if ( monitor != null )
- {
- monitor.worked( 1 );
- }
-
- extendedOperationsPage.save();
- if ( monitor != null )
- {
- monitor.worked( 1 );
+ switch ( serverConfiguration.getVersion() )
+ {
+ case VERSION_1_5_2:
+ generalPage.save();
+ authenticationPage.save();
+ partitionsPage.save();
+ interceptorsPage.save();
+ extendedOperationsPage.save();
+ break;
+ case VERSION_1_5_1:
+ generalPage.save();
+ partitionsPage.save();
+ interceptorsPage.save();
+ extendedOperationsPage.save();
+ break;
+ case VERSION_1_5_0:
+ generalPage.save();
+ authenticationPage.save();
+ partitionsPage.save();
+ interceptorsPage.save();
+ extendedOperationsPage.save();
+ break;
+ }
}
}
@@ -277,10 +400,10 @@
* @throws IOException
* @throws ServerConfigurationWriterException
*/
- private void saveConfiguration( String path ) throws IOException, ServerConfigurationWriterException
+ private void saveConfiguration( String path ) throws IOException
{
BufferedWriter outFile = new BufferedWriter( new FileWriter( path ) );
- String xml = ServerConfigurationWriter.toXml( serverConfiguration );
+ String xml = serverXmlIO.toXml( serverConfiguration );
outFile.write( xml );
outFile.close();
}
@@ -294,10 +417,9 @@
* @throws ServerConfigurationWriterException
* @throws CoreException
*/
- private void saveConfiguration( FileEditorInput fei, IProgressMonitor monitor )
- throws ServerConfigurationWriterException, CoreException
+ private void saveConfiguration( FileEditorInput fei, IProgressMonitor monitor ) throws CoreException
{
- String xml = ServerConfigurationWriter.toXml( serverConfiguration );
+ String xml = serverXmlIO.toXml( serverConfiguration );
fei.getFile().setContents( new ByteArrayInputStream( xml.getBytes() ), true, true, monitor );
}
@@ -315,10 +437,9 @@
{
try
{
- monitor.beginTask( "Saving the Server Configuration", 5 );
- saveEditorPages( monitor );
+ monitor.beginTask( "Saving the Server Configuration", IProgressMonitor.UNKNOWN );
+ saveEditorPages();
boolean success = doSaveAs( monitor );
- monitor.worked( 1 );
setDirty( !success );
monitor.done();
}
@@ -360,7 +481,7 @@
{
// detect IDE or RCP:
// check if perspective org.eclipse.ui.resourcePerspective is available
- boolean isIDE = PluginUtils.isIDEEnvironment();
+ boolean isIDE = ApacheDSConfigurationPluginUtils.isIDEEnvironment();
if ( isIDE )
{
@@ -389,7 +510,7 @@
FileEditorInput fei = new FileEditorInput( file );
// Saving the file to disk
- saveEditorPages( monitor );
+ saveEditorPages();
saveConfiguration( fei, monitor );
// Setting the new input to the editor
@@ -440,7 +561,7 @@
}
// Saving the file to disk
- saveEditorPages( monitor );
+ saveEditorPages();
saveConfiguration( path );
// Creating the new input for the editor
@@ -498,6 +619,18 @@
{
return serverConfiguration;
}
+
+
+ /**
+ * Gets the error message.
+ *
+ * @return
+ * the error message
+ */
+ public String getErrorMessage()
+ {
+ return errorMessage;
+ }
}
/**
@@ -628,7 +761,7 @@
/**
* Returns the path.
*/
- public IPath getPath( Object element )
+ public IPath getErrorMessage( Object element )
{
if ( element instanceof PathEditorInput )
{
@@ -638,4 +771,5 @@
return null;
}
+
}
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfiguration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfiguration.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfiguration.java (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/ServerConfiguration.java Sat Jun 7 07:17:06 2008
@@ -20,1083 +20,19 @@
package org.apache.directory.studio.apacheds.configuration.model;
-import java.util.ArrayList;
-import java.util.List;
-
-
/**
- * This class represents a Server Configuration.
+ * This interface represents a Server Configuration.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public class ServerConfiguration
+public interface ServerConfiguration
{
- // LDAP Configuration
-
- /** The port */
- private int ldapPort;
-
- /** The principal */
- private String principal;
-
- /** The password */
- private String password;
-
- // Limits
-
- /** The Max Time Limit */
- private int maxTimeLimit;
-
- /** the Max Size Limit */
- private int maxSizeLimit;
-
- /** The Synchronization Period */
- private long synchronizationPeriod;
-
- /** The Maximum number of Threads */
- private int maxThreads;
-
- /** The Supported Mechanisms */
- private List<String> supportedMechanisms;
-
- // SASL Properties
-
- /** The SASL Host */
- private String saslHost;
-
- /** The SASL Principal */
- private String saslPrincipal;
-
- /** The SASL QOP */
- private List<String> saslQops;
-
- /** The SASL Realms */
- private List<String> saslRealms;
-
- /** The Search Base DN */
- private String searchBaseDn;
-
- // Protocols
-
- /** The flag for Enable Access Control */
- private boolean enableAccessControl;
-
- /** The flag for Enable Kerberos */
- private boolean enableKerberos;
-
- /** The port for Kerberos */
- private int kerberosPort;
-
- /** The flag for Enable NTP */
- private boolean enableNtp;
-
- /** The port for NTP */
- private int ntpPort;
-
- /** The flag for Enable DNS */
- private boolean enableDns;
-
- /** The port for DNS */
- private int dnsPort;
-
- /** The flag for Enable LDAPS */
- private boolean enableLdaps;
-
- /** The port for LDAPS */
- private int ldapsPort;
-
- /** The flag for Enable Change Password */
- private boolean enableChangePassword;
-
- /** The port for Change Password */
- private int changePasswordPort;
-
- // Options
-
- /** The flag for Denormalize Operational Attributes */
- private boolean denormalizeOpAttr;
-
- /** The flag for Allow Anonymous Access */
- private boolean allowAnonymousAccess;
-
- // Other configuration elements
-
- /** The Binary Attributes */
- private List<String> binaryAttributes;
-
- /** The Partitions */
- private List<Partition> partitions;
-
- /** The Interceptors */
- private List<Interceptor> interceptors;
-
- /** The Extended Operations */
- private List<ExtendedOperation> extendedOperations;
-
-
- /**
- * Creates a new instance of ServerConfiguration.
- */
- public ServerConfiguration()
- {
- supportedMechanisms = new ArrayList<String>();
- saslQops = new ArrayList<String>();
- saslRealms = new ArrayList<String>();
- partitions = new ArrayList<Partition>();
- interceptors = new ArrayList<Interceptor>();
- extendedOperations = new ArrayList<ExtendedOperation>();
- binaryAttributes = new ArrayList<String>();
- }
-
-
- /**
- * Adds a Binary Attribute.
- *
- * @param binaryAttribute
- * the Partition to add
- * @return
- * true (as per the general contract of the Collection.add method).
- */
- public boolean addBinaryAttribute( String binaryAttribute )
- {
- return binaryAttributes.add( binaryAttribute );
- }
-
-
- /**
- * Adds an Extended Operation.
- *
- * @param extendedOperation
- * the Extended Operation to add
- * @return
- * true (as per the general contract of the Collection.add method).
- */
- public boolean addExtendedOperation( ExtendedOperation extendedOperation )
- {
- return extendedOperations.add( extendedOperation );
- }
-
-
- /**
- * Adds an Interceptor.
- *
- * @param interceptor
- * the Interceptor to add
- * @return
- * true (as per the general contract of the Collection.add method).
- */
- public boolean addInterceptor( Interceptor interceptor )
- {
- return interceptors.add( interceptor );
- }
-
-
- /**
- * Adds a Partition.
- *
- * @param partition
- * the Partition to add
- * @return
- * true (as per the general contract of the Collection.add method).
- */
- public boolean addPartition( Partition partition )
- {
- return partitions.add( partition );
- }
-
-
- /**
- * Adds a SASL Quality Of Protection.
- *
- * @param saslQop
- * the SASL Quality Of Protection to add
- * @return
- * true (as per the general contract of the Collection.add method).
- */
- public boolean addSaslQop( String saslQop )
- {
- return saslQops.add( saslQop );
- }
-
-
- /**
- * Adds a SASL Realm.
- *
- * @param qop
- * the SASL Realm to add
- * @return
- * true (as per the general contract of the Collection.add method).
- */
- public boolean addSaslRealm( String saslRealm )
- {
- return saslRealms.add( saslRealm );
- }
-
-
- /**
- * Adds a Supported Mechanism.
- *
- * @param supportedMechanism
- * the Supported Mechanism to add
- * @return
- * true (as per the general contract of the Collection.add method).
- */
- public boolean addSupportedMechanism( String supportedMechanism )
- {
- return supportedMechanisms.add( supportedMechanism );
- }
-
-
- /**
- * Removes all Binary Attributes.
- */
- public void clearBinaryAttributes()
- {
- binaryAttributes.clear();
- }
-
-
- /**
- * Removes all ExtendedOperations.
- */
- public void clearExtendedOperations()
- {
- extendedOperations.clear();
- }
-
-
- /**
- * Removes all interceptors.
- */
- public void clearInterceptors()
- {
- interceptors.clear();
- }
-
-
- /**
- * Removes all partitions.
- */
- public void clearPartitions()
- {
- partitions.clear();
- }
-
-
- /**
- * Gets the Binary Attributes List.
- *
- * @return
- * the Binary Attributes List
- */
- public List<String> getBinaryAttributes()
- {
- return binaryAttributes;
- }
-
-
- /**
- * Gets the Change Password port.
- *
- * @return
- * the Change Password port
- */
- public int getChangePasswordPort()
- {
- return changePasswordPort;
- }
-
-
- /**
- * Gets the DNS port.
- *
- * @return
- * the DNS port
- */
- public int getDnsPort()
- {
- return dnsPort;
- }
-
-
- /**
- * Gets the Extended Operations List.
- *
- * @return
- * the Extended Operations List
- */
- public List<ExtendedOperation> getExtendedOperations()
- {
- return extendedOperations;
- }
-
-
- /**
- * Gets the Interceptors List.
- *
- * @return
- * the Interceptors List
- */
- public List<Interceptor> getInterceptors()
- {
- return interceptors;
- }
-
-
- /**
- * Gets the Kerberos port.
- *
- * @return
- * the Kerberos port
- */
- public int getKerberosPort()
- {
- return kerberosPort;
- }
-
-
- /**
- * Gets the LDAPS port.
- *
- * @return
- * the LDAPS port
- */
- public int getLdapsPort()
- {
- return ldapsPort;
- }
-
-
- /**
- * Gets the Maximum Size Limit.
- *
- * @return
- * the Maximum Size Limit
- */
- public int getMaxSizeLimit()
- {
- return maxSizeLimit;
- }
-
-
- /**
- * Gets the Maximum number of Threads.
- *
- * @return
- * the Maximum number of Threads
- */
- public int getMaxThreads()
- {
- return maxThreads;
- }
-
-
- /**
- * Gets the Maximum Time Limit.
- *
- * @return
- * the Maximum Time Limit
- */
- public int getMaxTimeLimit()
- {
- return maxTimeLimit;
- }
-
-
- /**
- * Gets the NTP port.
- *
- * @return
- * the NTP port
- */
- public int getNtpPort()
- {
- return ntpPort;
- }
-
-
- /**
- * Gets the Partitions List.
- *
- * @return
- * the Partitions List
- */
- public List<Partition> getPartitions()
- {
- return partitions;
- }
-
-
- /**
- * Gets the password.
- *
- * @return
- * the password
- */
- public String getPassword()
- {
- return password;
- }
-
-
- /**
- * Gets the LDAP Port.
- *
- * @return
- * the LDAP Port
- */
- public int getLdapPort()
- {
- return ldapPort;
- }
-
-
- /**
- * Gets the Principal
- *
- * @return
- * the Principal
- */
- public String getPrincipal()
- {
- return principal;
- }
-
-
- /**
- * Gets the SASL Host.
- *
- * @return
- * the SASL Host
- */
- public String getSaslHost()
- {
- return saslHost;
- }
-
-
- /**
- * Gets the SASL Principal.
- *
- * @return
- * the SASL Principal
- */
- public String getSaslPrincipal()
- {
- return saslPrincipal;
- }
-
-
- /**
- * Gets the SASL Quality Of Protection List
- *
- * @return
- * the SASL Quality Of Protection List
- */
- public List<String> getSaslQops()
- {
- return saslQops;
- }
-
-
- /**
- * Gets the SASL Realms List.
- *
- * @return
- * the SASL Realms List
- */
- public List<String> getSaslRealms()
- {
- return saslRealms;
- }
-
-
- /**
- * Gets the Search Base DN.
- *
- * @return
- * the Search Base DN
- */
- public String getSearchBaseDn()
- {
- return searchBaseDn;
- }
-
-
- /**
- * Gets the Supported Mechanisms List.
- *
- * @return
- * the Supported Mechanisms List
- */
- public List<String> getSupportedMechanisms()
- {
- return supportedMechanisms;
- }
-
-
- /**
- * Gets the Synchronization Period.
- *
- * @return
- * the Synchronization Period
- */
- public long getSynchronizationPeriod()
- {
- return synchronizationPeriod;
- }
-
-
- /**
- * Gets the Allow Anonymous flag.
- *
- * @return
- * true if the server configuration allows Anonymous Access
- */
- public boolean isAllowAnonymousAccess()
- {
- return allowAnonymousAccess;
- }
-
-
- /**
- * Gets the Denormalize Operational Attributes flag.
- *
- * @return
- * the Denormalize Operational Attributes flag
- */
- public boolean isDenormalizeOpAttr()
- {
- return denormalizeOpAttr;
- }
-
-
- /**
- * Gets the Enable Access Control flag.
- *
- * @return
- * true if Access Control is enabled
- */
- public boolean isEnableAccessControl()
- {
- return enableAccessControl;
- }
-
-
- /**
- * Gets the Enable Change Password flag.
- *
- * @return
- * true if Change Password is enabled
- */
- public boolean isEnableChangePassword()
- {
- return enableChangePassword;
- }
-
-
- /**
- * Gets the Enable DNS flag.
- *
- * @return
- * true if DNS is enabled
- */
- public boolean isEnableDns()
- {
- return enableDns;
- }
-
-
- /**
- * Gets the Enable Kerberos flag.
- *
- * @return
- * true if Kerberos is enabled
- */
- public boolean isEnableKerberos()
- {
- return enableKerberos;
- }
-
-
- /**
- * Gets the Enable LDAPS flag.
- *
- * @return
- * true if LDAPS is enabled
- */
- public boolean isEnableLdaps()
- {
- return enableLdaps;
- }
-
-
- /**
- * Gets the Enable NTP flag.
- *
- * @return
- * true if NTP is enabled
- */
- public boolean isEnableNtp()
- {
- return enableNtp;
- }
-
-
- /**
- * Removes a Binary Attribute.
- *
- * @param binaryAttribute
- * the Binary Attribute to remove
- * @return
- * true if this list contained the specified element.
- */
- public boolean removeBinaryAttribute( String binaryAttribute )
- {
- return binaryAttributes.remove( binaryAttribute );
- }
-
-
- /**
- * Removes an Extended Operation.
- *
- * @param extendedOperation
- * the Extended Operation to remove
- * @return
- * true if this list contained the specified element.
- */
- public boolean removeExtendedOperation( ExtendedOperation extendedOperation )
- {
- return extendedOperations.remove( extendedOperation );
- }
-
-
/**
- * Removes an Supported Mechanism.
+ * Gets the version of the server configuration
*
- * @param supportedMechanism
- * the Supported Mechanism to remove
* @return
- * true if this list contained the specified element.
- */
- public boolean removeExtendedOperation( String supportedMechanism )
- {
- return supportedMechanisms.remove( supportedMechanism );
- }
-
-
- /**
- * Removes an Interceptor.
- *
- * @param interceptor
- * the Interceptor to remove
- * @return
- * true if this list contained the specified element.
- */
- public boolean removeInterceptor( Interceptor interceptor )
- {
- return interceptors.remove( interceptor );
- }
-
-
- /**
- * Removes a Partition.
- *
- * @param partition
- * the partition to remove
- * @return
- * true if this list contained the specified element.
- */
- public boolean removePartition( Partition partition )
- {
- return partitions.remove( partition );
- }
-
-
- /**
- * Removes a SASL Quality Of Protection.
- *
- * @param saslQop
- * the SASL Quality Of Protection to remove
- * @return
- * true if this list contained the specified element.
- */
- public boolean removeSaslQop( String saslQop )
- {
- return saslQops.remove( saslQop );
- }
-
-
- /**
- * Removes a SASL Realm.
- *
- * @param saslRealm
- * the SASL Realm to remove
- * @return
- * true if this list contained the specified element.
- */
- public boolean removeSaslRealm( String saslRealm )
- {
- return saslRealms.remove( saslRealm );
- }
-
-
- /**
- * Sets the Allow Anonymous flag.
- *
- * @param allowAnonymousAccess
- * the new value
- */
- public void setAllowAnonymousAccess( boolean allowAnonymousAccess )
- {
- this.allowAnonymousAccess = allowAnonymousAccess;
- }
-
-
- /**
- * Sets the Binary Attributes List.
- *
- * @param binaryAttributes
- * the new value
- */
- public void setBinaryAttributes( List<String> binaryAttributes )
- {
- this.binaryAttributes = binaryAttributes;
- }
-
-
- /**
- * Sets the Change Password port.
- *
- * @param changePasswordPort
- * the Change Password port
- */
- public void setChangePasswordPort( int changePasswordPort )
- {
- this.changePasswordPort = changePasswordPort;
- }
-
-
- /**
- * Sets the Denormalize Operational Attributes flag.
- *
- * @param denormalizeOpAttr
- * the new Denormalize Operational Attributes flag
- */
- public void setDenormalizeOpAttr( boolean denormalizeOpAttr )
- {
- this.denormalizeOpAttr = denormalizeOpAttr;
- }
-
-
- /**
- * Sets the DNS port.
- *
- * @param dnsPort
- * the DNS port
- */
- public void setDnsPort( int dnsPort )
- {
- this.dnsPort = dnsPort;
- }
-
-
- /**
- * Sets the Enable Access Control flag.
- *
- * @param enableAccessControl
- * the new value
- */
- public void setEnableAccessControl( boolean enableAccessControl )
- {
- this.enableAccessControl = enableAccessControl;
- }
-
-
- /**
- * Sets the Enable Change Password flag.
- *
- * @param enableChangePassword
- * the new value
- */
- public void setEnableChangePassword( boolean enableChangePassword )
- {
- this.enableChangePassword = enableChangePassword;
- }
-
-
- /**
- * Sets Enable DNS flag.
- *
- * @param enableDns
- * the new value
- */
- public void setEnableDns( boolean enableDns )
- {
- this.enableDns = enableDns;
- }
-
-
- /**
- * Sets the Enable Kerberos flag.
- *
- * @param enableKerberos
- * the new value
- */
- public void setEnableKerberos( boolean enableKerberos )
- {
- this.enableKerberos = enableKerberos;
- }
-
-
- /**
- * Sets the Enable LDAPS flag.
- *
- * @param enableLdaps
- * the new value
- */
- public void setEnableLdaps( boolean enableLdaps )
- {
- this.enableLdaps = enableLdaps;
- }
-
-
- /**
- * Sets the Enable NTP flag.
- *
- * @param enableNtp
- * the new value
- */
- public void setEnableNtp( boolean enableNtp )
- {
- this.enableNtp = enableNtp;
- }
-
-
- /**
- * Sets the Extended Operations List.
- *
- * @param extendedOperations
- * the new value
- */
- public void setExtendedOperations( List<ExtendedOperation> extendedOperations )
- {
- this.extendedOperations = extendedOperations;
- }
-
-
- /**
- * Sets the Interceptors List.
- *
- * @param interceptors
- * the new value
- */
- public void setInterceptors( List<Interceptor> interceptors )
- {
- this.interceptors = interceptors;
- }
-
-
- /**
- * Sets the Kerberos port.
- *
- * @param kerberosPort
- * the new value
- */
- public void setKerberosPort( int kerberosPort )
- {
- this.kerberosPort = kerberosPort;
- }
-
-
- /**
- * Sets The LDAPS port.
- *
- * @param ldapsPort
- */
- public void setLdapsPort( int ldapsPort )
- {
- this.ldapsPort = ldapsPort;
- }
-
-
- /**
- * Sets the Maximum Size Limit.
- *
- * @param maxSizeLimit
- * the new value
- */
- public void setMaxSizeLimit( int maxSizeLimit )
- {
- this.maxSizeLimit = maxSizeLimit;
- }
-
-
- /**
- * Sets the Maximum number of Threads
- *
- * @param maxThreads
- * the new value
- */
- public void setMaxThreads( int maxThreads )
- {
- this.maxThreads = maxThreads;
- }
-
-
- /**
- * Sets the Maximum Time Limit.
- *
- * @param maxTimeLimit
- * the new value
- */
- public void setMaxTimeLimit( int maxTimeLimit )
- {
- this.maxTimeLimit = maxTimeLimit;
- }
-
-
- /**
- * Sets the NTP port.
- *
- * @param ntpPort
- * the new value
- */
- public void setNtpPort( int ntpPort )
- {
- this.ntpPort = ntpPort;
- }
-
-
- /**
- * Sets the Partitions List.
- *
- * @param partitions
- * the new value
- */
- public void setPartitions( List<Partition> partitions )
- {
- this.partitions = partitions;
- }
-
-
- /**
- * Sets the password.
- *
- * @param password
- * the new password
- */
- public void setPassword( String password )
- {
- this.password = password;
- }
-
-
- /**
- * Sets the LDAP Port
- *
- * @param ldapPort
- * the new value
- */
- public void setLdapPort( int ldapPort )
- {
- this.ldapPort = ldapPort;
- }
-
-
- /**
- * Sets the Principal
- *
- * @param principal
- * the new value
- */
- public void setPrincipal( String principal )
- {
- this.principal = principal;
- }
-
-
- /**
- * Sets the SASL Host.
- *
- * @param saslHost
- * the new value
- */
- public void setSaslHost( String saslHost )
- {
- this.saslHost = saslHost;
- }
-
-
- /**
- * Sets the SASL Principal.
- *
- * @param saslPrincipal
- * the new value
- */
- public void setSaslPrincipal( String saslPrincipal )
- {
- this.saslPrincipal = saslPrincipal;
- }
-
-
- /**
- * Sets the SASL Quality Of Protection List.
- *
- * @param saslQops
- * the new value
- */
- public void setSaslQops( List<String> saslQops )
- {
- this.saslQops = saslQops;
- }
-
-
- /**
- * Sets the SASL Realms List.
- *
- * @param saslRealms
- * the new value
- */
- public void setSaslRealms( List<String> saslRealms )
- {
- this.saslRealms = saslRealms;
- }
-
-
- /**
- * Sets the Search Base DN
- *
- * @param searchBaseDn
- * the new value
- */
- public void setSearchBaseDn( String searchBaseDn )
- {
- this.searchBaseDn = searchBaseDn;
- }
-
-
- /**
- * Sets the Supported Mechanisms List.
- *
- * @param supportedMechanisms
- * the new value
- */
- public void setSupportedMechanisms( List<String> supportedMechanisms )
- {
- this.supportedMechanisms = supportedMechanisms;
- }
-
-
- /**
- * Sets the Synchonization Period.
- *
- * @param synchronizationPeriod
- * the new value
+ * the version of the server configuration
*/
- public void setSynchronizationPeriod( long synchronizationPeriod )
- {
- this.synchronizationPeriod = synchronizationPeriod;
- }
+ public ServerConfigurationVersionEnum getVersion();
}
Modified: directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizard.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizard.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizard.java (original)
+++ directory/sandbox/seelmann/testingframework/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/wizards/NewApacheDSConfigurationFileWizard.java Sat Jun 7 07:17:06 2008
@@ -20,12 +20,15 @@
package org.apache.directory.studio.apacheds.configuration.wizards;
-import org.apache.directory.studio.apacheds.configuration.Activator;
-import org.apache.directory.studio.apacheds.configuration.editor.ServerConfigurationEditor;
+import org.apache.directory.studio.apacheds.configuration.ApacheDSConfigurationPlugin;
import org.apache.directory.studio.apacheds.configuration.editor.NonExistingServerConfigurationInput;
+import org.apache.directory.studio.apacheds.configuration.editor.ServerConfigurationEditor;
import org.apache.directory.studio.apacheds.configuration.model.ServerConfiguration;
-import org.apache.directory.studio.apacheds.configuration.model.ServerConfigurationParser;
-import org.apache.directory.studio.apacheds.configuration.model.ServerConfigurationParserException;
+import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIO;
+import org.apache.directory.studio.apacheds.configuration.model.ServerXmlIOException;
+import org.apache.directory.studio.apacheds.configuration.model.v150.ServerXmlIOV150;
+import org.apache.directory.studio.apacheds.configuration.model.v151.ServerXmlIOV151;
+import org.apache.directory.studio.apacheds.configuration.model.v152.ServerXmlIOV152;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swt.SWT;
@@ -49,6 +52,19 @@
/** The window */
private IWorkbenchWindow window;
+ /** The page */
+ private NewApacheDSConfigurationFileWizardPage page;
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ public void addPages()
+ {
+ page = new NewApacheDSConfigurationFileWizardPage();
+ addPage( page );
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
@@ -57,18 +73,42 @@
{
try
{
- ServerConfigurationParser parser = new ServerConfigurationParser();
- ServerConfiguration serverConfiguration = parser.parse( Activator.class
- .getResourceAsStream( "default-server.xml" ) );
+ // Getting the default server configuration for the target version
+ ServerConfiguration serverConfiguration = null;
+ ServerXmlIO serverXmlIO = null;
+ switch ( page.getTargetVersion() )
+ {
+ case VERSION_1_5_2:
+ serverXmlIO = new ServerXmlIOV152();
+ serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
+ .getResourceAsStream( "default-server-1.5.2.xml" ) );
+ break;
+ case VERSION_1_5_1:
+ serverXmlIO = new ServerXmlIOV151();
+ serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
+ .getResourceAsStream( "default-server-1.5.1.xml" ) );
+ break;
+ case VERSION_1_5_0:
+ serverXmlIO = new ServerXmlIOV150();
+ serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
+ .getResourceAsStream( "default-server-1.5.0.xml" ) );
+ break;
+ default:
+ serverXmlIO = new ServerXmlIOV152();
+ serverConfiguration = serverXmlIO.parse( ApacheDSConfigurationPlugin.class
+ .getResourceAsStream( "default-server-1.5.2.xml" ) );
+ break;
+ }
IWorkbenchPage page = window.getActivePage();
- page.openEditor( new NonExistingServerConfigurationInput( serverConfiguration ), ServerConfigurationEditor.ID );
+ page.openEditor( new NonExistingServerConfigurationInput( serverConfiguration ),
+ ServerConfigurationEditor.ID );
}
catch ( PartInitException e )
{
return false;
}
- catch ( ServerConfigurationParserException e )
+ catch ( ServerXmlIOException e )
{
MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.OK | SWT.ICON_ERROR );
Modified: directory/sandbox/seelmann/testingframework/connection-core/plugin.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/connection-core/plugin.xml?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/connection-core/plugin.xml (original)
+++ directory/sandbox/seelmann/testingframework/connection-core/plugin.xml Sat Jun 7 07:17:06 2008
@@ -29,6 +29,12 @@
id="org.apache.directory.studio.connection.core.io.jndi.LdifModificationLogger"
name="LDIF Modification Logger">
</jndiLogger>
+ <jndiLogger
+ class="org.apache.directory.studio.connection.core.io.jndi.LdifSearchLogger"
+ description="Logs searches in LDIF format to a file."
+ id="org.apache.directory.studio.connection.core.io.jndi.LdifSearchLogger"
+ name="LDIF Search Logger">
+ </jndiLogger>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
Modified: directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java (original)
+++ directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java Sat Jun 7 07:17:06 2008
@@ -38,4 +38,10 @@
/** The constant used to identify the "enable modification logs" preference */
public static final String PREFERENCE_MODIFICATIONLOGS_ENABLE = "modificationLogsEnable";
+ /** The constant used to identify the "enable search request logs" preference */
+ public static final String PREFERENCE_SEARCHREQUESTLOGS_ENABLE = "searchRequestLogsEnable";
+
+ /** The constant used to identify the "enable search result entry logs" preference */
+ public static final String PREFERENCE_SEARCHRESULTENTRYLOGS_ENABLE = "searchResultEntryLogsEnable";
+
}
Modified: directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java (original)
+++ directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java Sat Jun 7 07:17:06 2008
@@ -26,6 +26,7 @@
import org.apache.directory.studio.connection.core.event.CoreEventRunner;
import org.apache.directory.studio.connection.core.event.EventRunner;
import org.apache.directory.studio.connection.core.io.jndi.LdifModificationLogger;
+import org.apache.directory.studio.connection.core.io.jndi.LdifSearchLogger;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
@@ -242,6 +243,25 @@
}
return null;
}
+
+
+ /**
+ * Gets the LDIF search logger.
+ *
+ * @return the LDIF search logger, null if none found.
+ */
+ public LdifSearchLogger getLdifSearchLogger()
+ {
+ List<IJndiLogger> jndiLoggers = getJndiLoggers();
+ for ( IJndiLogger jndiLogger : jndiLoggers )
+ {
+ if(jndiLogger instanceof LdifSearchLogger)
+ {
+ return ( LdifSearchLogger ) jndiLogger;
+ }
+ }
+ return null;
+ }
/**
Modified: directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePreferencesInitializer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePreferencesInitializer.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePreferencesInitializer.java (original)
+++ directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePreferencesInitializer.java Sat Jun 7 07:17:06 2008
@@ -42,6 +42,10 @@
// Modification Logs
preferences.setDefault( ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE, true );
+
+ // Search Logs
+ preferences.setDefault( ConnectionCoreConstants.PREFERENCE_SEARCHREQUESTLOGS_ENABLE, true );
+ preferences.setDefault( ConnectionCoreConstants.PREFERENCE_SEARCHRESULTENTRYLOGS_ENABLE, false );
}
}
Modified: directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java (original)
+++ directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java Sat Jun 7 07:17:06 2008
@@ -83,6 +83,27 @@
/**
+ * Gets the Search Log filename for the corresponding connection.
+ *
+ * @param connection
+ * the connection
+ * @return
+ * the Search Log filename
+ */
+ public static final String getSearchLogFileName( Connection connection )
+ {
+ IPath p = ConnectionCorePlugin.getDefault().getStateLocation().append( "logs" ); //$NON-NLS-1$
+ File file = p.toFile();
+ if ( !file.exists() )
+ {
+ file.mkdir();
+ }
+ return p
+ .append( "search-" + Utils.getFilenameString( connection.getId() ) + "-%u-%g.ldiflog" ).toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+
+ /**
* Gets the filename of the Connection Store.
*
* @return
Modified: directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java (original)
+++ directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java Sat Jun 7 07:17:06 2008
@@ -23,8 +23,12 @@
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
import javax.naming.ldap.Control;
+import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
+import org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult;
+
/**
* Callback interface to log modifications
@@ -44,7 +48,8 @@
* @param controls the controls
* @param ex the naming exception if an error occurred, null otherwise
*/
- public void logChangetypeAdd( Connection connection, final String dn, final Attributes attributes, final Control[] controls, NamingException ex );
+ public void logChangetypeAdd( Connection connection, final String dn, final Attributes attributes,
+ final Control[] controls, NamingException ex );
/**
@@ -56,7 +61,8 @@
* @param ex the naming exception if an error occurred, null otherwise
*
*/
- public void logChangetypeDelete( Connection connection, final String dn, final Control[] controls, NamingException ex );
+ public void logChangetypeDelete( Connection connection, final String dn, final Control[] controls,
+ NamingException ex );
/**
@@ -68,7 +74,8 @@
* @param ex the naming exception if an error occurred, null otherwise
* @param controls the controls
*/
- public void logChangetypeModify( Connection connection, final String dn, final ModificationItem[] modificationItems, final Control[] controls, NamingException ex );
+ public void logChangetypeModify( Connection connection, final String dn,
+ final ModificationItem[] modificationItems, final Control[] controls, NamingException ex );
/**
@@ -81,7 +88,8 @@
* @param controls the controls
* @param ex the naming exception if an error occurred, null otherwise
*/
- public void logChangetypeModDn( Connection connection, final String oldDn, final String newDn, final boolean deleteOldRdn, final Control[] controls, NamingException ex );
+ public void logChangetypeModDn( Connection connection, final String oldDn, final String newDn,
+ final boolean deleteOldRdn, final Control[] controls, NamingException ex );
/**
@@ -98,8 +106,8 @@
* @return the logger ID
*/
public String getId();
-
-
+
+
/**
* Sets the logger name.
*
@@ -114,16 +122,16 @@
* @return the logger name
*/
public String getName();
-
-
+
+
/**
* Sets the logger description.
*
* @param description the new logger description
*/
public void setDescription( String description );
-
-
+
+
/**
* Gets the logger description.
*
@@ -131,4 +139,44 @@
*/
public String getDescription();
+
+ /**
+ * Logs a search request.
+ *
+ * @param connection the connection
+ * @param searchBase the search base
+ * @param filter the filter
+ * @param searchControls the search controls
+ * @param aliasesDereferencingMethod the aliases dereferncing method
+ * @param controls the LDAP controls
+ * @param requestNum the request number
+ * @param namingException the naming exception if an error occurred, null otherwise
+ */
+ public void logSearchRequest( Connection connection, String searchBase, String filter,
+ SearchControls searchControls, AliasDereferencingMethod aliasesDereferencingMethod, Control[] controls,
+ long requestNum, NamingException namingException );
+
+
+ /**
+ * Logs a search result entry.
+ *
+ * @param connection the connection
+ * @param studioSearchResult the search result
+ * @param requestNum the request number
+ * @param the naming exception if an error occurred, null otherwise
+ */
+ public void logSearchResultEntry( Connection connection, StudioSearchResult studioSearchResult, long requestNum,
+ NamingException namingException );
+
+
+ /**
+ * Logs a search result done.
+ *
+ * @param connection the connection
+ * @param count the number of received entries
+ * @param requestNum the request number
+ * @param the naming exception if an error occurred, null otherwise
+ */
+ public void logSearchResultDone( Connection connection, long count, long requestNum, NamingException namingException );
+
}