airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1485838 - in /airavata/trunk/modules/rest: client/src/main/java/org/apache/airavata/rest/client/ service/src/main/java/org/apache/airavata/services/registry/rest/resources/
Date Thu, 23 May 2013 19:46:32 GMT
Author: chathuri
Date: Thu May 23 19:46:31 2013
New Revision: 1485838

URL: http://svn.apache.org/r1485838
Log:
adding REST client changes related to GFac Job data

Modified:
    airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
    airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
    airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java

Modified: airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java?rev=1485838&r1=1485837&r2=1485838&view=diff
==============================================================================
--- airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
(original)
+++ airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
Thu May 23 19:46:31 2013
@@ -2269,6 +2269,479 @@ public class ProvenanceResourceClient {
         return 0;
     }
 
+    public void addGFacJob(GFacJob job) {
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.ADD_GFAC_JOB);
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, null, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).post(ClientResponse.class, job);
+        int status = response.getStatus();
+
+        if (status == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, null, userName, callback.getPassword(userName), null, gateway);
+            response = builder.accept(
+                    MediaType.TEXT_PLAIN).post(ClientResponse.class, job);
+            status = response.getStatus();
+            if (status != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + status);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + status);
+        }
+    }
+
+    public void updateGFacJob(GFacJob job) {
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_GFAC_JOB);
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, null, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).post(ClientResponse.class, job);
+        int status = response.getStatus();
+
+        if (status == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, null, userName, callback.getPassword(userName), null, gateway);
+            response = builder.accept(
+                    MediaType.TEXT_PLAIN).post(ClientResponse.class, job);
+            status = response.getStatus();
+            if (status != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + status);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + status);
+        }
+    }
+
+    public void updateGFacJobStatus(String gfacJobId, GFacJob.GFacJobStatus status) {
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_GFAC_JOB_STATUS);
+        MultivaluedMap formParams = new MultivaluedMapImpl();
+        formParams.add("gfacJobID", gfacJobId);
+        formParams.add("gfacJobStatus", status.toString());
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, null, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+        int responseStatus = response.getStatus();
+
+        if (responseStatus == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (responseStatus == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, null, userName, callback.getPassword(userName), null, gateway);
+            response = builder.accept(
+                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+            responseStatus = response.getStatus();
+            if (responseStatus != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + responseStatus);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + responseStatus);
+        }
+    }
+
+    public void updateGFacJobData(String gfacJobId, String jobdata){
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_GFAC_JOB_DATA);
+        MultivaluedMap formParams = new MultivaluedMapImpl();
+        formParams.add("gfacJobID", gfacJobId);
+        formParams.add("jobdata", jobdata);
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, null, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+        int responseStatus = response.getStatus();
+
+        if (responseStatus == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (responseStatus == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, null, userName, callback.getPassword(userName), null, gateway);
+            response = builder.accept(
+                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+            responseStatus = response.getStatus();
+            if (responseStatus != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + responseStatus);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + responseStatus);
+        }
+    }
+
+    public void updateGFacJobSubmittedTime(String gfacJobId, Date submitted){
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String submittedDate = dateFormat.format(submitted);
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_GFAC_JOB_SUBMITTED_TIME);
+        MultivaluedMap formParams = new MultivaluedMapImpl();
+        formParams.add("gfacJobID", gfacJobId);
+        formParams.add("submittedDate", submittedDate);
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, null, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+        int responseStatus = response.getStatus();
+
+        if (responseStatus == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (responseStatus == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, null, userName, callback.getPassword(userName), null, gateway);
+            response = builder.accept(
+                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+            responseStatus = response.getStatus();
+            if (responseStatus != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + responseStatus);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + responseStatus);
+        }
+
+    }
+
+    public void updateGFacJobCompletedTime(String gfacJobId, Date completed){
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String completedDate = dateFormat.format(completed);
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_GFAC_JOB_COMPLETED_TIME);
+        MultivaluedMap formParams = new MultivaluedMapImpl();
+        formParams.add("gfacJobID", gfacJobId);
+        formParams.add("completedDate", completedDate);
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, null, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+        int responseStatus = response.getStatus();
+
+        if (responseStatus == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (responseStatus == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, null, userName, callback.getPassword(userName), null, gateway);
+            response = builder.accept(
+                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+            responseStatus = response.getStatus();
+            if (responseStatus != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + responseStatus);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + responseStatus);
+        }
+    }
+
+    public void updateGFacJobMetadata(String gfacJobId, String metadata){
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_GFAC_JOB_METADATA);
+        MultivaluedMap formParams = new MultivaluedMapImpl();
+        formParams.add("gfacJobID", gfacJobId);
+        formParams.add("metadata", metadata);
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, null, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+        int responseStatus = response.getStatus();
+
+        if (responseStatus == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (responseStatus == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, null, userName, callback.getPassword(userName), null, gateway);
+            response = builder.accept(
+                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
+            responseStatus = response.getStatus();
+            if (responseStatus != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + responseStatus);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + responseStatus);
+        }
+    }
+
+    public GFacJob getGFacJob(String gfacJobId){
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.GET_GFAC_JOB);
+        MultivaluedMap queryParams = new MultivaluedMapImpl();
+        queryParams.add("gfacJobId", gfacJobId);
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, queryParams, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).get(ClientResponse.class);
+        int status = response.getStatus();
+
+        if (status == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, queryParams, userName, callback.getPassword(userName), null,
gateway);
+            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
+            status = response.getStatus();
+            if (status == ClientConstant.HTTP_NO_CONTENT) {
+                return null;
+            }
+            if (status != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + status);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
+            return null;
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + status);
+        }
+
+        GFacJob gFacJob = response.getEntity(GFacJob.class);
+        return gFacJob;
+    }
+
+    public List<GFacJob> getGFacJobsForDescriptors(String serviceDescriptionId,
+                                                   String hostDescriptionId,
+                                                   String applicationDescriptionId){
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.GET_GFAC_JOB);
+        MultivaluedMap queryParams = new MultivaluedMapImpl();
+        queryParams.add("serviceDescriptionId", serviceDescriptionId);
+        queryParams.add("hostDescriptionId", hostDescriptionId);
+        queryParams.add("applicationDescriptionId", applicationDescriptionId);
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, queryParams, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).get(ClientResponse.class);
+        int status = response.getStatus();
+
+        if (status == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, queryParams, userName, callback.getPassword(userName), null,
gateway);
+            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
+            status = response.getStatus();
+            if (status == ClientConstant.HTTP_NO_CONTENT) {
+                return null;
+            }
+            if (status != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + status);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
+            return null;
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + status);
+        }
+
+        GFacJobList gFacJobList = response.getEntity(GFacJobList.class);
+        return gFacJobList.getJobList();
+    }
+
+    public List<GFacJob> getGFacJobs(String experimentId,
+                                     String workflowExecutionId,
+                                     String nodeId) {
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.GET_GFAC_JOB);
+        MultivaluedMap queryParams = new MultivaluedMapImpl();
+        queryParams.add("experimentId", experimentId);
+        queryParams.add("workflowExecutionId", workflowExecutionId);
+        queryParams.add("nodeId", nodeId);
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, queryParams, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).get(ClientResponse.class);
+        int status = response.getStatus();
+
+        if (status == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, queryParams, userName, callback.getPassword(userName), null,
gateway);
+            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
+            status = response.getStatus();
+            if (status == ClientConstant.HTTP_NO_CONTENT) {
+                return null;
+            }
+            if (status != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + status);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
+            return null;
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + status);
+        }
+        GFacJobList gFacJobList = response.getEntity(GFacJobList.class);
+        return gFacJobList.getJobList();
+    }
+
+    public boolean isGFacJobExists(String gfacJobId){
+        webResource = getProvenanceRegistryBaseResource().path(
+                ResourcePathConstants.ProvenanceResourcePathConstants.GFAC_JOB_EXIST);
+        MultivaluedMap queryParams = new MultivaluedMapImpl();
+        queryParams.add("gfacJobId", gfacJobId);
+        builder = BasicAuthHeaderUtil.getBuilder(
+                webResource, queryParams, userName, null, cookie, gateway);
+        ClientResponse response = builder.accept(
+                MediaType.TEXT_PLAIN).get(ClientResponse.class);
+        int status = response.getStatus();
+
+        if (status == ClientConstant.HTTP_OK) {
+            if (response.getCookies().size() > 0) {
+                cookie = response.getCookies().get(0).toCookie();
+                CookieManager.setCookie(cookie);
+            }
+        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
+            builder = BasicAuthHeaderUtil.getBuilder(
+                    webResource, queryParams, userName, callback.getPassword(userName), null,
gateway);
+            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
+            status = response.getStatus();
+            if (status == ClientConstant.HTTP_NO_CONTENT) {
+                return false;
+            }
+            if (status != ClientConstant.HTTP_OK) {
+                logger.error(response.getEntity(String.class));
+                throw new RuntimeException("Failed : HTTP error code : "
+                        + status);
+            } else {
+                if (response.getCookies().size() > 0) {
+                    cookie = response.getCookies().get(0).toCookie();
+                    CookieManager.setCookie(cookie);
+                }
+            }
+        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
+            return false;
+        } else {
+            logger.error(response.getEntity(String.class));
+            throw new RuntimeException("Failed : HTTP error code : "
+                    + status);
+        }
+        String exists = response.getEntity(String.class);
+        if (exists.equals("true")) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
     public List<WorkflowNodeIOData> searchWorkflowInstanceNodeInput(String experimentIdRegEx,
                                                                     String workflowNameRegEx,
                                                                     String nodeNameRegEx)
{

Modified: airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java?rev=1485838&r1=1485837&r2=1485838&view=diff
==============================================================================
--- airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
(original)
+++ airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
Thu May 23 19:46:31 2013
@@ -903,75 +903,71 @@ public class RegistryClient extends Aira
 
 	@Override
 	public void addGFacJob(GFacJob job) throws RegistryException {
-		// TODO Auto-generated method stub
+		getProvenanceResourceClient().addGFacJob(job);
 		
 	}
 
 	@Override
 	public void updateGFacJob(GFacJob job) throws RegistryException {
-		// TODO Auto-generated method stub
+        getProvenanceResourceClient().updateGFacJob(job);
 		
 	}
 
 	@Override
 	public void updateGFacJobStatus(String gfacJobId, GFacJobStatus status)
 			throws RegistryException {
-		// TODO Auto-generated method stub
+        getProvenanceResourceClient().updateGFacJobStatus(gfacJobId, status);
 		
 	}
 
 	@Override
 	public void updateGFacJobData(String gfacJobId, String jobdata)
 			throws RegistryException {
-		// TODO Auto-generated method stub
+        getProvenanceResourceClient().updateGFacJobData(gfacJobId, jobdata);
 		
 	}
 
 	@Override
 	public void updateGFacJobSubmittedTime(String gfacJobId, Date submitted)
 			throws RegistryException {
-		// TODO Auto-generated method stub
+        getProvenanceResourceClient().updateGFacJobSubmittedTime(gfacJobId, submitted);
 		
 	}
 
 	@Override
 	public void updateGFacJobCompletedTime(String gfacJobId, Date completed)
 			throws RegistryException {
-		// TODO Auto-generated method stub
+        getProvenanceResourceClient().updateGFacJobCompletedTime(gfacJobId, completed);
 		
 	}
 
 	@Override
 	public void updateGFacJobMetadata(String gfacJobId, String metadata)
 			throws RegistryException {
-		// TODO Auto-generated method stub
+        getProvenanceResourceClient().updateGFacJobMetadata(gfacJobId, metadata);
 		
 	}
 
 	@Override
 	public GFacJob getGFacJob(String gfacJobId) throws RegistryException {
-		// TODO Auto-generated method stub
-		return null;
+		return getProvenanceResourceClient().getGFacJob(gfacJobId);
 	}
 
 	@Override
 	public List<GFacJob> getGFacJobsForDescriptors(String serviceDescriptionId,
 			String hostDescriptionId, String applicationDescriptionId)
 			throws RegistryException {
-		// TODO Auto-generated method stub
-		return null;
+		return getProvenanceResourceClient().getGFacJobsForDescriptors(serviceDescriptionId, hostDescriptionId,
applicationDescriptionId);
 	}
 
 	@Override
 	public List<GFacJob> getGFacJobs(String experimentId,
 			String workflowExecutionId, String nodeId) throws RegistryException {
-		// TODO Auto-generated method stub
-		return null;
+		return getProvenanceResourceClient().getGFacJobs(experimentId, workflowExecutionId, nodeId);
 	}
 
 	@Override
 	public boolean isGFacJobExists(String gfacJobId) throws RegistryException {
-		// TODO Auto-generated method stub
-		return false;
+		return getProvenanceResourceClient().isGFacJobExists(gfacJobId);
 	}
 }

Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java?rev=1485838&r1=1485837&r2=1485838&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
(original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
Thu May 23 19:46:31 2013
@@ -1753,7 +1753,7 @@ public class ProvenanceRegistryResource 
     @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
     @Produces(MediaType.TEXT_PLAIN)
     public Response updateGFacJobMetadata(@FormParam("gfacJobID") String gfacJobID,
-                                               @FormParam("metadata") String metadata ) {
+                                          @FormParam("metadata") String metadata ) {
         AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
         try {
             airavataRegistry.updateGFacJobMetadata(gfacJobID, metadata);
@@ -1858,11 +1858,11 @@ public class ProvenanceRegistryResource 
             boolean gFacJobExists = airavataRegistry.isGFacJobExists(gfacJobId);
             if (gFacJobExists) {
                 Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("GFac Job exists in the system");
+                builder.entity("true");
                 return builder.build();
             } else {
                 Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                builder.entity("GFac Job does not exist in the system");
+                builder.entity("false");
                 return builder.build();
             }
         } catch (Throwable e) {



Mime
View raw message