| | |
| | | * the global ACIs from the configuration entry. |
| | | */ |
| | | private void processGlobalAcis( |
| | | DseeCompatAccessControlHandlerCfg configuration) |
| | | throws InitializationException { |
| | | SortedSet<Aci> globalAcis = configuration.getGlobalACI(); |
| | | try { |
| | | if (globalAcis != null) { |
| | | aciList.addAci(DN.nullDN(),globalAcis); |
| | | Message message = INFO_ACI_ADD_LIST_GLOBAL_ACIS.get( |
| | | Integer.toString(globalAcis.size())); |
| | | logError(message); |
| | | } else { |
| | | Message message = INFO_ACI_ADD_LIST_NO_GLOBAL_ACIS.get(); |
| | | logError(message); |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | if (debugEnabled()) |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | Message message = INFO_ACI_HANDLER_FAIL_PROCESS_GLOBAL_ACI. |
| | | get(String.valueOf(configuration.dn())); |
| | | throw new InitializationException(message, e); |
| | | DseeCompatAccessControlHandlerCfg configuration) |
| | | throws InitializationException { |
| | | SortedSet<Aci> globalAcis = configuration.getGlobalACI(); |
| | | try { |
| | | if (globalAcis != null) { |
| | | aciList.addAci(DN.nullDN(),globalAcis); |
| | | Message message = INFO_ACI_ADD_LIST_GLOBAL_ACIS.get( |
| | | Integer.toString(globalAcis.size())); |
| | | logError(message); |
| | | } |
| | | } catch (Exception e) { |
| | | if (debugEnabled()) |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | Message message = INFO_ACI_HANDLER_FAIL_PROCESS_GLOBAL_ACI. |
| | | get(String.valueOf(configuration.dn())); |
| | | throw new InitializationException(message, e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * the ACIs in the naming context. |
| | | */ |
| | | private void processConfigAcis() throws InitializationException { |
| | | try |
| | | { |
| | | DN configDN=DN.decode("cn=config"); |
| | | LinkedHashSet<String> attrs = new LinkedHashSet<String>(1); |
| | | attrs.add("aci"); |
| | | LinkedList<Message>failedACIMsgs=new LinkedList<Message>(); |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | InternalSearchOperation op = conn.processSearch(configDN, |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, 0, 0, false, |
| | | SearchFilter.createFilterFromString("aci=*"), attrs); |
| | | if(op.getSearchEntries().isEmpty()) { |
| | | Message message = |
| | | INFO_ACI_ADD_LIST_NO_ACIS.get(String.valueOf(configDN)); |
| | | logError(message); |
| | | } else { |
| | | int validAcis = |
| | | aciList.addAci(op.getSearchEntries(), failedACIMsgs); |
| | | if(!failedACIMsgs.isEmpty()) |
| | | aciListenerMgr.logMsgsSetLockDownMode(failedACIMsgs); |
| | | Message message = INFO_ACI_ADD_LIST_ACIS.get( |
| | | Integer.toString(validAcis), String.valueOf(configDN)); |
| | | logError(message); |
| | | } |
| | | } catch (DirectoryException e) { |
| | | Message message = INFO_ACI_HANDLER_FAIL_PROCESS_ACI.get(); |
| | | throw new InitializationException(message, e); |
| | | try |
| | | { |
| | | DN configDN=DN.decode("cn=config"); |
| | | LinkedHashSet<String> attrs = new LinkedHashSet<String>(1); |
| | | attrs.add("aci"); |
| | | LinkedList<Message>failedACIMsgs=new LinkedList<Message>(); |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | InternalSearchOperation op = conn.processSearch(configDN, |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, 0, 0, false, |
| | | SearchFilter.createFilterFromString("aci=*"), attrs); |
| | | if(!op.getSearchEntries().isEmpty()) { |
| | | int validAcis = |
| | | aciList.addAci(op.getSearchEntries(), failedACIMsgs); |
| | | if(!failedACIMsgs.isEmpty()) |
| | | aciListenerMgr.logMsgsSetLockDownMode(failedACIMsgs); |
| | | Message message = INFO_ACI_ADD_LIST_ACIS.get( |
| | | Integer.toString(validAcis), String.valueOf(configDN)); |
| | | logError(message); |
| | | } |
| | | } catch (DirectoryException e) { |
| | | Message message = INFO_ACI_HANDLER_FAIL_PROCESS_ACI.get(); |
| | | throw new InitializationException(message, e); |
| | | } |
| | | } |
| | | |
| | | |