Source Code Cross Referenced for EncryptContainerUndoOperation.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » store » raw » data » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.impl.store.raw.data 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Derby - Class org.apache.derby.impl.store.raw.data.EncryptContainerUndoOperation
004:
005:           Licensed to the Apache Software Foundation (ASF) under one or more
006:           contributor license agreements.  See the NOTICE file distributed with
007:           this work for additional information regarding copyright ownership.
008:           The ASF licenses this file to you under the Apache License, Version 2.0
009:           (the "License"); you may not use this file except in compliance with
010:           the License.  You may obtain a copy of the License at
011:
012:              http://www.apache.org/licenses/LICENSE-2.0
013:
014:           Unless required by applicable law or agreed to in writing, software
015:           distributed under the License is distributed on an "AS IS" BASIS,
016:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:           See the License for the specific language governing permissions and
018:           limitations under the License.
019:
020:         */
021:
022:        package org.apache.derby.impl.store.raw.data;
023:
024:        import org.apache.derby.iapi.services.sanity.SanityManager;
025:        import org.apache.derby.iapi.services.io.StoredFormatIds;
026:
027:        import org.apache.derby.iapi.store.raw.Compensation;
028:        import org.apache.derby.iapi.store.raw.Loggable;
029:        import org.apache.derby.iapi.store.raw.Transaction;
030:        import org.apache.derby.iapi.store.raw.Undoable;
031:        import org.apache.derby.iapi.util.ByteArray;
032:        import org.apache.derby.iapi.store.raw.log.LogInstant;
033:        import org.apache.derby.iapi.error.StandardException;
034:
035:        import java.io.ObjectOutput;
036:        import java.io.ObjectInput;
037:        import java.io.IOException;
038:        import org.apache.derby.iapi.services.io.LimitObjectInput;
039:
040:        /** A Encrypt Container undo operation rolls back the change of a 
041:         *  Encrypt Container operation 
042:         */
043:        public class EncryptContainerUndoOperation implements  Compensation {
044:            // the operation to rollback 
045:            transient private EncryptContainerOperation undoOp;
046:
047:            /** During redo, the whole operation will be reconstituted from the log */
048:
049:            /** 
050:             *	Set up a Encrypt Container undo operation during run time rollback
051:             *  @param op Encrypt contaner operatation that is to be undone. 
052:             */
053:            public EncryptContainerUndoOperation(EncryptContainerOperation op) {
054:                undoOp = op;
055:            }
056:
057:            /*
058:             * Formatable methods
059:             */
060:
061:            // no-arg constructor, required by Formatable 
062:            public EncryptContainerUndoOperation() {
063:                super ();
064:            }
065:
066:            public void writeExternal(ObjectOutput out) throws IOException {
067:                // nothing to write.
068:            }
069:
070:            /**
071:            	@exception IOException cannot read log record from log stream
072:            	@exception ClassNotFoundException cannot read ByteArray object
073:             */
074:            public void readExternal(ObjectInput in) throws IOException,
075:                    ClassNotFoundException {
076:                // nothing to read.
077:            }
078:
079:            /**
080:            	Return my format identifier.
081:             */
082:            public int getTypeFormatId() {
083:                return StoredFormatIds.LOGOP_ENCRYPT_CONTAINER_UNDO;
084:            }
085:
086:            /** 
087:            	Compensation method
088:             */
089:
090:            /** Set up a Container undo operation during recovery redo. */
091:            public void setUndoOp(Undoable op) {
092:                if (SanityManager.DEBUG) {
093:                    SanityManager
094:                            .ASSERT(op instanceof  EncryptContainerOperation);
095:                }
096:
097:                undoOp = (EncryptContainerOperation) op;
098:            }
099:
100:            /**
101:            	Loggable methods
102:             */
103:
104:            /**
105:             * Check if this operation needs to be redone during recovery redo. 
106:             * Returns true if this op should be redone during recovery redo,
107:             * @param xact	the transaction that is doing the rollback
108:             * @return  true, if this operation needs to be redone during recovery.
109:             * @exception StandardException Standard Derby error policy
110:             */
111:            public boolean needsRedo(Transaction xact) throws StandardException {
112:                return true;
113:            }
114:
115:            /**
116:               the default for prepared log is always null for all the operations
117:               that don't have optionalData.  If an operation has optional data,
118:               the operation need to prepare the optional data for this method.
119:
120:               Encrypt Conatainer Undo Operation has no optional data to write out
121:             */
122:            public ByteArray getPreparedLog() {
123:                return (ByteArray) null;
124:            }
125:
126:            /** Apply the undo operation, in this implementation of the
127:                RawStore, it can only call the undoMe method of undoOp
128:                @param xact			the Transaction that is doing the rollback
129:                @param instant		the log instant of this compenstaion operation
130:                @param in			optional data
131:                @exception IOException Can be thrown by any of the methods of ObjectInput.
132:                @exception StandardException Standard Derby policy.
133:
134:                @see EncryptContainerOperation#generateUndo
135:             */
136:            public final void doMe(Transaction xact, LogInstant instant,
137:                    LimitObjectInput in) throws StandardException, IOException {
138:                undoOp.undoMe(xact);
139:                releaseResource(xact);
140:            }
141:
142:            /* make sure resource found in undoOp is released */
143:            public void releaseResource(Transaction xact) {
144:                if (undoOp != null)
145:                    undoOp.releaseResource(xact);
146:            }
147:
148:            /* Undo operation is a COMPENSATION log operation */
149:            public int group() {
150:                return Loggable.COMPENSATION | Loggable.RAWSTORE;
151:            }
152:
153:            /**
154:              DEBUG: Print self.
155:             */
156:            public String toString() {
157:                if (SanityManager.DEBUG) {
158:                    String str = "CLR (Encrypt Container Undo): ";
159:                    if (undoOp != null)
160:                        str += undoOp.toString();
161:                    else
162:                        str += "undo Operation not set";
163:
164:                    return str;
165:                } else
166:                    return null;
167:            }
168:        }
w_ww___.j___a___va__2_s_.c__o__m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.