directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r657070 - in /directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration: editor/v152/ editor/v152/dialogs/ model/v152/
Date Fri, 16 May 2008 14:05:50 GMT
Author: pamarcelot
Date: Fri May 16 07:05:50 2008
New Revision: 657070

URL: http://svn.apache.org/viewvc?rev=657070&view=rev
Log:
o Added interceptors description.
o Fixed interceptors UI.
o Interceptors are now saved to the file.

Modified:
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorDetailsPage.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorsMasterDetailsBlock.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/InterceptorDialog.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/InterceptorEnum.java
    directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorDetailsPage.java?rev=657070&r1=657069&r2=657070&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorDetailsPage.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorDetailsPage.java
Fri May 16 07:05:50 2008
@@ -24,6 +24,7 @@
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.layout.GridData;
@@ -123,7 +124,7 @@
         section.setLayoutData( td );
         Composite client = toolkit.createComposite( section );
         toolkit.paintBordersFor( client );
-        GridLayout glayout = new GridLayout( 3, false );
+        GridLayout glayout = new GridLayout( 2, false );
         client.setLayout( glayout );
         section.setClient( client );
 
@@ -131,13 +132,14 @@
         toolkit.createLabel( client, "Name:" );
         nameText = toolkit.createText( client, "" );
         nameText.setEditable( false );
-        nameText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+        nameText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         // Description
         toolkit.createLabel( client, "Description:" );
-        descriptionText = toolkit.createText( client, "" );
+        descriptionText = toolkit.createText( client, "", SWT.MULTI | SWT.WRAP | SWT.V_SCROLL
);
         descriptionText.setEditable( false );
-        GridData gridData = new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 );
+        GridData gridData = new GridData( SWT.FILL, SWT.NONE, true, false );
+        gridData.widthHint = 100;
         gridData.heightHint = 75;
         descriptionText.setLayoutData( gridData );
     }
@@ -148,8 +150,6 @@
      */
     private void addListeners()
     {
-        nameText.addModifyListener( textModifyListener );
-        descriptionText.addModifyListener( textModifyListener );
     }
 
 
@@ -158,8 +158,6 @@
      */
     private void removeListeners()
     {
-        nameText.removeModifyListener( textModifyListener );
-        descriptionText.removeModifyListener( textModifyListener );
     }
 
 

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorsMasterDetailsBlock.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorsMasterDetailsBlock.java?rev=657070&r1=657069&r2=657070&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorsMasterDetailsBlock.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/InterceptorsMasterDetailsBlock.java
Fri May 16 07:05:50 2008
@@ -75,8 +75,6 @@
     /** The Details Page */
     private InterceptorDetailsPage detailsPage;
 
-    private static final String NEW_NAME = "New Interceptor ";
-
     // UI Fields
     private TableViewer viewer;
     private Button addButton;
@@ -293,38 +291,6 @@
 
 
     /**
-     * Gets a new Name for a new Extended Operation.
-     *
-     * @return 
-     *      a new Name for a new Extended Operation
-     */
-    private String getNewName()
-    {
-        int counter = 1;
-        String name = NEW_NAME;
-        boolean ok = false;
-
-        while ( !ok )
-        {
-            ok = true;
-            name = NEW_NAME + counter;
-
-            for ( InterceptorEnum interceptor : interceptors )
-            {
-                if ( interceptor.getName().equalsIgnoreCase( name ) )
-                {
-                    ok = false;
-                }
-            }
-
-            counter++;
-        }
-
-        return name;
-    }
-
-
-    /**
      * Enables or Disables the Up and Down Buttons.
      */
     private void enableDisableUpDownButtons()

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/InterceptorDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/InterceptorDialog.java?rev=657070&r1=657069&r2=657070&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/InterceptorDialog.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/v152/dialogs/InterceptorDialog.java
Fri May 16 07:05:50 2008
@@ -215,6 +215,10 @@
         {
             availableInterceptors.add( InterceptorEnum.SCHEMA );
         }
+        if ( !initialInterceptors.contains( InterceptorEnum.SUBENTRY ) )
+        {
+            availableInterceptors.add( InterceptorEnum.SUBENTRY );
+        }
         if ( !initialInterceptors.contains( InterceptorEnum.COLLECTIVE_ATTRIBUTE ) )
         {
             availableInterceptors.add( InterceptorEnum.COLLECTIVE_ATTRIBUTE );

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/InterceptorEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/InterceptorEnum.java?rev=657070&r1=657069&r2=657070&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/InterceptorEnum.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/InterceptorEnum.java
Fri May 16 07:05:50 2008
@@ -20,6 +20,8 @@
 package org.apache.directory.studio.apacheds.configuration.model.v152;
 
 
+
+
 /**
  * This enum contains all the interceptors.
  *
@@ -29,43 +31,63 @@
 public enum InterceptorEnum
 {
     /** The Normalization Interceptor */
-    NORMALIZATION("Normalization", "Description"),
+    NORMALIZATION("Normalization", "A name normalization interceptor. This interceptor makes
sure all relative "
+        + "and distinguished names are normalized before calls are made against "
+        + "the respective interface methods on PartitionNexus."),
 
     /** The Authentication Interceptor */
-    AUTHENTICATION("Authentication", "Description"),
+    AUTHENTICATION("Authentication", "An interceptor that authenticates users."),
 
     /** The Referral Interceptor */
-    REFERRAL("Referral", "Description"),
+    REFERRAL("Referral", "An interceptor which is responsible referral handling behaviors.
 It "
+        + "manages  referral handling behavior when the Context#REFERRAL "
+        + "is implicitly or explicitly set to \"ignore\", when set to \"throw\" " + "and
when set to \"follow\"."),
 
     /** The ACI Authorization Interceptor */
-    ACI_AUTHORIZATION("ACI Authorization", "Description"),
+    ACI_AUTHORIZATION("ACI Authorization", "An ACI based authorization interceptor."),
 
     /** The Default Authorization Interceptor */
-    DEFAULT_AUTHORIZATION("Default Authorization", "Description"),
+    DEFAULT_AUTHORIZATION("Default Authorization", "An interceptor that controls access to
PartitionNexus. If a user "
+        + "tries to perform any operations that requires permission he or she "
+        + "doesn't have, NoPermissionException will be thrown and therefore the "
+        + "current invocation chain will terminate."),
 
     /** The Exception Interceptor */
-    EXCEPTION("Exception", "Description"),
+    EXCEPTION("Exception", "An interceptor that detects any operations that breaks integrity
of "
+        + "Partition and terminates the current invocation chain by throwing a "
+        + "NamingException. Those operations include when an entry already "
+        + "exists at a DN and is added once again to the same DN."),
 
     /** The Operational Attribute Interceptor */
-    OPERATIONAL_ATTRIBUTE("Operational Attribute", "Description"),
+    OPERATIONAL_ATTRIBUTE("Operational Attribute", "An interceptor that adds or modifies
the default attributes of "
+        + "entries. There are four default attributes for now; 'creatorsName', "
+        + "'createTimestamp', 'modifiersName', 'modifyTimestamp'."),
 
     /** The Schema Interceptor */
-    SCHEMA("Schema", "Description"),
+    SCHEMA("Schema", "An interceptor that manages and enforces schemas."),
 
     /** The Sub-Entry Interceptor */
-    SUBENTRY("Sub-Entry", "Description"),
+    SUBENTRY("Sub-Entry", "The sub-entry interceptor service which is responsible for filtering
"
+        + "out sub-entries on search operations and injecting operational attributes"),
 
     /** The Collective Attribute Interceptor */
-    COLLECTIVE_ATTRIBUTE("Collective Attribute", "Description"),
+    COLLECTIVE_ATTRIBUTE("Collective Attribute", "An interceptor based service dealing with
collective attribute "
+        + "management. This service intercepts read operations on entries to "
+        + "inject collective attribute value pairs into the response based on "
+        + "the entires inclusion within collectiveAttributeSpecificAreas and collectiveAttributeInnerAreas."),
 
     /** The Event Interceptor */
-    EVENT("Event", "Description"),
+    EVENT("Event", "An interceptor based serivice for notifying NamingListeners of "
+        + "EventContext and EventDirContext changes."),
 
     /** The Trigger Interceptor */
-    TRIGGER("Trigger", "Description"),
+    TRIGGER("Trigger", "The trigger interceptor based on the Trigger Specification."),
 
     /** The Replication Interceptor */
-    REPLICATION("Replication", "Description", new ReplicationInterceptorConfiguration());
+    REPLICATION("Replication", "An interceptor that intercepts LDAP operations and propagates
the "
+        + "changes occurred by the operations into other ReplicaIds so the DIT "
+        + "of each ReplicaId in the cluster has the same content without any conflict.",
+        new ReplicationInterceptorConfiguration());
 
     /** The name */
     private String name;

Modified: directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java?rev=657070&r1=657069&r2=657070&view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java
(original)
+++ directory/studio/trunk/apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/model/v152/ServerXmlIOV152.java
Fri May 16 07:05:50 2008
@@ -828,7 +828,9 @@
             org.dom4j.Attribute idAttribute = ldapServerElement.attribute( "id" );
             if ( idAttribute == null )
             {
-                // TODO throw an error
+                // If the 'id' attribute does not exists,
+                // we throw an exception
+                throw new ServerXmlIOException( "Unable to find the 'id' attribute for the
'ldapServer' bean." );
             }
             else
             {
@@ -892,7 +894,9 @@
             org.dom4j.Attribute idAttribute = ldapServerElement.attribute( "id" );
             if ( idAttribute == null )
             {
-                // TODO throw an error
+                // If the 'id' attribute does not exists,
+                // we throw an exception
+                throw new ServerXmlIOException( "Unable to find the 'id' attribute for the
'ldapServer' bean." );
             }
             else
             {
@@ -1267,8 +1271,61 @@
      */
     private void createInterceptors( Element interceptorsElement, ServerConfigurationV152
serverConfiguration )
     {
-        // TODO Auto-generated method stub
+        List<InterceptorEnum> interceptors = serverConfiguration.getInterceptors();
 
+        if ( interceptors.contains( InterceptorEnum.NORMALIZATION ) )
+        {
+            interceptorsElement.addElement( "normalizationInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.AUTHENTICATION ) )
+        {
+            interceptorsElement.addElement( "authenticationInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.REFERRAL ) )
+        {
+            interceptorsElement.addElement( "referralInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.ACI_AUTHORIZATION ) )
+        {
+            interceptorsElement.addElement( "aciAuthorizationInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.DEFAULT_AUTHORIZATION ) )
+        {
+            interceptorsElement.addElement( "defaultAuthorizationInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.EXCEPTION ) )
+        {
+            interceptorsElement.addElement( "exceptionInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.OPERATIONAL_ATTRIBUTE ) )
+        {
+            interceptorsElement.addElement( "operationalAttributeInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.SCHEMA ) )
+        {
+            interceptorsElement.addElement( "schemaInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.SUBENTRY ) )
+        {
+            interceptorsElement.addElement( "subentryInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.COLLECTIVE_ATTRIBUTE ) )
+        {
+            interceptorsElement.addElement( "collectiveAttributeInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.EVENT ) )
+        {
+            interceptorsElement.addElement( "eventInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.TRIGGER ) )
+        {
+            interceptorsElement.addElement( "triggerInterceptor" );
+        }
+        if ( interceptors.contains( InterceptorEnum.REPLICATION ) )
+        {
+            // TODO support replication interceptor
+            //            interceptorsElement.addElement( "replicationInterceptor" );
+        }
     }
 
 



Mime
View raw message