Fixed saving current time as reservation start and endtime

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

Branch: refs/heads/lahiru/AIRAVATA-2065
Commit: 2b3dec80736c0542346c70a6d6ab122d9f6448d5
Parents: cc009e3
Author: Shameera Rathnayaka <shameerai...@gmail.com>
Authored: Wed Aug 31 10:12:01 2016 -0400
Committer: Shameera Rathnayaka <shameerai...@gmail.com>
Committed: Wed Aug 31 10:12:01 2016 -0400

----------------------------------------------------------------------
 .../app/catalog/impl/GwyResourceProfileImpl.java  | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/2b3dec80/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
 
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
index bbf300a..b2d31a4 100644
--- 
a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
+++ 
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
@@ -84,8 +84,13 @@ public class GwyResourceProfileImpl implements 
GwyResourceProfile {
                     
resource.setScratchLocation(preference.getScratchLocation());
                     
resource.setQualityOfService(preference.getQualityOfService());
                     resource.setReservation(preference.getReservation());
-                    
resource.setReservationStartTime(AiravataUtils.getTime(preference.getReservationStartTime()));
-                    
resource.setReservationEndTime(AiravataUtils.getTime(preference.getReservationEndTime()));
+                    if(preference.getReservationStartTime() > 0){
+                        
resource.setReservationStartTime(AiravataUtils.getTime(preference.getReservationStartTime()));
+                    }
+
+                    if (preference.getReservationEndTime() > 0) {
+                        
resource.setReservationEndTime(AiravataUtils.getTime(preference.getReservationEndTime()));
+                    }
                     resource.save();
                 }
             }
@@ -144,8 +149,13 @@ public class GwyResourceProfileImpl implements 
GwyResourceProfile {
                     
resource.setUsageReportingGatewayId(preference.getUsageReportingGatewayId());
                     
resource.setQualityOfService(preference.getQualityOfService());
                     resource.setReservation(preference.getReservation());
-                    
resource.setReservationStartTime(AiravataUtils.getTime(preference.getReservationStartTime()));
-                    
resource.setReservationEndTime(AiravataUtils.getTime(preference.getReservationEndTime()));
+                    if(preference.getReservationStartTime() > 0){
+                        
resource.setReservationStartTime(AiravataUtils.getTime(preference.getReservationStartTime()));
+                    }
+
+                    if (preference.getReservationEndTime() > 0) {
+                        
resource.setReservationEndTime(AiravataUtils.getTime(preference.getReservationEndTime()));
+                    }
                     resource.save();
                 }
             }

Reply via email to