KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > storagemanager > logging > SmStoreEvent


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.storagemanager.logging;
13
14 import com.versant.core.storagemanager.StorageManager;
15
16 /**
17  * Info on a store operation.
18  */

19 public class SmStoreEvent extends SmStatesReturnedEvent {
20
21     private int toStoreSize;
22     private String JavaDoc[] toStoreOIDs;
23     private int toDeleteSize;
24     private String JavaDoc[] toDeleteOIDs;
25
26     private boolean returnFieldsUpdatedBySM;
27     private int storeOption;
28     private boolean evictClasses;
29
30     public SmStoreEvent(int storageManagerId, boolean returnFieldsUpdatedBySM,
31             int storeOption, boolean evictClasses) {
32         super(storageManagerId, StorageManagerEvent.STORE);
33         this.returnFieldsUpdatedBySM = returnFieldsUpdatedBySM;
34         this.storeOption = storeOption;
35         this.evictClasses = evictClasses;
36     }
37
38     public boolean isReturnFieldsUpdatedBySM() {
39         return returnFieldsUpdatedBySM;
40     }
41
42     public int getStoreOption() {
43         return storeOption;
44     }
45
46     public String JavaDoc getStoreOptionStr() {
47         switch (storeOption) {
48             case StorageManager.STORE_OPTION_COMMIT:
49                 return "COMMIT";
50             case StorageManager.STORE_OPTION_FLUSH:
51                 return "FLUSH";
52             case StorageManager.STORE_OPTION_PREPARE:
53                 return "PREPARE";
54         }
55         return "UNKNOWN(" + storeOption + ")";
56     }
57
58     public boolean isEvictClasses() {
59         return evictClasses;
60     }
61
62     public String JavaDoc getDescription() {
63         StringBuffer JavaDoc s = new StringBuffer JavaDoc();
64         s.append(toStoreSize);
65         s.append(" OID(s) delete ");
66         s.append(toDeleteSize);
67         s.append(" OID(s) ");
68         s.append(getStoreOption());
69         if (returnFieldsUpdatedBySM) {
70             s.append(" returnFieldsUpdatedBySM");
71         }
72         if (evictClasses) {
73             s.append(" evictClasses");
74         }
75         return s.toString();
76     }
77
78     public int getToStoreSize() {
79         return toStoreSize;
80     }
81
82     public void setToStoreSize(int toStoreSize) {
83         this.toStoreSize = toStoreSize;
84     }
85
86     public String JavaDoc[] getToStoreOIDs() {
87         return toStoreOIDs;
88     }
89
90     public void setToStoreOIDs(String JavaDoc[] toStoreOIDs) {
91         this.toStoreOIDs = toStoreOIDs;
92     }
93
94     public int getToDeleteSize() {
95         return toDeleteSize;
96     }
97
98     public void setToDeleteSize(int toDeleteSize) {
99         this.toDeleteSize = toDeleteSize;
100     }
101
102     public String JavaDoc[] getToDeleteOIDs() {
103         return toDeleteOIDs;
104     }
105
106     public void setToDeleteOIDs(String JavaDoc[] toDeleteOIDs) {
107         this.toDeleteOIDs = toDeleteOIDs;
108     }
109
110 }
111
Popular Tags