Package org.nasutekds.server.types

Examples of org.nasutekds.server.types.InitializationException


      }
      catch (Throwable t)
      {
        Message message = ERR_CONFIG_FILE_CANNOT_OPEN_FOR_READ.get(
            f.getAbsolutePath(), String.valueOf(t));
        throw new InitializationException(message, t);
      }

      if (! f.exists())
      {
        Message message =
          ERR_CONFIG_FILE_DOES_NOT_EXIST.get(f.getAbsolutePath());
        throw new InitializationException(message);
      }

      configEntries.clear();

      // Read the first entry from the configuration file.
      Entry entry;
      try
      {
        entry = reader.readEntry(checkSchema);
        if (entry == null)
        {
          Message message = ERR_CONFIG_FILE_EMPTY.get(f.getAbsolutePath());
          throw new InitializationException(message);
        }
        configRootEntry = new ConfigEntry(entry, null);

        baseDNs = new DN[] { configRootEntry.getDN() };

        configEntries.put(entry.getDN(), configRootEntry);
        // Iterate through the rest of the configuration file and process the
        // remaining entries.
        while (entry != null)
        {
          // Read the next entry from the configuration.
          entry = reader.readEntry(checkSchema);
          if (entry != null)
          {
            DN entryDN = entry.getDN();
            DN parentDN = entryDN.getParent();
            ConfigEntry parentEntry = null;
            if (parentDN != null)
            {
              parentEntry = configEntries.get(parentDN);
            }
            if (parentEntry == null)
            {
              if (parentDN == null)
              {
                Message message = ERR_CONFIG_FILE_UNKNOWN_PARENT.get(
                    entryDN.toString(),
                    reader.getLastEntryLineNumber(),
                    f.getAbsolutePath());
                throw new InitializationException(message);
              }
              else
              {
                Message message =
                  ERR_CONFIG_FILE_NO_PARENT.get(entryDN.toString(),
                    reader.getLastEntryLineNumber(),
                    f.getAbsolutePath(), parentDN.toString());
                throw new InitializationException(message);
              }
            }
            else
            {
              ConfigEntry configEntry = new ConfigEntry(entry, parentEntry);
              parentEntry.addChild(configEntry);
              configEntries.put(entryDN, configEntry);
            }
          }
        }
      }
      catch (InitializationException ie)
      {
        throw ie;
      }
      catch (LDIFException le)
      {
        Message message = ERR_CONFIG_FILE_INVALID_LDIF_ENTRY.get(
            le.getLineNumber(), f.getAbsolutePath(),
            String.valueOf(le));
        throw new InitializationException(message, le);
      }
      catch (Throwable t)
      {
        Message message = ERR_CONFIG_FILE_READ_ERROR.get(f.getAbsolutePath(),
            String.valueOf(t));
        throw new InitializationException(message, t);
      }


      // Determine the appropriate server root.
      File rootFile = DirectoryServer.getEnvironmentConfig().getServerRoot();
View Full Code Here


            }
          }

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

      return mapper;
    }
    catch (InitializationException e) {
      // Avoid re-wrapping the initialization exception.
      throw e;
    }
    catch (Exception e)
    {
      Message message = ERR_CONFIG_CERTMAPPER_INITIALIZATION_FAILED.
          get(className, String.valueOf(configuration.dn()),
              stackTraceToSingleLineString(e));
      throw new InitializationException(message, e);
    }
  }
View Full Code Here

      String schemaDirPath= getSchemaDirectoryPath(false);
      File schemaDir = new File(schemaDirPath);
      if (schemaDirPath == null || ! schemaDir.exists())
      {
        Message message = ERR_CONFIG_SCHEMA_NO_SCHEMA_DIR.get(schemaDirPath);
        throw new InitializationException(message);
      }
      else if (! schemaDir.isDirectory())
      {
        Message message =
          ERR_CONFIG_SCHEMA_DIR_NOT_DIRECTORY.get(schemaDirPath);
        throw new InitializationException(message);
      }
      FileFilter ldifFiles = new FileFilter()
      {
        /**
         * {@inheritDoc}
 
View Full Code Here

            }
          }

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

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

      {
        TRACER.debugCaught(DebugLogLevel.ERROR, unhe);
      }
      Message message = ERR_SASL_CANNOT_GET_SERVER_FQDN.get(String
          .valueOf(configEntryDN), getExceptionMessage(unhe));
      throw new InitializationException(message, unhe);
    }
    catch (IOException ioe)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, ioe);
      }
      Message message = ERR_SASLGSSAPI_CANNOT_CREATE_JAAS_CONFIG
          .get(getExceptionMessage(ioe));
      throw new InitializationException(message, ioe);
    }
    catch (LoginException le)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, le);
      }
      Message message = ERR_SASLGSSAPI_CANNOT_CREATE_LOGIN_CONTEXT
          .get(getExceptionMessage(le));
      throw new InitializationException(message, le);
    }
  }
View Full Code Here

    String realm = configuration.getRealm();
    if ((kdcAddress != null && realm == null)
        || (kdcAddress == null && realm != null))
    {
      Message message = ERR_SASLGSSAPI_KDC_REALM_NOT_DEFINED.get();
      throw new InitializationException(message);
    }
    else if (kdcAddress != null && realm != null)
    {
      System.setProperty(KRBV_PROPERTY_KDC, kdcAddress);
      System.setProperty(KRBV_PROPERTY_REALM, realm);
View Full Code Here

      keyTabFilePath = home+sep+"krb5.keytab";
    }
    File keyTabFile = new File(keyTabFilePath);
    if(!keyTabFile.exists()) {
      Message msg = ERR_SASL_GSSAPI_KEYTAB_INVALID.get(keyTabFilePath);
      throw new InitializationException(msg);
    }
    w.write("keyTab=\"" + keyTabFile + "\" ");
    StringBuilder principal = new StringBuilder();
    String principalName = configuration.getPrincipalName();
    String realm = configuration.getRealm();
View Full Code Here

            }
          }

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

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

      }
      catch (NumberFormatException nfe)
      {
        Message message = ERR_MAKELDIF_TAG_CANNOT_PARSE_AS_INTEGER.get(
            arguments[0], getName(), lineNumber);
        throw new InitializationException(message);
      }
    }
    else
    {
      Message message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_RANGE_COUNT.get(
          getName(), lineNumber, 0, 1, arguments.length);
      throw new InitializationException(message);
    }
  }
View Full Code Here

  {
    if (arguments.length != 0)
    {
      Message message = ERR_MAKELDIF_TAG_INVALID_ARGUMENT_COUNT.get(
          getName(), lineNumber, 0, arguments.length);
      throw new InitializationException(message);
    }
  }
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.