| | |
| | | import org.forgerock.util.Reject; |
| | | import org.opends.server.api.CompressedSchema; |
| | | import org.opends.server.backends.pluggable.spi.Cursor; |
| | | import org.opends.server.backends.pluggable.spi.Importer; |
| | | import org.opends.server.backends.pluggable.spi.ReadableTransaction; |
| | | import org.opends.server.backends.pluggable.spi.StorageRuntimeException; |
| | | import org.opends.server.backends.pluggable.spi.TreeName; |
| | |
| | | } |
| | | |
| | | ByteString encode(Entry entry) throws DirectoryException { |
| | | final EntryCodec codec = acquireEntryCodec(); |
| | | try |
| | | { |
| | | return codec.encode(entry, dataConfig); |
| | | } |
| | | finally |
| | | { |
| | | codec.release(); |
| | | } |
| | | return entryToDatabase(entry, dataConfig); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * Write a record in the entry tree. |
| | | * |
| | | * @param importer a non null importer |
| | | * @param id The entry ID which forms the key. |
| | | * @param entry The LDAP entry. |
| | | * @throws StorageRuntimeException If an error occurs in the storage. |
| | | * @throws DirectoryException If a problem occurs while attempting to encode the entry. |
| | | */ |
| | | public void importPut(Importer importer, EntryID id, Entry entry) |
| | | throws StorageRuntimeException, DirectoryException |
| | | { |
| | | Reject.ifNull(importer, "importer must not be null."); |
| | | importer.put(getName(), id.toByteString(), encode(entry)); |
| | | } |
| | | |
| | | /** |
| | | * Remove a record from the entry tree. |
| | | * |
| | | * @param txn a non null transaction |