airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject [2/7] moving common monitoring classes to gfac-core
Date Mon, 05 May 2014 16:00:10 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java b/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
index e4d55b8..5494629 100644
--- a/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
+++ b/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
@@ -28,15 +28,15 @@ import java.util.Map;
 
 import org.apache.airavata.gfac.Constants;
 import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.context.JobExecutionContext;
+import org.apache.airavata.gfac.core.context.JobExecutionContext;
+import org.apache.airavata.gfac.core.notification.events.StartExecutionEvent;
+import org.apache.airavata.gfac.core.provider.AbstractProvider;
+import org.apache.airavata.gfac.core.provider.GFacProviderException;
+import org.apache.airavata.gfac.core.provider.utils.ProviderUtils;
+import org.apache.airavata.gfac.core.utils.GFacUtils;
+import org.apache.airavata.gfac.core.utils.OutputUtils;
 import org.apache.airavata.gfac.local.utils.InputStreamToFileWriter;
 import org.apache.airavata.gfac.local.utils.InputUtils;
-import org.apache.airavata.gfac.notification.events.StartExecutionEvent;
-import org.apache.airavata.gfac.provider.AbstractProvider;
-import org.apache.airavata.gfac.provider.GFacProviderException;
-import org.apache.airavata.gfac.provider.utils.ProviderUtils;
-import org.apache.airavata.gfac.utils.GFacUtils;
-import org.apache.airavata.gfac.utils.OutputUtils;
 import org.apache.airavata.model.workspace.experiment.JobDetails;
 import org.apache.airavata.model.workspace.experiment.JobState;
 import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/utils/LocalProviderUtil.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/utils/LocalProviderUtil.java b/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/utils/LocalProviderUtil.java
index 4a19b65..932c693 100644
--- a/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/utils/LocalProviderUtil.java
+++ b/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/utils/LocalProviderUtil.java
@@ -20,8 +20,8 @@
 */
 package org.apache.airavata.gfac.local.utils;
 
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.provider.GFacProviderException;
+import org.apache.airavata.gfac.core.context.JobExecutionContext;
+import org.apache.airavata.gfac.core.provider.GFacProviderException;
 import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-local/src/test/java/org/apache/airavata/core/gfac/services/impl/LocalProviderTest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-local/src/test/java/org/apache/airavata/core/gfac/services/impl/LocalProviderTest.java b/modules/gfac/gfac-local/src/test/java/org/apache/airavata/core/gfac/services/impl/LocalProviderTest.java
index afb101c..df628e4 100644
--- a/modules/gfac/gfac-local/src/test/java/org/apache/airavata/core/gfac/services/impl/LocalProviderTest.java
+++ b/modules/gfac/gfac-local/src/test/java/org/apache/airavata/core/gfac/services/impl/LocalProviderTest.java
@@ -23,12 +23,12 @@ package org.apache.airavata.core.gfac.services.impl;
 import org.apache.airavata.commons.gfac.type.*;
 import org.apache.airavata.gfac.GFacConfiguration;
 import org.apache.airavata.gfac.GFacException;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.context.MessageContext;
+import org.apache.airavata.gfac.core.context.ApplicationContext;
+import org.apache.airavata.gfac.core.context.JobExecutionContext;
+import org.apache.airavata.gfac.core.context.MessageContext;
+import org.apache.airavata.gfac.core.provider.GFacProviderException;
 import org.apache.airavata.gfac.local.handler.LocalDirectorySetupHandler;
 import org.apache.airavata.gfac.local.provider.impl.LocalProvider;
-import org.apache.airavata.gfac.provider.GFacProviderException;
 import org.apache.airavata.model.workspace.experiment.TaskDetails;
 import org.apache.airavata.persistance.registry.jpa.impl.LoggingRegistryImpl;
 import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
@@ -161,7 +161,7 @@ public class LocalProviderTest {
     }
 
     @Test
-    public void testLocalProvider() throws GFacException,GFacProviderException{
+    public void testLocalProvider() throws GFacException,GFacProviderException {
         LocalDirectorySetupHandler localDirectorySetupHandler = new LocalDirectorySetupHandler();
         localDirectorySetupHandler.invoke(jobExecutionContext);
         LocalProvider localProvider = new LocalProvider();

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-local/src/test/resources/gfac-config.xml
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-local/src/test/resources/gfac-config.xml b/modules/gfac/gfac-local/src/test/resources/gfac-config.xml
index 8147853..82c9ca8 100644
--- a/modules/gfac/gfac-local/src/test/resources/gfac-config.xml
+++ b/modules/gfac/gfac-local/src/test/resources/gfac-config.xml
@@ -13,7 +13,7 @@
 <GFac>
     <GlobalHandlers>
         <InHandlers>
-            <Handler class="org.apache.airavata.gfac.handler.AppDescriptorCheckHandler">
+            <Handler class="org.apache.airavata.gfac.core.handler.AppDescriptorCheckHandler">
                     <property name="name" value="value"/>
             </Handler>
         </InHandlers>

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AbstractActivityListener.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AbstractActivityListener.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AbstractActivityListener.java
deleted file mode 100644
index 63f89df..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AbstractActivityListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.gfac.monitor;
-
-
-public interface AbstractActivityListener {
-	public void setup(Object... configurations);
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataExperimentStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataExperimentStatusUpdator.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataExperimentStatusUpdator.java
deleted file mode 100644
index a70b14f..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataExperimentStatusUpdator.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor;
-
-import com.google.common.eventbus.Subscribe;
-import org.apache.airavata.gfac.monitor.state.ExperimentStatusChangeRequest;
-import org.apache.airavata.model.workspace.experiment.Experiment;
-import org.apache.airavata.model.workspace.experiment.ExperimentState;
-import org.apache.airavata.registry.cpi.DataType;
-import org.apache.airavata.registry.cpi.Registry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Calendar;
-
-public class AiravataExperimentStatusUpdator implements AbstractActivityListener {
-    private final static Logger logger = LoggerFactory.getLogger(AiravataExperimentStatusUpdator.class);
-
-    private Registry airavataRegistry;
-
-    public Registry getAiravataRegistry() {
-        return airavataRegistry;
-    }
-
-    public void setAiravataRegistry(Registry airavataRegistry) {
-        this.airavataRegistry = airavataRegistry;
-    }
-
-    @Subscribe
-    public void updateRegistry(ExperimentStatusChangeRequest experimentStatus) {
-        ExperimentState state = experimentStatus.getState();
-        if (state != null) {
-            try {
-                String experimentID = experimentStatus.getIdentity().getExperimentID();
-                updateExperimentStatus(experimentID, state);
-            } catch (Exception e) {
-                logger.error("Error persisting data" + e.getLocalizedMessage(), e);
-            }
-        }
-    }
-
-    public  void updateExperimentStatus(String experimentId, ExperimentState state) throws Exception {
-    	Experiment details = (Experiment)airavataRegistry.get(DataType.EXPERIMENT, experimentId);
-        if(details == null) {
-            details = new Experiment();
-            details.setExperimentID(experimentId);
-        }
-        org.apache.airavata.model.workspace.experiment.ExperimentStatus status = new org.apache.airavata.model.workspace.experiment.ExperimentStatus();
-        status.setExperimentState(state);
-        status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
-        details.setExperimentStatus(status);
-        airavataRegistry.update(DataType.EXPERIMENT, details, experimentId);
-    }
-
-	@Override
-	public void setup(Object... configurations) {
-		for (Object configuration : configurations) {
-			if (configuration instanceof Registry){
-				this.airavataRegistry=(Registry)configuration;
-			} 
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataJobStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataJobStatusUpdator.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataJobStatusUpdator.java
deleted file mode 100644
index 6db5241..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataJobStatusUpdator.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor;
-
-import com.google.common.eventbus.Subscribe;
-import org.apache.airavata.gfac.monitor.event.MonitorPublisher;
-import org.apache.airavata.gfac.monitor.state.JobStatusChangeRequest;
-import org.apache.airavata.gfac.monitor.state.TaskStatusChangeRequest;
-import org.apache.airavata.model.workspace.experiment.JobDetails;
-import org.apache.airavata.model.workspace.experiment.JobState;
-import org.apache.airavata.model.workspace.experiment.TaskState;
-import org.apache.airavata.registry.cpi.CompositeIdentifier;
-import org.apache.airavata.registry.cpi.DataType;
-import org.apache.airavata.registry.cpi.Registry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Calendar;
-import java.util.concurrent.BlockingQueue;
-
-public class AiravataJobStatusUpdator implements AbstractActivityListener {
-    private final static Logger logger = LoggerFactory.getLogger(AiravataJobStatusUpdator.class);
-
-    private Registry airavataRegistry;
-
-    private MonitorPublisher monitorPublisher;
-
-    private BlockingQueue<MonitorID> jobsToMonitor;
-
-
-    public Registry getAiravataRegistry() {
-        return airavataRegistry;
-    }
-
-    public void setAiravataRegistry(Registry airavataRegistry) {
-        this.airavataRegistry = airavataRegistry;
-    }
-
-    public BlockingQueue<MonitorID> getJobsToMonitor() {
-        return jobsToMonitor;
-    }
-
-    public void setJobsToMonitor(BlockingQueue<MonitorID> jobsToMonitor) {
-        this.jobsToMonitor = jobsToMonitor;
-    }
-
-    @Subscribe
-    public void updateRegistry(JobStatusChangeRequest jobStatus) {
-        /* Here we need to parse the jobStatus message and update
-                the registry accordingly, for now we are just printing to standard Out
-                 */
-        JobState state = jobStatus.getState();
-        if (state != null) {
-            try {
-                String taskID = jobStatus.getIdentity().getTaskId();
-                String jobID = jobStatus.getIdentity().getJobId();
-                updateJobStatus(taskID, jobID, state);
-            } catch (Exception e) {
-                logger.error("Error persisting data" + e.getLocalizedMessage(), e);
-            }
-            logger.info("Job ID:" + jobStatus.getIdentity().getJobId() + " is "+state.toString());
-            switch (state) {
-                case COMPLETE: case UNKNOWN: case CANCELED:case FAILED:case SUSPENDED:
-                    jobsToMonitor.remove(jobStatus.getMonitorID());
-                    break;
-			default:
-				break;
-            }
-        }
-    }
-
-    @Subscribe
-    public void setupTaskStatus(JobStatusChangeRequest jobStatus){
-    	TaskState state=TaskState.UNKNOWN;
-    	switch(jobStatus.getState()){
-    	case ACTIVE:
-    		state=TaskState.EXECUTING; break;
-    	case CANCELED:
-    		state=TaskState.CANCELED; break;
-    	case COMPLETE:
-    		state=TaskState.COMPLETED; break;
-    	case FAILED:
-    		state=TaskState.FAILED; break;
-    	case HELD: case SUSPENDED: case QUEUED:
-    		state=TaskState.WAITING; break;
-    	case SETUP:
-    		state=TaskState.PRE_PROCESSING; break;
-    	case SUBMITTED:
-    		state=TaskState.STARTED; break;
-    	case UN_SUBMITTED:
-    		state=TaskState.CANCELED; break;
-    	case CANCELING:
-    		state=TaskState.CANCELING; break;
-		default:
-			break;
-    	}
-    	logger.debug("Publishing Task Status "+state.toString());
-    	monitorPublisher.publish(new TaskStatusChangeRequest(jobStatus.getIdentity(),state));
-    }
-
-    public  void updateJobStatus(String taskId, String jobID, JobState state) throws Exception {
-        CompositeIdentifier ids = new CompositeIdentifier(taskId, jobID);
-        JobDetails details = (JobDetails)airavataRegistry.get(DataType.JOB_DETAIL, ids);
-        if(details == null) {
-            details = new JobDetails();
-        }
-        org.apache.airavata.model.workspace.experiment.JobStatus status = new org.apache.airavata.model.workspace.experiment.JobStatus();
-        status.setJobState(state);
-        status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
-        details.setJobStatus(status);
-        details.setJobID(jobID);
-        airavataRegistry.update(DataType.JOB_DETAIL, details, ids);
-    }
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public void setup(Object... configurations) {
-		for (Object configuration : configurations) {
-			if (configuration instanceof Registry){
-				this.airavataRegistry=(Registry)configuration;
-			} else if (configuration instanceof BlockingQueue<?>){
-				this.jobsToMonitor=(BlockingQueue<MonitorID>) configuration;
-			} else if (configuration instanceof MonitorPublisher){
-				this.monitorPublisher=(MonitorPublisher) configuration;
-			} 
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataTaskStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataTaskStatusUpdator.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataTaskStatusUpdator.java
deleted file mode 100644
index e8dd7a0..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataTaskStatusUpdator.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor;
-
-import com.google.common.eventbus.Subscribe;
-import org.apache.airavata.gfac.monitor.event.MonitorPublisher;
-import org.apache.airavata.gfac.monitor.state.TaskStatusChangeRequest;
-import org.apache.airavata.gfac.monitor.state.WorkflowNodeStatusChangeRequest;
-import org.apache.airavata.model.workspace.experiment.TaskDetails;
-import org.apache.airavata.model.workspace.experiment.TaskState;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeState;
-import org.apache.airavata.registry.cpi.DataType;
-import org.apache.airavata.registry.cpi.Registry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Calendar;
-
-public class AiravataTaskStatusUpdator implements AbstractActivityListener {
-    private final static Logger logger = LoggerFactory.getLogger(AiravataTaskStatusUpdator.class);
-
-    private Registry airavataRegistry;
-
-    private MonitorPublisher monitorPublisher;
-    
-    public Registry getAiravataRegistry() {
-        return airavataRegistry;
-    }
-
-    public void setAiravataRegistry(Registry airavataRegistry) {
-        this.airavataRegistry = airavataRegistry;
-    }
-
-    @Subscribe
-    public void updateRegistry(TaskStatusChangeRequest taskStatus) {
-        TaskState state = taskStatus.getState();
-        if (state != null) {
-            try {
-                String taskID = taskStatus.getIdentity().getTaskId();
-                updateTaskStatus(taskID, state);
-            } catch (Exception e) {
-                logger.error("Error persisting data" + e.getLocalizedMessage(), e);
-            }
-        }
-    }
-    
-    @Subscribe
-    public void setupWorkflowNodeStatus(TaskStatusChangeRequest taskStatus){
-    	WorkflowNodeState state=WorkflowNodeState.UNKNOWN;
-    	switch(taskStatus.getState()){
-    	case CANCELED:
-    		state=WorkflowNodeState.CANCELED; break;
-    	case COMPLETED:
-    		state=WorkflowNodeState.COMPLETED; break;
-    	case CONFIGURING_WORKSPACE:
-    		state=WorkflowNodeState.INVOKED; break;
-    	case FAILED:
-    		state=WorkflowNodeState.FAILED; break;
-    	case EXECUTING: case WAITING: case PRE_PROCESSING: case POST_PROCESSING: case OUTPUT_DATA_STAGING: case INPUT_DATA_STAGING:
-    		state=WorkflowNodeState.EXECUTING; break;
-    	case STARTED:
-    		state=WorkflowNodeState.INVOKED; break;
-    	case CANCELING:
-    		state=WorkflowNodeState.CANCELING; break;
-		default:
-			break;
-    	}
-    	logger.debug("Publishing Experiment Status "+state.toString());
-    	monitorPublisher.publish(new WorkflowNodeStatusChangeRequest(taskStatus.getIdentity(),state));
-    }
-    
-    public  void updateTaskStatus(String taskId, TaskState state) throws Exception {
-    	TaskDetails details = (TaskDetails)airavataRegistry.get(DataType.TASK_DETAIL, taskId);
-        if(details == null) {
-            details = new TaskDetails();
-            details.setTaskID(taskId);
-        }
-        org.apache.airavata.model.workspace.experiment.TaskStatus status = new org.apache.airavata.model.workspace.experiment.TaskStatus();
-        status.setExecutionState(state);
-        status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
-        details.setTaskStatus(status);
-        airavataRegistry.update(DataType.TASK_DETAIL, details, taskId);
-    }
-
-	@Override
-	public void setup(Object... configurations) {
-		for (Object configuration : configurations) {
-			if (configuration instanceof Registry){
-				this.airavataRegistry=(Registry)configuration;
-			} else if (configuration instanceof MonitorPublisher){
-				this.monitorPublisher=(MonitorPublisher) configuration;
-			} 
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataWorkflowNodeStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataWorkflowNodeStatusUpdator.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataWorkflowNodeStatusUpdator.java
deleted file mode 100644
index 2375d72..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataWorkflowNodeStatusUpdator.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor;
-
-import com.google.common.eventbus.Subscribe;
-import org.apache.airavata.gfac.monitor.event.MonitorPublisher;
-import org.apache.airavata.gfac.monitor.state.ExperimentStatusChangeRequest;
-import org.apache.airavata.gfac.monitor.state.WorkflowNodeStatusChangeRequest;
-import org.apache.airavata.model.workspace.experiment.ExperimentState;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeState;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeStatus;
-import org.apache.airavata.registry.cpi.DataType;
-import org.apache.airavata.registry.cpi.Registry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Calendar;
-
-public class AiravataWorkflowNodeStatusUpdator implements AbstractActivityListener {
-    private final static Logger logger = LoggerFactory.getLogger(AiravataWorkflowNodeStatusUpdator.class);
-
-    private Registry airavataRegistry;
-
-    private MonitorPublisher monitorPublisher;
-
-    public Registry getAiravataRegistry() {
-        return airavataRegistry;
-    }
-
-    public void setAiravataRegistry(Registry airavataRegistry) {
-        this.airavataRegistry = airavataRegistry;
-    }
-
-    @Subscribe
-    public void updateRegistry(WorkflowNodeStatusChangeRequest workflowNodeStatus) {
-        WorkflowNodeState state = workflowNodeStatus.getState();
-        if (state != null) {
-            try {
-                String workflowNodeID = workflowNodeStatus.getIdentity().getWorkflowNodeID();
-                updateWorkflowNodeStatus(workflowNodeID, state);
-            } catch (Exception e) {
-                logger.error("Error persisting data" + e.getLocalizedMessage(), e);
-            }
-        }
-    }
-
-    @Subscribe
-    public void setupExperimentStatus(WorkflowNodeStatusChangeRequest nodeStatus){
-    	ExperimentState state=ExperimentState.UNKNOWN;
-    	switch(nodeStatus.getState()){
-    	case CANCELED:
-    		state=ExperimentState.CANCELED; break;
-    	case COMPLETED:
-    		state=ExperimentState.COMPLETED; break;
-    	case INVOKED:
-    		state=ExperimentState.LAUNCHED; break;
-    	case FAILED:
-    		state=ExperimentState.FAILED; break;
-    	case EXECUTING:
-    		state=ExperimentState.EXECUTING; break;
-    	case CANCELING:
-    		state=ExperimentState.CANCELING; break;
-		default:
-			break;
-    	}
-    	logger.debug("Publishing Experiment Status "+state.toString());
-    	monitorPublisher.publish(new ExperimentStatusChangeRequest(nodeStatus.getIdentity(),state));
-    }
-
-    public  void updateWorkflowNodeStatus(String workflowNodeId, WorkflowNodeState state) throws Exception {
-    	WorkflowNodeDetails details = (WorkflowNodeDetails)airavataRegistry.get(DataType.WORKFLOW_NODE_DETAIL, workflowNodeId);
-        if(details == null) {
-            details = new WorkflowNodeDetails();
-            details.setNodeInstanceId(workflowNodeId);
-        }
-        WorkflowNodeStatus status = new WorkflowNodeStatus();
-        status.setWorkflowNodeState(state);
-        status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
-        details.setWorkflowNodeStatus(status);
-        airavataRegistry.update(DataType.WORKFLOW_NODE_DETAIL, details, workflowNodeId);
-    }
-
-	@Override
-	public void setup(Object... configurations) {
-		for (Object configuration : configurations) {
-			if (configuration instanceof Registry){
-				this.airavataRegistry=(Registry)configuration;
-			} else if (configuration instanceof MonitorPublisher){
-				this.monitorPublisher=(MonitorPublisher) configuration;
-			} 
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/ExperimentIdentity.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/ExperimentIdentity.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/ExperimentIdentity.java
deleted file mode 100644
index ba8efeb..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/ExperimentIdentity.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.gfac.monitor;
-
-public class ExperimentIdentity {
-	private String experimentID;
-	public ExperimentIdentity(String experimentId) {
-		setExperimentID(experimentId);
-	}
-	public String getExperimentID() {
-		return experimentID;
-	}
-
-	public void setExperimentID(String experimentID) {
-		this.experimentID = experimentID;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
new file mode 100644
index 0000000..da4ff88
--- /dev/null
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HPCMonitorID.java
@@ -0,0 +1,248 @@
+package org.apache.airavata.gfac.monitor;/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.gfac.core.context.JobExecutionContext;
+import org.apache.airavata.gfac.core.monitor.MonitorID;
+import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
+import org.apache.airavata.model.workspace.experiment.JobState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.Timestamp;
+import java.util.Date;
+import java.util.Map;
+
+public class HPCMonitorID extends MonitorID {
+    private final static Logger logger = LoggerFactory.getLogger(HPCMonitorID.class);
+
+    private String userName;
+
+    private Timestamp jobStartedTime;
+
+    private Timestamp lastMonitored;
+
+    private HostDescription host;
+
+    private AuthenticationInfo authenticationInfo = null;
+
+    private Map<String, Object> parameters;
+
+    private String experimentID;
+
+    private String workflowNodeID;
+
+    private String taskID;
+
+    private String jobID;
+
+    private int failedCount = 0;
+
+    private JobState state;
+
+    private JobExecutionContext jobExecutionContext;
+
+    public HPCMonitorID(HostDescription host, String jobID,String taskID, String workflowNodeID, String experimentID, String userName) {
+        super(host,jobID,taskID,workflowNodeID,experimentID,userName);
+        this.host = host;
+        this.jobStartedTime = new Timestamp((new Date()).getTime());
+        this.userName = userName;
+        this.jobID = jobID;
+        this.taskID = taskID;
+        this.experimentID = experimentID;
+        this.workflowNodeID = workflowNodeID;
+    }
+
+    public HPCMonitorID(AuthenticationInfo authenticationInfo, JobExecutionContext jobExecutionContext) {
+        this.authenticationInfo = authenticationInfo;
+        this.jobExecutionContext = jobExecutionContext;
+        host = jobExecutionContext.getApplicationContext().getHostDescription();
+        userName = jobExecutionContext.getExperiment().getUserName();
+        jobID = jobExecutionContext.getJobDetails().getJobID();
+        taskID = jobExecutionContext.getTaskData().getTaskID();
+        experimentID = jobExecutionContext.getExperiment().getExperimentID();
+        workflowNodeID =  jobExecutionContext.getExperiment().getWorkflowNodeDetailsList().get(0).getNodeInstanceId();// at this point we only have one node todo: fix this
+
+    }
+
+    public HPCMonitorID(HostDescription host, String jobID,String taskID, String workflowNodeID, String experimentID, String userName,AuthenticationInfo authenticationInfo) {
+        this.host = host;
+        this.jobStartedTime = new Timestamp((new Date()).getTime());
+        this.authenticationInfo = authenticationInfo;
+        this.userName = userName;
+        // if we give myproxyauthenticationInfo, so we try to use myproxy user as the user
+        if(this.authenticationInfo != null){
+            if(this.authenticationInfo instanceof MyProxyAuthenticationInfo){
+                this.userName = ((MyProxyAuthenticationInfo)this.authenticationInfo).getUserName();
+            }
+        }
+        this.workflowNodeID = workflowNodeID;
+        this.jobID = jobID;
+        this.taskID = taskID;
+        this.experimentID = experimentID;
+    }
+    public HostDescription getHost() {
+        return host;
+    }
+
+    public void setHost(HostDescription host) {
+        this.host = host;
+    }
+
+    public Timestamp getLastMonitored() {
+        return lastMonitored;
+    }
+
+    public void setLastMonitored(Timestamp lastMonitored) {
+        this.lastMonitored = lastMonitored;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getJobID() {
+        return jobID;
+    }
+
+    public void setJobID(String jobID) {
+        this.jobID = jobID;
+    }
+
+    public Timestamp getJobStartedTime() {
+        return jobStartedTime;
+    }
+
+    public void setJobStartedTime(Timestamp jobStartedTime) {
+        this.jobStartedTime = jobStartedTime;
+    }
+
+    public AuthenticationInfo getAuthenticationInfo() {
+        return authenticationInfo;
+    }
+
+    public void setAuthenticationInfo(AuthenticationInfo authenticationInfo) {
+        this.authenticationInfo = authenticationInfo;
+    }
+
+    public void addParameter(String key,Object value) {
+        this.parameters.put(key, value);
+    }
+
+    public Object getParameter(String key) {
+        return this.parameters.get(key);
+    }
+
+    public Map<String, Object> getParameters() {
+        return parameters;
+    }
+
+    public void setParameters(Map<String, Object> parameters) {
+        this.parameters = parameters;
+    }
+
+    public String getExperimentID() {
+        return experimentID;
+    }
+
+    public void setExperimentID(String experimentID) {
+        this.experimentID = experimentID;
+    }
+
+    public String getTaskID() {
+        return taskID;
+    }
+
+    public void setTaskID(String taskID) {
+        this.taskID = taskID;
+    }
+
+    public int getFailedCount() {
+        return failedCount;
+    }
+
+    public void setFailedCount(int failedCount) {
+        this.failedCount = failedCount;
+    }
+
+    public JobState getStatus() {
+        return state;
+    }
+
+    public void setStatus(JobState status) {
+        // this logic is going to be useful for fast finishing jobs
+        // because in some machines job state vanishes quicckly when the job is done
+        // during that case job state comes as unknown.so we handle it here.
+            if (this.state != null && status.equals(JobState.UNKNOWN)) {
+                if (getFailedCount() > 2) {
+                    switch (this.state) {
+                        case ACTIVE:
+                            this.state = JobState.COMPLETE;
+                            break;
+                        case QUEUED:
+                            this.state = JobState.COMPLETE;
+                            break;
+                    }
+                } else {
+                    try {
+                        // when state becomes unknown we sleep for a while
+                        Thread.sleep(10000);
+                    } catch (InterruptedException e) {
+                        e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                    }
+                    setFailedCount(getFailedCount() + 1);
+                }
+            } else {
+                // normal scenario
+                this.state = status;
+            }
+    }
+
+	public String getWorkflowNodeID() {
+		return workflowNodeID;
+	}
+
+	public void setWorkflowNodeID(String workflowNodeID) {
+		this.workflowNodeID = workflowNodeID;
+	}
+
+    public JobExecutionContext getJobExecutionContext() {
+        return jobExecutionContext;
+    }
+
+    public void setJobExecutionContext(JobExecutionContext jobExecutionContext) {
+        this.jobExecutionContext = jobExecutionContext;
+    }
+
+    //	public String getWorkflowNodeID() {
+//		return workflowNodeID;
+//	}
+//
+//	public void setWorkflowNodeID(String workflowNodeID) {
+//		this.workflowNodeID = workflowNodeID;
+//	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HostMonitorData.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HostMonitorData.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HostMonitorData.java
index e57087d..0480925 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HostMonitorData.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/HostMonitorData.java
@@ -21,6 +21,7 @@
 package org.apache.airavata.gfac.monitor;
 
 import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.gfac.core.monitor.MonitorID;
 import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
 
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/JobIdentity.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/JobIdentity.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/JobIdentity.java
deleted file mode 100644
index 84c4a55..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/JobIdentity.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.gfac.monitor;
-
-public class JobIdentity extends TaskIdentity {
-	private String jobId;
-	
-	public JobIdentity(String experimentId, String workflowNodeId, String taskId, String jobId) {
-		super(experimentId,workflowNodeId,taskId);
-		setJobId(jobId);
-	}
-
-	public String getJobId() {
-		return jobId;
-	}
-
-	public void setJobId(String jobId) {
-		this.jobId = jobId;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/MonitorID.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/MonitorID.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/MonitorID.java
deleted file mode 100644
index e21160a..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/MonitorID.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor;
-
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
-import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
-import org.apache.airavata.model.workspace.experiment.JobState;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.Timestamp;
-import java.util.Date;
-import java.util.Map;
-
-/*
-This is the object which contains the data to identify a particular
-Job to start the monitoring
-*/
-public class MonitorID {
-    private final static Logger logger = LoggerFactory.getLogger(MonitorID.class);
-
-    private String userName;
-
-    private Timestamp jobStartedTime;
-
-    private Timestamp lastMonitored;
-
-    private HostDescription host;
-
-    private AuthenticationInfo authenticationInfo = null;
-
-    private Map<String, Object> parameters;
-
-    private String experimentID;
-
-    private String workflowNodeID;
-
-    private String taskID;
-
-    private String jobID;
-
-    private int failedCount = 0;
-
-    private JobState state;
-
-    private JobExecutionContext jobExecutionContext;
-
-    public MonitorID(HostDescription host, String jobID,String taskID, String workflowNodeID, String experimentID, String userName) {
-        this.host = host;
-        this.jobStartedTime = new Timestamp((new Date()).getTime());
-        this.userName = userName;
-        this.jobID = jobID;
-        this.taskID = taskID;
-        this.experimentID = experimentID;
-        this.workflowNodeID = workflowNodeID;
-    }
-
-    public MonitorID(AuthenticationInfo authenticationInfo, JobExecutionContext jobExecutionContext) {
-        this.authenticationInfo = authenticationInfo;
-        this.jobExecutionContext = jobExecutionContext;
-        host = jobExecutionContext.getApplicationContext().getHostDescription();
-        userName = jobExecutionContext.getExperiment().getUserName();
-        jobID = jobExecutionContext.getJobDetails().getJobID();
-        taskID = jobExecutionContext.getTaskData().getTaskID();
-        experimentID = jobExecutionContext.getExperiment().getExperimentID();
-        workflowNodeID =  jobExecutionContext.getExperiment().getWorkflowNodeDetailsList().get(0).getNodeInstanceId();// at this point we only have one node todo: fix this
-
-    }
-
-    public MonitorID(HostDescription host, String jobID,String taskID, String workflowNodeID, String experimentID, String userName,AuthenticationInfo authenticationInfo) {
-        this.host = host;
-        this.jobStartedTime = new Timestamp((new Date()).getTime());
-        this.authenticationInfo = authenticationInfo;
-        this.userName = userName;
-        // if we give myproxyauthenticationInfo, so we try to use myproxy user as the user
-        if(this.authenticationInfo != null){
-            if(this.authenticationInfo instanceof MyProxyAuthenticationInfo){
-                this.userName = ((MyProxyAuthenticationInfo)this.authenticationInfo).getUserName();
-            }
-        }
-        this.workflowNodeID = workflowNodeID;
-        this.jobID = jobID;
-        this.taskID = taskID;
-        this.experimentID = experimentID;
-    }
-    public HostDescription getHost() {
-        return host;
-    }
-
-    public void setHost(HostDescription host) {
-        this.host = host;
-    }
-
-    public Timestamp getLastMonitored() {
-        return lastMonitored;
-    }
-
-    public void setLastMonitored(Timestamp lastMonitored) {
-        this.lastMonitored = lastMonitored;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public String getJobID() {
-        return jobID;
-    }
-
-    public void setJobID(String jobID) {
-        this.jobID = jobID;
-    }
-
-    public Timestamp getJobStartedTime() {
-        return jobStartedTime;
-    }
-
-    public void setJobStartedTime(Timestamp jobStartedTime) {
-        this.jobStartedTime = jobStartedTime;
-    }
-
-    public AuthenticationInfo getAuthenticationInfo() {
-        return authenticationInfo;
-    }
-
-    public void setAuthenticationInfo(AuthenticationInfo authenticationInfo) {
-        this.authenticationInfo = authenticationInfo;
-    }
-
-    public void addParameter(String key,Object value) {
-        this.parameters.put(key, value);
-    }
-
-    public Object getParameter(String key) {
-        return this.parameters.get(key);
-    }
-
-    public Map<String, Object> getParameters() {
-        return parameters;
-    }
-
-    public void setParameters(Map<String, Object> parameters) {
-        this.parameters = parameters;
-    }
-
-    public String getExperimentID() {
-        return experimentID;
-    }
-
-    public void setExperimentID(String experimentID) {
-        this.experimentID = experimentID;
-    }
-
-    public String getTaskID() {
-        return taskID;
-    }
-
-    public void setTaskID(String taskID) {
-        this.taskID = taskID;
-    }
-
-    public int getFailedCount() {
-        return failedCount;
-    }
-
-    public void setFailedCount(int failedCount) {
-        this.failedCount = failedCount;
-    }
-
-    public JobState getStatus() {
-        return state;
-    }
-
-    public void setStatus(JobState status) {
-        // this logic is going to be useful for fast finishing jobs
-        // because in some machines job state vanishes quicckly when the job is done
-        // during that case job state comes as unknown.so we handle it here.
-            if (this.state != null && status.equals(JobState.UNKNOWN)) {
-                if (getFailedCount() > 2) {
-                    switch (this.state) {
-                        case ACTIVE:
-                            this.state = JobState.COMPLETE;
-                            break;
-                        case QUEUED:
-                            this.state = JobState.COMPLETE;
-                            break;
-                    }
-                } else {
-                    try {
-                        // when state becomes unknown we sleep for a while
-                        Thread.sleep(10000);
-                    } catch (InterruptedException e) {
-                        e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                    }
-                    setFailedCount(getFailedCount() + 1);
-                }
-            } else {
-                // normal scenario
-                this.state = status;
-            }
-    }
-
-	public String getWorkflowNodeID() {
-		return workflowNodeID;
-	}
-
-	public void setWorkflowNodeID(String workflowNodeID) {
-		this.workflowNodeID = workflowNodeID;
-	}
-
-    public JobExecutionContext getJobExecutionContext() {
-        return jobExecutionContext;
-    }
-
-    public void setJobExecutionContext(JobExecutionContext jobExecutionContext) {
-        this.jobExecutionContext = jobExecutionContext;
-    }
-
-    //	public String getWorkflowNodeID() {
-//		return workflowNodeID;
-//	}
-//
-//	public void setWorkflowNodeID(String workflowNodeID) {
-//		this.workflowNodeID = workflowNodeID;
-//	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/TaskIdentity.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/TaskIdentity.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/TaskIdentity.java
deleted file mode 100644
index c6d386e..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/TaskIdentity.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.gfac.monitor;
-
-public class TaskIdentity extends WorkflowNodeIdentity {
-	private String taskId;
-
-	public TaskIdentity(String experimentId, String workflowNodeId, String taskId) {
-		super(experimentId,workflowNodeId);
-		setTaskId(taskId);
-	}
-	public String getTaskId() {
-		return taskId;
-	}
-
-	public void setTaskId(String taskId) {
-		this.taskId = taskId;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/WorkflowNodeIdentity.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/WorkflowNodeIdentity.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/WorkflowNodeIdentity.java
deleted file mode 100644
index e569c52..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/WorkflowNodeIdentity.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.gfac.monitor;
-
-public class WorkflowNodeIdentity extends ExperimentIdentity {
-	private String workflowNodeID;
-	public WorkflowNodeIdentity(String experimentId, String workflowNodeId) {
-		super(experimentId);
-		setWorkflowNodeID(workflowNodeId);
-	}
-	public String getWorkflowNodeID() {
-		return workflowNodeID;
-	}
-
-	public void setWorkflowNodeID(String workflowNodeID) {
-		this.workflowNodeID = workflowNodeID;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/core/AiravataAbstractMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/core/AiravataAbstractMonitor.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/core/AiravataAbstractMonitor.java
index da6baf8..26f25b8 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/core/AiravataAbstractMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/core/AiravataAbstractMonitor.java
@@ -20,7 +20,7 @@
 */
 package org.apache.airavata.gfac.monitor.core;
 
-import org.apache.airavata.gfac.monitor.event.MonitorPublisher;
+import org.apache.airavata.gfac.core.notification.MonitorPublisher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/core/PushMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/core/PushMonitor.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/core/PushMonitor.java
index 8e13252..1b6a228 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/core/PushMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/core/PushMonitor.java
@@ -20,7 +20,7 @@
 */
 package org.apache.airavata.gfac.monitor.core;
 
-import org.apache.airavata.gfac.monitor.MonitorID;
+import org.apache.airavata.gfac.core.monitor.MonitorID;
 import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
 
 /**

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/event/MonitorPublisher.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/event/MonitorPublisher.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/event/MonitorPublisher.java
deleted file mode 100644
index 52487fe..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/event/MonitorPublisher.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor.event;
-
-import com.google.common.eventbus.EventBus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MonitorPublisher{
-    private final static Logger logger = LoggerFactory.getLogger(MonitorPublisher.class);
-    private EventBus eventBus;
-    
-    public MonitorPublisher(EventBus eventBus) {
-        this.eventBus = eventBus;
-    }
-
-    public void registerListener(Object listener) {
-        eventBus.register(listener);
-    }
-    
-    public void unregisterListener(Object listener) {
-        eventBus.unregister(listener);
-    }
-
-    public void publish(Object o) {
-        eventBus.post(o);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
index fc83751..a87b8a5 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
@@ -22,11 +22,12 @@ package org.apache.airavata.gfac.monitor.handlers;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.handler.GFacHandlerException;
-import org.apache.airavata.gfac.handler.ThreadedHandler;
-import org.apache.airavata.gfac.monitor.AbstractActivityListener;
-import org.apache.airavata.gfac.monitor.MonitorID;
+import org.apache.airavata.gfac.core.context.JobExecutionContext;
+import org.apache.airavata.gfac.core.handler.GFacHandlerException;
+import org.apache.airavata.gfac.core.handler.ThreadedHandler;
+import org.apache.airavata.gfac.core.monitor.AbstractActivityListener;
+import org.apache.airavata.gfac.core.monitor.MonitorID;
+import org.apache.airavata.gfac.monitor.HPCMonitorID;
 import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
 import org.apache.airavata.gfac.monitor.impl.pull.qstat.HPCPullMonitor;
 import org.apache.airavata.gfac.monitor.util.CommonUtils;
@@ -90,14 +91,14 @@ public class GridPullMonitorHandler extends ThreadedHandler {
         hpcPullMonitor.run();
     }
 
-    public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException{
+    public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
         if(!registrySet){
             for(AbstractActivityListener listener:activityListeners){
                 listener.setup(jobExecutionContext.getRegistry());
             }
         }
         super.invoke(jobExecutionContext);
-        MonitorID monitorID = new MonitorID(authenticationInfo, jobExecutionContext);
+        MonitorID monitorID = new HPCMonitorID(authenticationInfo, jobExecutionContext);
         try {
             CommonUtils.addMonitortoQueue(hpcPullMonitor.getQueue(), monitorID);
         } catch (AiravataMonitorException e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/LocalJobMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/LocalJobMonitor.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/LocalJobMonitor.java
index a64b484..3c87d7d 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/LocalJobMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/LocalJobMonitor.java
@@ -21,10 +21,10 @@
 package org.apache.airavata.gfac.monitor.impl;
 
 import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.gfac.monitor.JobIdentity;
-import org.apache.airavata.gfac.monitor.MonitorID;
+import org.apache.airavata.gfac.core.monitor.MonitorID;
+import org.apache.airavata.gfac.core.monitor.state.JobStatusChangeRequest;
+import org.apache.airavata.gfac.core.monitor.JobIdentity;
 import org.apache.airavata.gfac.monitor.core.AiravataAbstractMonitor;
-import org.apache.airavata.gfac.monitor.state.JobStatusChangeRequest;
 import org.apache.airavata.model.workspace.experiment.JobState;
 
 import java.util.concurrent.BlockingQueue;

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
index 0a1e985..38453e8 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
@@ -23,13 +23,13 @@ package org.apache.airavata.gfac.monitor.impl.pull.qstat;
 import com.google.common.eventbus.EventBus;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.gfac.core.monitor.MonitorID;
+import org.apache.airavata.gfac.core.monitor.state.JobStatusChangeRequest;
+import org.apache.airavata.gfac.core.notification.MonitorPublisher;
 import org.apache.airavata.gfac.monitor.HostMonitorData;
-import org.apache.airavata.gfac.monitor.MonitorID;
 import org.apache.airavata.gfac.monitor.UserMonitorData;
 import org.apache.airavata.gfac.monitor.core.PullMonitor;
-import org.apache.airavata.gfac.monitor.event.MonitorPublisher;
 import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
-import org.apache.airavata.gfac.monitor.state.JobStatusChangeRequest;
 import org.apache.airavata.gfac.monitor.util.CommonUtils;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
 import org.apache.airavata.model.workspace.experiment.JobState;
@@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory;
 
 import java.sql.Timestamp;
 import java.util.*;
-import java.util.concurrent.ArrayBlockingQueue;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingDeque;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
index 6ab86af..957e288 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/ResourceConnection.java
@@ -21,9 +21,9 @@
 package org.apache.airavata.gfac.monitor.impl.pull.qstat;
 
 import org.apache.airavata.gfac.GFacException;
+import org.apache.airavata.gfac.core.monitor.MonitorID;
 import org.apache.airavata.gfac.gsissh.security.GSISecurityContext;
 import org.apache.airavata.gfac.monitor.HostMonitorData;
-import org.apache.airavata.gfac.monitor.MonitorID;
 import org.apache.airavata.gsi.ssh.api.SSHApiException;
 import org.apache.airavata.gsi.ssh.impl.JobStatus;
 import org.apache.airavata.gsi.ssh.impl.PBSCluster;

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/AMQPMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/AMQPMonitor.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/AMQPMonitor.java
index fbf6e21..fa17c4e 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/AMQPMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/AMQPMonitor.java
@@ -26,12 +26,12 @@ import com.rabbitmq.client.Channel;
 import com.rabbitmq.client.Connection;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.gfac.monitor.JobIdentity;
-import org.apache.airavata.gfac.monitor.MonitorID;
+import org.apache.airavata.gfac.core.monitor.JobIdentity;
+import org.apache.airavata.gfac.core.monitor.MonitorID;
+import org.apache.airavata.gfac.core.monitor.state.JobStatusChangeRequest;
+import org.apache.airavata.gfac.core.notification.MonitorPublisher;
 import org.apache.airavata.gfac.monitor.core.PushMonitor;
-import org.apache.airavata.gfac.monitor.event.MonitorPublisher;
 import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
-import org.apache.airavata.gfac.monitor.state.JobStatusChangeRequest;
 import org.apache.airavata.gfac.monitor.util.AMQPConnectionUtil;
 import org.apache.airavata.gfac.monitor.util.CommonUtils;
 import org.apache.airavata.model.workspace.experiment.JobState;

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/BasicConsumer.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/BasicConsumer.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/BasicConsumer.java
index 1d60c45..b8ec08a 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/BasicConsumer.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/BasicConsumer.java
@@ -24,9 +24,9 @@ import com.rabbitmq.client.AMQP;
 import com.rabbitmq.client.Consumer;
 import com.rabbitmq.client.Envelope;
 import com.rabbitmq.client.ShutdownSignalException;
-import org.apache.airavata.gfac.monitor.MonitorID;
+import org.apache.airavata.gfac.core.monitor.MonitorID;
+import org.apache.airavata.gfac.core.notification.MonitorPublisher;
 import org.apache.airavata.gfac.monitor.core.MessageParser;
-import org.apache.airavata.gfac.monitor.event.MonitorPublisher;
 import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/UnRegisterWorker.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/UnRegisterWorker.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/UnRegisterWorker.java
index c6e1378..2cde735 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/UnRegisterWorker.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/UnRegisterWorker.java
@@ -22,9 +22,9 @@ package org.apache.airavata.gfac.monitor.impl.push.amqp;
 
 import com.google.common.eventbus.Subscribe;
 import com.rabbitmq.client.Channel;
-import org.apache.airavata.gfac.monitor.MonitorID;
+import org.apache.airavata.gfac.core.monitor.MonitorID;
+import org.apache.airavata.gfac.core.monitor.state.JobStatusChangeRequest;
 import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
-import org.apache.airavata.gfac.monitor.state.JobStatusChangeRequest;
 import org.apache.airavata.gfac.monitor.util.CommonUtils;
 import org.apache.airavata.model.workspace.experiment.JobState;
 import org.slf4j.Logger;

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/AbstractStateChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/AbstractStateChangeRequest.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/AbstractStateChangeRequest.java
deleted file mode 100644
index 10048b0..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/AbstractStateChangeRequest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.gfac.monitor.state;
-
-
-public abstract class AbstractStateChangeRequest implements PublisherMessage {
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/ExperimentStatusChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/ExperimentStatusChangeRequest.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/ExperimentStatusChangeRequest.java
deleted file mode 100644
index eecf88d..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/ExperimentStatusChangeRequest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor.state;
-
-import org.apache.airavata.gfac.monitor.ExperimentIdentity;
-import org.apache.airavata.model.workspace.experiment.ExperimentState;
-
-/**
- * This is the primary job state object used in
- * through out the monitor module. This use airavata-data-model JobState enum
- * Ideally after processing each event or monitoring message from remote system
- * Each monitoring implementation has to return this object with a state and
- * the monitoring ID
- */
-public class ExperimentStatusChangeRequest extends AbstractStateChangeRequest {
-    private ExperimentState state;
-    private ExperimentIdentity identity;
-
-    // this constructor can be used in Qstat monitor to handle errors
-    public ExperimentStatusChangeRequest() {
-    }
-
-    public ExperimentStatusChangeRequest(ExperimentIdentity experimentIdentity, ExperimentState state) {
-        this.state = state;
-        setIdentity(experimentIdentity);
-    }
-
-    public ExperimentState getState() {
-        return state;
-    }
-
-    public void setState(ExperimentState state) {
-       this.state = state;
-    }
-
-	public ExperimentIdentity getIdentity() {
-		return identity;
-	}
-
-	public void setIdentity(ExperimentIdentity identity) {
-		this.identity = identity;
-	}
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/JobStatusChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/JobStatusChangeRequest.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/JobStatusChangeRequest.java
deleted file mode 100644
index da52656..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/JobStatusChangeRequest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor.state;
-
-import org.apache.airavata.gfac.monitor.JobIdentity;
-import org.apache.airavata.gfac.monitor.MonitorID;
-import org.apache.airavata.model.workspace.experiment.JobState;
-
-/**
- * This is the primary job state object used in
- * through out the monitor module. This use airavata-data-model JobState enum
- * Ideally after processing each event or monitoring message from remote system
- * Each monitoring implementation has to return this object with a state and
- * the monitoring ID
- */
-public class JobStatusChangeRequest  extends AbstractStateChangeRequest {
-    private JobState state;
-    private JobIdentity identity;
-
-    private MonitorID monitorID;
-    
-    // this constructor can be used in Qstat monitor to handle errors
-    public JobStatusChangeRequest() {
-    }
-
-    public JobStatusChangeRequest(MonitorID monitorID) {
-        setIdentity(new JobIdentity(monitorID.getExperimentID(),monitorID.getWorkflowNodeID(),
-                monitorID.getTaskID(),monitorID.getJobID()));
-    	setMonitorID(monitorID);
-    	this.state = monitorID.getStatus();
-    }
-    public JobStatusChangeRequest(MonitorID monitorID, JobIdentity jobId, JobState state) {
-    	setIdentity(jobId);
-    	setMonitorID(monitorID);
-    	this.state = state;
-    }
-
-    public JobState getState() {
-        return state;
-    }
-
-    public void setState(JobState state) {
-       this.state = state;
-    }
-
-	public JobIdentity getIdentity() {
-		return identity;
-	}
-
-	public void setIdentity(JobIdentity identity) {
-		this.identity = identity;
-	}
-
-	public MonitorID getMonitorID() {
-		return monitorID;
-	}
-
-	public void setMonitorID(MonitorID monitorID) {
-		this.monitorID = monitorID;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/JobStatusInfo.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/JobStatusInfo.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/JobStatusInfo.java
deleted file mode 100644
index 9a59b50..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/JobStatusInfo.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor.state;
-
-import org.apache.airavata.gsi.ssh.impl.JobStatus;
-
-/**
- * Based on the job status monitoring we can gather
- * different informaation about the job, its not simply
- * the job status, so we need a way to implement
- * different job statusinfo object to keep job status
- */
-public interface JobStatusInfo {
-
-    /**
-     * This method can be used to get JobStatusInfo data and
-     * decide the finalJobState
-     *
-     * @param jobState
-     */
-    void setJobStatus(JobStatus jobState);
-
-    /**
-     * After setting the jobState by processing jobinformation
-     * this method can be used to get the JobStatus
-     * @return
-     */
-    JobStatus getJobStatus();
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/PublisherMessage.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/PublisherMessage.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/PublisherMessage.java
deleted file mode 100644
index cbfcb5a..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/PublisherMessage.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.gfac.monitor.state;
-
-public interface PublisherMessage {
-//	public String getType();
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/TaskStatusChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/TaskStatusChangeRequest.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/TaskStatusChangeRequest.java
deleted file mode 100644
index af20707..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/TaskStatusChangeRequest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor.state;
-
-import org.apache.airavata.gfac.monitor.TaskIdentity;
-import org.apache.airavata.model.workspace.experiment.TaskState;
-
-/**
- * This is the primary job state object used in
- * through out the monitor module. This use airavata-data-model JobState enum
- * Ideally after processing each event or monitoring message from remote system
- * Each monitoring implementation has to return this object with a state and
- * the monitoring ID
- */
-public class TaskStatusChangeRequest extends AbstractStateChangeRequest {
-    private TaskState state;
-    private TaskIdentity identity;
-    // this constructor can be used in Qstat monitor to handle errors
-    public TaskStatusChangeRequest() {
-    }
-
-    public TaskStatusChangeRequest(TaskIdentity taskIdentity, TaskState state) {
-        this.state = state;
-        setIdentity(taskIdentity);
-    }
-
-    public TaskState getState() {
-        return state;
-    }
-
-    public void setState(TaskState state) {
-       this.state = state;
-    }
-
-	public TaskIdentity getIdentity() {
-		return identity;
-	}
-
-	public void setIdentity(TaskIdentity identity) {
-		this.identity = identity;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/WorkflowNodeStatusChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/WorkflowNodeStatusChangeRequest.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/WorkflowNodeStatusChangeRequest.java
deleted file mode 100644
index 632f2e3..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/WorkflowNodeStatusChangeRequest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor.state;
-
-import org.apache.airavata.gfac.monitor.WorkflowNodeIdentity;
-import org.apache.airavata.model.workspace.experiment.WorkflowNodeState;
-
-/**
- * This is the primary job state object used in
- * through out the monitor module. This use airavata-data-model JobState enum
- * Ideally after processing each event or monitoring message from remote system
- * Each monitoring implementation has to return this object with a state and
- * the monitoring ID
- */
-public class WorkflowNodeStatusChangeRequest extends AbstractStateChangeRequest {
-    private WorkflowNodeState state;
-    private WorkflowNodeIdentity identity;
-
-    // this constructor can be used in Qstat monitor to handle errors
-    public WorkflowNodeStatusChangeRequest() {
-    }
-
-    public WorkflowNodeStatusChangeRequest(WorkflowNodeIdentity identity, WorkflowNodeState state) {
-        this.state = state;
-        setIdentity(identity);
-    }
-
-    public WorkflowNodeState getState() {
-        return state;
-    }
-
-    public void setState(WorkflowNodeState state) {
-       this.state = state;
-    }
-
-	public WorkflowNodeIdentity getIdentity() {
-		return identity;
-	}
-
-	public void setIdentity(WorkflowNodeIdentity identity) {
-		this.identity = identity;
-	}
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/39370c52/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/impl/AmazonJobStatusInfo.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/impl/AmazonJobStatusInfo.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/impl/AmazonJobStatusInfo.java
deleted file mode 100644
index 19b051a..0000000
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/state/impl/AmazonJobStatusInfo.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.gfac.monitor.state.impl;
-
-import org.apache.airavata.gfac.monitor.state.JobStatusInfo;
-import org.apache.airavata.gsi.ssh.impl.JobStatus;
-
-/**
- * This can be used to store job status information about
- * amazon jobs, this data could be very different from
- * a typical grid job
- */
-public class AmazonJobStatusInfo implements JobStatusInfo {
-    public void setJobStatus(JobStatus jobState) {
-        //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    public JobStatus getJobStatus() {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-}


Mime
View raw message