class XmlRemapper extends RamRemapper
Remapper interface which uses XML
file as a backing storage for the directory data.
XmlRemapper is derived from the RamRemapper
which implements all back-end functionality related to directory services
and combines it with loading/saving data from/to XML file implemented
by the XmlRemapperIO class.
| Modifier and Type | Field and Description |
|---|---|
private java.io.File |
file
XML file which will be used to load and store data
|
private boolean |
mustExist
XML file must exist flag
|
mutex, root| Constructor and Description |
|---|
XmlRemapper(BootstrapConfig config)
Construct an instance of the XmlRemapper for a given file.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
load()
Load tree from the XML document.
|
private boolean |
renameTo(java.io.File srcFile,
java.io.File dstFile)
File.renameTo(File) implementation is platform dependent.
|
protected void |
save()
Save current tree into XML file.
|
int |
save(java.lang.String newFile)
Save current tree into XML specified file.
|
private void |
saveWorker(java.io.File file,
int[] res)
Save current tree into XML specified file.
|
addAttributeValueExt, addNode, addNodeBitField, addNodeBitSelector, addNodeBoolean, addNodeByteArray, addNodeDate, addNodeDouble, addNodeExt, addNodeInteger, addNodeString, addNodeTime, bind, deleteNode, deleteNodeAttribute, deleteNodeAttributeExt, deleteNodeAttributeValue, deleteNodeAttributeValueExt, deleteNodeExt, enumerateNodeAttributes, enumerateNodes, getClassDefinition, getClassNames, getNodeBitField, getNodeBitSelector, getNodeBoolean, getNodeByteArray, getNodeClassName, getNodeDate, getNodeDouble, getNodeInteger, getNodeString, getNodeTime, getNodeValueExt, getObjClass, getRoot, isBound, isClassImmutable, isClassLeaf, locateNode, moveNode, moveNodeExt, refresh, setNodeBitField, setNodeBitSelector, setNodeBoolean, setNodeByteArray, setNodeDate, setNodeDouble, setNodeInteger, setNodeString, setNodeTime, setNodeValueExt, setRoot, unbind, updateprivate java.io.File file
private boolean mustExist
XmlRemapper(BootstrapConfig config) throws ConfigurationException
config - Configuration data.ConfigurationException - in case of configuration error.protected void load()
throws java.lang.Exception
load in class RamRemapperjava.lang.Exception - Various exceptions are forwarded from XmlHelper
or thrown in case of errors.protected void save()
throws java.lang.Exception
save in class RamRemapperjava.lang.Exception - If I/O error occurred during operation or
XmlHelper throws an
ParserConfigurationException.public int save(java.lang.String newFile)
newFile - Name of file to save the directory.DirectoryService for possible
error codes).private void saveWorker(java.io.File file,
int[] res)
throws java.lang.Exception
java.lang.Exception - If I/O error occurred during operation or
XmlHelper throws an
ParserConfigurationException.private boolean renameTo(java.io.File srcFile,
java.io.File dstFile)
srcFile - source file.dstFile - destination file.true on success false on failure.