title: How to know whether the jenkins build executors are idle or not in jenkins using java api
body: <p>I want to know the whether the build executors in jenkins are idle(either free or any job is running in the master node), by using java-jenkins API. And my requirement is like this.</p>
  
  <ol>
  <li>If any executor is free I've to trigger a jenkins job otherwise I'll wait till they are available.</li>
  <li>For this I've to use API of Jenkins</li>
  <li>And all this implementation I've to do in Java</li>
  </ol>
  
  <p>Please help me which API method will give that status of executor.Executors are the highlighted things shown in the pic below:</p>
  
  <p><img src="https://i.stack.imgur.com/Drk3P.png" /></p>