1 25 package org.ofbiz.service; 26 27 import java.sql.Timestamp ; 28 29 import org.ofbiz.base.util.UtilDateTime; 30 31 37 public class RunningService { 38 39 protected ModelService model; 40 protected String name; 41 protected int mode; 42 43 protected Timestamp startStamp; 44 protected Timestamp endStamp; 45 46 private RunningService() { 47 this.startStamp = UtilDateTime.nowTimestamp(); 48 this.endStamp = null; 49 } 50 51 public RunningService(String localName, ModelService model, int mode) { 52 this(); 53 this.name = localName; 54 this.model = model; 55 this.mode = mode; 56 } 57 58 public ModelService getModelService() { 59 return this.model; 60 } 61 62 public String getLocalName() { 63 return this.name; 64 } 65 66 public int getMode() { 67 return mode; 68 } 69 70 public Timestamp getStartStamp() { 71 return this.startStamp; 72 } 73 74 public Timestamp getEndStamp() { 75 return this.endStamp; 76 } 77 78 public void setEndStamp() { 79 this.endStamp = UtilDateTime.nowTimestamp(); 80 } 81 82 public boolean equals(Object o) { 83 if (o != null && o instanceof RunningService) { 84 RunningService x = (RunningService) o; 85 if (this.model.equals(x) && this.mode == x.getMode() && this.startStamp.equals(x.getStartStamp())) { 86 return true; 87 } 88 } 89 return false; 90 } 91 } 92 | Popular Tags |