[Registry-dev] svn commit r15508 - in trunk/registry/modules: core/src/main/java/org/wso2/registry core/src/main/java/org/wso2/registry/app core/src/main/java/org/wso2/registry/jdbc core/src/main/java/org/wso2/registry/secure core/src/test/java/org/wso2/registry/jdbc webapps/src/main/java/org/wso2/registry/web/utils

svn at wso2.org svn at wso2.org
Wed Apr 2 22:38:41 PDT 2008


Author: azeez
Date: Wed Apr  2 22:38:24 2008
New Revision: 15508

Log:

Changing the API. Association name should come first.



Modified:
   trunk/registry/modules/core/src/main/java/org/wso2/registry/Registry.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
   trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
   trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/DependencyTest.java
   trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/DependenciesUtil.java

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/Registry.java
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/Registry.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/Registry.java	Wed Apr  2 22:38:24 2008
@@ -84,14 +84,14 @@
      * versions. If a path refers to the current version, it should contain the path in the form
      * /c1/c2/r1. If it refers to an old version, it should be in the form /c1/c2/r1?v=2.
      *
+     * @param associationType Type of the association
      * @param sourcePath   Path of the dependent resource
      * @param associationPaths Paths of dependency resources
-     * @param associationType : Type of the association
      * @throws RegistryException Depends on the implementation
      */
-    void addAssociation(String sourcePath,
-                        String associationPaths,
-                        String associationType) throws RegistryException;
+    void addAssociation(String associationType,
+                        String sourcePath,
+                        String associationPaths) throws RegistryException;
 
     /**
      * Get all associations of the given resource. This is a chain of association starting from the

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java	Wed Apr  2 22:38:24 2008
@@ -316,7 +316,7 @@
                     String destinationPath = entry.getContent();
                     String associationType = entry.getSummary();
                     getSecureRegistry(request)
-                            .addAssociation(values[0] , destinationPath ,associationType);
+                            .addAssociation(associationType, values[0] , destinationPath);
                 }
 
             }

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java	Wed Apr  2 22:38:24 2008
@@ -452,7 +452,7 @@
         }
     }
 
-    public void addAssociation(String sourcePath, String associationPaths, String associationType)
+    public void addAssociation(String associationType, String sourcePath, String associationPaths)
             throws RegistryException {
         Abdera abdera = new Abdera();
         AbderaClient abderaClient = new AbderaClient(abdera);

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/JDBCRegistry.java	Wed Apr  2 22:38:24 2008
@@ -615,7 +615,7 @@
         }
     }
 
-    public void addAssociation(String sourcePath, String associationPath, String associationType)
+    public void addAssociation(String associationType, String sourcePath, String associationPath)
             throws RegistryException {
         Connection conn = null;
         try {

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java	(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/secure/SecureRegistry.java	Wed Apr  2 22:38:24 2008
@@ -429,7 +429,7 @@
      * @param associationPaths
      * @param associationType  @throws RegistryException On authorizing error or an error caused by the underlying core
      */
-    public void addAssociation(String sourcePath, String associationPaths, String associationType)
+    public void addAssociation(String associationType, String sourcePath, String associationPaths)
             throws RegistryException {
 
         String authPath = getAuthorizationPath(sourcePath);
@@ -449,7 +449,7 @@
             throw new RegistryException(msg, e);
         }
 
-        registry.addAssociation(sourcePath, associationPaths, associationType);
+        registry.addAssociation(associationType, sourcePath, associationPaths);
     }
 
 

Modified: trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/DependencyTest.java
==============================================================================
--- trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/DependencyTest.java	(original)
+++ trunk/registry/modules/core/src/test/java/org/wso2/registry/jdbc/DependencyTest.java	Wed Apr  2 22:38:24 2008
@@ -46,8 +46,8 @@
         Resource r2 = registry.newResource();
         r2.setContent("this is dependent on r1".getBytes());
         registry.put("/depTest/test1/r2", r2);
-        registry.addAssociation(r2.getPath() ,"/depTest/test1/r1" , Association.DEPENDENCY);
-        registry.addAssociation(r1.getPath() ,"/depTest/test1/r2" , Association.DEPENDENENT);
+        registry.addAssociation(Association.DEPENDENCY, r2.getPath() ,"/depTest/test1/r1" );
+        registry.addAssociation(Association.DEPENDENCY, r1.getPath() ,"/depTest/test1/r2");
 
 
         Resource r21 = registry.get("/depTest/test1/r1");
@@ -84,8 +84,8 @@
         r2.setContent("this is dependent on r2".getBytes());
         registry.put("/depTest/test2/r2", r2);
 
-        registry.addAssociation("/depTest/test2/r2", "/depTest/test2/r1", Association.DEPENDENCY);
-        registry.addAssociation("/depTest/test2/r1" ,"/depTest/test2/r2", Association.DEPENDENENT);
+        registry.addAssociation(Association.DEPENDENCY, "/depTest/test2/r2", "/depTest/test2/r1");
+        registry.addAssociation(Association.DEPENDENCY, "/depTest/test2/r1" ,"/depTest/test2/r2");
 
         Resource r21 = registry.get("/depTest/test2/r1");
         Resource r22 = registry.get("/depTest/test2/r2");

Modified: trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/DependenciesUtil.java
==============================================================================
--- trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/DependenciesUtil.java	(original)
+++ trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/DependenciesUtil.java	Wed Apr  2 22:38:24 2008
@@ -32,7 +32,7 @@
             String dependecyPath = request.getParameter("dependency");
             Registry registry = CommonUtil.getUserRegistry(request);
             //System.out.println("I am here.");
-            registry.addAssociation(dependentPath, dependecyPath, Association.DEPENDENCY);
+            registry.addAssociation(Association.DEPENDENCY, dependentPath, dependecyPath);
             //System.out.println("I am here2");
             //response.sendRedirect(new StringBuilder().append("/wso2registry/web").append(dependentPath).toString());
 



More information about the Registry-dev mailing list