Package org.nasutekds.server.api

Examples of org.nasutekds.server.api.AlertHandler


      if (configuration.isEnabled())
      {
        String className = configuration.getJavaClass();
        try
        {
          AlertHandler handler = loadHandler(className, configuration, true);
          alertHandlers.put(configuration.dn(), handler);
          DirectoryServer.registerAlertHandler(handler);
        }
        catch (InitializationException ie)
        {
View Full Code Here


    if (! configuration.isEnabled())
    {
      return new ConfigChangeResult(resultCode, adminActionRequired, messages);
    }

    AlertHandler alertHandler = null;

    // Get the name of the class and make sure we can instantiate it as an alert
    // handler.
    String className = configuration.getJavaClass();
    try
View Full Code Here

  {
    ResultCode         resultCode          = ResultCode.SUCCESS;
    boolean            adminActionRequired = false;
    ArrayList<Message> messages            = new ArrayList<Message>();

    AlertHandler alertHandler = alertHandlers.remove(configuration.dn());
    if (alertHandler != null)
    {
      DirectoryServer.deregisterAlertHandler(alertHandler);
      alertHandler.finalizeAlertHandler();
    }

    return new ConfigChangeResult(resultCode, adminActionRequired, messages);
  }
View Full Code Here

    boolean           adminActionRequired = false;
    ArrayList<Message> messages            = new ArrayList<Message>();


    // Get the existing alert handler if it's already enabled.
    AlertHandler existingHandler = alertHandlers.get(configuration.dn());


    // If the new configuration has the handler disabled, then disable it if it
    // is enabled, or do nothing if it's already disabled.
    if (! configuration.isEnabled())
    {
      if (existingHandler != null)
      {
        DirectoryServer.deregisterAlertHandler(existingHandler);

        AlertHandler alertHandler = alertHandlers.remove(configuration.dn());
        if (alertHandler != null)
        {
          alertHandler.finalizeAlertHandler();
        }
      }

      return new ConfigChangeResult(resultCode, adminActionRequired, messages);
    }


    // Get the class for the alert handler.  If the handler is already enabled,
    // then we shouldn't do anything with it although if the class has changed
    // then we'll at least need to indicate that administrative action is
    // required.  If the handler is disabled, then instantiate the class and
    // initialize and register it as an alert handler.
    String className = configuration.getJavaClass();
    if (existingHandler != null)
    {
      if (! className.equals(existingHandler.getClass().getName()))
      {
        adminActionRequired = true;
      }

      return new ConfigChangeResult(resultCode, adminActionRequired, messages);
    }

    AlertHandler alertHandler = null;
    try
    {
      alertHandler = loadHandler(className, configuration, true);
    }
    catch (InitializationException ie)
View Full Code Here

      AlertHandlerCfgDefn definition = AlertHandlerCfgDefn.getInstance();
      ClassPropertyDefinition propertyDefinition =
           definition.getJavaClassPropertyDefinition();
      Class<? extends AlertHandler> handlerClass =
           propertyDefinition.loadClass(className, AlertHandler.class);
      AlertHandler handler = handlerClass.newInstance();

      if (initialize)
      {
        Method method = handler.getClass().getMethod("initializeAlertHandler",
            configuration.configurationClass());
        method.invoke(handler, configuration);
      }
      else
      {
        Method method =
             handler.getClass().getMethod("isConfigurationAcceptable",
                                          AlertHandlerCfg.class, List.class);

        List<Message> unacceptableReasons = new ArrayList<Message>();
        Boolean acceptable = (Boolean) method.invoke(handler, configuration,
                                                     unacceptableReasons);
View Full Code Here

TOP

Related Classes of org.nasutekds.server.api.AlertHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.