01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.jdo;
12:
13: import java.io.Serializable;
14:
15: /**
16: * This is a read only value object to report the status of an jdo client
17: * connection i.e. a PersistenceManager (local or remote).
18: */
19: public final class PersistenceManagerStatus implements Serializable {
20:
21: private final int id;
22: private final long timeCreated;
23: private final boolean txActive;
24: private final long lastTxStarted;
25: private final long timeLastTxEnded;
26: private final Object userObject;
27: private final String remoteClient;
28: private final boolean optimistic;
29: private final boolean open;
30:
31: public PersistenceManagerStatus(int id, long timeCreated,
32: boolean txActive, long lastTxStarted, long timeLastTxEnded,
33: Object userObject, String remoteClient, boolean optimistic,
34: boolean open) {
35: this .id = id;
36: this .timeCreated = timeCreated;
37: this .txActive = txActive;
38: this .lastTxStarted = lastTxStarted;
39: this .timeLastTxEnded = timeLastTxEnded;
40: this .userObject = userObject;
41: this .remoteClient = remoteClient;
42: this .optimistic = optimistic;
43: this .open = open;
44: }
45:
46: public int getId() {
47: return id;
48: }
49:
50: public long getTimeCreated() {
51: return timeCreated;
52: }
53:
54: public boolean getTxActive() {
55: return txActive;
56: }
57:
58: public long getLastTxStarted() {
59: return lastTxStarted;
60: }
61:
62: public long getTimeLastTxEnded() {
63: return timeLastTxEnded;
64: }
65:
66: public Object getUserObject() {
67: return userObject;
68: }
69:
70: public String getRemoteClient() {
71: return remoteClient;
72: }
73:
74: public boolean getOptimistic() {
75: return optimistic;
76: }
77:
78: public boolean isRemote() {
79: return remoteClient != null;
80: }
81:
82: public boolean isOpen() {
83: return open;
84: }
85:
86: }
|