Package org.nasutekds.messages

Examples of org.nasutekds.messages.Severity


        {
          // don't add any severity
        }
        else
        {
          Severity errorSeverity =
              Severity.parseString(defSev.name());
          if(errorSeverity != null)
          {
            defaultSeverities.add(errorSeverity);
          }
        }
      }
    }

    for(String overrideSeverity : config.getOverrideSeverity())
    {
      if(overrideSeverity != null)
      {
        int equalPos = overrideSeverity.indexOf('=');
        if (equalPos < 0)
        {
          Message msg =
              WARN_ERROR_LOGGER_INVALID_OVERRIDE_SEVERITY.get(overrideSeverity);
          throw new ConfigException(msg);

        } else
        {
          String categoryName = overrideSeverity.substring(0, equalPos);
          categoryName = categoryName.replace("-", "_").toUpperCase();
          try
          {
            Category category = Category.valueOf(categoryName);

            HashSet<Severity> severities =
                new HashSet<Severity>();
            StringTokenizer sevTokenizer =
              new StringTokenizer(overrideSeverity.substring(equalPos+1), ",");
            while (sevTokenizer.hasMoreElements())
            {
              String severityName = sevTokenizer.nextToken();
              severityName = severityName.replace("-", "_").toUpperCase();
              if(severityName.equalsIgnoreCase(LOG_SEVERITY_ALL))
              {
                severities.add(Severity.FATAL_ERROR);
                severities.add(Severity.INFORMATION);
                severities.add(Severity.MILD_ERROR);
                severities.add(Severity.MILD_WARNING);
                severities.add(Severity.NOTICE);
                severities.add(Severity.SEVERE_ERROR);
                severities.add(Severity.SEVERE_WARNING);
              }
              else
              {
                try
                {
                  Severity severity =
                      Severity.parseString(severityName);

                  severities.add(severity);
                }
                catch(Exception e)
View Full Code Here


        {
          // don't add any severity
        }
        else
        {
          Severity errorSeverity =
              Severity.parseString(defSev.name());
          if(errorSeverity != null)
          {
            defaultSeverities.add(errorSeverity);
          }
        }
      }
    }

    definedSeverities.clear();
    for(String overrideSeverity : config.getOverrideSeverity())
    {
      if(overrideSeverity != null)
      {
        int equalPos = overrideSeverity.indexOf('=');
        if (equalPos < 0)
        {
          Message msg = WARN_ERROR_LOGGER_INVALID_OVERRIDE_SEVERITY.get(
                  overrideSeverity);
          resultCode = DirectoryServer.getServerErrorResultCode();
          messages.add(msg);
        } else
        {
          String categoryName = overrideSeverity.substring(0, equalPos);
          categoryName = categoryName.replace("-", "_").toUpperCase();
          try
          {
            Category category = Category.valueOf(categoryName);

            HashSet<Severity> severities =
                new HashSet<Severity>();
            StringTokenizer sevTokenizer =
              new StringTokenizer(overrideSeverity.substring(equalPos+1), ",");
            while (sevTokenizer.hasMoreElements())
            {
              String severityName = sevTokenizer.nextToken();
              severityName = severityName.replace("-", "_").toUpperCase();
              if(severityName.equalsIgnoreCase(LOG_SEVERITY_ALL))
              {
                severities.add(Severity.FATAL_ERROR);
                severities.add(Severity.INFORMATION);
                severities.add(Severity.MILD_ERROR);
                severities.add(Severity.MILD_WARNING);
                severities.add(Severity.NOTICE);
                severities.add(Severity.SEVERE_ERROR);
                severities.add(Severity.SEVERE_WARNING);
              }
              else
              {
                try
                {
                  Severity severity =
                      Severity.parseString(severityName);

                  severities.add(severity);
                }
                catch(Exception e)
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void logError(Message message)
  {
    Severity severity = message.getDescriptor().getSeverity();
    Category category = message.getDescriptor().getCategory();
    int msgId = message.getDescriptor().getId();
    HashSet<Severity> severities = definedSeverities.get(category);
    if(severities == null)
    {
View Full Code Here

   * {@inheritDoc}
   */
  public void logError(Message message)
  {
    if (message != null) {
      Severity severity = message.getDescriptor().getSeverity();
      Category category = message.getDescriptor().getCategory();
      int msgId = message.getDescriptor().getId();
      Thread currentThread = Thread.currentThread();
      if(this.thread.equals(currentThread) ||
          this.thread.getThreadGroup().equals(currentThread.getThreadGroup()))
View Full Code Here

TOP

Related Classes of org.nasutekds.messages.Severity

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.