You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2006/11/27 04:12:37 UTC

svn commit: r479503 - in /directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration: ./ Replica.java ReplicaId.java ReplicationAgreement.java ReplicationGroup.java ReplicationSchedule.java

Author: akarasulu
Date: Sun Nov 26 19:12:36 2006
New Revision: 479503

URL: http://svn.apache.org/viewvc?view=rev&rev=479503
Log:
some ideas from reading varios drafts

Added:
    directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/
    directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/Replica.java
    directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicaId.java
    directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationAgreement.java
    directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationGroup.java
    directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationSchedule.java

Added: directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/Replica.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/Replica.java?view=auto&rev=479503
==============================================================================
--- directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/Replica.java (added)
+++ directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/Replica.java Sun Nov 26 19:12:36 2006
@@ -0,0 +1,31 @@
+/*
+ *  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.server.replication.configuration;
+
+/**
+ * Document me!
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class Replica
+{
+
+}

Added: directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicaId.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicaId.java?view=auto&rev=479503
==============================================================================
--- directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicaId.java (added)
+++ directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicaId.java Sun Nov 26 19:12:36 2006
@@ -0,0 +1,152 @@
+/*
+ *  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.server.replication.configuration;
+
+
+import java.io.Serializable;
+import java.util.regex.Pattern;
+
+import org.apache.directory.shared.ldap.util.StringTools;
+
+
+/**
+ * Store a replica ID after having normalized it.
+ * 
+ * The normalization proces checks that the submitted id is valid, ie
+ * contains only this char set : { '-', '_', 'a..z', 'A..Z', '0..9' }
+ * and its length is between 1 and 16. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class ReplicaId implements Comparable, Serializable
+{
+    /**
+     * Declares the Serial Version Uid.
+     */
+    private static final long serialVersionUID = 1L;
+
+    /** The replica pattern. */
+    private static final Pattern REPLICA_ID_PATTERN = Pattern.compile( "[-_A-Z0-9]{1,16}" );
+
+    /** The formated replicaId */
+    private String id;
+
+
+    /**
+     * Creates a new instance of ReplicaId. The id must be a String 
+     * which respect the pattern :
+     * 
+     * [-_a-zA-Z0-9]*
+     * 
+     * and must be between 1 and 16 chars length
+     *
+     * @param id The replica pattern
+     */
+    public ReplicaId( String id )
+    {
+        if ( StringTools.isEmpty( id ) )
+        {
+            throw new IllegalArgumentException( "Empty ID: " + id );
+        }
+
+        String tmpId = id.trim().toUpperCase();
+
+        if ( !REPLICA_ID_PATTERN.matcher( tmpId ).matches() )
+        {
+            throw new IllegalArgumentException( "Invalid replica ID: " + id );
+        }
+
+        this.id = id;
+    }
+
+
+    /**
+     * @return The replicaId
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+
+    /**
+     * Returns a hash code value for the object.
+     * 
+     * @return a hash code value for this object.
+     */
+    public int hashCode()
+    {
+        return id.hashCode();
+    }
+
+
+    /**
+     * Indicates whether some other object is "equal to" this one
+     * 
+     * @param o the reference object with which to compare.
+     * @return <code>true</code> if this object is the same as the obj argument; 
+     * <code>false</code> otherwise.
+     */
+    public boolean equals( Object o )
+    {
+        if ( o == null )
+        {
+            return false;
+        }
+
+        if ( o == this )
+        {
+            return true;
+        }
+
+        if ( o instanceof ReplicaId )
+        {
+            return this.id.equals( ( ( ReplicaId ) o ).id );
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+
+    /**
+     * Compares this object with the specified object for order.  Returns a
+     * negative integer, zero, or a positive integer as this object is less
+     * than, equal to, or greater than the specified object.<p>
+     * 
+     * @param   o the Object to be compared.
+     * @return  a negative integer, zero, or a positive integer as this object
+     *      is less than, equal to, or greater than the specified object.
+     */
+    public int compareTo( Object o )
+    {
+        return this.id.compareTo( ( ( ReplicaId ) o ).id );
+    }
+
+
+    /**
+     * @return the Replica Id
+     */
+    public String toString()
+    {
+        return id;
+    }
+}

Added: directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationAgreement.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationAgreement.java?view=auto&rev=479503
==============================================================================
--- directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationAgreement.java (added)
+++ directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationAgreement.java Sun Nov 26 19:12:36 2006
@@ -0,0 +1,96 @@
+/*
+ *  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.server.replication.configuration;
+
+
+import java.util.Set;
+
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
+
+
+/**
+ * Document me!
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class ReplicationAgreement
+{
+    /**
+     * Each replication agreement has a unique identifier.
+     */
+    String id;
+    
+    /** 
+     * The set of critical attributes: those that trigger the immediate 
+     * initiation of a replication cycle.  
+     * 
+     * These are numeric attribute OIDs so the structure can be used for 
+     * fast lookups.
+     */
+    Set<String> criticalAttributes;
+    
+    /** 
+     * The set of attributes that are not replicated: note that attributes
+     * of type dSAOperation and collective attributes are not replicated.
+     * 
+     * These are numeric attribute OIDs so the structure can be used for 
+     * fast lookups.
+     */
+    Set<String> exclusions;
+    
+    /** 
+     * The set of attributes that are replicated.  Some attributes may be
+     * dSAOperation attributes and may still need to be replicated.
+     * 
+     * These are numeric attribute OIDs so the structure can be used for 
+     * fast lookups.
+     */
+    Set<String> inclusions;
+    
+    /**
+     * The replication group composing this agreement. 
+     */
+    ReplicationGroup replicationGroup;
+    
+    /**
+     * The replicatin area defined as a subtreeSpecification.
+     */
+    SubtreeSpecification area;
+    
+    /**
+     * The administrative point for the replication specific autonomous area.
+     */
+    LdapDN replicationBase;
+    
+    /**
+     * The schedule to use for initiating replication cycles.  This may be:
+     * <ul>
+     *   <li>periodic</li>
+     *   <li>manual</li>
+     *   <li>singular</li>
+     *   <li>on change with optional delay</li>
+     *   <li>after meeting a threshold of changes</li>
+     *   <li>minimum time after the last replication cycle</li>
+     * </ul> 
+     */
+    ReplicationSchedule replicationSchedule;
+}

Added: directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationGroup.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationGroup.java?view=auto&rev=479503
==============================================================================
--- directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationGroup.java (added)
+++ directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationGroup.java Sun Nov 26 19:12:36 2006
@@ -0,0 +1,32 @@
+/*
+ *  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.server.replication.configuration;
+
+
+/**
+ * Document me!
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class ReplicationGroup
+{
+
+}

Added: directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationSchedule.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationSchedule.java?view=auto&rev=479503
==============================================================================
--- directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationSchedule.java (added)
+++ directory/trunks/apacheds/server-replication/src/main/java/org/apache/directory/server/replication/configuration/ReplicationSchedule.java Sun Nov 26 19:12:36 2006
@@ -0,0 +1,31 @@
+/*
+ *  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.server.replication.configuration;
+
+
+/**
+ * Document me!
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface ReplicationSchedule
+{
+}