Package be.jedi.jvspherecontrol.exceptions

Examples of be.jedi.jvspherecontrol.exceptions.MissingCLIArgumentException


      cmdLine = parser.parse( options, args );

    }
    catch( ParseException exp ) {
      // oops, something went wrong
      throw new MissingCLIArgumentException("parse exception"+exp.getMessage());
    }
   
  }
View Full Code Here


      } else {
        //nothing to do here
      }
    } else {
      if (vmOmapiRegister) {
      throw new MissingCLIArgumentException("omapihost is required when omapiregister is enabled")
      }
    }

    //Omapi Port : default 9991
    String omapiPortString=cmdLine.getOptionValue("omapiport");
    if (omapiPortString!=null) {
      try {
        this.omapiPort=Integer.parseInt(omapiPortString);
      } catch (NumberFormatException ex) {
        throw new InvalidCLIArgumentSyntaxException("omapiport must be an integer");
      }
    } else {
      JVsphereControl.logger.debug("no omapiport is given, using default value of "+omapiPort+" for omapiport");
   
       
    omapiKeyName=cmdLine.getOptionValue("omapikeyname");
    omapiKeyValue=cmdLine.getOptionValue("omapikeyvalue");
   
   
    if (vmOmapiRegister) {
      if (omapiKeyName==null) {
        throw new MissingCLIArgumentException("omapikeyname is required when omapiregister is enabled");       
      }
      if (omapiKeyValue==null) {
        throw new MissingCLIArgumentException("omapikeyvalue is required when omapiregister is enabled");       
      }
    }
   
    //Omapi Overwrite
    String omapiOverWriteString=cmdLine.getOptionValue("omapioverwrite");
View Full Code Here

      } else {
        //nothing to do here
      }
    } else {
      if (vmOmapiRegister) {
      throw new MissingCLIArgumentException("omapihost is required when omapiregister is enabled")
      }
    }

    //Omapi Port : default 9991
    String omapiPortString=cmdLine.getOptionValue("omapiport");
    if (omapiPortString!=null) {
      try {
        this.omapiPort=Integer.parseInt(omapiPortString);
      } catch (NumberFormatException ex) {
        throw new InvalidCLIArgumentSyntaxException("omapiport must be an integer");
      }
    } else {
      JVsphereControl.logger.debug("no omapiport is given, using default value of "+omapiPort+" for omapiport");
   
       
    omapiKeyName=cmdLine.getOptionValue("omapikeyname");
    omapiKeyValue=cmdLine.getOptionValue("omapikeyvalue");
   
    if (vmOmapiRegister) {
      if (omapiKeyName==null) {
        throw new MissingCLIArgumentException("omapikeyname is required when omapiregister is enabled");       
      }
      if (omapiKeyValue==null) {
        throw new MissingCLIArgumentException("omapikeyvalue is required when omapiregister is enabled");       
      }
    }
   
    //Omapi Overwrite
    String omapiOverWriteString=cmdLine.getOptionValue("omapioverwrite");
View Full Code Here

        InvalidCLIArgumentSyntaxException ex=new InvalidCLIArgumentSyntaxException("Syntax error in argument:"+e.getLocalizedMessage());
        throw ex;       
      }
    } else {
      logger.error("We need at least one arg");
      MissingCLIArgumentException ex=new MissingCLIArgumentException("We need at least one argument");
      throw ex;
   
   
  }
View Full Code Here

TOP

Related Classes of be.jedi.jvspherecontrol.exceptions.MissingCLIArgumentException

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.