Class DefaultCompressedSchema
- java.lang.Object
-
- org.opends.server.api.CompressedSchema
-
- org.opends.server.core.DefaultCompressedSchema
-
public final class DefaultCompressedSchema extends CompressedSchema
This class provides a default implementation of a compressed schema manager that will store the schema definitions in a binary file (config/schematokens.dat).
-
-
Constructor Summary
Constructors Constructor Description DefaultCompressedSchema(ServerContext serverContext)Creates a new instance of this compressed schema manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidstoreAttribute(byte[] encodedAttribute, String attributeName, Iterable<String> attributeOptions)Persists the provided encoded attribute.protected voidstoreObjectClasses(byte[] encodedObjectClasses, Collection<String> objectClassNames)Persists the provided encoded object classes.-
Methods inherited from class org.opends.server.api.CompressedSchema
decodeAttribute, decodeObjectClasses, encodeAttribute, encodeObjectClasses, getAllAttributes, getAllObjectClasses, loadAttribute, loadObjectClasses
-
-
-
-
Constructor Detail
-
DefaultCompressedSchema
public DefaultCompressedSchema(ServerContext serverContext)
Creates a new instance of this compressed schema manager.- Parameters:
serverContext- The server context.
-
-
Method Detail
-
storeAttribute
protected void storeAttribute(byte[] encodedAttribute, String attributeName, Iterable<String> attributeOptions) throws DirectoryExceptionDescription copied from class:CompressedSchemaPersists the provided encoded attribute. The default implementation is to do nothing. Calls to this method are synchronized, so implementations can assume that this method is not being called by other threads. Note that this method is not thread-safe with respect toCompressedSchema.storeObjectClasses(byte[], Collection).Called with the exclusive lock of this compressed schema held, and that lock is reentrant, so an implementation must re-enter neither the encode, the load nor the decode path of the compressed schema it belongs to. The registration being persisted has already been appended to the decode map - so that an implementation persisting the whole content rather than the element it is handed, as
DefaultCompressedSchemadoes, has it - and is withdrawn from there if this method throws. Encoding or loading appends to the same decode map, and the withdrawal would take back whatever was appended last; decoding rebuilds the mappings when the schema has changed, and the withdrawal would then have to take the element out of a map that has already been replaced. Neither is withdrawn: the violation is reported and the registration is left behind, holding an id no definition was persisted under.- Overrides:
storeAttributein classCompressedSchema- Parameters:
encodedAttribute- The encoded attribute description.attributeName- The user provided attribute type name.attributeOptions- The non-null but possibly empty set of attribute options.- Throws:
DirectoryException- If an error occurred while persisting the encoded attribute.
-
storeObjectClasses
protected void storeObjectClasses(byte[] encodedObjectClasses, Collection<String> objectClassNames) throws DirectoryExceptionDescription copied from class:CompressedSchemaPersists the provided encoded object classes. The default implementation is to do nothing. Calls to this method are synchronized, so implementations can assume that this method is not being called by other threads. Note that this method is not thread-safe with respect toCompressedSchema.storeAttribute(byte[], String, Iterable).Called with the exclusive lock of this compressed schema held, and that lock is reentrant, so an implementation must re-enter neither the encode, the load nor the decode path of the compressed schema it belongs to. The registration being persisted has already been appended to the decode map - so that an implementation persisting the whole content rather than the element it is handed, as
DefaultCompressedSchemadoes, has it - and is withdrawn from there if this method throws. Encoding or loading appends to the same decode map, and the withdrawal would take back whatever was appended last; decoding rebuilds the mappings when the schema has changed, and the withdrawal would then have to take the element out of a map that has already been replaced. Neither is withdrawn: the violation is reported and the registration is left behind, holding an id no definition was persisted under.- Overrides:
storeObjectClassesin classCompressedSchema- Parameters:
encodedObjectClasses- The encoded object classes.objectClassNames- The user provided set of object class names.- Throws:
DirectoryException- If an error occurred while persisting the encoded object classes.
-
-