Replaced all tabs with spaces in java and pom.xml
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / common / workflow / context / WorkflowContext.java
index 3ec7773..2a10271 100644 (file)
@@ -26,73 +26,72 @@ import java.util.concurrent.TimeUnit;
 
 
 /**
- * @version 1.0
- * Workflow context object used to send timeout response, if workflow instance does not write the response in time
+ * @version 1.0 Workflow context object used to send timeout response, if workflow instance does not write the response
+ *          in time
  */
 public class WorkflowContext implements Delayed {
-       private final String processKey;
-       private final String requestId;
-
-       private final long startTime;
-       private final long timeout;
-       
-       private final WorkflowResponse workflowResponse;
-       
-       public WorkflowContext(String processKey, String requestId, long timeout, WorkflowResponse workflowResponse) {
-               this.processKey = processKey;
-               this.requestId = requestId;             
-               this.timeout = timeout;
-               this.startTime = System.currentTimeMillis(); 
-               this.workflowResponse = workflowResponse;
-       }
-       
-       public String getRequestId() {
-               return requestId;
-       }
-
-       public String getProcessKey() {
-               return processKey;
-       }
-
-
-       public long getTimeout() {
-               return timeout;
-       }
-
-       public long getStartTime() {
-               return startTime;
-       }
-       
-       public WorkflowResponse getWorkflowResponse() {
-               return workflowResponse;
-       }
-
-       /**
-        * Required implementation by Delay queue
-        * Returns the elapsed time for this context
-        */
-       @Override
-       public long getDelay(TimeUnit unit) {
-               // 0 or negative means this object is considered to be expired
-               return unit.convert(startTime + timeout - System.currentTimeMillis(), unit);
-       }
-
-       /**
-        * Required implementation by Delay queue
-        * Compares the object to determine whether the object can be marked as expired
-        */
-       @Override
-       public int compareTo(Delayed object) {
-               WorkflowContext that = (WorkflowContext) object;
-               long thisEndTime = startTime + timeout;
-               long thatEndTime = that.startTime + that.timeout;
-
-               if (thisEndTime < thatEndTime) {
-                       return -1;
-               } else if (thisEndTime > thatEndTime) {
-                       return 1;
-               } else {
-                       return 0;
-               }
-       }
+    private final String processKey;
+    private final String requestId;
+
+    private final long startTime;
+    private final long timeout;
+
+    private final WorkflowResponse workflowResponse;
+
+    public WorkflowContext(String processKey, String requestId, long timeout, WorkflowResponse workflowResponse) {
+        this.processKey = processKey;
+        this.requestId = requestId;
+        this.timeout = timeout;
+        this.startTime = System.currentTimeMillis();
+        this.workflowResponse = workflowResponse;
+    }
+
+    public String getRequestId() {
+        return requestId;
+    }
+
+    public String getProcessKey() {
+        return processKey;
+    }
+
+
+    public long getTimeout() {
+        return timeout;
+    }
+
+    public long getStartTime() {
+        return startTime;
+    }
+
+    public WorkflowResponse getWorkflowResponse() {
+        return workflowResponse;
+    }
+
+    /**
+     * Required implementation by Delay queue Returns the elapsed time for this context
+     */
+    @Override
+    public long getDelay(TimeUnit unit) {
+        // 0 or negative means this object is considered to be expired
+        return unit.convert(startTime + timeout - System.currentTimeMillis(), unit);
+    }
+
+    /**
+     * Required implementation by Delay queue Compares the object to determine whether the object can be marked as
+     * expired
+     */
+    @Override
+    public int compareTo(Delayed object) {
+        WorkflowContext that = (WorkflowContext) object;
+        long thisEndTime = startTime + timeout;
+        long thatEndTime = that.startTime + that.timeout;
+
+        if (thisEndTime < thatEndTime) {
+            return -1;
+        } else if (thisEndTime > thatEndTime) {
+            return 1;
+        } else {
+            return 0;
+        }
+    }
 }