org.apache.derby.impl.store.raw.data
Class EncryptContainerUndoOperation

java.lang.Object
  extended by org.apache.derby.impl.store.raw.data.EncryptContainerUndoOperation
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Formatable, TypedFormat, Compensation, Loggable

public class EncryptContainerUndoOperation
extends java.lang.Object
implements Compensation

A Encrypt Container undo operation rolls back the change of a Encrypt Container operation

See Also:
Serialized Form

Field Summary
private  EncryptContainerOperation undoOp
           
 
Fields inherited from interface org.apache.derby.iapi.store.raw.Loggable
ABORT, BI_LOG, CHECKSUM, COMMIT, COMPENSATION, FILE_RESOURCE, FIRST, LAST, PREPARE, RAWSTORE, XA_NEEDLOCK
 
Constructor Summary
EncryptContainerUndoOperation()
           
EncryptContainerUndoOperation(EncryptContainerOperation op)
          Set up a Encrypt Container undo operation during run time rollback
 
Method Summary
 void doMe(Transaction xact, LogInstant instant, LimitObjectInput in)
          Apply the undo operation, in this implementation of the RawStore, it can only call the undoMe method of undoOp
 ByteArray getPreparedLog()
          the default for prepared log is always null for all the operations that don't have optionalData.
 int getTypeFormatId()
          Return my format identifier.
 int group()
          Get the loggable's group value
 boolean needsRedo(Transaction xact)
          Check if this operation needs to be redone during recovery redo.
 void readExternal(java.io.ObjectInput in)
           
 void releaseResource(Transaction xact)
          Release any resource that was acquired for doMe for rollback or recovery redo.
 void setUndoOp(Undoable op)
          Set up a Container undo operation during recovery redo.
 java.lang.String toString()
          DEBUG: Print self.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

undoOp

private transient EncryptContainerOperation undoOp
Constructor Detail

EncryptContainerUndoOperation

public EncryptContainerUndoOperation(EncryptContainerOperation op)
Set up a Encrypt Container undo operation during run time rollback

Parameters:
op - Encrypt contaner operatation that is to be undone.

EncryptContainerUndoOperation

public EncryptContainerUndoOperation()
Method Detail

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException - cannot read log record from log stream
java.lang.ClassNotFoundException - cannot read ByteArray object

getTypeFormatId

public int getTypeFormatId()
Return my format identifier.

Specified by:
getTypeFormatId in interface TypedFormat
Returns:
The identifier. (A UUID stuffed in an array of 16 bytes).

setUndoOp

public void setUndoOp(Undoable op)
Set up a Container undo operation during recovery redo.

Specified by:
setUndoOp in interface Compensation
Parameters:
op - the Undoable operation
See Also:
Loggable.needsRedo(org.apache.derby.iapi.store.raw.Transaction)

needsRedo

public boolean needsRedo(Transaction xact)
                  throws StandardException
Check if this operation needs to be redone during recovery redo. Returns true if this op should be redone during recovery redo,

Specified by:
needsRedo in interface Loggable
Parameters:
xact - the transaction that is doing the rollback
Returns:
true, if this operation needs to be redone during recovery.
Throws:
StandardException - Standard Derby error policy
See Also:
Loggable.releaseResource(org.apache.derby.iapi.store.raw.Transaction)

getPreparedLog

public ByteArray getPreparedLog()
the default for prepared log is always null for all the operations that don't have optionalData. If an operation has optional data, the operation need to prepare the optional data for this method. Encrypt Conatainer Undo Operation has no optional data to write out

Specified by:
getPreparedLog in interface Loggable

doMe

public final void doMe(Transaction xact,
                       LogInstant instant,
                       LimitObjectInput in)
                throws StandardException,
                       java.io.IOException
Apply the undo operation, in this implementation of the RawStore, it can only call the undoMe method of undoOp

Specified by:
doMe in interface Loggable
Parameters:
xact - the Transaction that is doing the rollback
instant - the log instant of this compenstaion operation
in - optional data
Throws:
java.io.IOException - Can be thrown by any of the methods of ObjectInput.
StandardException - Standard Derby policy.
See Also:
EncryptContainerOperation.generateUndo(org.apache.derby.iapi.store.raw.Transaction, org.apache.derby.iapi.services.io.LimitObjectInput)

releaseResource

public void releaseResource(Transaction xact)
Description copied from interface: Loggable
Release any resource that was acquired for doMe for rollback or recovery redo. This resource is acquired in either generateUndo (if this is a compensation operation during run time rollback or recovery rollback) or in needsRedo (if this is during recovery redo). The run time transaction context should have all the resource already acquird for run time roll forward, so there is no need to releaseResource during run time roll forward. This method must be safe to be called multiple times.

Specified by:
releaseResource in interface Loggable

group

public int group()
Description copied from interface: Loggable
Get the loggable's group value

Specified by:
group in interface Loggable

toString

public java.lang.String toString()
DEBUG: Print self.

Overrides:
toString in class java.lang.Object

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.