public EngineResult exitJavaProcess ( List < String > ignoreJobs ) { HttpPost postRequest = new HttpPost ( baseUrl ) ; List < NameValuePair > nvp = new LinkedList < NameValuePair > ( ) ; // 3.2.x //nvp.add(new BasicNameValuePair("action", "Exit Java Process")); // 3.3.x nvp . add ( new BasicNameValuePair ( "action" , "exit java process" ) ) ; nvp . add ( new BasicNameValuePair ( "im_sure" , "on" ) ) ; // ignore__${jobname}=on if ( ignoreJobs != null && ignoreJobs . size ( ) > 0 ) { for ( int i = 0 ; i < ignoreJobs . size ( ) ; ++ i ) { nvp . add ( new BasicNameValuePair ( "ignore__" + ignoreJobs . get ( i ) , "on" ) ) ; } } StringEntity postEntity = null ; try { postEntity = new UrlEncodedFormEntity ( nvp ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } postEntity . setContentType ( "application/x-www-form-urlencoded" ) ; postRequest . addHeader ( "Accept" , "application/xml" ) ; postRequest . setEntity ( postEntity ) ; return engineResult ( postRequest ) ; }
Send JVM shutdown action to Heritrix 3 . If there are any running jobs they must be included in the ignored jobs list passed as argument . Otherwise the shutdown action is ignored .