Package arq.cmd

Examples of arq.cmd.CmdException


            String[] x = getValue(argRepeat).split(",") ;
            if ( x.length == 1 )
            {
                try { repeatCount = Integer.parseInt(x[0]) ; }
                catch (NumberFormatException ex)
                { throw new CmdException("Can't parse "+x[0]+" in arg "+getValue(argRepeat)+" as an integer") ; }
               
            }
            else if ( x.length == 2 )
            {
                try { warmupCount = Integer.parseInt(x[0]) ; }
                catch (NumberFormatException ex)
                { throw new CmdException("Can't parse "+x[0]+" in arg "+getValue(argRepeat)+" as an integer") ; }
                try { repeatCount = Integer.parseInt(x[1]) ; }
                catch (NumberFormatException ex)
                { throw new CmdException("Can't parse "+x[1]+" in arg "+getValue(argRepeat)+" as an integer") ; }
            }
            else
                throw new CmdException("Wrong format for repeat count: "+getValue(argRepeat)) ;
        }
        if ( isVerbose() )
            ARQ.getContext().setTrue(ARQ.symLogExec) ;
       
        if ( hasArg(argExplain) )
            ARQ.setExecutionLogging(Explain.InfoLevel.ALL) ;
       
        if ( hasArg(argOptimize) )
        {
            String x1 = getValue(argOptimize).toLowerCase() ;
            if ( hasValueOfTrue(argOptimize) || x1.equals("on") || x1.equals("yes") )      queryOptimization = true ;
            else if ( hasValueOfFalse(argOptimize) || x1.equals("off") || x1.equals("no") ) queryOptimization = false ;
            else throw new CmdException("Optimization flag must be true/false/on/off/yes/no. Found: "+getValue(argOptimize)) ;
        }
    }
View Full Code Here


            ex.printStackTrace(System.err) ;
        }
        catch (QueryException qEx)
        {
            //System.err.println(qEx.getMessage()) ;
            throw new CmdException("Query Exeception", qEx) ;
        }
        catch (JenaException ex) { throw ex ; }
        catch (CmdException ex) { throw ex ; }
        catch (Exception ex)
        {
            throw new CmdException("Exception", ex) ;
        }
    }   
View Full Code Here

    @Override
    protected void processModulesAndArgs()
    {
        super.processModulesAndArgs() ;
        if ( modRemote.getServiceURL() == null )
            throw new CmdException("No SPARQL endpoint specificied") ;
    }
View Full Code Here

                HttpQuery.urlLimit = 0 ;

            QueryExecUtils.executeQuery(query, qe, modResults.getResultsFormat()) ;
        } catch (QueryExceptionHTTP ex)
        {
            throw new CmdException("HTTP Exeception", ex) ;
        }
        catch (Exception ex)
        {
            System.out.flush() ;
            ex.printStackTrace(System.err) ;
View Full Code Here

            cl.process() ;
        } catch (IllegalArgumentException ex)
        {
            System.err.println(ex.getMessage()) ;
            usage(System.err) ;
            throw new CmdException() ;
        }

        if ( cl.contains(helpDecl) )
        {
            usage() ;
View Full Code Here

            else if ( arg.equalsIgnoreCase("plan"))     { printPlan = true ; }
            else if ( arg.equalsIgnoreCase("opt"))      { printOpt = true ; }
            else if ( arg.equalsIgnoreCase("optquad"))  { printQuadOpt = true ; }
            else if ( arg.equalsIgnoreCase("quadopt"))  { printQuadOpt = true ; }
            else
                throw new CmdException("Not a recognized print form: "+arg+" : Choices are: query, op, quad, opt, optquad") ;
        }
       
        if ( ! printQuery && ! printOp && ! printQuad && ! printPlan && ! printOpt && ! printQuadOpt )
            printQuery = true ;
    }
View Full Code Here

            ex.printStackTrace(System.err) ;
        }
        catch (QueryException qEx)
        {
            //System.err.println(qEx.getMessage()) ;
            throw new CmdException("Query Exeception", qEx) ;
        }
        catch (JenaException ex) {
            ex.printStackTrace() ;
            throw ex ; }
        catch (CmdException ex) { throw ex ; }
        catch (Exception ex)
        {
            throw new CmdException("Exception", ex) ;
        }
    }
View Full Code Here

    @Override
    protected void exec()
    {
        if ( modRemote.getServiceURL() == null )
        {
            throw new CmdException("No endpoint given") ;
        }
        String endpoint = modRemote.getServiceURL() ;

       
        for ( Iterator<String> iter = requestFiles.iterator() ; iter.hasNext() ; )
View Full Code Here

            if ( arg.equalsIgnoreCase("op") ||
                      arg.equalsIgnoreCase("alg") ||
                      arg.equalsIgnoreCase("algebra") ) { printOp = true ; }
            else if ( arg.equalsIgnoreCase("plan"))     { printPlan = true ; }
            else
                throw new CmdException("Not a recognized print form: "+arg+" : Choices are: query, op, quad") ;
        }
       
    }
View Full Code Here

            useDefaultAssemblerFile = true ;
            // throw new CmdException("No assembler file and no location") ;
        }
           
        if ( count > 1 )
            throw new CmdException("Only one of an assembler file and a location") ;
    }
View Full Code Here

TOP

Related Classes of arq.cmd.CmdException

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.