KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > store > raw > data > RawContainerHandle


1 /*
2
3    Derby - Class org.apache.derby.iapi.store.raw.data.RawContainerHandle
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.store.raw.data;
23
24 import org.apache.derby.iapi.store.raw.ContainerHandle;
25 import org.apache.derby.iapi.store.raw.Page;
26 import org.apache.derby.iapi.store.raw.log.LogInstant;
27
28 import org.apache.derby.iapi.error.StandardException;
29
30 import org.apache.derby.iapi.util.ByteArray;
31
32 /**
33         RawContainerHandle is the form of ContainerHandle that is used within
34         the raw store. This allows the raw store to have a handle on dropped
35         container without exposing this to the external interface, which is not
36         allowed to get back a handle on a dropped container
37 */

38
39 public interface RawContainerHandle extends ContainerHandle {
40
41     /** A container can be in 4 states:
42         non_existent - this is represented by a null ContainerHandle
43
44         NORMAL - this is the normal case, container has been created and is not dropped.
45         DROPPED - container has been dropped, but is not known whether the drop
46                         has been committed or not
47         COMMITTED_DROP - container has been dropped and has committed. To
48                         everyone else except recovery, this state is equivalent
49                         to NON_EXISTENT
50     */

51     public static final int NORMAL = 1;
52     public static final int DROPPED = 2;
53     public static final int COMMITTED_DROP = 4;
54
55     /**
56         Return the status of the container - one of NORMAL, DROPPED, COMMITTED_DROP.
57         @exception StandardException Standard cloudscape exception policy
58     */

59     public int getContainerStatus() throws StandardException;
60
61     /**
62         Remove the container.
63
64         @exception StandardException Standard cloudscape exception policy
65     */

66     public void removeContainer(LogInstant instant) throws StandardException;
67
68     /**
69         If drop is true, drop the container. if drop is false, un-drop the
70         container
71         @exception StandardException Standard cloudscape exception policy
72     */

73     public void dropContainer(LogInstant instant, boolean drop) throws StandardException;
74
75     /**
76         Get the logged container version
77         @exception StandardException Standard cloudscape exception policy
78     */

79     public long getContainerVersion() throws StandardException;
80
81     /**
82         Return a Page that represents any page - alloc page, valid page, free page,
83         dealloced page etc.
84
85         @exception StandardException Standard Cloudscape error policy
86     */

87     public Page getAnyPage(long pageNumber) throws StandardException;
88
89
90     /** Backup restore support */
91
92     /**
93         ReCreate a page for redo recovery.
94
95         Used during redo recovery while trying to apply log records which
96         are creating the page.
97
98         @exception StandardException Standard Cloudscape error policy
99      */

100     public Page reCreatePageForRedoRecovery(
101     int pageFormat,
102     long pageNumber,
103     long pageOffset)
104          throws StandardException;
105
106     /**
107         Log all information necessary to recreate the container during a load
108         tran.
109
110         @exception StandardException Standard Cloudscape error policy
111      */

112     public ByteArray logCreateContainerInfo() throws StandardException;
113
114      /**
115        The container is about to be modified.
116        Loggable actions use this to make sure the container gets cleaned if a
117        checkpoint is taken after any log record is sent to the log stream but
118        before the container is actually dirtied.
119
120         @exception StandardException Standard Cloudscape error policy
121      */

122     public void preDirty(boolean preDirtyOn) throws StandardException;
123
124
125     /**
126      * Create encrypted version of the container with the
127      * user specified encryption properties.
128      * @param newFilePath file to store the new encrypted version of the container
129      * @exception StandardException Standard Cloudscape error policy
130      */

131     public void encryptContainer(String JavaDoc newFilePath) throws StandardException;
132
133 }
134
Popular Tags