PersistentCompressedSchema.java revision 146873b8af444f3d215ed4f60d991479c8bc4f54
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS.
*/
/**
* This class provides a compressed schema implementation whose definitions are
* persisted in a database.
*/
final class PersistentCompressedSchema extends CompressedSchema
{
/** The name of the database used to store compressed attribute description definitions. */
/** The name of the database used to store compressed object class set definitions. */
/** The compressed attribute description schema tree. */
/** The compressed object class set schema tree. */
/** The storage in which the databases are held. */
/**
* Creates a new instance of this JE compressed schema manager.
*
* @param storage
* A reference to the database environment in which the databases
* will be held.
* @param txn a non null database transaction
* @throws StorageRuntimeException
* If a database problem occurs while loading the compressed schema
* definitions from the database.
* @throws InitializationException
* If an error occurs while loading and processing the compressed
* schema definitions.
*/
{
}
/** {@inheritDoc} */
protected void storeAttribute(final byte[] encodedAttribute,
throws DirectoryException
{
try
{
{
}
}
catch (final IOException e)
{
// TODO: Shouldn't happen but should log a message
}
}
/** {@inheritDoc} */
protected void storeObjectClasses(final byte[] encodedObjectClasses,
{
try
{
{
}
}
catch (final IOException e)
{
// TODO: Shouldn't happen but should log a message
}
}
/**
* Loads the compressed schema information from the database.
*
* @throws StorageRuntimeException
* If a database error occurs while loading the definitions from the
* database.
* @throws InitializationException
* If an error occurs while loading and processing the definitions.
*/
{
// Cursor through the object class database and load the object class set
// definitions. At the same time, figure out the highest token value and
// initialize the object class counter to one greater than that.
try
{
{
while (reader.hasNextElement())
{
}
}
}
catch (final IOException e)
{
logger.traceException(e);
throw new InitializationException(
}
finally
{
}
// Cursor through the attribute description database and load the attribute
// set definitions.
try
{
{
while (reader.hasNextElement())
{
}
}
}
catch (final IOException e)
{
logger.traceException(e);
throw new InitializationException(
}
finally
{
}
}
throws DirectoryException
{
try
{
{
{
}
});
return true;
}
catch (final Exception e)
{
}
}
}