Package hirondelle.web4j.model

Examples of hirondelle.web4j.model.ModelCtorException


  private static final String END_OF_INPUT = "\\Z"
  //note the user of a logger attached to a public class
  private static final Logger fLogger = Util.getLogger(PerformanceMonitor.class);

  private void validateState(){
    ModelCtorException ex = new ModelCtorException();
   
    if ( FAILS == Check.required(fTargetURL, Check.pattern(HTTP_TARGET)) ) {
      ex.add("Target URL is required, must start with 'http://'.");
    }
    if( Util.textHasContent(fTargetURL)) {
      try {
        URL testUrl = new URL(fTargetURL);
      }
      catch(MalformedURLException exception){
        ex.add("Target URL is malformed.");
      }
    }
   
    if ( FAILS == Check.required(fPingFrequency, Check.range(1,60))) {
      ex.add("Ping Frequency is required, must be in range 1..60 minutes.");
    }
    if ( FAILS == Check.required(fTimeout, Check.range(1,60))) {
      ex.add("Timeout is required, must be in range 1..60 seconds.");
    }
   
    if ( ! ex.isEmpty() ) {
      throw new IllegalArgumentException("Cannot construct BadResponseDetector : " + ex.toString(), ex);
    }
  }
View Full Code Here

TOP

Related Classes of hirondelle.web4j.model.ModelCtorException

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.