| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS. |
| | | * Portions copyright 2011-2012 ForgeRock AS. |
| | | * Portions copyright 2011 profiq s.r.o. |
| | | */ |
| | | package org.opends.server.plugins; |
| | |
| | | private boolean stopRequested=false; |
| | | |
| | | //The thread name. |
| | | private final String name="Referential Integrity Background Update Thread"; |
| | | private static final String name = |
| | | "Referential Integrity Background Update Thread"; |
| | | |
| | | //The name of the logfile that the update thread uses to process change |
| | | //records. Defaults to "logs/referint", but can be changed in the |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | ReferentialIntegrityPluginCfg pluginCfg) |
| | | throws ConfigException |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ReferentialIntegrityPluginCfg newConfiguration) |
| | | { |
| | |
| | | // Iterate through all of the defined attribute types and ensure that they |
| | | // have acceptable syntaxes and that they are indexed for equality below all |
| | | // base DNs. |
| | | Set<AttributeType> attributeTypes = pluginCfg.getAttributeType(); |
| | | for (AttributeType type : attributeTypes) |
| | | Set<AttributeType> theAttributeTypes = pluginCfg.getAttributeType(); |
| | | for (AttributeType type : theAttributeTypes) |
| | | { |
| | | if (! isAttributeSyntaxValid(type)) |
| | | { |
| | |
| | | AttributeType attrType = |
| | | DirectoryServer.getAttributeType(attr.toLowerCase()); |
| | | |
| | | if (attrType == null || !attributeTypes.contains(attrType)) |
| | | if (attrType == null || !theAttributeTypes.contains(attrType)) |
| | | { |
| | | isAcceptable = false; |
| | | unacceptableReasons.add( |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ReferentialIntegrityPluginCfg configuration, |
| | | List<Message> unacceptableReasons) |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public PluginResult.PostOperation |
| | | doPostOperation(PostOperationModifyDNOperation |
| | | modifyDNOperation) |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public PluginResult.PostOperation doPostOperation( |
| | | PostOperationDeleteOperation deleteOperation) |
| | | { |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public PluginResult.SubordinateModifyDN processSubordinateModifyDN( |
| | | SubordinateModifyDNOperation modifyDNOperation, Entry oldEntry, |
| | | Entry newEntry, List<Modification> modifications) |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public PluginResult.SubordinateDelete processSubordinateDelete( |
| | | DeleteOperation deleteOperation, Entry entry) |
| | | { |
| | |
| | | * @return The name of the listener. |
| | | * |
| | | */ |
| | | @Override |
| | | public String getShutdownListenerName() { |
| | | return name; |
| | | } |
| | |
| | | * @param reason The reason message for the shutdown. |
| | | * |
| | | */ |
| | | @Override |
| | | public void processServerShutdown(Message reason) |
| | | { |
| | | stopRequested = true; |
| | |
| | | /** |
| | | * Run method for the background thread. |
| | | */ |
| | | @Override |
| | | public void run() { |
| | | while(!isShuttingDown()) { |
| | | try { |
| | |
| | | private PluginResult.PreOperation |
| | | isIntegrityMaintained(List<Attribute> attrs, DN entryDN, DN entryBaseDN) |
| | | { |
| | | PluginResult.PreOperation result = null; |
| | | for(Attribute attr : attrs) |
| | | { |
| | | result = isIntegrityMaintained(attr, entryDN, entryBaseDN); |
| | | PluginResult.PreOperation result = |
| | | isIntegrityMaintained(attr, entryDN, entryBaseDN); |
| | | if (result != PluginResult.PreOperation.continueOperationProcessing()) |
| | | { |
| | | return result; |
| | |
| | | while (attrValIt.hasNext()) |
| | | { |
| | | AttributeValue attrVal = attrValIt.next(); |
| | | DN valueEntryDN = null; |
| | | Entry valueEntry = null; |
| | | |
| | | valueEntryDN = DN.decode(attrVal.getNormalizedValue()); |
| | | DN valueEntryDN = DN.decode(attrVal.getNormalizedValue()); |
| | | |
| | | if (currentConfiguration.getCheckReferencesScopeCriteria() |
| | | == CheckReferencesScopeCriteria.NAMING_CONTEXT) |