| | |
| | | @Override |
| | | public void search(final SearchOperation searchOperation) throws DirectoryException |
| | | { |
| | | final Set<String> excludedDomains = MultimasterReplication.getECLDisabledDomains(); |
| | | excludedDomains.add(DN_EXTERNAL_CHANGELOG_ROOT); |
| | | SearchParams params = new SearchParams(searchOperation.toString(), excludedDomains); |
| | | final ExternalChangelogRequestControl eclRequestControl = |
| | | searchOperation.getRequestControl(ExternalChangelogRequestControl.DECODER); |
| | | if (eclRequestControl == null) |
| | | { |
| | | params.requestType = REQUEST_TYPE_FROM_CHANGE_NUMBER; |
| | | } |
| | | else |
| | | { |
| | | params.requestType = REQUEST_TYPE_FROM_COOKIE; |
| | | params.multiDomainServerState = eclRequestControl.getCookie(); |
| | | } |
| | | checkChangelogReadPrivilege(searchOperation); |
| | | |
| | | final SearchParams params = buildSearchParameters(searchOperation); |
| | | |
| | | optimizeSearchParameters(params, searchOperation.getBaseDN(), searchOperation.getFilter()); |
| | | try |
| | |
| | | } |
| | | } |
| | | |
| | | private SearchParams buildSearchParameters(final SearchOperation searchOperation) throws DirectoryException |
| | | { |
| | | final Set<String> excludedDomains = MultimasterReplication.getECLDisabledDomains(); |
| | | excludedDomains.add(DN_EXTERNAL_CHANGELOG_ROOT); |
| | | final SearchParams params = new SearchParams(searchOperation.toString(), excludedDomains); |
| | | final ExternalChangelogRequestControl eclRequestControl = |
| | | searchOperation.getRequestControl(ExternalChangelogRequestControl.DECODER); |
| | | if (eclRequestControl == null) |
| | | { |
| | | params.requestType = REQUEST_TYPE_FROM_CHANGE_NUMBER; |
| | | } |
| | | else |
| | | { |
| | | params.requestType = REQUEST_TYPE_FROM_COOKIE; |
| | | params.multiDomainServerState = eclRequestControl.getCookie(); |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Set<String> getSupportedControls() |
| | |
| | | + entryDN + "\" into an External Change Log entry: " + exception.getMessage())); |
| | | } |
| | | |
| | | private void checkChangelogReadPrivilege(SearchOperation searchOp) throws DirectoryException |
| | | { |
| | | if (!searchOp.getClientConnection().hasPrivilege(Privilege.CHANGELOG_READ, searchOp)) |
| | | { |
| | | throw new DirectoryException(ResultCode.INSUFFICIENT_ACCESS_RIGHTS, |
| | | NOTE_SEARCH_CHANGELOG_INSUFFICIENT_PRIVILEGES.get()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Create a changelog entry from a set of provided information. This is the part of |
| | | * entry creation common to all types of msgs (ADD, DEL, MOD, MODDN). |