airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [05/50] [abbrv] airavata git commit: adding thrift generate files
Date Wed, 16 Dec 2015 03:50:52 GMT
adding thrift generate files


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/13667e77
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/13667e77
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/13667e77

Branch: refs/heads/master
Commit: 13667e77e68f92c79f260bc200d3443e0713e4ca
Parents: 2d35514
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Wed Dec 2 11:39:44 2015 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Tue Dec 15 21:09:35 2015 -0500

----------------------------------------------------------------------
 modules/data-manager/pom.xml                    | 21 ++++++++
 .../airavata/data/manager/DataManager.java      | 56 ++++++++++++++++++--
 .../data/manager/DataManagerFactory.java        |  4 ++
 .../airavata/data/manager/DataManagerImpl.java  | 23 +++++++-
 .../data/manager/DataManagerFactoryTest.java    |  8 +++
 pom.xml                                         |  1 +
 6 files changed, 109 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/13667e77/modules/data-manager/pom.xml
----------------------------------------------------------------------
diff --git a/modules/data-manager/pom.xml b/modules/data-manager/pom.xml
index 4d7a673..ffd5082 100644
--- a/modules/data-manager/pom.xml
+++ b/modules/data-manager/pom.xml
@@ -15,5 +15,26 @@
     <name>Airavata Data Manager</name>
     <url>http://airavata.apache.org/</url>
 
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-data-models</artifactId>
+            <version>${project.version}</version>
+        </dependency>
 
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.7</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/13667e77/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManager.java
----------------------------------------------------------------------
diff --git a/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManager.java
b/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManager.java
index ed79edb..7451a94 100644
--- a/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManager.java
+++ b/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManager.java
@@ -1,7 +1,57 @@
+/*
+ *
+ * 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.data.manager;
 
-/**
- * Created by supun on 12/1/15.
- */
+import org.apache.airavata.model.data.resource.ResourceModel;
+
 public interface DataManager {
+
+    /**
+     * To create a replica entry for an already existing file(s). This is how the system
comes to know about already
+     * existing resources
+     * @param resource
+     * @return
+     */
+    boolean publishResource(ResourceModel resource);
+
+    /**
+     * To remove a resource entry from the replica catalog
+     * @param resourceId
+     * @return
+     */
+    boolean removeResource(String resourceId);
+
+    /**
+     * To copy an already existing resource to a specified location. After successful copying
the new location will be
+     * added to the available replica locations of the resource
+     * @param resourceId
+     * @param destLocation
+     * @return
+     */
+    boolean copyResource(String resourceId, String destLocation);
+
+    /**
+     * To retrieve a resource object providing the resourceId
+     * @param resourceId
+     * @return
+     */
+    ResourceModel getResource(String resourceId);
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/13667e77/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerFactory.java
----------------------------------------------------------------------
diff --git a/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerFactory.java
b/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerFactory.java
index 74fd68f..e1fb18a 100644
--- a/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerFactory.java
+++ b/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerFactory.java
@@ -25,4 +25,8 @@ import org.slf4j.LoggerFactory;
 
 public class DataManagerFactory {
     private final static Logger logger = LoggerFactory.getLogger(DataManagerFactory.class);
+
+    public static DataManager getDataManager(){
+        return new DataManagerImpl();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/13667e77/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerImpl.java
b/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerImpl.java
index 379418f..fb92edf 100644
--- a/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerImpl.java
+++ b/modules/data-manager/src/main/java/org/apache/airavata/data/manager/DataManagerImpl.java
@@ -20,9 +20,30 @@
 */
 package org.apache.airavata.data.manager;
 
+import org.apache.airavata.model.data.resource.ResourceModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class DataManagerImpl {
+public class DataManagerImpl implements DataManager{
     private final static Logger logger = LoggerFactory.getLogger(DataManagerImpl.class);
+
+    @Override
+    public boolean publishResource(ResourceModel resource) {
+        return false;
+    }
+
+    @Override
+    public boolean removeResource(String resourceId) {
+        return false;
+    }
+
+    @Override
+    public boolean copyResource(String resourceId, String destLocation) {
+        return false;
+    }
+
+    @Override
+    public ResourceModel getResource(String resourceId) {
+        return null;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/13667e77/modules/data-manager/src/test/java/org/apache/airavata/data/manager/DataManagerFactoryTest.java
----------------------------------------------------------------------
diff --git a/modules/data-manager/src/test/java/org/apache/airavata/data/manager/DataManagerFactoryTest.java
b/modules/data-manager/src/test/java/org/apache/airavata/data/manager/DataManagerFactoryTest.java
index 4bfa570..aa10724 100644
--- a/modules/data-manager/src/test/java/org/apache/airavata/data/manager/DataManagerFactoryTest.java
+++ b/modules/data-manager/src/test/java/org/apache/airavata/data/manager/DataManagerFactoryTest.java
@@ -20,9 +20,17 @@
 */
 package org.apache.airavata.data.manager;
 
+import junit.framework.Assert;
+import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class DataManagerFactoryTest {
     private final static Logger logger = LoggerFactory.getLogger(DataManagerFactoryTest.class);
+
+    @Test
+    public void testCreateDataManager(){
+        DataManager dataManager = DataManagerFactory.getDataManager();
+        Assert.assertNotNull(dataManager);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/13667e77/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0f320b5..e83c5c7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -556,6 +556,7 @@
 				<module>modules/registry</module>
 				<module>modules/security</module>
 				<module>modules/credential-store</module>
+				<module>modules/data-manager</module>
 				<module>modules/orchestrator</module>
 				<module>modules/server</module>
 				<module>modules/test-suite</module>


Mime
View raw message