org.opends.server.authorization.dseecompat
Class AciListenerManager

java.lang.Object
  extended by org.opends.server.authorization.dseecompat.AciListenerManager
All Implemented Interfaces:
AlertGenerator, BackendInitializationListener, ChangeNotificationListener

public class AciListenerManager
extends java.lang.Object
implements ChangeNotificationListener, BackendInitializationListener, AlertGenerator

The AciListenerManager updates an ACI list after each modification operation. Also, updates ACI list when backends are initialized and finalized.


Constructor Summary
AciListenerManager(AciList aciList, DN cfgDN)
          Save the list created by the AciHandler routine.
 
Method Summary
 void finalizeListenerManager()
          Deregister from the change notification listener, the backend initialization listener and the alert generator.
 java.util.LinkedHashMap<java.lang.String,java.lang.String> getAlerts()
          Retrieves information about the set of alerts that this generator may produce.
 java.lang.String getClassName()
          Retrieves the fully-qualified name of the Java class for this alert generator implementation.
 DN getComponentEntryDN()
          Retrieves the DN of the configuration entry used to configure the handler.
 void handleAddOperation(PostResponseAddOperation addOperation, Entry entry)
          An Add operation succeeded.
 void handleDeleteOperation(PostResponseDeleteOperation deleteOperation, Entry entry)
          A delete operation succeeded.
 void handleModifyDNOperation(PostResponseModifyDNOperation modifyDNOperation, Entry oldEntry, Entry newEntry)
          A modify DN operation has succeeded.
 void handleModifyOperation(PostResponseModifyOperation modOperation, Entry oldEntry, Entry newEntry)
          A modify operation succeeded.
 void logMsgsSetLockDownMode(java.util.LinkedList<Message> failedACIMsgs)
          Log the exception messages from the failed ACI decode and then put the server in lockdown mode -- if needed.
 void performBackendFinalizationProcessing(Backend backend)
          Performs any processing that may be required whenever a backend is finalized.
 void performBackendInitializationProcessing(Backend backend)
          Performs any processing that may be required whenever a backend is initialized for use in the Directory Server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AciListenerManager

public AciListenerManager(AciList aciList,
                          DN cfgDN)
Save the list created by the AciHandler routine. Registers as an Alert Generator that can send alerts when the server is being put in lockdown mode. Registers as backend initialization listener that is used to manage the ACI list cache when backends are initialized/finalized. Registers as a change notification listener that is used to manage the ACI list cache after ACI modifications have been performed.

Parameters:
aciList - The list object created and loaded by the handler.
cfgDN - The DN of the access control configuration entry.
Method Detail

finalizeListenerManager

public void finalizeListenerManager()
Deregister from the change notification listener, the backend initialization listener and the alert generator.


handleDeleteOperation

public void handleDeleteOperation(PostResponseDeleteOperation deleteOperation,
                                  Entry entry)
A delete operation succeeded. Remove any ACIs associated with the entry deleted.

Specified by:
handleDeleteOperation in interface ChangeNotificationListener
Parameters:
deleteOperation - The delete operation.
entry - The entry being deleted.

handleAddOperation

public void handleAddOperation(PostResponseAddOperation addOperation,
                               Entry entry)
An Add operation succeeded. Add any ACIs associated with the entry being added.

Specified by:
handleAddOperation in interface ChangeNotificationListener
Parameters:
addOperation - The add operation.
entry - The entry being added.

handleModifyOperation

public void handleModifyOperation(PostResponseModifyOperation modOperation,
                                  Entry oldEntry,
                                  Entry newEntry)
A modify operation succeeded. Adjust the ACIs by removing ACIs based on the oldEntry and then adding ACIs based on the new entry.

Specified by:
handleModifyOperation in interface ChangeNotificationListener
Parameters:
modOperation - the modify operation.
oldEntry - The old entry to examine.
newEntry - The new entry to examine.

handleModifyDNOperation

public void handleModifyDNOperation(PostResponseModifyDNOperation modifyDNOperation,
                                    Entry oldEntry,
                                    Entry newEntry)
A modify DN operation has succeeded. Adjust the ACIs by moving ACIs under the old entry DN to the new entry DN.

Specified by:
handleModifyDNOperation in interface ChangeNotificationListener
Parameters:
modifyDNOperation - The LDAP modify DN operation.
oldEntry - The old entry.
newEntry - The new entry.

performBackendInitializationProcessing

public void performBackendInitializationProcessing(Backend backend)
Performs any processing that may be required whenever a backend is initialized for use in the Directory Server. This method will be invoked after the backend has been initialized but before it has been put into service. In this case, the server will search the backend to find all aci attribute type values that it may contain and add them to the ACI list.

Specified by:
performBackendInitializationProcessing in interface BackendInitializationListener
Parameters:
backend - The backend that has been initialized and is about to be put into service.

performBackendFinalizationProcessing

public void performBackendFinalizationProcessing(Backend backend)
Performs any processing that may be required whenever a backend is finalized. This method will be invoked after the backend has been taken out of service but before it has been finalized. In this case, the server will remove all aci attribute type values associated with entries in the provided backend.

Specified by:
performBackendFinalizationProcessing in interface BackendInitializationListener
Parameters:
backend - The backend that has been taken out of service and is about to be finalized.

getClassName

public java.lang.String getClassName()
Retrieves the fully-qualified name of the Java class for this alert generator implementation.

Specified by:
getClassName in interface AlertGenerator
Returns:
The fully-qualified name of the Java class for this alert generator implementation.

getComponentEntryDN

public DN getComponentEntryDN()
Retrieves the DN of the configuration entry used to configure the handler.

Specified by:
getComponentEntryDN in interface AlertGenerator
Returns:
The DN of the configuration entry containing the Access Control configuration information.

getAlerts

public java.util.LinkedHashMap<java.lang.String,java.lang.String> getAlerts()
Retrieves information about the set of alerts that this generator may produce. The map returned should be between the notification type for a particular notification and the human-readable description for that notification. This alert generator must not generate any alerts with types that are not contained in this list.

Specified by:
getAlerts in interface AlertGenerator
Returns:
Information about the set of alerts that this generator may produce.

logMsgsSetLockDownMode

public void logMsgsSetLockDownMode(java.util.LinkedList<Message> failedACIMsgs)
Log the exception messages from the failed ACI decode and then put the server in lockdown mode -- if needed.

Parameters:
failedACIMsgs - List of exception messages from failed ACI decodes.