airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1395614 - in /airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa: ./ resources/
Date Mon, 08 Oct 2012 15:32:20 GMT
Author: lahiru
Date: Mon Oct  8 15:32:18 2012
New Revision: 1395614

URL: http://svn.apache.org/viewvc?rev=1395614&view=rev
Log:
adding logs to methods

Modified:
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentMetadataResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GramDataResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/HostDescriptorResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeDataResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/PublishWorkflowResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ServiceDescriptorResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java Mon Oct  8 15:32:18 2012
@@ -23,6 +23,8 @@ package org.apache.airavata.persistance.
 import org.apache.airavata.persistance.registry.jpa.model.*;
 import org.apache.airavata.persistance.registry.jpa.resources.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.persistence.*;
 import java.util.ArrayList;
@@ -33,6 +35,7 @@ import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 
 public class ResourceUtils {
+    private final static Logger logger = LoggerFactory.getLogger(ResourceUtils.class);
     private static final String PERSISTENCE_UNIT_NAME = "airavata_data";
     protected static EntityManagerFactory factory;
 
@@ -52,7 +55,6 @@ public class ResourceUtils {
             properties.put("openjpa.WriteLockLevel", "none");
             properties.put("openjpa.LockTimeout", "30000");
             properties.put("openjpa.LockManager", "none");
-//            properties.put("openjpa.jdbc.Schema", "AIRAVATA");
             properties.put("openjpa.ConnectionFactoryProperties","PrettyPrint=true, PrettyPrintLineLength=72, PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=60000");
             factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
         }
@@ -107,7 +109,7 @@ public class ResourceUtils {
             em.close();
             return true;
         } catch (Exception e) {
-            e.printStackTrace();
+            logger.error(e.getMessage(), e);
             return false;
         }
 
@@ -133,7 +135,7 @@ public class ResourceUtils {
             em.getTransaction().commit();
             em.close();
         } catch (Exception e) {
-            e.printStackTrace();
+            logger.error(e.getMessage(), e);
         }
 
     }
@@ -157,7 +159,7 @@ public class ResourceUtils {
             em.close();
             return true;
         } catch (Exception e) {
-            e.printStackTrace();
+            logger.error(e.getMessage(), e);
             return false;
         }
 
@@ -267,6 +269,7 @@ public class ResourceUtils {
             em.close();
             return existing!= null;
         } catch (Exception e){
+            logger.error(e.getMessage(), e);
             throw new EntityNotFoundException();
         }
     }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ConfigurationResource.java Mon Oct  8 15:32:18 2012
@@ -66,7 +66,7 @@ public class ConfigurationResource exten
      * @return UnsupportedOperationException
      */
     public Resource create(ResourceType type) {
-        logger.error("Unsupported operation for application descriptor resource " +
+        logger.error("Unsupported operation for configuration resource " +
                 "since there are no child resources generated by configuration resource.. ", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
@@ -79,7 +79,7 @@ public class ConfigurationResource exten
      * throws UnsupportedOperationException
      */
     public void remove(ResourceType type, Object name) {
-        logger.error("Unsupported operation for application descriptor resource " +
+        logger.error("Unsupported operation for configuration resource " +
                 "since there are no child resources generated by configuration resource.. ", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
@@ -93,7 +93,7 @@ public class ConfigurationResource exten
      * @return UnsupportedOperationException
      */
     public Resource get(ResourceType type, Object name) {
-        logger.error("Unsupported operation for application descriptor resource " +
+        logger.error("Unsupported operation for configuration resource " +
                 "since there are no child resources generated by configuration resource.. ", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
@@ -133,7 +133,7 @@ public class ConfigurationResource exten
      * @return UnsupportedOperationException
      */
     public List<Resource> get(ResourceType type) {
-        logger.error("Unsupported operation for application descriptor resource " +
+        logger.error("Unsupported operation for configuration resource " +
                 "since there are no child resources generated by configuration resource.. ", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
@@ -187,7 +187,7 @@ public class ConfigurationResource exten
      * @return UnsupportedOperationException
      */
     public boolean isExists(ResourceType type, Object name) {
-        logger.error("Unsupported operation for application descriptor resource " +
+        logger.error("Unsupported operation for configuration resource " +
                 "since there are no child resources generated by configuration resource.. ", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentDataRetriever.java Mon Oct  8 15:32:18 2012
@@ -109,18 +109,13 @@ public class ExperimentDataRetriever {
             statement.close();
             connection.close();
         } catch (InstantiationException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (IllegalAccessException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (ClassNotFoundException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (SQLException e){
-            e.printStackTrace();
         }catch (ParseException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         }
         return experimentData;
@@ -138,7 +133,6 @@ public class ExperimentDataRetriever {
             connection = DriverManager.getConnection(connectionURL, Utils.getJDBCUser(), Utils.getJDBCPassword());
             statement = connection.createStatement();
 
-//            String queryString = "SELECT experiment_ID FROM Experiment WHERE user_name ='" +  user + "'";
             // FIXME : pass user ID as a regular expression
             String queryString = "SELECT ed.experiment_ID FROM Experiment_Data ed " +
                     "LEFT JOIN Experiment e " +
@@ -156,16 +150,12 @@ public class ExperimentDataRetriever {
             statement.close();
             connection.close();
         } catch (InstantiationException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (IllegalAccessException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (ClassNotFoundException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (SQLException e){
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         }
 
@@ -282,7 +272,6 @@ public class ExperimentDataRetriever {
         } catch (ClassNotFoundException e) {
             logger.error(e.getMessage(), e);
         } catch (SQLException e){
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         }
         return experimentDataList;
@@ -331,16 +320,12 @@ public class ExperimentDataRetriever {
             statement.close();
             connection.close();
         } catch (InstantiationException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (IllegalAccessException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (ClassNotFoundException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (SQLException e){
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         }
         return experimentData;
@@ -392,16 +377,12 @@ public class ExperimentDataRetriever {
             statement.close();
             connection.close();
         } catch (InstantiationException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (IllegalAccessException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (ClassNotFoundException e) {
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         } catch (SQLException e){
-            e.printStackTrace();
             logger.error(e.getMessage(), e);
         }
         return experimentDataList;

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentMetadataResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentMetadataResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentMetadataResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentMetadataResource.java Mon Oct  8 15:32:18 2012
@@ -32,19 +32,26 @@ public class ExperimentMetadataResource 
     }
 
     public Resource create(ResourceType type) {
-
+        logger.error("Unsupported operation for experiment metadata resource " +
+                "since there are no child resources generated by experiment metadata resource.. ", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
     public void remove(ResourceType type, Object name) {
+        logger.error("Unsupported operation for experiment metadata resource " +
+                "since there are no child resources generated by experiment metadata resource.. ", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
     public Resource get(ResourceType type, Object name) {
+        logger.error("Unsupported operation for experiment metadata resource " +
+                "since there are no child resources generated by experiment metadata resource.. ", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
     public List<Resource> get(ResourceType type) {
+        logger.error("Unsupported operation for experiment metadata resource " +
+                "since there are no child resources generated by experiment metadata resource.. ", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExperimentResource.java Mon Oct  8 15:32:18 2012
@@ -36,8 +36,11 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.model.Project;
 import org.apache.airavata.persistance.registry.jpa.model.Users;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ExperimentResource extends AbstractResource {
+    private static final Logger logger = LoggerFactory.getLogger(ExperimentResource.class);
     private WorkerResource worker;
     private String expID;
     private Date submittedDate;
@@ -88,24 +91,37 @@ public class ExperimentResource extends 
 	            expDataResource.setExperimentID(getExpID());
 	            return expDataResource;
 	        default:
-	            throw new IllegalArgumentException("Unsupported resource type for experiment data resource.");
+                logger.error("Unsupported resource type for experiment resource.", new IllegalArgumentException());
+	            throw new IllegalArgumentException("Unsupported resource type for experiment resource.");
 	    }
     }
 
     /**
-     * Since experiments are at the leaf level, this method is not
-     * valid for an experiment
+     *
      * @param type  child resource types
      * @param name name of the child resource
      * @return UnsupportedOperationException
      */
     public void remove(ResourceType type, Object name) {
-        throw new UnsupportedOperationException();
+        EntityManager em = ResourceUtils.getEntityManager();
+        em.getTransaction().begin();
+        Query q;
+        QueryGenerator generator;
+        switch (type){
+            case EXPERIMENT_DATA:
+                generator = new QueryGenerator(EXPERIMENT_DATA);
+                generator.setParameter(ExperimentDataConstants.EXPERIMENT_ID, name);
+                q = generator.deleteQuery(em);
+                q.executeUpdate();
+                break;
+        }
+        em.getTransaction().commit();
+        em.close();
+
     }
 
     /**
-     * Since experiments are at the leaf level, this method is not
-     * valid for an experiment
+     *
      * @param type  child resource types
      * @param name name of the child resource
      * @return UnsupportedOperationException
@@ -128,6 +144,7 @@ public class ExperimentResource extends 
             default:
                 em.getTransaction().commit();
                 em.close();
+                logger.error("Unsupported resource type for experiment resource.", new IllegalArgumentException());
                 throw new IllegalArgumentException("Unsupported resource type for experiment data resource.");
         }
 
@@ -156,12 +173,12 @@ public class ExperimentResource extends 
     }
 
     /**
-     * Since experiments are at the leaf level, this method is not
-     * valid for an experiment
+     *
      * @param type  child resource types
      * @return UnsupportedOperationException
      */
     public List<Resource> get(ResourceType type) {
+        logger.error("Unsupported resource type for experiment resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GatewayResource.java Mon Oct  8 15:32:18 2012
@@ -133,6 +133,7 @@ public class GatewayResource extends Abs
                 workerResource.setGateway(this);
                 return workerResource;
             default:
+                logger.error("Unsupported resource type for gateway resource.", new IllegalArgumentException());
                 throw new IllegalArgumentException("Unsupported resource type for gateway resource.");
         }
     }
@@ -190,6 +191,7 @@ public class GatewayResource extends Abs
                 q.executeUpdate();
                 break;
             default:
+                logger.error("Unsupported resource type for gateway resource.", new IllegalArgumentException());
                 break;
         }
 
@@ -278,6 +280,7 @@ public class GatewayResource extends Abs
             default:
                 em.getTransaction().commit();
                 em.close();
+                logger.error("Unsupported resource type for gateway resource.", new IllegalArgumentException());
                 throw new IllegalArgumentException("Unsupported resource type for gateway resource.");
 
         }
@@ -398,6 +401,7 @@ public class GatewayResource extends Abs
             default:
                 em.getTransaction().commit();
                 em.close();
+                logger.error("Unsupported resource type for gateway resource.", new IllegalArgumentException());
                 throw new IllegalArgumentException("Unsupported resource type for gateway resource.");
         }
         em.getTransaction().commit();
@@ -471,6 +475,7 @@ public class GatewayResource extends Abs
                 em.close();
                 return existingExp != null;
             default:
+                logger.error("Unsupported resource type for gateway resource.", new IllegalArgumentException());
                 throw new IllegalArgumentException("Unsupported resource type for gateway resource.");
         }
     }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GramDataResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GramDataResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GramDataResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/GramDataResource.java Mon Oct  8 15:32:18 2012
@@ -29,11 +29,14 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.model.Gram_DataPK;
 import org.apache.airavata.persistance.registry.jpa.model.Node_Data;
 import org.apache.airavata.persistance.registry.jpa.model.Workflow_Data;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import java.util.List;
 
 public class GramDataResource extends AbstractResource{
+    private final static Logger logger = LoggerFactory.getLogger(GramDataResource.class);
     private WorkflowDataResource workflowDataResource;
     private String nodeID;
     private String rsl;
@@ -81,18 +84,22 @@ public class GramDataResource extends Ab
     }
 
     public Resource create(ResourceType type) {
+        logger.error("Unsupported resource type for Gram data resource" ,new UnsupportedOperationException() );
         throw new UnsupportedOperationException();
     }
 
     public void remove(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for Gram data resource" ,new UnsupportedOperationException() );
         throw new UnsupportedOperationException();
     }
 
     public Resource get(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for Gram data resource" ,new UnsupportedOperationException() );
         throw new UnsupportedOperationException();
     }
 
     public List<Resource> get(ResourceType type) {
+        logger.error("Unsupported resource type for Gram data resource" ,new UnsupportedOperationException() );
         throw new UnsupportedOperationException();
     }
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/HostDescriptorResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/HostDescriptorResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/HostDescriptorResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/HostDescriptorResource.java Mon Oct  8 15:32:18 2012
@@ -25,6 +25,8 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
@@ -35,6 +37,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 public class HostDescriptorResource extends AbstractResource {
+    private final static Logger logger = LoggerFactory.getLogger(HostDescriptorResource.class);
     private String hostDescName;
     private String gatewayName;
     private String userName;
@@ -113,8 +116,11 @@ public class HostDescriptorResource exte
             applicationDescriptorResource.setGatewayName(gatewayName);
             applicationDescriptorResource.setHostDescName(getHostDescName());
             return applicationDescriptorResource;
+        }else{
+            logger.error("Unsupported resource type for host descriptor resource.", new IllegalArgumentException());
+            throw new IllegalArgumentException("Unsupported resource type for host descriptor resource.");
         }
-        return null;
+
     }
 
     /**
@@ -123,7 +129,8 @@ public class HostDescriptorResource exte
      * @param name child resource name
      */
     public void remove(ResourceType type, Object name) {
-       throw new UnsupportedOperationException();
+        logger.error("Unsupported resource type for host descriptor resource.", new UnsupportedOperationException());
+        throw new UnsupportedOperationException();
     }
 
     /**
@@ -133,6 +140,7 @@ public class HostDescriptorResource exte
      * @return UnsupportedOperationException
      */
     public Resource get(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for host descriptor resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -232,6 +240,7 @@ public class HostDescriptorResource exte
      * @return boolean whether the child resource already exists
      */
     public boolean isExists(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for host descriptor resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeDataResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeDataResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeDataResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/NodeDataResource.java Mon Oct  8 15:32:18 2012
@@ -28,12 +28,15 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.model.Node_Data;
 import org.apache.airavata.persistance.registry.jpa.model.Node_DataPK;
 import org.apache.airavata.persistance.registry.jpa.model.Workflow_Data;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import java.sql.Timestamp;
 import java.util.List;
 
 public class NodeDataResource extends AbstractResource{
+    private final static Logger logger = LoggerFactory.getLogger(NodeDataResource.class);
     private WorkflowDataResource workflowDataResource;
     private String nodeID;
     private String nodeType;
@@ -108,18 +111,22 @@ public class NodeDataResource extends Ab
     }
 
     public Resource create(ResourceType type) {
+        logger.error("Unsupported resource type for node data resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
     public void remove(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for node data resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
     public Resource get(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for node data resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
     public List<Resource> get(ResourceType type) {
+        logger.error("Unsupported resource type for node data resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ProjectResource.java Mon Oct  8 15:32:18 2012
@@ -34,9 +34,11 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.model.Project;
 import org.apache.airavata.persistance.registry.jpa.model.Users;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class ProjectResource extends AbstractResource {
-
+    private final static Logger logger = LoggerFactory.getLogger(ProjectResource.class);
     private String name;
     private GatewayResource gateway;
     private WorkerResource worker;
@@ -72,6 +74,7 @@ public class ProjectResource extends Abs
             experimentResource.setWorker(getWorker());
             return experimentResource;
         } else {
+            logger.error("Unsupported resource type for project resource.", new IllegalArgumentException());
             throw new IllegalArgumentException("Unsupported resource type for project resource.");
         }
     }
@@ -91,6 +94,9 @@ public class ProjectResource extends Abs
         	generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
         	Query q = generator.deleteQuery(em);
         	q.executeUpdate();
+        }else {
+            logger.error("Unsupported resource type for project resource.", new IllegalArgumentException());
+            throw new IllegalArgumentException("Unsupported resource type for project resource.");
         }
         em.getTransaction().commit();
         em.close();
@@ -118,6 +124,7 @@ public class ProjectResource extends Abs
             em.close();
             return experimentResource;
         }else{
+            logger.error("Unsupported resource type for project resource.", new IllegalArgumentException());
             throw new IllegalArgumentException("Unsupported resource type for project resource.");
         }
 
@@ -174,6 +181,9 @@ public class ProjectResource extends Abs
             }
             em.getTransaction().commit();
             em.close();
+        } else {
+            logger.error("Unsupported resource type for project resource.", new IllegalArgumentException());
+            throw new IllegalArgumentException("Unsupported resource type for project resource.");
         }
         return resourceList;
     }

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/PublishWorkflowResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/PublishWorkflowResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/PublishWorkflowResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/PublishWorkflowResource.java Mon Oct  8 15:32:18 2012
@@ -28,6 +28,8 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.model.Published_Workflow_PK;
 import org.apache.airavata.persistance.registry.jpa.model.Users;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
@@ -36,6 +38,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 public class PublishWorkflowResource extends AbstractResource {
+    private final static Logger logger = LoggerFactory.getLogger(PublishWorkflowResource.class);
     private String name;
     private String version;
     private Date publishedDate;
@@ -153,6 +156,7 @@ public class PublishWorkflowResource ext
      * @return UnsupportedOperationException
      */
     public Resource create(ResourceType type) {
+        logger.error("Unsupported resource type for published workflow resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -163,6 +167,7 @@ public class PublishWorkflowResource ext
      * @param name name of the child resource
      */
     public void remove(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for published workflow resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -174,6 +179,7 @@ public class PublishWorkflowResource ext
      * @return UnsupportedOperationException
      */
     public Resource get(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for published workflow resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -206,6 +212,7 @@ public class PublishWorkflowResource ext
      * @return UnsupportedOperationException
      */
     public List<Resource> get(ResourceType type) {
+        logger.error("Unsupported resource type for published workflow resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -255,6 +262,7 @@ public class PublishWorkflowResource ext
      * @return UnsupportedOperationException
      */
     public boolean isExists(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for published workflow resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ServiceDescriptorResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ServiceDescriptorResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ServiceDescriptorResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ServiceDescriptorResource.java Mon Oct  8 15:32:18 2012
@@ -25,6 +25,8 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.*;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
@@ -32,16 +34,12 @@ import java.util.ArrayList;
 import java.util.List;
 
 public class ServiceDescriptorResource extends AbstractResource {
+    private final static Logger logger = LoggerFactory.getLogger(ServiceDescriptorResource.class);
     private String serviceDescName;
     private String gatewayName;
     private String userName;
     private String content;
 
-
-    public ServiceDescriptorResource(String serviceDescName) {
-        this.setServiceDescName(serviceDescName);
-    }
-
     public ServiceDescriptorResource() {
 
     }
@@ -81,14 +79,17 @@ public class ServiceDescriptorResource e
             applicationDescriptorResource.setHostDescName(getServiceDescName());
             return applicationDescriptorResource;
         }
+        logger.error("Unsupported resource type for service descriptor resource.", new IllegalArgumentException());
         throw new IllegalArgumentException("Unsupported resource type for service descriptor resource.");
     }
 
     public void remove(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for service descriptor resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
     public Resource get(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for service descriptor resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -160,6 +161,7 @@ public class ServiceDescriptorResource e
     }
 
     public boolean isExists(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for service descriptor resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserResource.java Mon Oct  8 15:32:18 2012
@@ -26,10 +26,13 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.ResourceType;
 import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
 import org.apache.airavata.persistance.registry.jpa.model.Users;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 
 public class UserResource extends AbstractResource {
+    private final static Logger logger = LoggerFactory.getLogger(UserResource.class);
     private String userName;
     private String password;
     private String gatewayName;
@@ -79,6 +82,7 @@ public class UserResource extends Abstra
      * @return child resource
      */
     public Resource create(ResourceType type) {
+        logger.error("Unsupported resource type for user resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -88,6 +92,7 @@ public class UserResource extends Abstra
      * @param name child resource name
      */
     public void remove(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for user resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -98,6 +103,7 @@ public class UserResource extends Abstra
      * @return UnsupportedOperationException
      */
     public Resource get(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for user resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -107,6 +113,7 @@ public class UserResource extends Abstra
      * @return UnsupportedOperationException
      */
     public List<Resource> get(ResourceType type) {
+        logger.error("Unsupported resource type for user resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -140,6 +147,7 @@ public class UserResource extends Abstra
      * @return UnsupportedOperationException
      */
     public boolean isExists(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for user resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/UserWorkflowResource.java Mon Oct  8 15:32:18 2012
@@ -28,6 +28,8 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.model.User_Workflow_PK;
 import org.apache.airavata.persistance.registry.jpa.model.Users;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
@@ -37,6 +39,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 public class UserWorkflowResource extends AbstractResource {
+    private final static Logger logger = LoggerFactory.getLogger(UserWorkflowResource.class);
     private GatewayResource gateway;
     private WorkerResource worker;
     private String name;
@@ -86,14 +89,17 @@ public class UserWorkflowResource extend
     }
 
     public Resource create(ResourceType type) {
+        logger.error("Unsupported resource type for user workflow resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
     public void remove(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for user workflow resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
     public Resource get(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for user workflow resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -121,6 +127,7 @@ public class UserWorkflowResource extend
     }
 
     public List<Resource> get(ResourceType type) {
+        logger.error("Unsupported resource type for user workflow resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
@@ -159,6 +166,7 @@ public class UserWorkflowResource extend
     }
 
     public boolean isExists(ResourceType type, Object name) {
+        logger.error("Unsupported resource type for user workflow resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java Mon Oct  8 15:32:18 2012
@@ -47,9 +47,12 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.registry.api.AiravataRegistryConnectionDataProvider;
 import org.apache.airavata.registry.api.AiravataRegistryFactory;
 import org.apache.airavata.registry.api.exception.UnknownRegistryConnectionDataException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 public class Utils {
+    private final static Logger logger = LoggerFactory.getLogger(Utils.class);
 
     public static Properties loadProperties(){
         URL resource = Utils.class.getClassLoader().getResource("repository.properties");
@@ -57,7 +60,7 @@ public class Utils {
         try {
             properties.load(resource.openStream());
         } catch (IOException e) {
-            e.printStackTrace();
+            logger.error("Unable to read repository properties..", e);
         }
         return properties;
     }
@@ -74,7 +77,7 @@ public class Utils {
     	try {
             return getProvider().getValue(JPAConstants.KEY_JDBC_URL).toString();
 		} catch (UnknownRegistryConnectionDataException e) {
-			e.printStackTrace();
+            logger.error(e.getMessage(), e);
             return null;
 		}
     }
@@ -86,7 +89,7 @@ public class Utils {
             URI uri = URI.create(cleanURI);
             return uri.getHost();
         } catch (Exception e) {
-            e.printStackTrace();
+            logger.error(e.getMessage(), e);
             return null;
         }
     }
@@ -98,7 +101,7 @@ public class Utils {
             URI uri = URI.create(cleanURI);
             return uri.getPort();
         } catch (Exception e) {
-            e.printStackTrace();
+            logger.error(e.getMessage(), e);
             return -1;
         }
     }
@@ -110,7 +113,7 @@ public class Utils {
             URI uri = URI.create(cleanURI);
             return uri.getScheme();
         } catch (Exception e) {
-            e.printStackTrace();
+            logger.error(e.getMessage(), e);
             return null;
         }
     }
@@ -132,7 +135,7 @@ public class Utils {
 				return getProvider().getValue(JPAConstants.KEY_JDBC_USER).toString();
 			}
 		} catch (UnknownRegistryConnectionDataException e) {
-			e.printStackTrace();
+            logger.error(e.getMessage(), e);
 		}
         Properties properties = loadProperties();
         return properties.getProperty(JPAConstants.KEY_JDBC_USER);
@@ -144,7 +147,7 @@ public class Utils {
 				return getProvider().getValue(JPAConstants.KEY_JDBC_PASSWORD).toString();
 			}
 		} catch (UnknownRegistryConnectionDataException e) {
-			e.printStackTrace();
+            logger.error(e.getMessage(), e);
 		}
         Properties properties = loadProperties();
         return properties.getProperty(JPAConstants.KEY_JDBC_PASSWORD);
@@ -156,7 +159,7 @@ public class Utils {
 				return getProvider().getValue(JPAConstants.KEY_JDBC_DRIVER).toString();
 			}
 		} catch (UnknownRegistryConnectionDataException e) {
-			e.printStackTrace();
+            logger.error(e.getMessage(), e);
 		}
         Properties properties = loadProperties();
         return properties.getProperty(JPAConstants.KEY_JDBC_DRIVER);
@@ -174,96 +177,112 @@ public class Utils {
                 if (o instanceof Gateway) {
                     return createGateway((Gateway) o);
                 } else {
+                    logger.error("Object should be a Gateway.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Gateway.");
                 }
             case PROJECT:
                 if (o instanceof Project){
                     return createProject((Project) o);
                 } else {
+                    logger.error("Object should be a Project.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Project.");
                 }
             case CONFIGURATION:
                 if(o instanceof Configuration){
                     return createConfiguration((Configuration) o);
                 }else {
+                    logger.error("Object should be a Configuration.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Configuration.");
                 }
             case APPLICATION_DESCRIPTOR:
                 if (o instanceof Application_Descriptor){
                     return createApplicationDescriptor((Application_Descriptor) o);
                 } else {
+                    logger.error("Object should be a Application Descriptor.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Application Descriptor.");
                 }
             case EXPERIMENT:
                 if (o instanceof Experiment){
                     return createExperiment((Experiment) o);
                 }  else {
+                    logger.error("Object should be a Experiment.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Experiment.");
                 }
             case USER:
                 if(o instanceof Users) {
                     return createUser((Users) o);
                 }else {
+                    logger.error("Object should be a User.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a User.");
                 }
             case HOST_DESCRIPTOR:
                 if (o instanceof Host_Descriptor){
                     return createHostDescriptor((Host_Descriptor) o);
                 }else {
+                    logger.error("Object should be a Host Descriptor.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Host Descriptor.");
                 }
             case SERVICE_DESCRIPTOR:
                 if (o instanceof Service_Descriptor){
                     return createServiceDescriptor((Service_Descriptor) o);
                 }else {
+                    logger.error("Object should be a Service Descriptor.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Service Descriptor.");
                 }
             case PUBLISHED_WORKFLOW:
                 if (o instanceof Published_Workflow){
                     return createPublishWorkflow((Published_Workflow) o);
                 }else {
+                    logger.error("Object should be a Publish Workflow.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Publish Workflow.");
                 }
             case USER_WORKFLOW:
                 if (o instanceof User_Workflow){
                     return createUserWorkflow((User_Workflow) o);
                 }else {
+                    logger.error("Object should be a User Workflow.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a User Workflow.");
                 }
             case GATEWAY_WORKER:
                 if (o instanceof Gateway_Worker){
                     return createGatewayWorker((Gateway_Worker)o);
                 } else {
+                    logger.error("Object should be a Gateway Worker.", new IllegalArgumentException());
                     throw  new IllegalArgumentException("Object should be a Gateway Worker.");
                 }
             case EXPERIMENT_DATA:
                 if (o instanceof  Experiment_Data){
                     return createExperimentData((Experiment_Data)o);
                 }else {
+                    logger.error("Object should be a Experiment Data.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Experiment Data.");
                 }
             case EXPERIMENT_METADATA:
                 if (o instanceof  Experiment_Metadata){
                     return createExperimentMetadata((Experiment_Metadata)o);
                 }else {
+                    logger.error("Object should be a Experiment Metadata.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Experiment Metadata.");
                 }
             case WORKFLOW_DATA:
                 if (o instanceof  Workflow_Data){
                     return createWorkflowData((Workflow_Data) o);
                 }else {
+                    logger.error("Object should be a Workflow Data.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Workflow Data.");
                 }
             case NODE_DATA:
                 if (o instanceof  Node_Data){
                     return createNodeData((Node_Data) o);
                 }else {
+                    logger.error("Object should be a Node Data.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Node Data.");
                 }
             case GRAM_DATA:
                 if (o instanceof  Gram_Data){
                     return createGramData((Gram_Data) o);
                 }else {
+                    logger.error("Object should be a Gram Data.", new IllegalArgumentException());
                     throw new IllegalArgumentException("Object should be a Gram Data.");
                 }
             default:
@@ -445,6 +464,11 @@ public class Utils {
         return userResource;
     }
 
+    /**
+     *
+     * @param o Experiment Data model object
+     * @return Experiment Data resource object
+     */
     private static Resource createExperimentData(Experiment_Data o){
         ExperimentDataResource experimentDataResource = new ExperimentDataResource();
         experimentDataResource.setExperimentID(o.getExperiment_ID());
@@ -453,6 +477,11 @@ public class Utils {
         return experimentDataResource;
     }
 
+    /**
+     *
+     * @param o Experiment MetaData model object
+     * @return Experiment MetaData resource object
+     */
     private static Resource createExperimentMetadata(Experiment_Metadata o) {
         ExperimentMetadataResource experimentMetadataResource = new ExperimentMetadataResource();
         experimentMetadataResource.setExpID(o.getExperiment_ID());
@@ -460,6 +489,11 @@ public class Utils {
         return experimentMetadataResource;
     }
 
+    /**
+     *
+     * @param o  Workflow_Data model object
+     * @return  WorkflowDataResource object
+     */
     private static Resource createWorkflowData(Workflow_Data o){
         WorkflowDataResource workflowDataResource = new WorkflowDataResource();
         workflowDataResource.setExperimentID(o.getExperiment_data().getExperiment_ID());
@@ -471,6 +505,11 @@ public class Utils {
         return workflowDataResource;
     }
 
+    /**
+     *
+     * @param o  Node_Data model object
+     * @return Node Data resource
+     */
     private static Resource createNodeData (Node_Data o){
         NodeDataResource nodeDataResource = new NodeDataResource();
         WorkflowDataResource workflowDataResource = (WorkflowDataResource)createWorkflowData(o.getWorkflow_Data());
@@ -489,6 +528,11 @@ public class Utils {
         return nodeDataResource;
     }
 
+    /**
+     *
+     * @param o GramData model object
+     * @return GramData Resource object
+     */
     private static Resource createGramData (Gram_Data o){
         GramDataResource gramDataResource = new GramDataResource();
         WorkflowDataResource workflowDataResource = (WorkflowDataResource)createWorkflowData(o.getWorkflow_Data());

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkerResource.java Mon Oct  8 15:32:18 2012
@@ -33,9 +33,12 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.model.*;
 import org.apache.airavata.persistance.registry.jpa.resources.AbstractResource.WorkflowDataConstants;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class WorkerResource extends AbstractResource {
-	private String user;
+    private final static Logger logger = LoggerFactory.getLogger(WorkerResource.class);
+    private String user;
 	private GatewayResource gateway;
 
     /**
@@ -74,7 +77,9 @@ public class WorkerResource extends Abst
 				userWorkflowResource.setGateway(gateway);
 				result=userWorkflowResource;
 			default:
-				break;
+                logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
+                throw new IllegalArgumentException("Unsupported resource type for worker resource.");
+
 		}
 		return result;
 	}
@@ -118,7 +123,8 @@ public class WorkerResource extends Abst
                 q.executeUpdate();
                 break;
 			default:
-				break;
+                logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
+                break;
 		}
         em.getTransaction().commit();
         em.close();
@@ -169,7 +175,8 @@ public class WorkerResource extends Abst
                 WorkflowDataResource workflowDataResource = (WorkflowDataResource)Utils.getResource(ResourceType.WORKFLOW_DATA, eworkflowData);
                 result= workflowDataResource;
 			default:
-				break;
+                logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
+                break;
 		}
         em.getTransaction().commit();
         em.close();
@@ -222,7 +229,8 @@ public class WorkerResource extends Abst
 	            }
 	            break;
 			default:
-				break;
+                logger.error("Unsupported resource type for worker resource.", new IllegalArgumentException());
+                break;
 		}
         em.getTransaction().commit();
         em.close();

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java?rev=1395614&r1=1395613&r2=1395614&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java Mon Oct  8 15:32:18 2012
@@ -29,6 +29,8 @@ import org.apache.airavata.persistance.r
 import org.apache.airavata.persistance.registry.jpa.model.Node_Data;
 import org.apache.airavata.persistance.registry.jpa.model.Workflow_Data;
 import org.apache.airavata.persistance.registry.jpa.utils.QueryGenerator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
@@ -37,6 +39,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 public class WorkflowDataResource extends AbstractResource{
+    private final static Logger logger = LoggerFactory.getLogger(WorkflowDataResource.class);
     public static final String NODE_DATA = "Node_Data";
     public static final String GRAM_DATA = "Gram_Data";
     private String experimentID;
@@ -105,6 +108,7 @@ public class WorkflowDataResource extend
                gramDataResource.setWorkflowDataResource(this);
                return gramDataResource;
            default:
+               logger.error("Unsupported resource type for workflow data resource.", new IllegalArgumentException());
                throw new IllegalArgumentException("Unsupported resource type for workflow data resource.");
        }
     }
@@ -130,6 +134,7 @@ public class WorkflowDataResource extend
                 q.executeUpdate();
                 break;
             default:
+                logger.error("Unsupported resource type for workflow data resource.", new IllegalArgumentException());
                 break;
         }
         em.getTransaction().commit();
@@ -165,6 +170,7 @@ public class WorkflowDataResource extend
             default:
                 em.getTransaction().commit();
                 em.close();
+                logger.error("Unsupported resource type for workflow data resource.", new IllegalArgumentException());
                 throw new IllegalArgumentException("Unsupported resource type for workflow data resource.");
 
 
@@ -209,6 +215,7 @@ public class WorkflowDataResource extend
             default:
                 em.getTransaction().commit();
                 em.close();
+                logger.error("Unsupported resource type for workflow data resource.", new IllegalArgumentException());
                 throw new IllegalArgumentException("Unsupported resource type for workflow data resource.");
         }
         em.getTransaction().commit();



Mime
View raw message