You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2012/01/17 16:11:13 UTC

svn commit: r1232437 [1/3] - in /incubator/airavata/trunk: modules/commons/ modules/commons/common-registry-api/ modules/commons/common-registry-api/src/ modules/commons/common-registry-api/src/main/ modules/commons/common-registry-api/src/main/java/ m...

Author: samindaw
Date: Tue Jan 17 15:11:10 2012
New Revision: 1232437

URL: http://svn.apache.org/viewvc?rev=1232437&view=rev
Log:
refactoring registry api

Added:
    incubator/airavata/trunk/modules/commons/common-registry-api/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/pom.xml
    incubator/airavata/trunk/modules/commons/common-registry-api/src/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/Registry.java
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/exception/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/exception/RegistryException.java
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/Authorizable.java
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/AuthorizableExistsException.java
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/Group.java
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/User.java
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/UserManager.java
    incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/UserManagerFactory.java
    incubator/airavata/trunk/modules/commons/common-registry-api/src/test/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/apache/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/apache/airavata/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/apache/airavata/registry/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/apache/airavata/registry/api/   (with props)
    incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/apache/airavata/registry/api/impl/   (with props)
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
Removed:
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Registry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/RegistryException.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/JCRRegistry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/user/
Modified:
    incubator/airavata/trunk/modules/commons/pom.xml
    incubator/airavata/trunk/modules/commons/registry-api/   (props changed)
    incubator/airavata/trunk/modules/commons/registry-api/pom.xml
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/DeploymentDescriptionRetrieveException.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/HostDescriptionRetrieveException.java
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/ServiceDescriptionRetrieveException.java
    incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryDeleteTest.java
    incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryRestartTest.java
    incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistrySearchTest.java
    incubator/airavata/trunk/modules/commons/registry-api/src/test/java/org/apache/airavata/registry/api/impl/JCRRegistryTest.java
    incubator/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/SwingUtil.java
    incubator/airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml
    incubator/airavata/trunk/modules/gfac-axis2/pom.xml
    incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
    incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/reciever/GFacMessageReciever.java
    incubator/airavata/trunk/modules/gfac-core/pom.xml
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/ExecutionContext.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/context/invocation/impl/DefaultExecutionContext.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/extension/post/OutputRegister.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java
    incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImpl.java
    incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java
    incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/SchedulerTest.java
    incubator/airavata/trunk/modules/test-suite/src/test/java/org/apache/airavata/test/suite/gfac/GramProviderTest.java
    incubator/airavata/trunk/modules/xbaya-gui/pom.xml
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionAdvancedOptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionHostAdvancedOptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/DescriptorEditorDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/gui/NewJCRRegistryUserDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistry.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/AbstractJackRabbitUMComponent.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizable.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitAuthorizableWrap.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroup.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitGroupWrap.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserManagerWrap.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/jackrabbit/user/JackRabbitUserWrap.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/experiment/gui/WorkflowInterpreterLaunchWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/JCRBrowserPanel.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/ApplicationDeploymentDescriptionWrap.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/ApplicationDeploymentDescriptions.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/GFacURL.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/GFacURLs.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/HostDescriptions.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/ServiceDescriptions.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/XBayaWorkflowExperiments.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/model/XBayaWorkflowTemplates.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/RegistryServiceTest.java
    incubator/airavata/trunk/samples/complex-math-service/   (props changed)
    incubator/airavata/trunk/samples/levenshtein-distance-service/   (props changed)

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Jan 17 15:11:10 2012
@@ -0,0 +1,4 @@
+target
+.classpath
+.project
+.settings

Added: incubator/airavata/trunk/modules/commons/common-registry-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/pom.xml?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/pom.xml (added)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/pom.xml Tue Jan 17 15:11:10 2012
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--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. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>commons</artifactId>
+        <version>0.2-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.airavata</groupId>
+    <artifactId>common-registry-api</artifactId>
+    <packaging>jar</packaging>
+    <name>Airavata Common Registry API</name>
+    <url>http://incubator.apache.org/airavata/</url>
+
+    <dependencies>
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>gfac-schema-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>common-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        
+        
+        <!-- Test -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-jcr-rmi</artifactId>
+            <scope>test</scope>
+        </dependency>
+        
+    </dependencies>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>2.3.2</version>
+                    <configuration>
+                        <source>1.5</source>
+                        <target>1.5</target>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+</project>

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/Registry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/Registry.java?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/Registry.java (added)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/Registry.java Tue Jan 17 15:11:10 2012
@@ -0,0 +1,48 @@
+/*
+ *
+ * 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.airavata.common.registry.api;
+
+import java.net.URI;
+
+public interface Registry {
+    /**
+     * Returns the default username that is specified to connect to the repository
+     * 
+     * @return
+     */
+    public String getUsername();
+
+    /**
+     * Repository uri
+     * 
+     * @return
+     */
+    public URI getRepositoryURI();
+
+    /**
+     * Returns the repository name
+     * 
+     * @return
+     */
+    public String getName();
+
+}

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/exception/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/exception/RegistryException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/exception/RegistryException.java?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/exception/RegistryException.java (added)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/exception/RegistryException.java Tue Jan 17 15:11:10 2012
@@ -0,0 +1,37 @@
+/*
+ *
+ * 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.airavata.common.registry.api.exception;
+
+public class RegistryException extends Exception {
+	
+    private final static String ERROR_MESSAGE = "Error occured while attempting to retrieve existing deployment descriptions";
+    
+    private static final long serialVersionUID = -2849422320139467602L;
+
+    public RegistryException(Exception e) {
+        super(ERROR_MESSAGE, e);
+    }
+    
+    protected RegistryException(String message, Exception e) {
+        super(message, e);
+    }
+}

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java (added)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java Tue Jan 17 15:11:10 2012
@@ -0,0 +1,194 @@
+/*
+ *
+ * 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.airavata.common.registry.api.impl;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
+import java.util.Map;
+import java.util.Observable;
+
+import javax.jcr.Credentials;
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.RepositoryFactory;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+
+import org.apache.airavata.common.registry.api.Registry;
+import org.apache.airavata.common.registry.api.user.UserManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class JCRRegistry extends Observable implements Registry{
+
+    private static final String XML_PROPERTY_NAME = "XML";
+
+    public static final String PUBLIC = "PUBLIC";
+
+    private Repository repository;
+    private Credentials credentials;
+    private UserManager userManager;
+    private String username;
+    private URI repositoryURI;
+    private Class registryRepositoryFactory;
+    private Map<String,String> connectionMap;
+    private String password;
+
+    private static Logger log = LoggerFactory.getLogger(JCRRegistry.class);
+
+    public JCRRegistry(URI repositoryURI, String className, String user, String pass, Map<String, String> map)
+            throws RepositoryException {
+        try {
+            /*
+             * Load the configuration from properties file at this level and create the object
+             */
+            connectionMap = map;
+            registryRepositoryFactory = Class.forName(className);
+            Constructor c = registryRepositoryFactory.getConstructor();
+            RepositoryFactory repositoryFactory = (RepositoryFactory) c.newInstance();
+            setRepositoryURI(repositoryURI);
+            repository = repositoryFactory.getRepository(connectionMap);
+            setUsername(user);
+            setPassword(pass);
+            credentials = new SimpleCredentials(getUsername(), new String(pass).toCharArray());
+        } catch (ClassNotFoundException e) {
+            log.error("Error class path settting", e);
+        } catch (RepositoryException e) {
+            log.error("Error connecting Remote Registry instance", e);
+            throw e;
+        } catch (Exception e) {
+            log.error("Error init", e);
+        }
+    }
+
+    public JCRRegistry(Repository repo, Credentials credentials) {
+        this.repository = repo;
+        this.credentials = credentials;
+    }
+
+    public Session getSession() throws RepositoryException {
+        Session session = null;
+        try {
+            session = repository.login(credentials);
+            if (session == null) {
+                session = resetSession(session);
+            }
+        } catch (Exception e) {
+            session = resetSession(session);
+        }
+        return session;
+    }
+
+    protected Session resetSession(Session session){
+        try {
+            Constructor c = registryRepositoryFactory.getConstructor();
+            RepositoryFactory repositoryFactory = (RepositoryFactory) c.newInstance();
+            setRepositoryURI(repositoryURI);
+            repository = repositoryFactory.getRepository(connectionMap);
+            setUsername(username);
+            credentials = new SimpleCredentials(getUsername(), getPassword().toCharArray());
+            session = repository.login(credentials);
+        } catch (NoSuchMethodException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        } catch (InstantiationException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        } catch (InvocationTargetException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        } catch (RepositoryException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+        return session;
+    }
+
+    protected Node getOrAddNode(Node node, String name) throws RepositoryException {
+        Node node1 = null;
+        try {
+            node1 = node.getNode(name);
+        } catch (PathNotFoundException pnfe) {
+            node1 = node.addNode(name);
+        } catch (RepositoryException e) {
+            String msg = "failed to resolve the path of the given node ";
+            log.debug(msg);
+            throw new RepositoryException(msg, e);
+        }
+        return node1;
+    }
+
+    protected void closeSession(Session session) {
+        if (session != null && session.isLive()) {
+            session.logout();
+        }
+    }
+
+
+    public UserManager getUserManager() {
+        return userManager;
+    }
+
+    public void setUserManager(UserManager userManager) {
+        this.userManager = userManager;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+    
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public URI getRepositoryURI() {
+        return repositoryURI;
+    }
+
+    protected void setRepositoryURI(URI repositoryURI) {
+        this.repositoryURI = repositoryURI;
+    }
+
+    protected void triggerObservers(Object o) {
+        setChanged();
+        notifyObservers(o);
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getName() {
+        return repository.getDescriptor(Repository.REP_NAME_DESC);
+    }
+
+    public Repository getRepository() {
+        return repository;
+    }
+
+
+}

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/Authorizable.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/Authorizable.java?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/Authorizable.java (added)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/Authorizable.java Tue Jan 17 15:11:10 2012
@@ -0,0 +1,170 @@
+/*
+ * 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.airavata.common.registry.api.user;
+
+import java.security.Principal;
+import java.util.Iterator;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+
+/**
+ * The Authorizable is the common base interface for {@link User} and {@link Group}. It provides access to the
+ * <code>Principal</code>s associated with an <code>Authorizable</code> (see below) and allow to access and modify
+ * additional properties such as e.g. full name, e-mail or address.
+ * <p/>
+ * <p/>
+ * Please note the difference between <code>Authorizable</code> and {@link java.security.Principal Principal}:<br>
+ * An <code>Authorizable</code> is repository object that is neither associated with nor depending from a particular
+ * <code>Session</code> and thus independant of the login mechanisms creating <code>Session</code>s.<br>
+ * <p/>
+ * On the other hand <code>Principal</code>s are representations of user identities. In other words: each
+ * <code>Principal</code> within the set associated with the Session's Subject upon login represents an identity for
+ * that user. An the set of <code>Principal</code>s may differ between different login mechanisms.<br>
+ * <p/>
+ * Consequently an one-to-many relationship exists between Authorizable and Principal (see also {@link #getPrincipal()}.
+ * <p/>
+ * <p/>
+ * The interfaces derived from Authorizable are defined as follows:
+ * <ul>
+ * <li>{@link User}: defined to be an authorizable that can be authenticated (by using Credentials) and impersonated.</li>
+ * <li>{@link Group}: defined to be a collection of other <code>Authorizable</code>s.</li>
+ * </ul>
+ * 
+ * @see User
+ * @see Group
+ */
+public interface Authorizable {
+
+    /**
+     * Return the implementation specific identifer for this <code>Authorizable</code>. It could e.g. be a UserID or
+     * simply the principal name.
+     * 
+     * @return Name of this <code>Authorizable</code>.
+     * @throws RepositoryException
+     *             if an error occurs.
+     */
+    String getID() throws RepositoryException;
+
+    /**
+     * @return if the current Authorizable is a {@link Group}
+     */
+    boolean isGroup();
+
+    /**
+     * @return a representation as Principal.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    Principal getPrincipal() throws RepositoryException;
+
+    /**
+     * @return all {@link Group}s, this Authorizable is declared member of.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    Iterator<Group> declaredMemberOf() throws RepositoryException;
+
+    /**
+     * @return all {@link Group}s, this Authorizable is member of included indirect group membership.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    Iterator<Group> memberOf() throws RepositoryException;
+
+    /**
+     * Removes this <code>Authorizable</code>, if the session has sufficient permissions. Note, that removing an
+     * <code>Authorizable</code> even if it listed as member of a Group or if still has members (this is a Group
+     * itself).
+     * 
+     * @throws RepositoryException
+     *             If an error occured and the <code>Authorizable</code> could not be removed.
+     */
+    void remove() throws RepositoryException;
+
+    /**
+     * Returns the names of properties present with <code>this</code> Authorizable.
+     * 
+     * @return names of properties.
+     * @throws RepositoryException
+     *             If an error occurs.
+     * @see #getProperty(String)
+     * @see #hasProperty(String)
+     */
+    Iterator<String> getPropertyNames() throws RepositoryException;
+
+    public Iterator<String> getPropertyNames(String name) throws RepositoryException;
+
+    /**
+     * Tests if a the property with specified name exists.
+     * 
+     * @param name
+     *            The name of the property to be tested.
+     * @return <code>true</code> if a property with the given name exists.
+     * @throws RepositoryException
+     *             If an error occurs.
+     * @see #getProperty(String)
+     */
+    boolean hasProperty(String name) throws RepositoryException;
+
+    /**
+     * Set an arbitrary property to this <code>Authorizable</code>.
+     * 
+     * @param name
+     *            The name of the property to be added or modified.
+     * @param value
+     *            The desired value.
+     * @throws RepositoryException
+     *             If the specified property could not be set.
+     */
+    void setProperty(String name, Value value) throws RepositoryException;
+
+    /**
+     * Set an arbitrary property to this <code>Authorizable</code>.
+     * 
+     * @param name
+     *            The name of the property to be added or modified.
+     * @param value
+     *            The desired property values.
+     * @throws RepositoryException
+     *             If the specified property could not be set.
+     */
+    void setProperty(String name, Value[] value) throws RepositoryException;
+
+    /**
+     * Returns the values for the properties with the specified name or <code>null</code>.
+     * 
+     * @param name
+     *            The name of the property to be retrieved.
+     * @return value of the property with the given name or <code>null</code> if no such property exists.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    Value[] getProperty(String name) throws RepositoryException;
+
+    /**
+     * Removes the property with the given name.
+     * 
+     * @param name
+     *            The name of the property to be removed.
+     * @return true If the property with the specified name was successfully removed; false if no such property was
+     *         present.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    boolean removeProperty(String name) throws RepositoryException;
+}

Added: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/AuthorizableExistsException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/AuthorizableExistsException.java?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/AuthorizableExistsException.java (added)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/AuthorizableExistsException.java Tue Jan 17 15:11:10 2012
@@ -0,0 +1,35 @@
+/*
+ * 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.airavata.common.registry.api.user;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * AuthorizableExistsException
+ */
+public class AuthorizableExistsException extends RepositoryException {
+
+    /**
+     * Serial version UID.
+     */
+    private static final long serialVersionUID = 7875416346848889564L;
+
+    public AuthorizableExistsException(String msg) {
+        super(msg);
+    }
+
+}

Added: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/Group.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/Group.java?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/Group.java (added)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/Group.java Tue Jan 17 15:11:10 2012
@@ -0,0 +1,76 @@
+/*
+ * 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.airavata.common.registry.api.user;
+
+import javax.jcr.RepositoryException;
+import java.util.Iterator;
+
+/**
+ * A Group is a collection of {@link #getMembers() Authorizable}s.
+ */
+public interface Group extends Authorizable {
+
+    /**
+     * @return Iterator of <code>Authorizable</code>s which are declared members of this Group.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    Iterator<Authorizable> getDeclaredMembers() throws RepositoryException;
+
+    /**
+     * @return Iterator of <code>Authorizable</code>s which are members of this Group. This includes both declared
+     *         members and all authorizables that are indirect group members.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    Iterator<Authorizable> getMembers() throws RepositoryException;
+
+    /**
+     * @param authorizable
+     *            The <code>Authorizable</code> to test.
+     * @return true if the Authorizable to test is a direct or indirect member of this Group.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    boolean isMember(Authorizable authorizable) throws RepositoryException;
+
+    /**
+     * Add a member to this Group.
+     * 
+     * @param authorizable
+     *            The <code>Authorizable</code> to be added as member to this group.
+     * @return true if the <code>Authorizable</code> has successfully been added to this Group, false otherwise (e.g.
+     *         unknown implemention or if it already is a member or if the passed authorizable is this group itself or
+     *         for some implementation specific constraint).
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    boolean addMember(Authorizable authorizable) throws RepositoryException;
+
+    /**
+     * Remove a member from this Group.
+     * 
+     * @param authorizable
+     *            The <code>Authorizable</code> to be removed from the list of group members.
+     * @return true if the Authorizable was successfully removed. False otherwise.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    boolean removeMember(Authorizable authorizable) throws RepositoryException;
+
+    public boolean isDeclaredMember(Authorizable authorizable) throws RepositoryException;
+}

Added: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/User.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/User.java?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/User.java (added)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/User.java Tue Jan 17 15:11:10 2012
@@ -0,0 +1,59 @@
+/*
+ * 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.airavata.common.registry.api.user;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Credentials;
+
+/**
+ * User is a special {@link Authorizable} that can be authenticated and impersonated.
+ * 
+ * @see #getCredentials()
+ * @see #getImpersonation()
+ */
+public interface User extends Authorizable {
+
+    /**
+     * @return true if the current user represents the administrator.
+     */
+    boolean isAdmin();
+
+    /**
+     * Returns <code>Credentials</code> for this user.
+     * 
+     * @return <code>Credentials</code> for this user.
+     * @throws javax.jcr.RepositoryException
+     *             If an error occurs.
+     */
+    Credentials getCredentials() throws RepositoryException;
+
+    // /**
+    // * @return <code>Impersonation</code> for this <code>User</code>.
+    // * @throws javax.jcr.RepositoryException If an error occurs.
+    // */
+    // Impersonation getImpersonation() throws RepositoryException;
+
+    /**
+     * Change the password of this user.
+     * 
+     * @param password
+     *            The new password.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    void changePassword(String password) throws RepositoryException;
+}
\ No newline at end of file

Added: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/UserManager.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/UserManager.java?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/UserManager.java (added)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/UserManager.java Tue Jan 17 15:11:10 2012
@@ -0,0 +1,203 @@
+/*
+ * 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.airavata.common.registry.api.user;
+
+import java.security.Principal;
+import java.util.Iterator;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.UnsupportedRepositoryOperationException;
+
+import org.apache.airavata.common.registry.api.impl.JCRRegistry;
+
+public interface UserManager {
+
+    /**
+     * Filter flag indicating that only <code>User</code>s should be searched and returned.
+     */
+    int SEARCH_TYPE_USER = 1;
+
+    /**
+     * Filter flag indicating that only <code>Group</code>s should be searched and returned.
+     */
+    int SEARCH_TYPE_GROUP = 2;
+
+    /**
+     * Filter flag indicating that all <code>Authorizable</code>s should be searched.
+     */
+    int SEARCH_TYPE_AUTHORIZABLE = 3;
+
+    /**
+     * Get the Authorizable by its id.
+     * 
+     * @param id
+     *            The user or group id.
+     * @return Authorizable or <code>null</code>, if not present.
+     * @throws RepositoryException
+     *             If an error occurs.
+     * @see Authorizable#getID()
+     */
+    Authorizable getAuthorizable(String id) throws RepositoryException;
+
+    /**
+     * Get the Authorizable by its main Principal.
+     * 
+     * @param principal
+     * @return Authorizable or <code>null</code>, if not present.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    Authorizable getAuthorizable(Principal principal) throws RepositoryException;
+
+    /**
+     * Returns all <code>Authorizable</code>s that have {@link Authorizable#getProperty(String) property} with the given
+     * name and that Property equals the given value.
+     * 
+     * @param propertyName
+     * @param value
+     * @return All <code>Authorizable</code>s that have a property with the given name exactly matching the given value.
+     * @throws RepositoryException
+     *             If an error occurs.
+     * @see Authorizable#getProperty(String)
+     */
+    Iterator<Authorizable> findAuthorizables(String propertyName, String value) throws RepositoryException;
+
+    /**
+     * Returns all <code>Authorizable</code>s that have {@link Authorizable#getProperty(String) property} with the given
+     * name and that Property equals the given value. In contrast to {@link #findAuthorizables(String, String)} the type
+     * of authorizable is respected while executing the search.
+     * 
+     * @param propertyName
+     * @param value
+     * @param searchType
+     *            Any of the following constants:
+     *            <ul>
+     *            <li>{@link #SEARCH_TYPE_AUTHORIZABLE}</li>
+     *            <li>{@link #SEARCH_TYPE_GROUP}</li>
+     *            <li>{@link #SEARCH_TYPE_USER}</li>
+     *            </ul>
+     * @return An iterator of <code>Authorizable</code>.
+     * @throws RepositoryException
+     *             If an error occurs.
+     */
+    Iterator<Authorizable> findAuthorizables(String propertyName, String value, int searchType)
+            throws RepositoryException;
+
+    /**
+     * Creates an User for the given userID / password pair; neither of the specified parameters can be
+     * <code>null</code>.<br>
+     * Same as {@link #createUser(String,String,Principal,String)} where the specified userID is equal to the principal
+     * name and the intermediate path is <code>null</code>.
+     * 
+     * @param userID
+     *            The id of the new user.
+     * @param password
+     *            The initial password of this user.
+     * @return The new <code>User</code>.
+     * @throws AuthorizableExistsException
+     *             in case the given userID is already in use or another Authorizable with the same principal name
+     *             exists.
+     * @throws RepositoryException
+     *             If another error occurs.
+     */
+    User createUser(String userID, String password) throws AuthorizableExistsException, RepositoryException;
+
+    /**
+     * Creates an User for the given parameters. If the implementation is not able to deal with the
+     * <code>intermediatePath</code> that parameter should be ignored. Except for the <code>intermediatePath</code>,
+     * neither of the specified parameters can be <code>null</code>.
+     * 
+     * @param userID
+     * @param password
+     * @param principal
+     * @param intermediatePath
+     * @return The new <code>User</code>.
+     * @throws AuthorizableExistsException
+     *             in case the given userID is already in use or another Authorizable with the same principal name
+     *             exists.
+     * @throws RepositoryException
+     *             If the current Session is not allowed to create users or some another error occurs.
+     */
+    User createUser(String userID, String password, Principal principal, String intermediatePath)
+            throws AuthorizableExistsException, RepositoryException;
+
+    /**
+     * Creates a new <code>Group</code> that is based on the given principal. Note that the group's ID is implementation
+     * specific. The implementation may take the principal name as ID hint but must in any case assert that it is unique
+     * among the IDs known to this manager.
+     * 
+     * @param principal
+     *            A non-null <code>Principal</code>
+     * @return The new <code>Group</code>.
+     * @throws AuthorizableExistsException
+     *             in case the given principal is already in use with another Authorizable.
+     * @throws RepositoryException
+     *             If another error occurs.
+     */
+    Group createGroup(Principal principal) throws AuthorizableExistsException, RepositoryException;
+
+    /**
+     * Creates a new <code>Group</code> that is based on the given principal and the specified
+     * <code>itermediatePath</code> hint. If the implementation is not able to deal with the
+     * <code>itermediatePath</code> this parameter should be ignored.
+     * 
+     * @param principal
+     * @param intermediatePath
+     * @return The new <code>Group</code>.
+     * @throws AuthorizableExistsException
+     *             in case the given principal is already in use with another Authorizable.
+     * @throws RepositoryException
+     *             If another error occurs.
+     */
+    Group createGroup(Principal principal, String intermediatePath) throws AuthorizableExistsException,
+            RepositoryException;
+
+    /**
+     * If any write operations executed through the User API are automatically persisted this method returns
+     * <code>true</code>. In this case there are no pending transient changes left and there is no need to explicitely
+     * call {@link javax.jcr.Session#save()}. If this method returns <code>false</code> any changes must be completed by
+     * an extra save call on the <code>Session</code> associated with this <code>UserManager</code>.
+     * 
+     * @return <code>true</code> if changes are automatically persisted; <code>false</code> if changes made through this
+     *         API (including method calls on {@link Authorizable} and subclasses are only transient and must be
+     *         persisted using {@link javax.jcr.Session#save()}.
+     * @throws RepositoryException
+     * @see #autoSave(boolean)
+     */
+    boolean isAutoSave() throws RepositoryException;
+
+    /**
+     * Changes the auto save behavior of this <code>UserManager</code>.
+     * <p/>
+     * Note, that this shouldn't be allowed in cases where the associated session is different from the original session
+     * accessing the user manager.
+     * 
+     * @param enable
+     *            If <code>true</code> changes made through this API will be automatically saved; otherwise an explict
+     *            call to {@link javax.jcr.Session#save()} is required in order to persist changes.
+     * @throws UnsupportedRepositoryOperationException
+     *             If the implementation does not allow to change the auto save behavior.
+     * @throws RepositoryException
+     *             If some other error occurs.
+     */
+    void autoSave(boolean enable) throws UnsupportedRepositoryOperationException, RepositoryException;
+
+    void setRepository(JCRRegistry repository);
+
+    JCRRegistry getRepository();
+}
\ No newline at end of file

Added: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/UserManagerFactory.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/UserManagerFactory.java?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/UserManagerFactory.java (added)
+++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/user/UserManagerFactory.java Tue Jan 17 15:11:10 2012
@@ -0,0 +1,58 @@
+/*
+ *
+ * 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.airavata.common.registry.api.user;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class UserManagerFactory {
+    private static Map<String, String> userManagers = new HashMap<String, String>();
+    private static Logger log = LoggerFactory.getLogger(UserManagerFactory.class);
+
+    public static UserManager getUserManager(String userManagerKey) throws Exception {
+        if (userManagers.containsKey(userManagerKey)) {
+            String userManagerClass = userManagers.get(userManagerKey);
+            try {
+                return (UserManager) Class.forName(userManagerClass).newInstance();
+            } catch (Exception e) {
+                log.error("Error retrieving user manager for key " + userManagerKey, e);
+                throw e;
+            }
+        }
+        return null;
+    }
+
+    public static void registerUserManager(String userManagerKey, String userManagerClassName) {
+        userManagers.put(userManagerKey, userManagerClassName);
+    }
+
+    public static void registerUserManager(String userManagerKey, Class<?> userManagerClass) {
+        registerUserManager(userManagerKey, userManagerClass.getCanonicalName());
+    }
+
+    public static void registerUserManager(String userManagerKey, UserManager userManagerObj) {
+        registerUserManager(userManagerKey, userManagerObj.getClass());
+    }
+}

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/test/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/apache/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/apache/airavata/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/apache/airavata/registry/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/apache/airavata/registry/api/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: incubator/airavata/trunk/modules/commons/common-registry-api/src/test/java/org/apache/airavata/registry/api/impl/
------------------------------------------------------------------------------
    bugtraq:number = true

Modified: incubator/airavata/trunk/modules/commons/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/pom.xml?rev=1232437&r1=1232436&r2=1232437&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/pom.xml (original)
+++ incubator/airavata/trunk/modules/commons/pom.xml Tue Jan 17 15:11:10 2012
@@ -92,6 +92,7 @@
 				<module>workflow-tracking</module>
 				<module>gfac-schema</module>
 				<module>utils</module>
+				<module>common-registry-api</module>
 				<module>registry-api</module>
 				<module>workflow-execution-context</module>
 			</modules>

Propchange: incubator/airavata/trunk/modules/commons/registry-api/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jan 17 15:11:10 2012
@@ -2,3 +2,4 @@
 .project
 .settings
 target
+derby.log

Modified: incubator/airavata/trunk/modules/commons/registry-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/pom.xml?rev=1232437&r1=1232436&r2=1232437&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/pom.xml (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/pom.xml Tue Jan 17 15:11:10 2012
@@ -46,7 +46,11 @@
             <artifactId>common-utils</artifactId>
             <version>${project.version}</version>
         </dependency>
-        
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>common-registry-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
         
         <!-- Test -->
         <dependency>

Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java?rev=1232437&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java (added)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java Tue Jan 17 15:11:10 2012
@@ -0,0 +1,226 @@
+/*
+ *
+ * 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.airavata.registry.api;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.registry.api.Registry;
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.registry.api.exception.DeploymentDescriptionRetrieveException;
+import org.apache.airavata.registry.api.exception.HostDescriptionRetrieveException;
+import org.apache.airavata.registry.api.exception.ServiceDescriptionRetrieveException;
+import org.apache.airavata.registry.api.workflow.WorkflowIOData;
+
+public interface AiravataRegistry extends Registry{
+    /**
+     * Find locations where the service is deployed
+     * 
+     * @param serviceId
+     * @return List of HostDescription having the service
+     */
+//    public List<HostDescription> getServiceLocation(String serviceId);
+
+    /**
+     * Retrieve a service description i.e. name, description, parameters
+     * 
+     * @param serviceId
+     * @return a service description or null if a description is not found
+     * @throws ServiceDescriptionRetrieveException
+     */
+    public ServiceDescription getServiceDescription(String serviceId) throws RegistryException;
+
+    /**
+     * Retrieve a deployment description for a service from the specific host
+     * 
+     * @param serviceId
+     * @param hostId
+     * @return a deployment description or null if a description is not found
+     * @throws DeploymentDescriptionRetrieveException
+     */
+    public ApplicationDeploymentDescription getDeploymentDescription(String serviceId, String hostId)
+            throws RegistryException;
+
+    /**
+     * Retrieve a host description
+     * 
+     * @param hostId
+     * @return a host description or null if a description is not found
+     */
+    public HostDescription getHostDescription(String hostId) throws RegistryException;
+
+    /**
+     * Save a host description with the specific name.
+     * 
+     * @param name
+     * @param host
+     * @return identifier
+     */
+    public String saveHostDescription(HostDescription host);
+
+    /**
+     * Save a service description with the specific name.
+     * 
+     * @param service
+     * @param host
+     * @return identifier
+     */
+    public String saveServiceDescription(ServiceDescription service);
+
+    /**
+     * Save a deployment description according to the service and host
+     * 
+     * @param serviceId
+     * @param hostId
+     * @param app
+     * @return identifier
+     */
+    public String saveDeploymentDescription(String serviceId, String hostId, ApplicationDeploymentDescription app);
+
+    /**
+     * Deploy a service on a host
+     * 
+     * @param serviceName
+     * @param hostName
+     * @return true if service can be deploy on the host, otherwise false
+     */
+    public boolean deployServiceOnHost(String serviceName, String hostName);
+
+    /**
+     * Search host description with name
+     * 
+     * @param name
+     * @return the host descriptions with matched name
+     * @throws HostDescriptionRetrieveException
+     * @throws PathNotFoundException
+     */
+    public List<HostDescription> searchHostDescription(String name) throws RegistryException;
+
+    /**
+     * Search service description with name
+     * 
+     * @param nameRegEx
+     * @return the service descriptions with matched name
+     * @throws PathNotFoundException
+     * @throws ServiceDescriptionRetrieveException
+     */
+    public List<ServiceDescription> searchServiceDescription(String nameRegEx) throws RegistryException;
+
+    /**
+     * Search deployment description from a service and/or a hostname
+     * 
+     * @param serviceName
+     * @param hostName
+     * @return the deployment descriptions with matched names
+     * @throws PathNotFoundException
+     * @throws DeploymentDescriptionRetrieveException
+     */
+    public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName)
+            throws RegistryException;
+
+    /**
+     * Search deployment description from a service name
+     * 
+     * @param serviceName
+     * @return the deployment descriptions with matched names
+     * @throws PathNotFoundException
+     * @throws DeploymentDescriptionRetrieveException
+     */
+    public Map<HostDescription, List<ApplicationDeploymentDescription>> searchDeploymentDescription(String serviceName)
+            throws RegistryException;
+    
+    /**
+     * Search deployment description from a service and/or a hostname
+     * 
+     * @param serviceName
+     * @param hostName
+     * @param applicationName
+     * @return the deployment descriptions with matched service name, host name & reg-ex supported application name
+     * @throws PathNotFoundException
+     * @throws DeploymentDescriptionRetrieveException
+     */
+    public List<ApplicationDeploymentDescription> searchDeploymentDescription(String serviceName, String hostName,
+            String applicationName) throws RegistryException;
+
+    /**
+     * Return all deployment descriptions
+     * 
+     * @return all deployment descriptions on a map with their values containing the service & host as a string
+     *         separated by "$"
+     * @throws PathNotFoundException
+     * @throws DeploymentDescriptionRetrieveException
+     */
+    public Map<ApplicationDeploymentDescription, String> searchDeploymentDescription() throws RegistryException;
+
+    /**
+     * This method can be used to save the gfacURL in to registry
+     * 
+     * @param gfacURL
+     * @return
+     */
+    public boolean saveGFacDescriptor(String gfacURL);
+
+    /**
+     * This method can be used to unset the gfacURL from repository resource
+     * 
+     * @param gfacURL
+     * @return
+     */
+    public boolean deleteGFacDescriptor(String gfacURL);
+
+    public List<String> getGFacDescriptorList();
+
+    public boolean saveWorkflow(QName ResourceID, String workflowName, String resourceDesc, String workflowAsaString,
+            String owner, boolean isMakePublic);
+
+    public Map<QName, Node> getWorkflows(String userName);
+
+    public Node getWorkflow(QName templateID, String userName);
+
+    public boolean deleteWorkflow(QName resourceID, String userName);
+
+    public void deleteServiceDescription(String serviceId) throws RegistryException;
+
+    public void deleteDeploymentDescription(String serviceName, String hostName, String applicationName)
+            throws RegistryException;
+
+    public void deleteHostDescription(String hostId) throws RegistryException;
+
+    public boolean saveWorkflowInput(WorkflowIOData workflowInputData);
+
+    public boolean saveWorkflowOutput(WorkflowIOData workflowOutputData);
+    
+    public List<WorkflowIOData> searchWorkflowInput(String experimentIdRegEx, String workflowNameRegEx, String nodeNameRegEx);
+
+    public List<WorkflowIOData> searchWorkflowOutput(String experimentIdRegEx, String workflowNameRegEx, String nodeNameRegEx);
+
+    public boolean saveWorkflowStatus(String experimentId,String status);
+
+    public String getWorkflowStatus(String experimentId);
+}

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java?rev=1232437&r1=1232436&r2=1232437&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java Tue Jan 17 15:11:10 2012
@@ -21,10 +21,10 @@
 
 package org.apache.airavata.registry.api;
 
+import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.registry.api.exception.RegistryException;
 
-public interface Axis2Registry extends Registry{
+public interface Axis2Registry extends AiravataRegistry{
 
     /**
      * Load WSDL for Axis2

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/DeploymentDescriptionRetrieveException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/DeploymentDescriptionRetrieveException.java?rev=1232437&r1=1232436&r2=1232437&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/DeploymentDescriptionRetrieveException.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/DeploymentDescriptionRetrieveException.java Tue Jan 17 15:11:10 2012
@@ -21,6 +21,8 @@
 
 package org.apache.airavata.registry.api.exception;
 
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
 public class DeploymentDescriptionRetrieveException extends RegistryException {
     private final static String ERROR_MESSAGE = "Error occured while attempting to retrieve existing deployment descriptions";
     /**

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/HostDescriptionRetrieveException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/HostDescriptionRetrieveException.java?rev=1232437&r1=1232436&r2=1232437&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/HostDescriptionRetrieveException.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/HostDescriptionRetrieveException.java Tue Jan 17 15:11:10 2012
@@ -21,6 +21,8 @@
 
 package org.apache.airavata.registry.api.exception;
 
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
 public class HostDescriptionRetrieveException extends RegistryException {
     private final static String ERROR_MESSAGE = "Error occured while attempting to retrieve existing hosts";
 

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/ServiceDescriptionRetrieveException.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/ServiceDescriptionRetrieveException.java?rev=1232437&r1=1232436&r2=1232437&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/ServiceDescriptionRetrieveException.java (original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/exception/ServiceDescriptionRetrieveException.java Tue Jan 17 15:11:10 2012
@@ -21,6 +21,8 @@
 
 package org.apache.airavata.registry.api.exception;
 
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+
 public class ServiceDescriptionRetrieveException extends RegistryException {
     private final static String ERROR_MESSAGE = "Error occured while attempting to retrieve existing service descriptions";
     /**