1 21 22 package org.apache.derby.impl.store.raw.data; 23 24 import org.apache.derby.iapi.services.sanity.SanityManager; 25 import org.apache.derby.iapi.services.io.StoredFormatIds; 26 27 import org.apache.derby.iapi.store.raw.Compensation; 28 import org.apache.derby.iapi.store.raw.Loggable; 29 import org.apache.derby.iapi.store.raw.Transaction; 30 import org.apache.derby.iapi.store.raw.Undoable; 31 import org.apache.derby.iapi.util.ByteArray; 32 import org.apache.derby.iapi.store.raw.log.LogInstant; 33 import org.apache.derby.iapi.error.StandardException; 34 35 import java.io.ObjectOutput ; 36 import java.io.ObjectInput ; 37 import java.io.IOException ; 38 import org.apache.derby.iapi.services.io.LimitObjectInput; 39 40 43 public class EncryptContainerUndoOperation implements Compensation 44 { 45 transient private EncryptContainerOperation undoOp; 47 48 49 50 54 public EncryptContainerUndoOperation(EncryptContainerOperation op) 55 { 56 undoOp = op; 57 } 58 59 62 63 public EncryptContainerUndoOperation() { super(); } 65 66 public void writeExternal(ObjectOutput out) throws IOException 67 { 68 } 70 71 75 public void readExternal(ObjectInput in) 76 throws IOException , ClassNotFoundException 77 { 78 } 80 81 84 public int getTypeFormatId() { 85 return StoredFormatIds.LOGOP_ENCRYPT_CONTAINER_UNDO; 86 } 87 88 91 92 93 public void setUndoOp(Undoable op) 94 { 95 if (SanityManager.DEBUG) { 96 SanityManager.ASSERT(op instanceof EncryptContainerOperation); 97 } 98 99 undoOp = (EncryptContainerOperation)op; 100 } 101 102 105 106 107 114 public boolean needsRedo(Transaction xact) 115 throws StandardException 116 { 117 return true; 118 } 119 120 127 public ByteArray getPreparedLog() 128 { 129 return (ByteArray) null; 130 } 131 132 133 143 public final void doMe(Transaction xact, LogInstant instant, 144 LimitObjectInput in) 145 throws StandardException, IOException 146 { 147 undoOp.undoMe(xact); 148 releaseResource(xact); 149 } 150 151 152 public void releaseResource(Transaction xact) 153 { 154 if (undoOp != null) 155 undoOp.releaseResource(xact); 156 } 157 158 159 public int group() 160 { 161 return Loggable.COMPENSATION | Loggable.RAWSTORE; 162 } 163 164 167 public String toString() 168 { 169 if (SanityManager.DEBUG) 170 { 171 String str = "CLR (Encrypt Container Undo): " ; 172 if (undoOp != null) 173 str += undoOp.toString(); 174 else 175 str += "undo Operation not set"; 176 177 return str; 178 } 179 else 180 return null; 181 } 182 } 183 | Popular Tags |