Package mykeynote.exceptions.configuration

Examples of mykeynote.exceptions.configuration.ConfigurationUnacceptableValue


      } else if (temp.compareTo("debug") == 0) {
        serverLog = true;
        verbouseLog = true;
        debugLog = true;
      } else {
        throw new ConfigurationUnacceptableValue(
             "In the configuration file there was a set un unkown option "
                   + temp + " for the option setLogLevel");
      }
    }
  }
View Full Code Here


        if (temp.compareTo("true") == 0) {
          reportToConsole = true;
        } else if (temp.compareTo("false") == 0) {
          reportToConsole = false;
        } else
          throw new ConfigurationUnacceptableValue(
             "In the configuration file there was a set un unkown option "
            + temp + " for the option reportToConsole");
      }
    }
    initializeReport();
View Full Code Here

          + uniqueFile.getAbsolutePath());
      throw new UniqueFileException("IOException hit while reading the unique file.");
      } catch (NumberFormatException e){
        report.reportErrorLog("localhost", "The first line of the unique file is not a parsable integer: "
          + uniqueFile.getAbsolutePath());
      throw new ConfigurationUnacceptableValue("The first line of the unique file is not a parsable integer.");
      }
      try {
        br.close();
      } catch (IOException e) {
        report.reportErrorLog("localhost", "Unable to close the file reader for the" +
View Full Code Here

   * @throws ConfigurationUnacceptableValue This exception is thrown if
   * the unique value is not acceptable.
   */
  private void checkUnique() throws ConfigurationUnacceptableValue{
    if(unique < 1){
      throw new ConfigurationUnacceptableValue(String.format(
          "The unique value should be at least 1, but is %d", unique));
    }
  }
View Full Code Here

   * @throws ConfigurationUnacceptableValue This exception is thrown if
   * a value, that is being set, is not acceptable.
   */
  private void checkPort() throws ConfigurationUnacceptableValue{
    if(solingertimeout < 1){
      throw new ConfigurationUnacceptableValue(String.format("So linger timeout is" +
          "set to %d, where it should be atleast 0. Aborting.", solingertimeout));
    }
   
    if(sotimeout < 1){
      throw new ConfigurationUnacceptableValue(String.format("So timeout is" +
          "set to %d, where it should be atleast 0. Aborting.", sotimeout));
    }
   
    if(useServer){
      if(port < 1 && port > MAXPORT){
        throw new ConfigurationUnacceptableValue(String.format("The port given for " +
            "the non persistent server is %d, which is more than the " +
            "allowed maximum of %d", port, MAXPORT));
      }
      if(maxAllowedConnectedClients < 0){
        throw new ConfigurationUnacceptableValue(String.format("The maximum allowed connected clients " +
            "is %d, where it is allowed to be minimum 0.", maxAllowedConnectedClients));
      }
    }
   
    if(usePServer){
      if(persistentPort < 1 && persistentPort > MAXPORT){
        throw new ConfigurationUnacceptableValue(String.format("The port given for " +
            "the persistent server is %d, which is more than the " +
            "allowed maximum of %d", persistentPort, MAXPORT));
      }
      if(maxAllowedConnectedPC < 0){
        throw new ConfigurationUnacceptableValue(String.format("The maximum allowed connected persistent clients " +
            "is %d, where it is allowed to be minimum 0.", maxAllowedConnectedPC));
      }
    }

    if(useServer && usePServer){
      if(port == persistentPort){
        throw new ConfigurationUnacceptableValue(String.format("The persistent server and the non persistent one are" +
            "expected to run on the same port %d, but this is not possible. Aborting", port));
      }
     
      if(acceptNP){
        throw new ConfigurationUnacceptableValue("You are not allowed to have both servers running and" +
            "still allow the persistent one to recieve non persistent connections.");
      }
    }
  }
View Full Code Here

      if(!pathToKeynote.exists())
        throw new FileNotFoundException(String.format(
            "The file %s was not found!", pathToKeynote.getAbsoluteFile()));
     
      if(!pathToKeynote.canExecute())
        throw new ConfigurationUnacceptableValue("The given Keynote file is not executable.");
    } else {
      throw new ConfigurationUnacceptableValue("The JNI keynote is not ready yet.");
    }
  }
View Full Code Here

TOP

Related Classes of mykeynote.exceptions.configuration.ConfigurationUnacceptableValue

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.