airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1405862 - in /airavata/trunk/modules: commons/utils/src/main/java/org/apache/airavata/common/exception/ commons/utils/src/main/java/org/apache/airavata/common/utils/ registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persista...
Date Mon, 05 Nov 2012 16:10:38 GMT
Author: samindaw
Date: Mon Nov  5 16:10:37 2012
New Revision: 1405862

URL: http://svn.apache.org/viewvc?rev=1405862&view=rev
Log:
adding annotations to support serialization/deserialization + some refactoring

Added:
    airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/LazyLoadedDataException.java
  (with props)
Modified:
    airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Version.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataSubRegistry.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java
    airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/WorkflowData.java

Added: airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/LazyLoadedDataException.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/LazyLoadedDataException.java?rev=1405862&view=auto
==============================================================================
--- airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/LazyLoadedDataException.java
(added)
+++ airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/LazyLoadedDataException.java
Mon Nov  5 16:10:37 2012
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.exception;
+
+public class LazyLoadedDataException extends AiravataException {
+	private static final long serialVersionUID = -3164776318582067936L;
+	public LazyLoadedDataException(String message) {
+		super(message);
+	}
+
+}

Propchange: airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/exception/LazyLoadedDataException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Version.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Version.java?rev=1405862&r1=1405861&r2=1405862&view=diff
==============================================================================
--- airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Version.java
(original)
+++ airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/Version.java
Mon Nov  5 16:10:37 2012
@@ -21,8 +21,14 @@
 
 package org.apache.airavata.common.utils;
 
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement
 public class Version {
-	public final String PROJECT_NAME;
+	public String PROJECT_NAME;
 	private Integer majorVersion=0;
 	private Integer minorVersion=0;
 	private Integer maintenanceVersion;
@@ -35,6 +41,9 @@ public class Version {
 		RC
 	}
 	
+	public Version() {
+	}
+	
 	public Version(String PROJECT_NAME,Integer majorVersion,Integer minorVersion,Integer maintenanceVersion,String
versionData,BuildType buildType) {
 		this.PROJECT_NAME=PROJECT_NAME;
 		this.majorVersion=majorVersion;

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1405862&r1=1405861&r2=1405862&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
Mon Nov  5 16:10:37 2012
@@ -31,6 +31,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.regex.Pattern;
 
+import org.apache.airavata.common.utils.Version;
 import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.commons.gfac.type.ServiceDescription;
@@ -96,6 +97,7 @@ public class AiravataJPARegistry extends
     private JPAResourceAccessor jpa;
     private boolean active=false;
     private static final String DEFAULT_PROJECT_NAME = "default";
+    private static final Version API_VERSION=new Version("Airavata Registry API",0,5,null,null,null);
     
     @Override
     protected void initialize() {
@@ -1417,5 +1419,9 @@ public class AiravataJPARegistry extends
 		return filteredExperiments;
 	}
 
+	@Override
+	public Version getVersion() {
+		return API_VERSION;
+	}
 
 }

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataSubRegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataSubRegistry.java?rev=1405862&r1=1405861&r2=1405862&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataSubRegistry.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataSubRegistry.java
Mon Nov  5 16:10:37 2012
@@ -21,6 +21,8 @@
 
 package org.apache.airavata.registry.api;
 
+import org.apache.airavata.common.utils.Version;
+
 public interface AiravataSubRegistry {
 
 	public abstract void setAiravataRegistry(AiravataRegistry2 registry);
@@ -36,4 +38,10 @@ public interface AiravataSubRegistry {
 	 */
 	public abstract boolean isActive();
 	
+	/**
+	 * Return the version of the Registry API
+	 * @return
+	 */
+	public Version getVersion();
+	
 }
\ No newline at end of file

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java?rev=1405862&r1=1405861&r2=1405862&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/exception/worker/ExperimentLazyLoadedException.java
Mon Nov  5 16:10:37 2012
@@ -21,9 +21,9 @@
 
 package org.apache.airavata.registry.api.exception.worker;
 
-import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.common.exception.LazyLoadedDataException;
 
-public class ExperimentLazyLoadedException extends RegistryException {
+public class ExperimentLazyLoadedException extends LazyLoadedDataException {
 
 	private static final long serialVersionUID = -8006347245307495767L;
 

Modified: airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/WorkflowData.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/WorkflowData.java?rev=1405862&r1=1405861&r2=1405862&view=diff
==============================================================================
--- airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/WorkflowData.java
(original)
+++ airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/WorkflowData.java
Mon Nov  5 16:10:37 2012
@@ -21,12 +21,23 @@
 
 package org.apache.airavata.workflow.model.wf;
 
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.airavata.common.exception.LazyLoadedDataException;
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement
 public class WorkflowData {
 	private String graphXML;
 	private boolean published;
 	private String name;
 	private boolean lazyLoaded;
 	
+	public WorkflowData() {
+	}
+	
 	public WorkflowData(String name, String graphXml, boolean published) {
 		setName(name);
 		setGraphXML(graphXml);
@@ -36,7 +47,7 @@ public class WorkflowData {
 	
 	public String getGraphXML() throws Exception {
 		if (isLazyLoaded()){
-			throw new Exception("This workflow data is lazy loaded. Please use the API to retrieve
the workflow graph!!!");
+			throw new LazyLoadedDataException("This workflow data is lazy loaded. Please use the API
to retrieve the workflow graph!!!");
 		}
 		return graphXML;
 	}



Mime
View raw message