1 2 12 package com.versant.core.storagemanager.logging; 13 14 import com.versant.core.storagemanager.StorageManager; 15 16 19 public class SmStoreEvent extends SmStatesReturnedEvent { 20 21 private int toStoreSize; 22 private String [] toStoreOIDs; 23 private int toDeleteSize; 24 private String [] 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 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 getDescription() { 63 StringBuffer s = new StringBuffer (); 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 [] getToStoreOIDs() { 87 return toStoreOIDs; 88 } 89 90 public void setToStoreOIDs(String [] 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 [] getToDeleteOIDs() { 103 return toDeleteOIDs; 104 } 105 106 public void setToDeleteOIDs(String [] toDeleteOIDs) { 107 this.toDeleteOIDs = toDeleteOIDs; 108 } 109 110 } 111 | Popular Tags |