01: /*******************************************************************************
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: *******************************************************************************/package org.ofbiz.service;
19:
20: import java.sql.Timestamp;
21:
22: import org.ofbiz.base.util.UtilDateTime;
23:
24: public class RunningService {
25:
26: protected ModelService model;
27: protected String name;
28: protected int mode;
29:
30: protected Timestamp startStamp;
31: protected Timestamp endStamp;
32:
33: private RunningService() {
34: this .startStamp = UtilDateTime.nowTimestamp();
35: this .endStamp = null;
36: }
37:
38: public RunningService(String localName, ModelService model, int mode) {
39: this ();
40: this .name = localName;
41: this .model = model;
42: this .mode = mode;
43: }
44:
45: public ModelService getModelService() {
46: return this .model;
47: }
48:
49: public String getLocalName() {
50: return this .name;
51: }
52:
53: public int getMode() {
54: return mode;
55: }
56:
57: public Timestamp getStartStamp() {
58: return this .startStamp;
59: }
60:
61: public Timestamp getEndStamp() {
62: return this .endStamp;
63: }
64:
65: public void setEndStamp() {
66: this .endStamp = UtilDateTime.nowTimestamp();
67: }
68:
69: public boolean equals(Object o) {
70: if (o != null && o instanceof RunningService) {
71: RunningService x = (RunningService) o;
72: if (this .model.equals(x) && this .mode == x.getMode()
73: && this .startStamp.equals(x.getStartStamp())) {
74: return true;
75: }
76: }
77: return false;
78: }
79: }
|