airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: adding log info messages to airavata API
Date Tue, 05 Jan 2016 20:20:20 GMT
Repository: airavata
Updated Branches:
  refs/heads/master fc3f979a4 -> 4dc658872


adding log info messages to airavata API


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

Branch: refs/heads/master
Commit: 4dc65887241821b23643a930cdd222238cda277c
Parents: fc3f979
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Tue Jan 5 15:20:53 2016 -0500
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Tue Jan 5 15:20:53 2016 -0500

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   | 166 ++++++++++++++-----
 1 file changed, 120 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/4dc65887/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 7c54deb..d9f5dc6 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -2574,7 +2574,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
     	try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().addComputeResource(computeResourceDescription);
+            String computeResource = appCatalog.getComputeResource().addComputeResource(computeResourceDescription);
+            logger.info("Airavata registered compute resource with compute resource Id :
" + computeResource);
+            return computeResource;
         } catch (AppCatalogException e) {
             logger.error("Error while saving compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -2597,7 +2599,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
     	try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().getComputeResource(computeResourceId);
+            ComputeResourceDescription computeResource = appCatalog.getComputeResource().getComputeResource(computeResourceId);
+            logger.info("Airavata retrieved compute resource with compute resource Id : "
+ computeResourceId);
+            return computeResource;
         } catch (AppCatalogException e) {
             logger.error(computeResourceId, "Error while retrieving compute resource...",
e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -2619,7 +2623,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             AiravataClientException, AiravataSystemException, AuthorizationException, TException
{
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().getAllComputeResourceIdList();
+            Map<String, String> computeResourceIdList = appCatalog.getComputeResource().getAllComputeResourceIdList();
+            logger.info("Airavata retrieved all the available compute resources...");
+            return computeResourceIdList;
         } catch (AppCatalogException e) {
             logger.error("Error while retrieving compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -2644,6 +2650,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     	try {
             appCatalog = RegistryFactory.getAppCatalog();
             appCatalog.getComputeResource().updateComputeResource(computeResourceId, computeResourceDescription);
+            logger.info("Airavata updated compute resource with compute resource Id : " +
computeResourceId);
             return true;
         } catch (AppCatalogException e) {
             logger.error(computeResourceId, "Error while updating compute resource...", e);
@@ -2668,6 +2675,7 @@ public class AiravataServerHandler implements Airavata.Iface {
     	try {
             appCatalog = RegistryFactory.getAppCatalog();
             appCatalog.getComputeResource().removeComputeResource(computeResourceId);
+            logger.info("Airavata deleted compute resource with compute resource Id : " +
computeResourceId);
             return true;
         } catch (AppCatalogException e) {
             logger.error(computeResourceId, "Error while deleting compute resource...", e);
@@ -2690,7 +2698,9 @@ public class AiravataServerHandler implements Airavata.Iface {
     public String registerStorageResource(AuthzToken authzToken, StorageResourceDescription
storageResourceDescription) throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getStorageResource().addStorageResource(storageResourceDescription);
+            String storageResource = appCatalog.getStorageResource().addStorageResource(storageResourceDescription);
+            logger.info("Airavata registered storage resource with storage resource Id :
" + storageResource);
+            return storageResource;
         } catch (AppCatalogException e) {
             logger.error("Error while saving storage resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -2712,7 +2722,9 @@ public class AiravataServerHandler implements Airavata.Iface {
     public StorageResourceDescription getStorageResource(AuthzToken authzToken, String storageResourceId)
throws InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException,
TException {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getStorageResource().getStorageResource(storageResourceId);
+            StorageResourceDescription storageResource = appCatalog.getStorageResource().getStorageResource(storageResourceId);
+            logger.info("Airavata retrieved storage resource with storage resource Id : "
+ storageResourceId);
+            return storageResource;
         } catch (AppCatalogException e) {
             logger.error(storageResourceId, "Error while retrieving storage resource...",
e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -2733,7 +2745,9 @@ public class AiravataServerHandler implements Airavata.Iface {
     public Map<String, String> getAllStorageResourceNames(AuthzToken authzToken) throws
InvalidRequestException, AiravataClientException, AiravataSystemException, AuthorizationException,
TException {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getStorageResource().getAllStorageResourceIdList();
+            Map<String, String> resourceIdList = appCatalog.getStorageResource().getAllStorageResourceIdList();
+            logger.info("Airavata retrieved storage resources list...");
+            return resourceIdList;
         } catch (AppCatalogException e) {
             logger.error("Error while retrieving storage resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -2757,6 +2771,7 @@ public class AiravataServerHandler implements Airavata.Iface {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
             appCatalog.getStorageResource().updateStorageResource(storageResourceId, storageResourceDescription);
+            logger.info("Airavata updated storage resource with storage resource Id : " +
storageResourceId);
             return true;
         } catch (AppCatalogException e) {
             logger.error(storageResourceId, "Error while updating storage resource...", e);
@@ -2780,6 +2795,7 @@ public class AiravataServerHandler implements Airavata.Iface {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
             appCatalog.getStorageResource().removeStorageResource(storageResourceId);
+            logger.info("Airavata deleted storage resource with storage resource Id : " +
storageResourceId);
             return true;
         } catch (AppCatalogException e) {
             logger.error(storageResourceId, "Error while deleting storage resource...", e);
@@ -2807,8 +2823,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     	try {
             appCatalog = RegistryFactory.getAppCatalog();
             ComputeResource computeResource = appCatalog.getComputeResource();
-            return addJobSubmissionInterface(computeResource, computeResourceId,
-            		computeResource.addLocalJobSubmission(localSubmission), JobSubmissionProtocol.LOCAL,
priorityOrder);
+            String submissionInterface = addJobSubmissionInterface(computeResource, computeResourceId,
+                    computeResource.addLocalJobSubmission(localSubmission), JobSubmissionProtocol.LOCAL,
priorityOrder);
+            logger.info("Airavata added local job submission for compute resource id: " +
computeResourceId);
+            return submissionInterface;
         } catch (AppCatalogException e) {
             logger.error(computeResourceId, "Error while adding job submission interface
to resource compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -2834,6 +2852,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             LocalSubmissionResource submission = AppCatalogThriftConversion.getLocalJobSubmission(localSubmission);
             submission.setJobSubmissionInterfaceId(jobSubmissionInterfaceId);
             submission.save();
+            logger.info("Airavata updated local job submission for job submission interface
id: " + jobSubmissionInterfaceId);
             return true;
         } catch (Exception e) {
             logger.error(jobSubmissionInterfaceId, "Error while adding job submission interface
to resource compute resource...", e);
@@ -2850,7 +2869,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             AiravataClientException, AiravataSystemException, AuthorizationException, TException
{
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().getLocalJobSubmission(jobSubmissionId);
+            LOCALSubmission localJobSubmission = appCatalog.getComputeResource().getLocalJobSubmission(jobSubmissionId);
+            logger.info("Airavata retrieved local job submission for job submission interface
id: " + jobSubmissionId);
+            return localJobSubmission;
         } catch (AppCatalogException e) {
             String errorMsg = "Error while retrieving local job submission interface to resource
compute resource...";
             logger.error(jobSubmissionId, errorMsg, e);
@@ -2889,8 +2910,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     	try {
             appCatalog = RegistryFactory.getAppCatalog();
             ComputeResource computeResource = appCatalog.getComputeResource();
-            return addJobSubmissionInterface(computeResource, computeResourceId,
-            		computeResource.addSSHJobSubmission(sshJobSubmission), JobSubmissionProtocol.SSH,
priorityOrder);
+            String submissionInterface = addJobSubmissionInterface(computeResource, computeResourceId,
+                    computeResource.addSSHJobSubmission(sshJobSubmission), JobSubmissionProtocol.SSH,
priorityOrder);
+            logger.info("Airavata registered SSH job submission for compute resource id:
" + computeResourceId);
+            return submissionInterface;
         } catch (AppCatalogException e) {
             logger.error(computeResourceId, "Error while adding job submission interface
to resource compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -2917,8 +2940,10 @@ public class AiravataServerHandler implements Airavata.Iface {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
             ComputeResource computeResource = appCatalog.getComputeResource();
-            return addJobSubmissionInterface(computeResource, computeResourceId,
+            String submissionDetails = addJobSubmissionInterface(computeResource, computeResourceId,
                     computeResource.addSSHJobSubmission(sshJobSubmission), JobSubmissionProtocol.SSH_FORK,
priorityOrder);
+            logger.info("Airavata registered Fork job submission for compute resource id:
" + computeResourceId);
+            return submissionDetails;
         } catch (AppCatalogException e) {
             logger.error(computeResourceId, "Error while adding job submission interface
to resource compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -2934,7 +2959,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             AiravataClientException, AiravataSystemException, AuthorizationException, TException
{
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().getSSHJobSubmission(jobSubmissionId);
+            SSHJobSubmission sshJobSubmission = appCatalog.getComputeResource().getSSHJobSubmission(jobSubmissionId);
+            logger.info("Airavata retrieved SSH job submission for job submission interface
id: " + jobSubmissionId);
+            return sshJobSubmission;
         } catch (AppCatalogException e) {
             String errorMsg = "Error while retrieving SSH job submission interface to resource
compute resource...";
             logger.error(jobSubmissionId, errorMsg, e);
@@ -2963,8 +2990,10 @@ public class AiravataServerHandler implements Airavata.Iface {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
             ComputeResource computeResource = appCatalog.getComputeResource();
-            return addJobSubmissionInterface(computeResource, computeResourceId,
+            String submissionInterface = addJobSubmissionInterface(computeResource, computeResourceId,
                     computeResource.addCloudJobSubmission(cloudJobSubmission), JobSubmissionProtocol.CLOUD,
priorityOrder);
+            logger.info("Airavata registered Cloud job submission for compute resource id:
" + computeResourceId);
+            return submissionInterface;
         } catch (AppCatalogException e) {
             logger.error(computeResourceId, "Error while adding job submission interface
to resource compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -2980,7 +3009,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             AiravataClientException, AiravataSystemException, AuthorizationException, TException
{
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().getCloudJobSubmission(jobSubmissionId);
+            CloudJobSubmission cloudJobSubmission = appCatalog.getComputeResource().getCloudJobSubmission(jobSubmissionId);
+            logger.info("Airavata retrieved cloud job submission for job submission interface
id: " + jobSubmissionId);
+            return cloudJobSubmission;
         } catch (AppCatalogException e) {
             String errorMsg = "Error while retrieving Cloud job submission interface to resource
compute resource...";
             logger.error(jobSubmissionId, errorMsg, e);
@@ -2999,8 +3030,10 @@ public class AiravataServerHandler implements Airavata.Iface {
 		try {
 	        appCatalog = RegistryFactory.getAppCatalog();
 	        ComputeResource computeResource = appCatalog.getComputeResource();
-	        return addJobSubmissionInterface(computeResource, computeResourceId,
-	        		computeResource.addUNICOREJobSubmission(unicoreJobSubmission), JobSubmissionProtocol.UNICORE,
priorityOrder);
+            String submissionInterface = addJobSubmissionInterface(computeResource, computeResourceId,
+                    computeResource.addUNICOREJobSubmission(unicoreJobSubmission), JobSubmissionProtocol.UNICORE,
priorityOrder);
+            logger.info("Airavata registered UNICORE job submission for compute resource
id: " + computeResourceId);
+            return submissionInterface;
 	    } catch (AppCatalogException e) {
 	        logger.error("Error while adding job submission interface to resource compute resource...",
e);
 	        AiravataSystemException exception = new AiravataSystemException();
@@ -3016,7 +3049,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().getUNICOREJobSubmission(jobSubmissionId);
+            UnicoreJobSubmission unicoreJobSubmission = appCatalog.getComputeResource().getUNICOREJobSubmission(jobSubmissionId);
+            logger.info("Airavata retrieved UNICORE job submission for job submission interface
id: " + jobSubmissionId);
+            return unicoreJobSubmission;
         } catch (AppCatalogException e) {
             String errorMsg = "Error while retrieving Unicore job submission interface to
resource compute resource...";
             logger.error(jobSubmissionId, errorMsg, e);
@@ -3043,6 +3078,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             SshJobSubmissionResource submission = AppCatalogThriftConversion.getSSHJobSubmission(sshJobSubmission);
             submission.setJobSubmissionInterfaceId(jobSubmissionInterfaceId);
             submission.save();
+            logger.info("Airavata updated SSH job submission for job submission interface
id: " + jobSubmissionInterfaceId);
             return true;
         } catch (Exception e) {
             logger.error(jobSubmissionInterfaceId, "Error while adding job submission interface
to resource compute resource...", e);
@@ -3069,6 +3105,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             CloudSubmissionResource submission = AppCatalogThriftConversion.getCloudJobSubmission(cloudJobSubmission);
             submission.setJobSubmissionInterfaceId(jobSubmissionInterfaceId);
             submission.save();
+            logger.info("Airavata updated Cloud job submission for job submission interface
id: " + jobSubmissionInterfaceId);
             return true;
         } catch (Exception e) {
             logger.error(jobSubmissionInterfaceId, "Error while adding job submission interface
to resource compute resource...", e);
@@ -3087,6 +3124,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             UnicoreJobSubmissionResource submission = AppCatalogThriftConversion.getUnicoreJobSubmission(unicoreJobSubmission);
             submission.setjobSubmissionInterfaceId(jobSubmissionInterfaceId);
             submission.save();
+            logger.info("Airavata updated UNICORE job submission for job submission interface
id: " + jobSubmissionInterfaceId);
             return true;
         } catch (Exception e) {
             logger.error(jobSubmissionInterfaceId, "Error while adding job submission interface
to resource compute resource...", e);
@@ -3115,8 +3153,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     	try {
             appCatalog = RegistryFactory.getAppCatalog();
             ComputeResource computeResource = appCatalog.getComputeResource();
-            return addDataMovementInterface(computeResource, resourceId,dmType,
-            		computeResource.addLocalDataMovement(localDataMovement), DataMovementProtocol.LOCAL,
priorityOrder);
+            String movementInterface = addDataMovementInterface(computeResource, resourceId,
dmType,
+                    computeResource.addLocalDataMovement(localDataMovement), DataMovementProtocol.LOCAL,
priorityOrder);
+            logger.info("Airavata registered local data movement for resource Id: " + resourceId);
+            return movementInterface;
         } catch (AppCatalogException e) {
             logger.error(resourceId, "Error while adding data movement interface to resource
resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -3129,25 +3169,26 @@ public class AiravataServerHandler implements Airavata.Iface {
     /**
      * Update the given Local data movement details
      *
-     * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be
updated.
+     * @param dataMovementInterfaceId The identifier of the JobSubmission Interface to be
updated.
      * @param localDataMovement        The LOCALDataMovement object to be updated.
      * @return status
      * Returns a success/failure of the update.
      */
     @Override
     @SecurityCheck
-    public boolean updateLocalDataMovementDetails(AuthzToken authzToken, String jobSubmissionInterfaceId,
LOCALDataMovement localDataMovement)
+    public boolean updateLocalDataMovementDetails(AuthzToken authzToken, String dataMovementInterfaceId,
LOCALDataMovement localDataMovement)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
     	try {
             LocalDataMovementResource movment = AppCatalogThriftConversion.getLocalDataMovement(localDataMovement);
-            movment.setDataMovementInterfaceId(jobSubmissionInterfaceId);
+            movment.setDataMovementInterfaceId(dataMovementInterfaceId);
             movment.save();
+            logger.info("Airavata updated local data movement with data movement id: " +
dataMovementInterfaceId);
             return true;
         } catch (Exception e) {
-            logger.error(jobSubmissionInterfaceId, "Error while adding job submission interface
to resource compute resource...", e);
+            logger.error(dataMovementInterfaceId, "Error while updating local data movement
interface..", e);
             AiravataSystemException exception = new AiravataSystemException();
             exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
-            exception.setMessage("Error while adding job submission interface to resource
compute resource. More info : " + e.getMessage());
+            exception.setMessage("Error while updating local data movement interface. More
info : " + e.getMessage());
             throw exception;
         }
     }
@@ -3158,7 +3199,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             AiravataClientException, AiravataSystemException, AuthorizationException, TException
{
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().getLocalDataMovement(dataMovementId);
+            LOCALDataMovement localDataMovement = appCatalog.getComputeResource().getLocalDataMovement(dataMovementId);
+            logger.info("Airavata retrieved local data movement with data movement id: "
+ dataMovementId);
+            return localDataMovement;
         } catch (AppCatalogException e) {
             String errorMsg = "Error while retrieving local data movement interface to resource
compute resource...";
             logger.error(dataMovementId, errorMsg, e);
@@ -3197,8 +3240,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     	try {
             appCatalog = RegistryFactory.getAppCatalog();
             ComputeResource computeResource = appCatalog.getComputeResource();
-            return addDataMovementInterface(computeResource, resourceId,dmType,
-            		computeResource.addScpDataMovement(scpDataMovement), DataMovementProtocol.SCP,
priorityOrder);
+            String movementInterface = addDataMovementInterface(computeResource, resourceId,
dmType,
+                    computeResource.addScpDataMovement(scpDataMovement), DataMovementProtocol.SCP,
priorityOrder);
+            logger.info("Airavata registered SCP data movement for resource Id: " + resourceId);
+            return movementInterface;
         } catch (AppCatalogException e) {
             logger.error(resourceId, "Error while adding data movement interface to resource
compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -3212,22 +3257,23 @@ public class AiravataServerHandler implements Airavata.Iface {
      * Update the given scp data movement details
      * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
      *
-     * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be
updated.
+     * @param dataMovementInterfaceId The identifier of the JobSubmission Interface to be
updated.
      * @param scpDataMovement          The SCPDataMovement object to be updated.
      * @return status
      * Returns a success/failure of the update.
      */
     @Override
     @SecurityCheck
-    public boolean updateSCPDataMovementDetails(AuthzToken authzToken, String jobSubmissionInterfaceId,
SCPDataMovement scpDataMovement)
+    public boolean updateSCPDataMovementDetails(AuthzToken authzToken, String dataMovementInterfaceId,
SCPDataMovement scpDataMovement)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
     	try {
             ScpDataMovementResource movment = AppCatalogThriftConversion.getSCPDataMovementDescription(scpDataMovement);
-            movment.setDataMovementInterfaceId(jobSubmissionInterfaceId);
+            movment.setDataMovementInterfaceId(dataMovementInterfaceId);
             movment.save();
+            logger.info("Airavata updated SCP data movement with data movement id: " + dataMovementInterfaceId);
             return true;
         } catch (Exception e) {
-            logger.error(jobSubmissionInterfaceId, "Error while adding job submission interface
to resource compute resource...", e);
+            logger.error(dataMovementInterfaceId, "Error while adding job submission interface
to resource compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
             exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
             exception.setMessage("Error while adding job submission interface to resource
compute resource. More info : " + e.getMessage());
@@ -3241,7 +3287,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             AiravataClientException, AiravataSystemException, AuthorizationException, TException
{
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().getSCPDataMovement(dataMovementId);
+            SCPDataMovement scpDataMovement = appCatalog.getComputeResource().getSCPDataMovement(dataMovementId);
+            logger.info("Airavata retrieved SCP data movement with data movement id: " +
dataMovementId);
+            return scpDataMovement;
         } catch (AppCatalogException e) {
             String errorMsg = "Error while retrieving SCP data movement interface to resource
compute resource...";
             logger.error(dataMovementId, errorMsg, e);
@@ -3259,8 +3307,10 @@ public class AiravataServerHandler implements Airavata.Iface {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
             ComputeResource computeResource = appCatalog.getComputeResource();
-            return addDataMovementInterface(computeResource, resourceId,dmType,
+            String movementInterface = addDataMovementInterface(computeResource, resourceId,
dmType,
                     computeResource.addUnicoreDataMovement(unicoreDataMovement), DataMovementProtocol.UNICORE_STORAGE_SERVICE,
priorityOrder);
+            logger.info("Airavata registered UNICORE data movement for resource Id: " + resourceId);
+            return movementInterface;
         } catch (AppCatalogException e) {
             logger.error(resourceId, "Error while adding data movement interface to resource
compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -3278,6 +3328,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             UnicoreDataMovementResource movment = AppCatalogThriftConversion.getUnicoreDMResource(unicoreDataMovement);
             movment.setDataMovementId(dataMovementInterfaceId);
             movment.save();
+            logger.info("Airavata updated UNICORE data movement with data movement id: "
+ dataMovementInterfaceId);
             return true;
         } catch (Exception e) {
             logger.error(dataMovementInterfaceId, "Error while updating unicore data movement
to compute resource...", e);
@@ -3294,7 +3345,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             AiravataClientException, AiravataSystemException, AuthorizationException, TException
{
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().getUNICOREDataMovement(dataMovementId);
+            UnicoreDataMovement unicoreDataMovement = appCatalog.getComputeResource().getUNICOREDataMovement(dataMovementId);
+            logger.info("Airavata retrieved UNICORE data movement with data movement id:
" + dataMovementId);
+            return unicoreDataMovement;
         } catch (AppCatalogException e) {
             String errorMsg = "Error while retrieving UNICORE data movement interface...";
             logger.error(dataMovementId, errorMsg, e);
@@ -3323,8 +3376,10 @@ public class AiravataServerHandler implements Airavata.Iface {
     	try {
             appCatalog = RegistryFactory.getAppCatalog();
             ComputeResource computeResource = appCatalog.getComputeResource();
-            return addDataMovementInterface(computeResource, computeResourceId,dmType,
-            		computeResource.addGridFTPDataMovement(gridFTPDataMovement), DataMovementProtocol.GridFTP,
priorityOrder);
+            String addDataMovementInterface = addDataMovementInterface(computeResource, computeResourceId,
dmType,
+                    computeResource.addGridFTPDataMovement(gridFTPDataMovement), DataMovementProtocol.GridFTP,
priorityOrder);
+            logger.info("Airavata registered GridFTP data movement for resource Id: " + computeResourceId);
+            return addDataMovementInterface;
         } catch (AppCatalogException e) {
             logger.error(computeResourceId, "Error while adding data movement interface to
resource compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -3338,22 +3393,23 @@ public class AiravataServerHandler implements Airavata.Iface {
      * Update the given GridFTP data movement details to a compute resource
      * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
      *
-     * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be
updated.
+     * @param dataMovementInterfaceId The identifier of the JobSubmission Interface to be
updated.
      * @param gridFTPDataMovement      The GridFTPDataMovement object to be updated.
      * @return status
      * Returns a success/failure of the updation.
      */
     @Override
     @SecurityCheck
-    public boolean updateGridFTPDataMovementDetails(AuthzToken authzToken, String jobSubmissionInterfaceId,
GridFTPDataMovement gridFTPDataMovement)
+    public boolean updateGridFTPDataMovementDetails(AuthzToken authzToken, String dataMovementInterfaceId,
GridFTPDataMovement gridFTPDataMovement)
             throws InvalidRequestException, AiravataClientException, AiravataSystemException,
AuthorizationException, TException {
     	try {
             GridftpDataMovementResource movment = AppCatalogThriftConversion.getGridFTPDataMovementDescription(gridFTPDataMovement);
-            movment.setDataMovementInterfaceId(jobSubmissionInterfaceId);
+            movment.setDataMovementInterfaceId(dataMovementInterfaceId);
             movment.save();
+            logger.info("Airavata updated GRIDFTP data movement with data movement id: "
+ dataMovementInterfaceId );
             return true;
         } catch (Exception e) {
-            logger.error(jobSubmissionInterfaceId, "Error while adding job submission interface
to resource compute resource...", e);
+            logger.error(dataMovementInterfaceId, "Error while adding job submission interface
to resource compute resource...", e);
             AiravataSystemException exception = new AiravataSystemException();
             exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
             exception.setMessage("Error while adding job submission interface to resource
compute resource. More info : " + e.getMessage());
@@ -3367,7 +3423,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             AiravataClientException, AiravataSystemException, AuthorizationException, TException
{
         try {
             appCatalog = RegistryFactory.getAppCatalog();
-            return appCatalog.getComputeResource().getGridFTPDataMovement(dataMovementId);
+            GridFTPDataMovement gridFTPDataMovement = appCatalog.getComputeResource().getGridFTPDataMovement(dataMovementId);
+            logger.info("Airavata retrieved GRIDFTP data movement with data movement id:
" + dataMovementId);
+            return gridFTPDataMovement;
         } catch (AppCatalogException e) {
             String errorMsg = "Error while retrieving GridFTP data movement interface to
resource compute resource...";
             logger.error(dataMovementId, errorMsg, e);
@@ -3450,6 +3508,7 @@ public class AiravataServerHandler implements Airavata.Iface {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
             appCatalog.getComputeResource().removeJobSubmissionInterface(computeResourceId,
jobSubmissionInterfaceId);
+            logger.info("Airavata deleted job submission interface with interface id : "
+ jobSubmissionInterfaceId);
             return true;
         } catch (AppCatalogException e) {
             logger.error(jobSubmissionInterfaceId, "Error while deleting job submission interface...",
e);
@@ -3474,6 +3533,7 @@ public class AiravataServerHandler implements Airavata.Iface {
         try {
             appCatalog = RegistryFactory.getAppCatalog();
             appCatalog.getComputeResource().removeDataMovementInterface(computeResourceId,
dataMovementInterfaceId);
+            logger.info("Airavata deleted data movement interface with interface id : " +
dataMovementInterfaceId);
             return true;
         } catch (AppCatalogException e) {
             logger.error(dataMovementInterfaceId, "Error while deleting data movement interface...",
e);
@@ -3594,7 +3654,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             }
             appCatalog = RegistryFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
-            return gatewayProfile.addGatewayResourceProfile(gatewayResourceProfile);
+            String resourceProfile = gatewayProfile.addGatewayResourceProfile(gatewayResourceProfile);
+            logger.info("Airavata registered gateway profile with gateway id : " + gatewayResourceProfile.getGatewayID());
+            return resourceProfile;
         } catch (AppCatalogException e) {
             logger.error("Error while registering gateway resource profile...", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -3622,7 +3684,9 @@ public class AiravataServerHandler implements Airavata.Iface {
             }
             appCatalog = RegistryFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
-            return gatewayProfile.getGatewayProfile(gatewayID);
+            GatewayResourceProfile gatewayResourceProfile = gatewayProfile.getGatewayProfile(gatewayID);
+            logger.info("Airavata retrieved gateway profile with gateway id : " + gatewayID);
+            return gatewayResourceProfile;
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while retrieving gateway resource profile...",
e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -3652,6 +3716,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             appCatalog = RegistryFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             gatewayProfile.updateGatewayResourceProfile(gatewayID, gatewayResourceProfile);
+            logger.info("Airavata updated gateway profile with gateway id : " + gatewayID);
             return true;
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while updating gateway resource profile...", e);
@@ -3681,6 +3746,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             appCatalog = RegistryFactory.getAppCatalog();
             GwyResourceProfile gatewayProfile = appCatalog.getGatewayProfile();
             gatewayProfile.removeGatewayResourceProfile(gatewayID);
+            logger.info("Airavata deleted gateway profile with gateway id : " + gatewayID);
             return true;
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while removing gateway resource profile...", e);
@@ -3720,6 +3786,7 @@ public class AiravataServerHandler implements Airavata.Iface {
 //            gatewayProfile.removeGatewayResourceProfile(gatewayID);
             profile.addToComputeResourcePreferences(computeResourcePreference);
             gatewayProfile.updateGatewayResourceProfile(gatewayID, profile);
+            logger.info("Airavata added gateway compute resource preference with gateway
id : " + gatewayID + " and for compute resource id : " + computeResourceId );
             return true;
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while registering gateway resource profile preference...",
e);
@@ -3747,6 +3814,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             dataStoragePreference.setStorageResourceId(storageResourceId);
             profile.addToStoragePreferences(dataStoragePreference);
             gatewayProfile.updateGatewayResourceProfile(gatewayID, profile);
+            logger.info("Airavata added storage resource preference with gateway id : " +
gatewayID + " and for storage resource id : " + storageResourceId );
             return true;
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while registering gateway resource profile preference...",
e);
@@ -3791,7 +3859,9 @@ public class AiravataServerHandler implements Airavata.Iface {
                 exception.setMessage("Given compute resource does not exist in the system.
Please provide a valid compute resource id...");
                 throw exception;
             }
-            return gatewayProfile.getComputeResourcePreference(gatewayID, computeResourceId);
+            ComputeResourcePreference computeResourcePreference = gatewayProfile.getComputeResourcePreference(gatewayID,
computeResourceId);
+            logger.info("Airavata retrieved gateway compute resource preference with gateway
id : " + gatewayID + " and for compute resoruce id : " + computeResourceId );
+            return computeResourcePreference;
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while reading gateway compute resource preference...",
e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -3818,7 +3888,9 @@ public class AiravataServerHandler implements Airavata.Iface {
                 throw exception;
             }
 
-            return gatewayProfile.getStoragePreference(gatewayID, storageId);
+            StoragePreference storagePreference = gatewayProfile.getStoragePreference(gatewayID,
storageId);
+            logger.info("Airavata retrieved storage resource preference with gateway id :
" + gatewayID + " and for storage resource id : " + storageId);
+            return storagePreference;
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while reading gateway data storage preference...",
e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -3927,6 +3999,7 @@ public class AiravataServerHandler implements Airavata.Iface {
 			}
             profile.getComputeResourcePreferences().add(computeResourcePreference);
             gatewayProfile.updateGatewayResourceProfile(gatewayID, profile);
+            logger.info("Airavata updated compute resource preference with gateway id : "
+ gatewayID + " and for compute resource id : " + computeResourceId );
             return true;
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while reading gateway compute resource preference...",
e);
@@ -3961,6 +4034,7 @@ public class AiravataServerHandler implements Airavata.Iface {
             }
             profile.getStoragePreferences().add(dataStoragePreference);
             gatewayProfile.updateGatewayResourceProfile(gatewayID, profile);
+            logger.info("Airavata updated storage resource preference with gateway id : "
+ gatewayID + " and for storage resource id : " + storageId );
             return true;
         } catch (AppCatalogException e) {
             logger.error(gatewayID, "Error while reading gateway data storage preference...",
e);


Mime
View raw message