| | |
| | | /** The vlv index configuration manager. */ |
| | | private final VLVIndexCfgManager vlvIndexCfgManager; |
| | | |
| | | /** ID of the backend to which this entry container belongs. */ |
| | | private final String backendID; |
| | | |
| | | /** The root container in which this entryContainer belongs. */ |
| | | private final RootContainer rootContainer; |
| | | |
| | | /** The baseDN this entry container is responsible for. */ |
| | | private final DN baseDN; |
| | | |
| | | /** The backend configuration. */ |
| | | private PluggableBackendCfg config; |
| | | |
| | | /** ID of the backend to which this entry container belongs. */ |
| | | private final String backendID; |
| | | /** The baseDN this entry container is responsible for. */ |
| | | private final DN baseDN; |
| | | /** The root container in which this entryContainer belongs. */ |
| | | private final RootContainer rootContainer; |
| | | /** The tree storage. */ |
| | | private final Storage storage; |
| | | |
| | |
| | | |
| | | /** The set of attribute indexes. */ |
| | | private final Map<AttributeType, AttributeIndex> attrIndexMap = new HashMap<>(); |
| | | |
| | | /** The set of VLV (Virtual List View) indexes. */ |
| | | private final Map<String, VLVIndex> vlvIndexMap = new HashMap<>(); |
| | | |
| | |
| | | ConfigurationDeleteListener<BackendVLVIndexCfg> |
| | | { |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | BackendVLVIndexCfg cfg, List<LocalizableMessage> unacceptableReasons) |
| | | public boolean isConfigurationAddAcceptable(BackendVLVIndexCfg cfg, List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | if(sortAttrs[i].startsWith("-")) |
| | | ascending[i] = !sortAttrs[i].startsWith("-"); |
| | | |
| | | if (sortAttrs[i].startsWith("-") || sortAttrs[i].startsWith("+")) |
| | | { |
| | | ascending[i] = false; |
| | | sortAttrs[i] = sortAttrs[i].substring(1); |
| | | } |
| | | else |
| | | { |
| | | ascending[i] = true; |
| | | if(sortAttrs[i].startsWith("+")) |
| | | { |
| | | sortAttrs[i] = sortAttrs[i].substring(1); |
| | | } |
| | | } |
| | | } |
| | | catch(Exception e) |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | AttributeType attrType = |
| | | DirectoryServer.getAttributeType(sortAttrs[i].toLowerCase()); |
| | | AttributeType attrType = DirectoryServer.getAttributeType(sortAttrs[i].toLowerCase()); |
| | | if(attrType == null) |
| | | { |
| | | unacceptableReasons.add(ERR_CONFIG_VLV_INDEX_UNDEFINED_ATTR.get(sortAttrs[i], cfg.getName())); |
| | |
| | | boolean shouldCreate = accessMode.isWriteable(); |
| | | try |
| | | { |
| | | DataConfig entryDataConfig = |
| | | new DataConfig(config.isEntriesCompressed(), |
| | | config.isCompactEncoding(), |
| | | rootContainer.getCompressedSchema()); |
| | | DataConfig entryDataConfig = new DataConfig( |
| | | config.isEntriesCompressed(), config.isCompactEncoding(), rootContainer.getCompressedSchema()); |
| | | |
| | | id2entry = new ID2Entry(getIndexName(ID2ENTRY_TREE_NAME), entryDataConfig); |
| | | id2entry.open(txn, shouldCreate); |
| | |
| | | * sortKeyResponseControl in the searchResultDone message, and not |
| | | * send back any search result entries. |
| | | */ |
| | | searchOperation.addResponseControl(new ServerSideSortResponseControl(NO_SUCH_ATTRIBUTE, null)); |
| | | searchOperation.addResponseControl(newServerSideSortControl(NO_SUCH_ATTRIBUTE)); |
| | | searchOperation.setResultCode(ResultCode.UNAVAILABLE_CRITICAL_EXTENSION); |
| | | return null; |
| | | } |
| | |
| | | entryIDSet = vlvIndex.evaluate(txn, searchOperation, sortRequest, vlvRequest, debugBuffer); |
| | | if (entryIDSet != null) |
| | | { |
| | | searchOperation.addResponseControl(new ServerSideSortResponseControl(SUCCESS, null)); |
| | | searchOperation.addResponseControl(newServerSideSortControl(SUCCESS)); |
| | | candidatesAreInScope = true; |
| | | break; |
| | | } |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | searchOperation.addResponseControl(new ServerSideSortResponseControl(de.getResultCode().intValue(), |
| | | null)); |
| | | searchOperation.addResponseControl(newServerSideSortControl(de.getResultCode().intValue())); |
| | | |
| | | if (sortRequest.isCritical()) |
| | | { |
| | |
| | | entryIDSet = sort(txn, entryIDSet, searchOperation, sortRequest.getSortOrder(), vlvRequest); |
| | | if (sortRequest.containsSortKeys()) |
| | | { |
| | | searchOperation.addResponseControl(new ServerSideSortResponseControl(SUCCESS, null)); |
| | | searchOperation.addResponseControl(newServerSideSortControl(SUCCESS)); |
| | | } |
| | | else |
| | | { |
| | |
| | | * include the sortKeyResponseControl in the searchResultDone |
| | | * message. |
| | | */ |
| | | searchOperation.addResponseControl(new ServerSideSortResponseControl(NO_SUCH_ATTRIBUTE, null)); |
| | | searchOperation.addResponseControl(newServerSideSortControl(NO_SUCH_ATTRIBUTE)); |
| | | } |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | searchOperation.addResponseControl(new ServerSideSortResponseControl(de.getResultCode().intValue(), |
| | | null)); |
| | | searchOperation.addResponseControl(newServerSideSortControl(de.getResultCode().intValue())); |
| | | |
| | | if (sortRequest.isCritical()) |
| | | { |
| | |
| | | |
| | | if (entryIDSet.isDefined()) |
| | | { |
| | | rootContainer.getMonitorProvider().updateIndexedSearchCount(); |
| | | rootContainer.getMonitorProvider().incrementIndexedSearchCount(); |
| | | searchIndexed(txn, entryIDSet, candidatesAreInScope, searchOperation, pageRequest); |
| | | } |
| | | else |
| | | { |
| | | rootContainer.getMonitorProvider().updateUnindexedSearchCount(); |
| | | rootContainer.getMonitorProvider().incrementUnindexedSearchCount(); |
| | | |
| | | searchOperation.addAdditionalLogItem(keyOnly(getClass(), "unindexed")); |
| | | |
| | |
| | | { |
| | | // FIXME -- Add support for sorting unindexed searches using indexes |
| | | // like DSEE currently does. |
| | | searchOperation.addResponseControl(new ServerSideSortResponseControl(UNWILLING_TO_PERFORM, null)); |
| | | searchOperation.addResponseControl(newServerSideSortControl(UNWILLING_TO_PERFORM)); |
| | | |
| | | if (sortRequest.isCritical()) |
| | | { |
| | |
| | | return null; |
| | | } |
| | | |
| | | private ServerSideSortResponseControl newServerSideSortControl(int resultCode) |
| | | { |
| | | return new ServerSideSortResponseControl(resultCode, null); |
| | | } |
| | | |
| | | private EntryIDSet getIDSetFromScope(final ReadableTransaction txn, DN aBaseDN, SearchScope searchScope, |
| | | int idSetLimit) throws DirectoryException |
| | | { |
| | |
| | | // plugins that make changes to subordinate entries and therefore |
| | | // provide an unmodifiable list for the modifications element. |
| | | // FIXME -- This will need to be updated appropriately if we decided that |
| | | // these plugins should be invoked for synchronization |
| | | // operations. |
| | | // these plugins should be invoked for synchronization operations. |
| | | if (modifyDNOperation != null && !modifyDNOperation.isSynchronizationOperation()) |
| | | { |
| | | SubordinateModifyDN pluginResult = |
| | |
| | | } |
| | | } |
| | | |
| | | // Remove the old DN from dn2id. |
| | | dn2id.remove(txn, oldDN); |
| | | |
| | | // Remove old ID from id2entry and put the new entry |
| | | // (old entry with new DN) in id2entry. |
| | | // Remove old ID from id2entry and put the new entry (old entry with new DN) in id2entry. |
| | | if (!newID.equals(oldID)) |
| | | { |
| | | id2entry.remove(txn, oldID); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Determine whether the provided operation has the ManageDsaIT request |
| | | * control. |
| | | * Determine whether the provided operation has the ManageDsaIT request control. |
| | | * @param operation The operation for which the determination is to be made. |
| | | * @return true if the operation has the ManageDsaIT request control, or false |
| | | * if not. |
| | | * @return true if the operation has the ManageDsaIT request control, or false if not. |
| | | */ |
| | | private static boolean isManageDsaITOperation(Operation operation) |
| | | { |
| | |
| | | * closed before calling this method. |
| | | * |
| | | * @param txn a non null transaction |
| | | * @throws StorageRuntimeException If an error occurs while removing the entry |
| | | * container. |
| | | * @throws StorageRuntimeException If an error occurs while removing the entry container. |
| | | */ |
| | | void delete(WriteableTransaction txn) throws StorageRuntimeException |
| | | { |
| | |
| | | { |
| | | if(tree == state) |
| | | { |
| | | // The state tree can not be removed individually. |
| | | // The state tree cannot be removed individually. |
| | | return; |
| | | } |
| | | |
| | | tree.delete(txn); |
| | | if(tree instanceof Index) |
| | | { |