Reduce methods visibility
Fixed up javadocs
| | |
| | | * @throws DatabaseException If an error occurred while attempting to insert |
| | | * the new record. |
| | | */ |
| | | public boolean insert(Transaction txn, DN dn, EntryID id) throws DatabaseException |
| | | boolean insert(Transaction txn, DN dn, EntryID id) throws DatabaseException |
| | | { |
| | | DatabaseEntry key = new DatabaseEntry(dnToDNKey(dn, prefixRDNComponents)); |
| | | DatabaseEntry data = id.getDatabaseEntry(); |
| | |
| | | * @throws DatabaseException If an error occurred while attempting to remove |
| | | * the record. |
| | | */ |
| | | public boolean remove(Transaction txn, DN dn) throws DatabaseException |
| | | boolean remove(Transaction txn, DN dn) throws DatabaseException |
| | | { |
| | | DatabaseEntry key = new DatabaseEntry(dnToDNKey(dn, prefixRDNComponents)); |
| | | |
| | |
| | | */ |
| | | package org.opends.server.backends.jeb; |
| | | |
| | | import static com.sleepycat.je.LockMode.*; |
| | | import static com.sleepycat.je.OperationStatus.*; |
| | | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.backends.jeb.JebFormat.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | |
| | | import com.sleepycat.je.*; |
| | | |
| | | import static com.sleepycat.je.LockMode.*; |
| | | import static com.sleepycat.je.OperationStatus.*; |
| | | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.backends.jeb.JebFormat.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | |
| | | /** |
| | | * This class represents the referral database which contains URIs from referral |
| | | * entries. |
| | |
| | | * @return true if the values were deleted, false if not. |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | */ |
| | | public boolean delete(Transaction txn, DN dn) |
| | | throws DatabaseException |
| | | boolean delete(Transaction txn, DN dn) throws DatabaseException |
| | | { |
| | | byte[] normDN = JebFormat.dnToDNKey(dn, prefixRDNComponents); |
| | | DatabaseEntry key = new DatabaseEntry(normDN); |
| | |
| | | * @return true if the value was deleted, false if not. |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | */ |
| | | public boolean delete(Transaction txn, DN dn, String labeledURI) |
| | | throws DatabaseException |
| | | private boolean delete(Transaction txn, DN dn, String labeledURI) throws DatabaseException |
| | | { |
| | | CursorConfig cursorConfig = null; |
| | | byte[] normDN = JebFormat.dnToDNKey(dn, prefixRDNComponents); |
| | |
| | | * @param mods The sequence of modifications made to the entry. |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | */ |
| | | public void modifyEntry(Transaction txn, Entry before, Entry after, |
| | | List<Modification> mods) |
| | | void modifyEntry(Transaction txn, Entry before, Entry after, List<Modification> mods) |
| | | throws DatabaseException |
| | | { |
| | | DN entryDN = before.getName(); |
| | |
| | | * @param entry The entry to be deleted. |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | */ |
| | | public void deleteEntry(Transaction txn, Entry entry) |
| | | throws DatabaseException |
| | | void deleteEntry(Transaction txn, Entry entry) throws DatabaseException |
| | | { |
| | | Set<String> labeledURIs = entry.getReferralURLs(); |
| | | if (labeledURIs != null) |
| | |
| | | * DN. The referral URLs will be set appropriately for the references found |
| | | * in the referral entry. |
| | | */ |
| | | public void checkTargetForReferral(Entry entry, SearchScope searchScope) |
| | | throws DirectoryException |
| | | void checkTargetForReferral(Entry entry, SearchScope searchScope) throws DirectoryException |
| | | { |
| | | Set<String> referralURLs = entry.getReferralURLs(); |
| | | if (referralURLs != null) |
| | |
| | | * DN. The referral URLs will be set appropriately for the references found |
| | | * in the referral entry. |
| | | */ |
| | | public void throwReferralException(DN targetDN, DN referralDN, |
| | | Set<String> labeledURIs, |
| | | SearchScope searchScope) |
| | | private void throwReferralException(DN targetDN, DN referralDN, Set<String> labeledURIs, SearchScope searchScope) |
| | | throws DirectoryException |
| | | { |
| | | ArrayList<String> URIList = new ArrayList<String>(labeledURIs.size()); |
| | |
| | | * DN. The referral URLs will be set appropriately for the references found |
| | | * in the referral entry. |
| | | */ |
| | | public void targetEntryReferrals(DN targetDN, SearchScope searchScope) |
| | | throws DirectoryException |
| | | void targetEntryReferrals(DN targetDN, SearchScope searchScope) throws DirectoryException |
| | | { |
| | | if (containsReferrals == ConditionResult.UNDEFINED) |
| | | { |
| | |
| | | * has been reached or the search has been abandoned). |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public boolean returnSearchReferences(SearchOperation searchOp) |
| | | throws DirectoryException |
| | | boolean returnSearchReferences(SearchOperation searchOp) throws DirectoryException |
| | | { |
| | | if (containsReferrals == ConditionResult.UNDEFINED) |
| | | { |
| | |
| | | * @throws DirectoryException If a problem occurs while attempting to encode |
| | | * the entry. |
| | | */ |
| | | public static ByteString entryToDatabase(Entry entry, DataConfig dataConfig) |
| | | throws DirectoryException |
| | | static ByteString entryToDatabase(Entry entry, DataConfig dataConfig) throws DirectoryException |
| | | { |
| | | EntryCodec codec = acquireEntryCodec(); |
| | | try |
| | |
| | | * @throws DirectoryException If a problem occurs while attempting to encode |
| | | * the entry. |
| | | */ |
| | | public boolean insert(Transaction txn, EntryID id, Entry entry) |
| | | boolean insert(Transaction txn, EntryID id, Entry entry) |
| | | throws DatabaseException, DirectoryException |
| | | { |
| | | DatabaseEntry key = id.getDatabaseEntry(); |
| | |
| | | * @return true if the entry was removed, false if it was not. |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | */ |
| | | public boolean remove(Transaction txn, EntryID id) throws DatabaseException |
| | | boolean remove(Transaction txn, EntryID id) throws DatabaseException |
| | | { |
| | | DatabaseEntry key = id.getDatabaseEntry(); |
| | | return delete(txn, key) == SUCCESS; |
| | |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public Index(String name, Indexer indexer, State state, |
| | | Index(String name, Indexer indexer, State state, |
| | | int indexEntryLimit, int cursorEntryLimit, boolean maintainCount, |
| | | Environment env, EntryContainer entryContainer) |
| | | throws DatabaseException |
| | |
| | | * @param keyBytes The index key bytes. |
| | | * @param entryID The entry ID. |
| | | */ |
| | | public void insertID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID) |
| | | void insertID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID) |
| | | { |
| | | getBufferedIndexValues(buffer, keyBytes).addEntryID(keyBytes, entryID); |
| | | } |
| | |
| | | * @param keyBytes The index key bytes. |
| | | * @param entryID The entry ID. |
| | | */ |
| | | public void removeID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID) |
| | | void removeID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID) |
| | | { |
| | | getBufferedIndexValues(buffer, keyBytes).deleteEntryID(keyBytes, entryID); |
| | | } |
| | |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * Copyright 2011-2014 ForgeRock AS |
| | | * Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.jeb; |
| | | |
| | |
| | | * @throws DatabaseException |
| | | * If an error occurs in the JE database. |
| | | */ |
| | | public NullIndex(String name, Indexer indexer, State state, Environment env, |
| | | EntryContainer entryContainer) throws DatabaseException |
| | | public NullIndex(String name, Indexer indexer, State state, Environment env, EntryContainer entryContainer) |
| | | throws DatabaseException |
| | | { |
| | | super(name, indexer, state, 0, 0, false, env, entryContainer); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void insert(DatabaseEntry key, ImportIDSet importIdSet, |
| | | DatabaseEntry data) throws DatabaseException |
| | | public void insert(DatabaseEntry key, ImportIDSet importIdSet, DatabaseEntry data) throws DatabaseException |
| | | { |
| | | // Do nothing. |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void delete(DatabaseEntry key, ImportIDSet importIdSet, |
| | | DatabaseEntry data) throws DatabaseException |
| | | public void delete(DatabaseEntry key, ImportIDSet importIdSet, DatabaseEntry data) throws DatabaseException |
| | | { |
| | | // Do nothing. |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | void updateKey(Transaction txn, DatabaseEntry key, EntryIDSet deletedIDs, |
| | | EntryIDSet addedIDs) throws DatabaseException |
| | | void updateKey(Transaction txn, DatabaseEntry key, EntryIDSet deletedIDs, EntryIDSet addedIDs) |
| | | throws DatabaseException |
| | | { |
| | | // Do nothing. |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConditionResult containsID(Transaction txn, DatabaseEntry key, |
| | | EntryID entryID) throws DatabaseException |
| | | public ConditionResult containsID(Transaction txn, DatabaseEntry key, EntryID entryID) throws DatabaseException |
| | | { |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public EntryIDSet readKey(DatabaseEntry key, Transaction txn, |
| | | LockMode lockMode) |
| | | public EntryIDSet readKey(DatabaseEntry key, Transaction txn, LockMode lockMode) |
| | | { |
| | | return new EntryIDSet(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void writeKey(Transaction txn, DatabaseEntry key, |
| | | EntryIDSet entryIDList) throws DatabaseException |
| | | public void writeKey(Transaction txn, DatabaseEntry key, EntryIDSet entryIDList) throws DatabaseException |
| | | { |
| | | // Do nothing. |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public EntryIDSet readRange(byte[] lower, byte[] upper, |
| | | boolean lowerIncluded, boolean upperIncluded) |
| | | public EntryIDSet readRange(byte[] lower, byte[] upper, boolean lowerIncluded, boolean upperIncluded) |
| | | { |
| | | return new EntryIDSet(); |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void modifyEntry(IndexBuffer buffer, EntryID entryID, Entry oldEntry, |
| | | Entry newEntry, List<Modification> mods, IndexingOptions options) throws DatabaseException |
| | | public void modifyEntry(IndexBuffer buffer, EntryID entryID, Entry oldEntry, Entry newEntry, List<Modification> mods, |
| | | IndexingOptions options) throws DatabaseException |
| | | { |
| | | // Do nothing. |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setTrusted(Transaction txn, boolean trusted) |
| | | throws DatabaseException |
| | | public void setTrusted(Transaction txn, boolean trusted) throws DatabaseException |
| | | { |
| | | // Do nothing. |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected OperationStatus put(Transaction txn, DatabaseEntry key, |
| | | DatabaseEntry data) throws DatabaseException |
| | | OperationStatus put(Transaction txn, DatabaseEntry key, DatabaseEntry data) throws DatabaseException |
| | | { |
| | | return OperationStatus.SUCCESS; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected OperationStatus read(Transaction txn, DatabaseEntry key, |
| | | DatabaseEntry data, LockMode lockMode) throws DatabaseException |
| | | { |
| | | return OperationStatus.SUCCESS; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected OperationStatus insert(Transaction txn, DatabaseEntry key, |
| | | DatabaseEntry data) throws DatabaseException |
| | | { |
| | | return OperationStatus.SUCCESS; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected OperationStatus delete(Transaction txn, DatabaseEntry key) |
| | | OperationStatus read(Transaction txn, DatabaseEntry key, DatabaseEntry data, LockMode lockMode) |
| | | throws DatabaseException |
| | | { |
| | | return OperationStatus.SUCCESS; |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Cursor openCursor(Transaction txn, CursorConfig cursorConfig) |
| | | throws DatabaseException |
| | | OperationStatus insert(Transaction txn, DatabaseEntry key, DatabaseEntry data) throws DatabaseException |
| | | { |
| | | return OperationStatus.SUCCESS; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | OperationStatus delete(Transaction txn, DatabaseEntry key) throws DatabaseException |
| | | { |
| | | return OperationStatus.SUCCESS; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Cursor openCursor(Transaction txn, CursorConfig cursorConfig) throws DatabaseException |
| | | { |
| | | throw new IllegalStateException(); |
| | | } |
| | |
| | | { |
| | | return new PreloadStats(); |
| | | } |
| | | |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2011-2014 ForgeRock AS |
| | | * Portions copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.jeb; |
| | | |
| | | import static com.sleepycat.je.LockMode.*; |
| | | import static com.sleepycat.je.OperationStatus.*; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | import com.sleepycat.je.*; |
| | | |
| | | import static com.sleepycat.je.LockMode.*; |
| | | import static com.sleepycat.je.OperationStatus.*; |
| | | |
| | | /** |
| | | * This class is responsible for storing the configuration state of |
| | | * the JE backend for a particular suffix. |
| | |
| | | * @return true if the entry was removed, false if it was not. |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | */ |
| | | public boolean removeIndexTrustState(Transaction txn, DatabaseContainer index) |
| | | boolean removeIndexTrustState(Transaction txn, DatabaseContainer index) |
| | | throws DatabaseException |
| | | { |
| | | DatabaseEntry key = keyForIndex(index); |
| | |
| | | * @param trusted The state value to put into the database. |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | */ |
| | | public void putIndexTrustState(Transaction txn, DatabaseContainer index, boolean trusted) |
| | | void putIndexTrustState(Transaction txn, DatabaseContainer index, boolean trusted) |
| | | throws DatabaseException |
| | | { |
| | | DatabaseEntry key = keyForIndex(index); |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.config.server.ConfigChangeResult; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.forgerock.opendj.config.server.ConfigChangeResult; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | |
| | | * @throws ConfigException if a error occurs while reading the VLV index |
| | | * configuration |
| | | */ |
| | | public VLVIndex(LocalDBVLVIndexCfg config, State state, Environment env, |
| | | EntryContainer entryContainer) |
| | | VLVIndex(LocalDBVLVIndexCfg config, State state, Environment env, EntryContainer entryContainer) |
| | | throws DatabaseException, ConfigException |
| | | { |
| | | super(entryContainer.getDatabasePrefix()+"_vlv."+config.getName(), |
| | |
| | | * @throws DirectoryException If a Directory Server |
| | | * error occurs. |
| | | */ |
| | | public boolean addEntry(IndexBuffer buffer, EntryID entryID, Entry entry) |
| | | throws DirectoryException |
| | | boolean addEntry(IndexBuffer buffer, EntryID entryID, Entry entry) throws DirectoryException |
| | | { |
| | | if (shouldInclude(entry)) |
| | | { |
| | |
| | | * or False otherwise. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public boolean removeEntry(IndexBuffer buffer, EntryID entryID, Entry entry) |
| | | throws DirectoryException |
| | | boolean removeEntry(IndexBuffer buffer, EntryID entryID, Entry entry) throws DirectoryException |
| | | { |
| | | if (shouldInclude(entry)) |
| | | { |
| | |
| | | * JE database. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public boolean modifyEntry(IndexBuffer buffer, |
| | | boolean modifyEntry(IndexBuffer buffer, |
| | | EntryID entryID, |
| | | Entry oldEntry, |
| | | Entry newEntry, |
| | |
| | | * JE database. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public SortValuesSet getSortValuesSet(Transaction txn, long entryID, |
| | | SortValuesSet getSortValuesSet(Transaction txn, long entryID, |
| | | ByteString[] values, AttributeType[] types) throws DatabaseException, |
| | | DirectoryException |
| | | { |
| | |
| | | * JE database. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public boolean containsValues(Transaction txn, long entryID, |
| | | boolean containsValues(Transaction txn, long entryID, |
| | | ByteString[] values, AttributeType[] types) throws JebException, |
| | | DatabaseException, DirectoryException |
| | | { |
| | |
| | | * @throws DirectoryException If a Directory Server |
| | | * error occurs. |
| | | */ |
| | | public void updateIndex(Transaction txn, |
| | | TreeSet<SortValues> addedValues, |
| | | TreeSet<SortValues> deletedValues) |
| | | void updateIndex(Transaction txn, TreeSet<SortValues> addedValues, TreeSet<SortValues> deletedValues) |
| | | throws DirectoryException, DatabaseException |
| | | { |
| | | // Handle cases where nothing is changed early to avoid |
| | |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | * @throws DatabaseException If an error occurs in the JE database. |
| | | */ |
| | | public EntryIDSet evaluate(Transaction txn, |
| | | EntryIDSet evaluate(Transaction txn, |
| | | SearchOperation searchOperation, |
| | | ServerSideSortRequestControl sortControl, |
| | | VLVRequestControl vlvRequest, |
| | |
| | | * otherwise. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public boolean shouldInclude(Entry entry) throws DirectoryException |
| | | boolean shouldInclude(Entry entry) throws DirectoryException |
| | | { |
| | | DN entryDN = entry.getName(); |
| | | return entryDN.matchesBaseAndScope(baseDN, scope) |
| | |
| | | * @throws StorageRuntimeException If an error occurred while attempting to insert |
| | | * the new record. |
| | | */ |
| | | public boolean insert(WriteableStorage txn, DN dn, EntryID id) throws StorageRuntimeException |
| | | boolean insert(WriteableStorage txn, DN dn, EntryID id) throws StorageRuntimeException |
| | | { |
| | | ByteString key = dnToDNKey(dn, prefixRDNComponents); |
| | | ByteString value = id.toByteString(); |
| | |
| | | * @throws StorageRuntimeException If an error occurred while attempting to remove |
| | | * the record. |
| | | */ |
| | | public boolean remove(WriteableStorage txn, DN dn) throws StorageRuntimeException |
| | | boolean remove(WriteableStorage txn, DN dn) throws StorageRuntimeException |
| | | { |
| | | ByteString key = dnToDNKey(dn, prefixRDNComponents); |
| | | |
| | |
| | | */ |
| | | package org.opends.server.backends.pluggable; |
| | | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | |
| | | |
| | | import com.forgerock.opendj.util.Pair; |
| | | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | |
| | | /** |
| | | * This class represents the referral database which contains URIs from referral |
| | | * entries. |
| | |
| | | * @return true if the values were deleted, false if not. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | */ |
| | | public boolean delete(WriteableStorage txn, DN dn) throws StorageRuntimeException |
| | | boolean delete(WriteableStorage txn, DN dn) throws StorageRuntimeException |
| | | { |
| | | ByteString key = toKey(dn); |
| | | |
| | |
| | | * @return true if the value was deleted, false if not. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | */ |
| | | public boolean delete(WriteableStorage txn, DN dn, Collection<String> labeledURIs) |
| | | throws StorageRuntimeException |
| | | boolean delete(WriteableStorage txn, DN dn, Collection<String> labeledURIs) throws StorageRuntimeException |
| | | { |
| | | ByteString key = toKey(dn); |
| | | |
| | |
| | | * Indicates whether the underlying database contains any referrals. |
| | | * |
| | | * @param txn The transaction to use when making the determination. |
| | | * |
| | | * @return {@code true} if it is believed that the underlying database may |
| | | * contain at least one referral, or {@code false} if it is certain |
| | | * that it doesn't. |
| | |
| | | * @param mods The sequence of modifications made to the entry. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | */ |
| | | public void modifyEntry(WriteableStorage txn, Entry before, Entry after, |
| | | List<Modification> mods) |
| | | void modifyEntry(WriteableStorage txn, Entry before, Entry after, List<Modification> mods) |
| | | throws StorageRuntimeException |
| | | { |
| | | DN entryDN = before.getName(); |
| | |
| | | * @param entry The entry to be deleted. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | */ |
| | | public void deleteEntry(WriteableStorage txn, Entry entry) |
| | | throws StorageRuntimeException |
| | | void deleteEntry(WriteableStorage txn, Entry entry) throws StorageRuntimeException |
| | | { |
| | | Set<String> labeledURIs = entry.getReferralURLs(); |
| | | if (labeledURIs != null) |
| | |
| | | * DN. The referral URLs will be set appropriately for the references found |
| | | * in the referral entry. |
| | | */ |
| | | public void checkTargetForReferral(Entry entry, SearchScope searchScope) |
| | | throws DirectoryException |
| | | void checkTargetForReferral(Entry entry, SearchScope searchScope) throws DirectoryException |
| | | { |
| | | Set<String> referralURLs = entry.getReferralURLs(); |
| | | if (referralURLs != null) |
| | |
| | | * DN. The referral URLs will be set appropriately for the references found |
| | | * in the referral entry. |
| | | */ |
| | | public void throwReferralException(DN targetDN, DN referralDN, Collection<String> labeledURIs, SearchScope searchScope) |
| | | void throwReferralException(DN targetDN, DN referralDN, Collection<String> labeledURIs, SearchScope searchScope) |
| | | throws DirectoryException |
| | | { |
| | | ArrayList<String> URIList = new ArrayList<String>(labeledURIs.size()); |
| | |
| | | |
| | | /** |
| | | * Process referral entries that are above the target DN of an operation. |
| | | * @param txn The transaction to use when making the determination. |
| | | * @param targetDN The target DN of the operation, or the base object of a |
| | | * search operation. |
| | | * @param searchScope The scope of the search operation, or null if the |
| | |
| | | * DN. The referral URLs will be set appropriately for the references found |
| | | * in the referral entry. |
| | | */ |
| | | public void targetEntryReferrals(ReadableStorage txn, DN targetDN, SearchScope searchScope) |
| | | throws DirectoryException |
| | | void targetEntryReferrals(ReadableStorage txn, DN targetDN, SearchScope searchScope) throws DirectoryException |
| | | { |
| | | if (containsReferrals == ConditionResult.UNDEFINED) |
| | | { |
| | |
| | | /** |
| | | * Return search result references for a search operation using the referral |
| | | * database to find all referral entries within scope of the search. |
| | | * @param txn The transaction to use when making the determination. |
| | | * @param searchOp The search operation for which search result references |
| | | * should be returned. |
| | | * @return <CODE>true</CODE> if the caller should continue processing the |
| | |
| | | * has been reached or the search has been abandoned). |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public boolean returnSearchReferences(ReadableStorage txn, SearchOperation searchOp) |
| | | throws DirectoryException |
| | | boolean returnSearchReferences(ReadableStorage txn, SearchOperation searchOp) throws DirectoryException |
| | | { |
| | | if (containsReferrals == ConditionResult.UNDEFINED) |
| | | { |
| | |
| | | * @throws DirectoryException If a problem occurs while attempting to encode |
| | | * the entry. |
| | | */ |
| | | public static ByteString entryToDatabase(Entry entry, DataConfig dataConfig) |
| | | throws DirectoryException |
| | | static ByteString entryToDatabase(Entry entry, DataConfig dataConfig) throws DirectoryException |
| | | { |
| | | EntryCodec codec = acquireEntryCodec(); |
| | | try |
| | |
| | | * @throws DirectoryException If a problem occurs while attempting to encode |
| | | * the entry. |
| | | */ |
| | | public boolean insert(WriteableStorage txn, EntryID id, Entry entry) |
| | | throws StorageRuntimeException, DirectoryException |
| | | boolean insert(WriteableStorage txn, EntryID id, Entry entry) throws StorageRuntimeException, DirectoryException |
| | | { |
| | | ByteString key = id.toByteString(); |
| | | EntryCodec codec = acquireEntryCodec(); |
| | |
| | | * @return true if the entry was removed, false if it was not. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | */ |
| | | public boolean remove(WriteableStorage txn, EntryID id) throws StorageRuntimeException |
| | | boolean remove(WriteableStorage txn, EntryID id) throws StorageRuntimeException |
| | | { |
| | | return delete(txn, id.toByteString()); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | * Portions Copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.pluggable; |
| | | |
| | |
| | | * @param maintainCount Whether to maintain a count of IDs for a key once |
| | | * the entry limit has exceeded. |
| | | * @param storage The JE Storage |
| | | * @param txn The transaction to use when creating this object |
| | | * @param entryContainer The database entryContainer holding this index. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | */ |
| | | public Index(TreeName name, Indexer indexer, State state, |
| | | Index(TreeName name, Indexer indexer, State state, |
| | | int indexEntryLimit, int cursorEntryLimit, boolean maintainCount, |
| | | Storage storage, WriteableStorage txn, EntryContainer entryContainer) |
| | | throws StorageRuntimeException |
| | |
| | | * @param keyBytes The index key bytes. |
| | | * @param entryID The entry ID. |
| | | */ |
| | | public void insertID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID) |
| | | void insertID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID) |
| | | { |
| | | getBufferedIndexValues(buffer, keyBytes).addEntryID(keyBytes, entryID); |
| | | } |
| | |
| | | * @param keyBytes The index key bytes. |
| | | * @param entryID The entry ID. |
| | | */ |
| | | public void removeID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID) |
| | | void removeID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID) |
| | | { |
| | | getBufferedIndexValues(buffer, keyBytes).deleteEntryID(keyBytes, entryID); |
| | | } |
| | |
| | | * Reads a range of keys and collects all their entry IDs into a |
| | | * single set. |
| | | * |
| | | * @param txn The transaction to use for the operation |
| | | * @param lower The lower bound of the range. A 0 length byte array indicates |
| | | * no lower bound and the range will start from the |
| | | * smallest key. |
| | |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * Copyright 2011-2014 ForgeRock AS |
| | | * Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.pluggable; |
| | | |
| | |
| | | * @param name |
| | | * The name of the index database within the entryContainer. |
| | | * @param indexer |
| | | * The indexer object to construct index keys from LDAP attribute |
| | | * values. |
| | | * The indexer object to construct index keys from LDAP attribute values. |
| | | * @param state |
| | | * The state database to persist index state info. |
| | | * @param storage |
| | | * The JE Storage |
| | | * @param txn |
| | | * The transaction to use when creating this object |
| | | * @param entryContainer |
| | | * The database entryContainer holding this index. |
| | | * @throws StorageRuntimeException |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | void updateKey(WriteableStorage txn, ByteString key, EntryIDSet deletedIDs, |
| | | EntryIDSet addedIDs) throws StorageRuntimeException |
| | | void updateKey(WriteableStorage txn, ByteString key, EntryIDSet deletedIDs, EntryIDSet addedIDs) |
| | | throws StorageRuntimeException |
| | | { |
| | | // Do nothing. |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConditionResult containsID(ReadableStorage txn, ByteString key, |
| | | EntryID entryID) throws StorageRuntimeException |
| | | public ConditionResult containsID(ReadableStorage txn, ByteString key, EntryID entryID) |
| | | throws StorageRuntimeException |
| | | { |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void writeKey(WriteableStorage txn, ByteString key, |
| | | EntryIDSet entryIDList) throws StorageRuntimeException |
| | | public void writeKey(WriteableStorage txn, ByteString key, EntryIDSet entryIDList) throws StorageRuntimeException |
| | | { |
| | | // Do nothing. |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void modifyEntry(IndexBuffer buffer, EntryID entryID, Entry oldEntry, |
| | | Entry newEntry, List<Modification> mods, IndexingOptions options) throws StorageRuntimeException |
| | | public void modifyEntry(IndexBuffer buffer, EntryID entryID, Entry oldEntry, Entry newEntry, List<Modification> mods, |
| | | IndexingOptions options) throws StorageRuntimeException |
| | | { |
| | | // Do nothing. |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setTrusted(WriteableStorage txn, boolean trusted) |
| | | throws StorageRuntimeException |
| | | public void setTrusted(WriteableStorage txn, boolean trusted) throws StorageRuntimeException |
| | | { |
| | | // Do nothing. |
| | | } |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void put(WriteableStorage txn, ByteSequence key, ByteSequence value) throws StorageRuntimeException |
| | | void put(WriteableStorage txn, ByteSequence key, ByteSequence value) throws StorageRuntimeException |
| | | { |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected ByteString read(ReadableStorage txn, ByteSequence key, boolean isRMW) throws StorageRuntimeException |
| | | ByteString read(ReadableStorage txn, ByteSequence key, boolean isRMW) throws StorageRuntimeException |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected boolean insert(WriteableStorage txn, ByteString key, |
| | | ByteString value) throws StorageRuntimeException |
| | | boolean insert(WriteableStorage txn, ByteString key, ByteString value) throws StorageRuntimeException |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected boolean delete(WriteableStorage txn, ByteSequence key) |
| | | throws StorageRuntimeException |
| | | boolean delete(WriteableStorage txn, ByteSequence key) throws StorageRuntimeException |
| | | { |
| | | return true; |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2011-2014 ForgeRock AS |
| | | * Portions copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.pluggable; |
| | | |
| | |
| | | * @return true if the entry was removed, false if it was not. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | */ |
| | | public boolean removeIndexTrustState(WriteableStorage txn, DatabaseContainer index) |
| | | throws StorageRuntimeException |
| | | boolean removeIndexTrustState(WriteableStorage txn, DatabaseContainer index) throws StorageRuntimeException |
| | | { |
| | | ByteString key = keyForIndex(index); |
| | | return delete(txn, key); |
| | |
| | | * @param trusted The state value to put into the database. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | */ |
| | | public void putIndexTrustState(WriteableStorage txn, DatabaseContainer index, boolean trusted) |
| | | void putIndexTrustState(WriteableStorage txn, DatabaseContainer index, boolean trusted) |
| | | throws StorageRuntimeException |
| | | { |
| | | ByteString key = keyForIndex(index); |
| | |
| | | */ |
| | | package org.opends.server.backends.pluggable; |
| | | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | import java.util.Comparator; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedList; |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.config.server.ConfigChangeResult; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.forgerock.opendj.config.server.ConfigChangeResult; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | |
| | | import org.opends.server.types.SortOrder; |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | /** |
| | | * This class represents a VLV index. Each database record is a sorted list |
| | | * of entry IDs followed by sets of attribute values used to sort the entries. |
| | |
| | | * index. |
| | | * @param state The state database to persist vlvIndex state info. |
| | | * @param env The JE Storage |
| | | * @param entryContainer The database entryContainer holding this vlvIndex. |
| | | * @param entryContainer The database entryContainer holding this vlvIndex. the sort order |
| | | * @param txn The transaction to use when creating this object |
| | | * @throws StorageRuntimeException |
| | | * If an error occurs in the JE database. |
| | | * @throws ConfigException if a error occurs while reading the VLV index |
| | |
| | | * @throws DirectoryException If a Directory Server |
| | | * error occurs. |
| | | */ |
| | | public boolean addEntry(IndexBuffer buffer, EntryID entryID, Entry entry) |
| | | throws DirectoryException |
| | | boolean addEntry(IndexBuffer buffer, EntryID entryID, Entry entry) throws DirectoryException |
| | | { |
| | | if (shouldInclude(entry)) |
| | | { |
| | |
| | | * or False otherwise. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public boolean removeEntry(IndexBuffer buffer, EntryID entryID, Entry entry) |
| | | throws DirectoryException |
| | | boolean removeEntry(IndexBuffer buffer, EntryID entryID, Entry entry) throws DirectoryException |
| | | { |
| | | if (shouldInclude(entry)) |
| | | { |
| | |
| | | * JE database. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public boolean modifyEntry(IndexBuffer buffer, |
| | | boolean modifyEntry(IndexBuffer buffer, |
| | | EntryID entryID, |
| | | Entry oldEntry, |
| | | Entry newEntry, |
| | |
| | | * JE database. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public boolean containsValues(ReadableStorage txn, long entryID, |
| | | ByteString[] values, AttributeType[] types) |
| | | boolean containsValues(ReadableStorage txn, long entryID, ByteString[] values, AttributeType[] types) |
| | | throws StorageRuntimeException, DirectoryException |
| | | { |
| | | SortValuesSet valuesSet = getSortValuesSet(txn, entryID, values, types); |
| | |
| | | * @throws DirectoryException If a Directory Server |
| | | * error occurs. |
| | | */ |
| | | public void updateIndex(WriteableStorage txn, |
| | | TreeSet<SortValues> addedValues, |
| | | TreeSet<SortValues> deletedValues) |
| | | void updateIndex(WriteableStorage txn, TreeSet<SortValues> addedValues, TreeSet<SortValues> deletedValues) |
| | | throws DirectoryException, StorageRuntimeException |
| | | { |
| | | // Handle cases where nothing is changed early to avoid |
| | |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | */ |
| | | public EntryIDSet evaluate(ReadableStorage txn, |
| | | EntryIDSet evaluate(ReadableStorage txn, |
| | | SearchOperation searchOperation, |
| | | ServerSideSortRequestControl sortControl, |
| | | VLVRequestControl vlvRequest, |
| | |
| | | * otherwise. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | public boolean shouldInclude(Entry entry) throws DirectoryException |
| | | boolean shouldInclude(Entry entry) throws DirectoryException |
| | | { |
| | | DN entryDN = entry.getName(); |
| | | return entryDN.matchesBaseAndScope(baseDN, scope) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Returns the sort order of this VLV index. |
| | | * |
| | | * @return the sort order |
| | | */ |
| | | SortOrder getSortOrder() |
| | | { |
| | | return sortOrder; |