code: public JobResult buildJobConfiguration(String jobname){
          HttpPost postRequest = new HttpPost(baseUrl + "job/" + jobname);
          StringEntity postEntity = null;
          try {
              postEntity = new StringEntity(BUILD_ACTION);
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
          }
          postEntity.setContentType("application/x-www-form-urlencoded");
          postRequest.addHeader("Accept", "application/xml");
          postRequest.setEntity(postEntity);
          return jobResult(postRequest);
      }
docs: Build an existing job.
  @param jobname job name
  @return job state