|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.impl.store.raw.data.EncryptData
public class EncryptData
This class is used to encrypt all the containers in the data segment with a
new encryption key when password/key is changed or when an existing database
is reconfigured for encryption.
Encryption of existing data in the data segments is done by doing the
following:
Find all the containers in data segment (seg0) and encrypt all of them
with the new encryption key, the process for each container is:
1.Write a log record to indicate that the container is getting encrypted.
2.Read all the pages of the container through the page cache and
encrypt each page with new encryption key and then write to a
temporary file(n
Field Summary
private intactionCode
private StorageFileactionDestStorageFile
private StorageFileactionStorageFile
private BaseDataFileFactorydataFactory
private intnoOldFiles
private StorageFile[]oldFiles
private static intSTORAGE_FILE_DELETE_ACTION
private static intSTORAGE_FILE_EXISTS_ACTION
private static intSTORAGE_FILE_RENAME_ACTION
private StorageFactorystorageFactory
Constructor Summary
EncryptData(BaseDataFileFactory dataFactory)
Method Summary
voidencryptAllContainers(RawTransaction t)
private StorageFileencryptContainer(RawTransaction t,
ContainerKey ckey)
Encrypt a container.
private StorageFilegetFile(ContainerKey containerId,
boolean old)
Get file handle to a container file that is used to keep
temporary versions of the container file.
private StorageFilegetFile(java.lang.String ctrFileName)
private java.lang.StringgetFilePath(ContainerKey containerId,
boolean old)
Get path to a container file that is used to keep temporary versions of
the container file.
private booleanisOldContainerFile(java.lang.String fileName)
private booleanprivDelete(StorageFile file)
private booleanprivExists(StorageFile file)
private booleanprivRename(StorageFile fromFile,
StorageFile destFile)
voidremoveOldVersionOfContainers(boolean inRecovery)
(package private) voidrestoreContainer(ContainerKey containerId)
java.lang.Objectrun()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
dataFactory
private BaseDataFileFactory dataFactory
storageFactory
private StorageFactory storageFactory
oldFiles
private StorageFile[] oldFiles
noOldFiles
private int noOldFiles
STORAGE_FILE_EXISTS_ACTION
private static final int STORAGE_FILE_EXISTS_ACTION
STORAGE_FILE_DELETE_ACTION
private static final int STORAGE_FILE_DELETE_ACTION
STORAGE_FILE_RENAME_ACTION
private static final int STORAGE_FILE_RENAME_ACTION
actionCode
private int actionCode
actionStorageFile
private StorageFile actionStorageFile
actionDestStorageFile
private StorageFile actionDestStorageFile
Constructor Detail
EncryptData
public EncryptData(BaseDataFileFactory dataFactory)
Method Detail
encryptAllContainers
public void encryptAllContainers(RawTransaction t)
throws StandardException
StandardException
encryptContainer
private StorageFile encryptContainer(RawTransaction t,
ContainerKey ckey)
throws StandardException
t - the transaction that is used to configure the database
with new encryption properties.ckey - the key of the container that is being encrypted.
StandardException - Standard Derby error policy
getFile
private StorageFile getFile(ContainerKey containerId,
boolean old)
getFilePath
private java.lang.String getFilePath(ContainerKey containerId,
boolean old)
isOldContainerFile
private boolean isOldContainerFile(java.lang.String fileName)
getFile
private StorageFile getFile(java.lang.String ctrFileName)
restoreContainer
void restoreContainer(ContainerKey containerId)
throws StandardException
StandardException
removeOldVersionOfContainers
public void removeOldVersionOfContainers(boolean inRecovery)
throws StandardException
StandardException
privExists
private boolean privExists(StorageFile file)
privDelete
private boolean privDelete(StorageFile file)
privRename
private boolean privRename(StorageFile fromFile,
StorageFile destFile)
run
public java.lang.Object run()
run in interface java.security.PrivilegedAction
Overview
Package
Class
Tree
Deprecated
Index
Help
Built on Thu 2012-03-29 21:53:33+0000, from revision ???
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.