directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r550524 - /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/
Date Mon, 25 Jun 2007 15:05:46 GMT
Author: pamarcelot
Date: Mon Jun 25 08:05:45 2007
New Revision: 550524

URL: http://svn.apache.org/viewvc?view=rev&rev=550524
Log:
Added :
	o Javadoc
	o Listener interfaces for Attribute Type, Object Class and Schema.
	o Listerner Adapters

Added:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeAdapter.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeListener.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassAdapter.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassListener.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaAdapter.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaListener.java
Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeImpl.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassImpl.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java

Added: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeAdapter.java?view=auto&rev=550524
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeAdapter.java
(added)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeAdapter.java
Mon Jun 25 08:05:45 2007
@@ -0,0 +1,49 @@
+/*
+ *  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.apacheds.schemaeditor.model;
+
+
+/**
+ * This adapter class provides default implementations for the methods 
+ * described by the AttributeTypeListener interface.
+ * <p>
+ * Classes that wish to deal with attribute type events can extend this class 
+ * and override only the methods which they are interested in. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public abstract class AttributeTypeAdapter implements AttributeTypeListener
+{
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeListener#attributeTypeModified()
+     */
+    public void attributeTypeModified()
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeListener#attributeTypeRemoved()
+     */
+    public void attributeTypeRemoved()
+    {
+    }
+}

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeImpl.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeImpl.java?view=diff&rev=550524&r1=550523&r2=550524
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeImpl.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeImpl.java
Mon Jun 25 08:05:45 2007
@@ -20,6 +20,9 @@
 package org.apache.directory.studio.apacheds.schemaeditor.model;
 
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.naming.NamingException;
 
 import org.apache.directory.shared.ldap.schema.AbstractAttributeType;
@@ -30,188 +33,312 @@
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 
 
+/**
+ * This class represents an attribute type.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class AttributeTypeImpl extends AbstractAttributeType implements MutableSchemaObject
 {
+    private static final long serialVersionUID = 1L;
+
     /** The name of the superior */
     private String superiorName;
-    
-    /** The OID of the Syntax */
+
+    /** The OID of the syntax */
     private String syntaxOid;
-    
-    /** The name of the Equality MatchingRule */
+
+    /** The name of the equality matching rule */
     private String equalityName;
-    
-    /** The name of the Ordering MatchingRule */
+
+    /** The name of the ordering matching rule */
     private String orderingName;
-    
-    /** The name of the Substr MatchingRule */
+
+    /** The name of the substr matching rule */
     private String substrName;
 
+    /** The listeners */
+    private List<AttributeTypeListener> listeners;
 
-    public String getEqualityName()
+
+    /**
+     * Creates a new instance of AttributeTypeImpl.
+     *
+     * @param oid
+     *      the OID of the attribute type
+     */
+    public AttributeTypeImpl( String oid )
     {
-        return equalityName;
+        super( oid );
     }
 
 
-    public void setEqualityName( String equalityName )
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractSchemaObject#setNames(java.lang.String[])
+     */
+    public void setNames( String[] names )
     {
-        this.equalityName = equalityName;
+        super.setNames( names );
     }
 
 
-    public String getOrderingName()
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractSchemaObject#setDescription(java.lang.String)
+     */
+    public void setDescription( String description )
     {
-        return orderingName;
+        super.setDescription( description );
     }
 
 
-    public void setOrderingName( String orderingName )
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractSchemaObject#setObsolete(boolean)
+     */
+    public void setObsolete( boolean obsolete )
     {
-        this.orderingName = orderingName;
+        super.setObsolete( obsolete );
     }
 
 
-    public String getSubstrName()
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractAttributeType#setCanUserModify(boolean)
+     */
+    public void setCanUserModify( boolean canUserModify )
     {
-        return substrName;
+        super.setCanUserModify( canUserModify );
     }
 
 
-    public void setSubstrName( String substrName )
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractAttributeType#setCollective(boolean)
+     */
+    public void setCollective( boolean collective )
     {
-        this.substrName = substrName;
+        super.setCollective( collective );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractAttributeType#setSingleValue(boolean)
+     */
+    public void setSingleValue( boolean singleValue )
+    {
+        super.setSingleValue( singleValue );
     }
 
 
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractAttributeType#setUsage(org.apache.directory.shared.ldap.schema.UsageEnum)
+     */
+    public void setUsage( UsageEnum usage )
+    {
+        super.setUsage( usage );
+    }
+
+
+    /**
+     * Gets the superior name.
+     *
+     * @return
+     *      the superior name
+     */
     public String getSuperiorName()
     {
         return superiorName;
     }
 
 
+    /**
+     * Sets the superior name.
+     *
+     * @param superiorName
+     *      the superior name
+     */
     public void setSuperiorName( String superiorName )
     {
         this.superiorName = superiorName;
     }
 
 
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AttributeType#getSuperior()
+     */
+    public AttributeType getSuperior() throws NamingException
+    {
+        return null;
+    }
+
+
+    /**
+     * Gets the OID of the syntax.
+     * 
+     * @return
+     *      the OID of the syntax
+     */
     public String getSyntaxOid()
     {
         return syntaxOid;
     }
 
 
+    /**
+     * Sets the OID of the syntax.
+     *
+     * @param syntaxOid
+     *      the OID of the syntax
+     */
     public void setSyntaxOid( String syntaxOid )
     {
         this.syntaxOid = syntaxOid;
     }
 
 
-    public AttributeTypeImpl( String oid )
-    {
-        super( oid );
-        
-    }
-
-    /**
-     * 
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AttributeType#getSyntax()
      */
-    private static final long serialVersionUID = 1L;
-
-
-    public MatchingRule getEquality() throws NamingException
+    public Syntax getSyntax() throws NamingException
     {
-        // TODO Auto-generated method stub
         return null;
     }
 
 
-    public MatchingRule getOrdering() throws NamingException
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractAttributeType#setLength(int)
+     */
+    public void setLength( int length )
     {
-        // TODO Auto-generated method stub
-        return null;
+        super.setLength( length );
     }
 
 
-    public MatchingRule getSubstr() throws NamingException
+    /**
+     * Gets the equality matching rule name.
+     * 
+     * @return
+     *      the equality matching rule name
+     */
+    public String getEqualityName()
     {
-        // TODO Auto-generated method stub
-        return null;
+        return equalityName;
     }
 
 
-    public AttributeType getSuperior() throws NamingException
+    /**
+     * Sets the equality matching rule name.
+     * 
+     * @param equalityName
+     *      the equality matching rule name
+     */
+    public void setEqualityName( String equalityName )
     {
-        // TODO Auto-generated method stub
-        return null;
+        this.equalityName = equalityName;
     }
 
 
-    public Syntax getSyntax() throws NamingException
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AttributeType#getEquality()
+     */
+    public MatchingRule getEquality() throws NamingException
     {
-        // TODO Auto-generated method stub
         return null;
     }
 
 
-    @Override
-    public void setDescription( String description )
+    /**
+     * Gets the ordering matching rule name.
+     *
+     * @return
+     *      the ordering matching rule name
+     */
+    public String getOrderingName()
     {
-        super.setDescription( description );
+        return orderingName;
     }
 
 
-    @Override
-    public void setNames( String[] names )
+    /**
+     * Sets the ordering matching rule name.
+     *
+     * @param orderingName
+     *      the ordering matching rule name
+     */
+    public void setOrderingName( String orderingName )
     {
-        super.setNames( names );
+        this.orderingName = orderingName;
     }
 
 
-    @Override
-    public void setObsolete( boolean obsolete )
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AttributeType#getOrdering()
+     */
+    public MatchingRule getOrdering() throws NamingException
     {
-        super.setObsolete( obsolete );
+        return null;
     }
 
 
-    @Override
-    public void setCanUserModify( boolean canUserModify )
+    /**
+     * Gets the substring matching rule name.
+     *
+     * @return
+     *      the substring matching rule name
+     */
+    public String getSubstrName()
     {
-        // TODO Auto-generated method stub
-        super.setCanUserModify( canUserModify );
+        return substrName;
     }
 
 
-    @Override
-    public void setCollective( boolean collective )
+    /**
+     * Sets the substring matching rule name.
+     *
+     * @param substrName
+     *      the substring matching rule name
+     */
+    public void setSubstrName( String substrName )
     {
-        // TODO Auto-generated method stub
-        super.setCollective( collective );
+        this.substrName = substrName;
     }
 
 
-    @Override
-    public void setLength( int length )
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AttributeType#getSubstr()
+     */
+    public MatchingRule getSubstr() throws NamingException
     {
-        // TODO Auto-generated method stub
-        super.setLength( length );
+        return null;
     }
 
 
-    @Override
-    public void setSingleValue( boolean singleValue )
+    /**
+     * Adds an AttributeTypeListener.
+     *
+     * @param listener
+     *      the AttributeTypeListener
+     */
+    public void addListener( AttributeTypeListener listener )
     {
-        // TODO Auto-generated method stub
-        super.setSingleValue( singleValue );
+        if ( listeners == null )
+        {
+            listeners = new ArrayList<AttributeTypeListener>();
+        }
+
+        listeners.add( listener );
     }
 
 
-    @Override
-    public void setUsage( UsageEnum usage )
+    /**
+     * Removes an AttributeTypeListener
+     *
+     * @param listener
+     *      the AttributeTypeListener
+     */
+    public void removeListener( AttributeTypeListener listener )
     {
-        // TODO Auto-generated method stub
-        super.setUsage( usage );
+        if ( listeners != null )
+        {
+            listeners.remove( listener );
+        }
     }
 }

Added: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeListener.java?view=auto&rev=550524
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeListener.java
(added)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/AttributeTypeListener.java
Mon Jun 25 08:05:45 2007
@@ -0,0 +1,42 @@
+/*
+ *  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.apacheds.schemaeditor.model;
+
+
+/**
+ * Classes which implement this interface provide methods that deal with the 
+ * events that are generated when an event occurs on an attribute type.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface AttributeTypeListener
+{
+    /**
+     * Sent when the attribute type is modified.
+     */
+    public void attributeTypeModified();
+
+
+    /**
+     * Sent when the attribute type is removed.
+     */
+    public void attributeTypeRemoved();
+}

Added: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassAdapter.java?view=auto&rev=550524
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassAdapter.java
(added)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassAdapter.java
Mon Jun 25 08:05:45 2007
@@ -0,0 +1,49 @@
+/*
+ *  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.apacheds.schemaeditor.model;
+
+
+/**
+ * This adapter class provides default implementations for the methods 
+ * described by the ObjectChangeListener interface.
+ * <p>
+ * Classes that wish to deal with object class events can extend this class 
+ * and override only the methods which they are interested in. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public abstract class ObjectClassAdapter implements ObjectClassListener
+{
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassListener#objectClassModified()
+     */
+    public void objectClassModified()
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassListener#objectClassRemoved()
+     */
+    public void objectClassRemoved()
+    {
+    }
+}

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassImpl.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassImpl.java?view=diff&rev=550524&r1=550523&r2=550524
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassImpl.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassImpl.java
Mon Jun 25 08:05:45 2007
@@ -19,6 +19,10 @@
  */
 package org.apache.directory.studio.apacheds.schemaeditor.model;
 
+
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.naming.NamingException;
 
 import org.apache.directory.shared.ldap.schema.AbstractSchemaObject;
@@ -27,114 +31,220 @@
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
 
+
+/**
+ * This class implements an object class.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ObjectClassImpl extends AbstractSchemaObject implements MutableSchemaObject,
ObjectClass
 {
-    private ObjectClassTypeEnum objectClassTypeEnum;
-    
+    private static final long serialVersionUID = 1L;
+
+    /** The object class type */
+    private ObjectClassTypeEnum type;
+
+    /** The optional attribute type names list */
     private String[] mayNamesList;
-    
+
+    /** The mandatory attribute type names list */
     private String[] mustNamesList;
-    
+
+    /** The super class names list */
     private String[] superClassesNames;
-    
+
+    /** The listeners */
+    private List<ObjectClassListener> listeners;
+
+
+    /**
+     * Creates a new instance of ObjectClassImpl.
+     *
+     * @param oid
+     *      the OID of the object class
+     */
     public ObjectClassImpl( String oid )
     {
         super( oid );
-        // TODO Auto-generated constructor stub
     }
 
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
 
-    public AttributeType[] getMayList() throws NamingException
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractSchemaObject#setNames(java.lang.String[])
+     */
+    public void setNames( String[] names )
     {
-        // TODO Auto-generated method stub
-        return null;
+        super.setNames( names );
     }
 
-    public AttributeType[] getMustList() throws NamingException
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractSchemaObject#setDescription(java.lang.String)
+     */
+    public void setDescription( String description )
     {
-        // TODO Auto-generated method stub
-        return null;
+        super.setDescription( description );
     }
 
-    public ObjectClass[] getSuperClasses() throws NamingException
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.AbstractSchemaObject#setObsolete(boolean)
+     */
+    public void setObsolete( boolean obsolete )
     {
-        // TODO Auto-generated method stub
-        return null;
+        super.setObsolete( obsolete );
     }
 
-    @Override
-    public void setDescription( String description )
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.ObjectClass#getType()
+     */
+    public ObjectClassTypeEnum getType()
     {
-        // TODO Auto-generated method stub
-        super.setDescription( description );
+        return type;
     }
 
-    @Override
-    public void setNames( String[] names )
+
+    /**
+     * Sets the type of the object class.
+     *
+     * @param objectClassTypeEnum
+     *      the type of the object class
+     */
+    public void setType( ObjectClassTypeEnum objectClassTypeEnum )
     {
-        // TODO Auto-generated method stub
-        super.setNames( names );
+        this.type = objectClassTypeEnum;
     }
 
-    @Override
-    public void setObsolete( boolean obsolete )
+
+    /**
+     * gets the names of the super classes.
+     *
+     * @return
+     *      the names of the super classes
+     */
+    public String[] getSuperClassesNames()
     {
-        // TODO Auto-generated method stub
-        super.setObsolete( obsolete );
+        return superClassesNames;
     }
 
-    public String[] getMayNamesList()
+
+    /**
+     * Sets the names of the super classes.
+     *
+     * @param superClassesNames
+     *      the names of the super classes
+     */
+    public void setSuperClassesNames( String[] superClassesNames )
     {
-        return mayNamesList;
+        this.superClassesNames = superClassesNames;
     }
 
-    public void setMayNamesList( String[] mayNamesList )
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.ObjectClass#getSuperClasses()
+     */
+    public ObjectClass[] getSuperClasses() throws NamingException
     {
-        this.mayNamesList = mayNamesList;
+        return null;
     }
 
+
+    /**
+     * Gets the names of the mandatory attribute types.
+     *
+     * @return
+     *      the names of the mandatory attribute types
+     */
     public String[] getMustNamesList()
     {
         return mustNamesList;
     }
 
+
+    /**
+     * Set the names of the mandatory attribute types.
+     *
+     * @param mustNamesList
+     *      the names of the mandatory attribute types
+     */
     public void setMustNamesList( String[] mustNamesList )
     {
         this.mustNamesList = mustNamesList;
     }
 
-    public String[] getSuperClassesNames()
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.ObjectClass#getMustList()
+     */
+    public AttributeType[] getMustList() throws NamingException
     {
-        return superClassesNames;
+        return null;
     }
 
-    public void setSuperClassesNames( String[] superClassesNames )
+
+    /**
+     * Gets the names of the optional attribute types.
+     *
+     * @return
+     *      the names of the optional attribute types
+     */
+    public String[] getMayNamesList()
     {
-        this.superClassesNames = superClassesNames;
+        return mayNamesList;
     }
 
-    public ObjectClassTypeEnum getObjectClassTypeEnum()
+
+    /**
+     * Sets the names of the optional attribute types.
+     *
+     * @param mayNamesList
+     *      the names of the optional attribute types
+     */
+    public void setMayNamesList( String[] mayNamesList )
     {
-        return objectClassTypeEnum;
+        this.mayNamesList = mayNamesList;
     }
 
-    public void setObjectClassTypeEnum( ObjectClassTypeEnum objectClassTypeEnum )
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.shared.ldap.schema.ObjectClass#getMayList()
+     */
+    public AttributeType[] getMayList() throws NamingException
     {
-        this.objectClassTypeEnum = objectClassTypeEnum;
+        return null;
     }
 
-    public ObjectClassTypeEnum getType()
+
+    /**
+     * Adds an ObjectClassListener.
+     *
+     * @param listener
+     *      the ObjectClassListener
+     */
+    public void addListener( ObjectClassListener listener )
     {
-        return objectClassTypeEnum;
+        if ( listeners == null )
+        {
+            listeners = new ArrayList<ObjectClassListener>();
+        }
+
+        listeners.add( listener );
     }
-    
-    
-    public void setType( ObjectClassTypeEnum objectClassTypeEnum )
+
+
+    /**
+     * Removes an ObjectClassListener
+     *
+     * @param listener
+     *      the ObjectClassListener
+     */
+    public void removeListener( ObjectClassListener listener )
     {
-        this.objectClassTypeEnum = objectClassTypeEnum;
+        if ( listeners != null )
+        {
+            listeners.remove( listener );
+        }
     }
 }

Added: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassListener.java?view=auto&rev=550524
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassListener.java
(added)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/ObjectClassListener.java
Mon Jun 25 08:05:45 2007
@@ -0,0 +1,42 @@
+/*
+ *  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.apacheds.schemaeditor.model;
+
+
+/**
+ * Classes which implement this interface provide methods that deal with the 
+ * events that are generated when an event occurs on an object class.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface ObjectClassListener
+{
+    /**
+     * Sent when the object class is modified.
+     */
+    public void objectClassModified();
+
+
+    /**
+     * Sent when the object class is removed.
+     */
+    public void objectClassRemoved();
+}

Added: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaAdapter.java?view=auto&rev=550524
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaAdapter.java
(added)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaAdapter.java
Mon Jun 25 08:05:45 2007
@@ -0,0 +1,129 @@
+/*
+ *  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.apacheds.schemaeditor.model;
+
+
+/**
+ * This adapter class provides default implementations for the methods 
+ * described by the SchemaListener interface.
+ * <p>
+ * Classes that wish to deal with schema events can extend this class 
+ * and override only the methods which they are interested in. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public abstract class SchemaAdapter implements SchemaListener
+{
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#attributeTypeAdded(org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeImpl)
+     */
+    public void attributeTypeAdded( AttributeTypeImpl at )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#attributeTypeModified(org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeImpl)
+     */
+    public void attributeTypeModified( AttributeTypeImpl at )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#attributeTypeRemoved(org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeImpl)
+     */
+    public void attributeTypeRemoved( AttributeTypeImpl at )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#matchingRuleAdded(org.apache.directory.studio.apacheds.schemaeditor.model.MatchingRuleImpl)
+     */
+    public void matchingRuleAdded( MatchingRuleImpl mr )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#matchingRuleModified(org.apache.directory.studio.apacheds.schemaeditor.model.MatchingRuleImpl)
+     */
+    public void matchingRuleModified( MatchingRuleImpl mr )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#matchingRuleRemoved(org.apache.directory.studio.apacheds.schemaeditor.model.MatchingRuleImpl)
+     */
+    public void matchingRuleRemoved( MatchingRuleImpl mr )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#objectClassAdded(org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl)
+     */
+    public void objectClassAdded( ObjectClassImpl oc )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#objectClassModified(org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl)
+     */
+    public void objectClassModified( ObjectClassImpl oc )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#objectClassRemoved(org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl)
+     */
+    public void objectClassRemoved( ObjectClassImpl oc )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#syntaxAdded(org.apache.directory.studio.apacheds.schemaeditor.model.SyntaxImpl)
+     */
+    public void syntaxAdded( SyntaxImpl syntax )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#syntaxModified(org.apache.directory.studio.apacheds.schemaeditor.model.SyntaxImpl)
+     */
+    public void syntaxModified( SyntaxImpl syntax )
+    {
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.apacheds.schemaeditor.model.SchemaListener#syntaxRemoved(org.apache.directory.studio.apacheds.schemaeditor.model.SyntaxImpl)
+     */
+    public void syntaxRemoved( SyntaxImpl syntax )
+    {
+    }
+}

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java?view=diff&rev=550524&r1=550523&r2=550524
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaImpl.java
Mon Jun 25 08:05:45 2007
@@ -29,6 +29,12 @@
 import org.apache.directory.shared.ldap.schema.Syntax;
 
 
+/**
+ * This class represents a schema.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class SchemaImpl implements Schema
 {
     /** The name */
@@ -46,7 +52,16 @@
     /** The Syntax List */
     private List<Syntax> syntaxes = new ArrayList<Syntax>();
 
+    /** The listeners */
+    private List<SchemaListener> listeners;
 
+
+    /**
+     * Creates a new instance of SchemaImpl.
+     *
+     * @param name
+     *      the name of the schema
+     */
     public SchemaImpl( String name )
     {
         this.name = name;
@@ -216,5 +231,37 @@
     public void setName( String name )
     {
         this.name = name;
+    }
+
+
+    /**
+     * Adds an SchemaListener.
+     *
+     * @param listener
+     *      the SchemaListener
+     */
+    public void addListener( SchemaListener listener )
+    {
+        if ( listeners == null )
+        {
+            listeners = new ArrayList<SchemaListener>();
+        }
+
+        listeners.add( listener );
+    }
+
+
+    /**
+     * Removes an SchemaListener
+     *
+     * @param listener
+     *      the SchemaListener
+     */
+    public void removeListener( SchemaListener listener )
+    {
+        if ( listeners != null )
+        {
+            listeners.remove( listener );
+        }
     }
 }

Added: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaListener.java?view=auto&rev=550524
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaListener.java
(added)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/SchemaListener.java
Mon Jun 25 08:05:45 2007
@@ -0,0 +1,138 @@
+/*
+ *  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.apacheds.schemaeditor.model;
+
+
+/**
+ * Classes which implement this interface provide methods that deal with the 
+ * events that are generated when an event occurs on a schema.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public interface SchemaListener
+{
+    /**
+     * Sent when the attribute type is added.
+     *
+     * @param at
+     *      the added attribute type
+     */
+    public void attributeTypeAdded( AttributeTypeImpl at );
+
+
+    /**
+     * Sent when the attribute type is modified.
+     *
+     * @param at
+     *      the modified attribute type
+     */
+    public void attributeTypeModified( AttributeTypeImpl at );
+
+
+    /**
+     * Sent when an attribute type is removed.
+     *
+     * @param at
+     *      the removed attribute type
+     */
+    public void attributeTypeRemoved( AttributeTypeImpl at );
+
+
+    /**
+     * Sent when a matching rule is added.
+     *
+     * @param mr
+     *      the added matching rule
+     */
+    public void matchingRuleAdded( MatchingRuleImpl mr );
+
+
+    /**
+     * Sent when a matching rule is modified.
+     *
+     * @param mr
+     *      the modified matching rule
+     */
+    public void matchingRuleModified( MatchingRuleImpl mr );
+
+
+    /**
+     * Sent when a matching rule is removed.
+     *
+     * @param mr
+     *      the removed matching rule
+     */
+    public void matchingRuleRemoved( MatchingRuleImpl mr );
+
+
+    /**
+     * Sent when an object class is added.
+     *
+     * @param oc
+     *      the added object class
+     */
+    public void objectClassAdded( ObjectClassImpl oc );
+
+
+    /**
+     * Sent when an object class is modified.
+     *
+     * @param oc
+     *      the modified object class
+     */
+    public void objectClassModified( ObjectClassImpl oc );
+
+
+    /**
+     * Sent when an object class is removed.
+     *
+     * @param oc
+     *      the removed attribute type
+     */
+    public void objectClassRemoved( ObjectClassImpl oc );
+
+
+    /**
+     * Sent when a syntax is added.
+     *
+     * @param mr
+     *      the added syntax
+     */
+    public void syntaxAdded( SyntaxImpl syntax );
+
+
+    /**
+     * Sent when a syntax is modified.
+     *
+     * @param mr
+     *      the modified syntax
+     */
+    public void syntaxModified( SyntaxImpl syntax );
+
+
+    /**
+     * Sent when a syntax is removed.
+     *
+     * @param mr
+     *      the removed syntax
+     */
+    public void syntaxRemoved( SyntaxImpl syntax );
+}



Mime
View raw message