Package org.nasutekds.server.types

Examples of org.nasutekds.server.types.InitializationException


          DirectoryServer.registerAlternateRootDN(rootUserCfg.dn(),
                                                  alternateBindDN);
        }
        catch (DirectoryException de)
        {
          throw new InitializationException(de.getMessageObject());
        }
      }

      alternateBindDNs.put(rootUserCfg.dn(), altBindDNs);
    }
View Full Code Here


            }
          }

          Message message = ERR_CONFIG_PWVALIDATOR_CONFIG_NOT_ACCEPTABLE.get(
              String.valueOf(configuration.dn()), buffer.toString());
          throw new InitializationException(message);
        }
      }

      return validator;
    }
    catch (Exception e)
    {
      Message message = ERR_CONFIG_PWVALIDATOR_INITIALIZATION_FAILED.
          get(className, String.valueOf(configuration.dn()),
              stackTraceToSingleLineString(e));
      throw new InitializationException(message, e);
    }
  }
View Full Code Here

        println(installStatus.getInstallationMsg());
        try
        {
          if (!confirmAction(INFO_CLI_DO_YOU_WANT_TO_CONTINUE.get(), true))
          {
            throw new InitializationException(Message.EMPTY, null);
          }
        }
        catch (CLIException ce)
        {
          LOG.log(Level.SEVERE, "Unexpected error: "+ce, ce);
          throw new InitializationException(Message.EMPTY, null);
        }
      }
      else
      {
        println(installStatus.getInstallationMsg());
      }
    }
    else if (installStatus.isInstalled())
    {
      throw new InitializationException(installStatus.getInstallationMsg(),
          null);
    }
  }
View Full Code Here

    }
    catch (Throwable t)
    {
      Message message = ERR_INSTALLDS_CANNOT_INITIALIZE_JMX.get(
              String.valueOf(configFile), t.getMessage());
      throw new InitializationException(message, t);
    }

    try
    {
      directoryServer.initializeConfiguration(configClass, configFile);
    }
    catch (Throwable t)
    {
      Message message = ERR_INSTALLDS_CANNOT_INITIALIZE_CONFIG.get(
              configFile, t.getMessage());
      throw new InitializationException(message, t);
    }

    try
    {
      directoryServer.initializeSchema();
    }
    catch (Throwable t)
    {
      Message message = ERR_INSTALLDS_CANNOT_INITIALIZE_SCHEMA.get(
              configFile, t.getMessage());
      throw new InitializationException(message, t);
    }
  }
View Full Code Here

          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }

        Message message = ERR_BACKEND_CANNOT_REGISTER_BASEDN.get(
            dn.toString(), getExceptionMessage(e));
        throw new InitializationException(message, e);
      }
    }

    DirectoryServer.registerAlertGenerator(this);
View Full Code Here

    {
      importLDIF(new LDIFImportConfig(ldifFile.getAbsolutePath()), false);
    }
    catch (DirectoryException de)
    {
      throw new InitializationException(de.getMessageObject(), de);
    }
  }
View Full Code Here

        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }

      Message message = ERR_BACKEND_CANNOT_REGISTER_BASEDN.get(
          taskRootDN.toString(), getExceptionMessage(e));
      throw new InitializationException(message, e);
    }
  }
View Full Code Here

    try {
      File f = getFileForPath(keyStoreFile);
      if (!(f.exists() && f.isFile())) {
        Message message = ERR_FILE_KEYMANAGER_NO_SUCH_FILE.get(
            String.valueOf(keyStoreFile), String.valueOf(configEntryDN));
        throw new InitializationException(message);
      }
    } catch (SecurityException e) {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }

      Message message = ERR_FILE_KEYMANAGER_CANNOT_DETERMINE_FILE.get(
          String.valueOf(configEntryDN), getExceptionMessage(e));
      throw new InitializationException(message, e);
    }

    // Get the keystore type. If none is specified, then use the
    // default type.
    if (configuration.getKeyStoreType() != null) {
      try {
        KeyStore.getInstance(configuration.getKeyStoreType());
        keyStoreType = configuration.getKeyStoreType();
      } catch (KeyStoreException kse) {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, kse);
        }

        Message message = ERR_FILE_KEYMANAGER_INVALID_TYPE.
            get(String.valueOf(configuration.getKeyStoreType()),
                String.valueOf(configEntryDN), getExceptionMessage(kse));
        throw new InitializationException(message);
      }
    } else {
      keyStoreType = KeyStore.getDefaultType();
    }

    // Get the PIN needed to access the contents of the keystore file.
    //
    // We will offer several places to look for the PIN, and we will
    // do so in the following order:
    //
    // - In a specified Java property
    // - In a specified environment variable
    // - In a specified file on the server filesystem.
    // - As the value of a configuration attribute.
    //
    // In any case, the PIN must be in the clear.
    keyStorePIN = null;

    if (configuration.getKeyStorePinProperty() != null) {
      String propertyName = configuration.getKeyStorePinProperty();
      String pinStr = System.getProperty(propertyName);

      if (pinStr == null) {
        Message message = ERR_FILE_KEYMANAGER_PIN_PROPERTY_NOT_SET.get(
            String.valueOf(propertyName), String.valueOf(configEntryDN));
        throw new InitializationException(message);
      }

      keyStorePIN = pinStr.toCharArray();
    } else if (configuration.getKeyStorePinEnvironmentVariable() != null) {
      String enVarName = configuration
          .getKeyStorePinEnvironmentVariable();
      String pinStr = System.getenv(enVarName);

      if (pinStr == null) {
        Message message = ERR_FILE_KEYMANAGER_PIN_ENVAR_NOT_SET.get(
            String.valueOf(enVarName), String.valueOf(configEntryDN));
        throw new InitializationException(message);
      }

      keyStorePIN = pinStr.toCharArray();
    } else if (configuration.getKeyStorePinFile() != null) {
      String fileName = configuration.getKeyStorePinFile();
      File pinFile = getFileForPath(fileName);

      if (!pinFile.exists()) {
        Message message = ERR_FILE_KEYMANAGER_PIN_NO_SUCH_FILE.get(
            String.valueOf(fileName), String.valueOf(configEntryDN));
        throw new InitializationException(message);
      }

      String pinStr;
      try {
        BufferedReader br = new BufferedReader(
            new FileReader(pinFile));
        pinStr = br.readLine();
        br.close();
      } catch (IOException ioe) {
        Message message = ERR_FILE_KEYMANAGER_PIN_FILE_CANNOT_READ.
            get(String.valueOf(fileName), String.valueOf(configEntryDN),
                getExceptionMessage(ioe));
        throw new InitializationException(message, ioe);
      }

      if (pinStr == null) {
        Message message = ERR_FILE_KEYMANAGER_PIN_FILE_EMPTY.get(
            String.valueOf(fileName), String.valueOf(configEntryDN));
        throw new InitializationException(message);
      }

      keyStorePIN = pinStr.toCharArray();
    } else if (configuration.getKeyStorePin() != null) {
      keyStorePIN = configuration.getKeyStorePin().toCharArray();
View Full Code Here

        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }

      Message message =
          ERR_SASLCRAMMD5_CANNOT_GET_MESSAGE_DIGEST.get(getExceptionMessage(e));
      throw new InitializationException(message, e);
    }


    // Create and fill the iPad and oPad arrays.
    iPad = new byte[HMAC_MD5_BLOCK_LENGTH];
View Full Code Here

            }
          }

          Message message = ERR_CONFIG_VATTR_CONFIG_NOT_ACCEPTABLE.get(
              String.valueOf(configuration.dn()), buffer.toString());
          throw new InitializationException(message);
        }
      }

      return provider;
    }
    catch (Exception e)
    {
      Message message = ERR_CONFIG_VATTR_INITIALIZATION_FAILED.
          get(className, String.valueOf(configuration.dn()),
              stackTraceToSingleLineString(e));
      throw new InitializationException(message, e);
    }
  }
View Full Code Here

TOP

Related Classes of org.nasutekds.server.types.InitializationException

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.