public String checkForScanStarted(final String scanId) throws ParserConfigurationException, IOException, SAXException, DASTProxyException, XPathExpressionException {
  String stateId;
  String state;
  LOGGER.debug("Inside AppScanEnterpriseRestService.requestForScanJobInfo");
  final XPathFactory factory=XPathFactory.newInstance();
  final XPath xpath=factory.newXPath();
  xpath.setNamespaceContext(_nsContext);
  final Document response=sendRESTRequestToASE(AppScanConstants.APPSCAN_SERVICE_FOR_FOLDERITEM + scanId,"");
  checkForError(response,null);
  LOGGER.debug("Checking for the Scan Job Status. ");
  stateId=(String)xpath.evaluate("//ase:content-scan-job/ase:state/ase:id/text()",response,XPathConstants.STRING);
  state=(String)xpath.evaluate("//ase:content-scan-job/ase:state/ase:name/text()",response,XPathConstants.STRING);
  if (!AppScanUtils.isNotNull(stateId)) {
    LOGGER.error(" Error inside AppScanEnterpriseRestService. checkForScanStarted.");
    throw new DASTProxyException(AppScanConstants.APPSCAN_ERROR_CODE_SCAN_JOB_ID_NOT_FOUND,"Scan Status for Job Id has returned as null. Contact the administrator");
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("Scan Action ID: " + stateId);
    LOGGER.debug("Scan Action: " + state);
  }
  return state;
}

public String checkForScanStarted ( final String scanId ) throws ParserConfigurationException , IOException , SAXException , DASTProxyException , XPathExpressionException { String stateId ; String state ; LOGGER . debug ( "Inside AppScanEnterpriseRestService.requestForScanJobInfo" ) ; final XPathFactory factory = XPathFactory . newInstance ( ) ; final XPath xpath = factory . newXPath ( ) ; xpath . setNamespaceContext ( _nsContext ) ; final Document response = sendRESTRequestToASE ( AppScanConstants . APPSCAN_SERVICE_FOR_FOLDERITEM + scanId , "" ) ; checkForError ( response , null ) ; LOGGER . debug ( "Checking for the Scan Job Status. " ) ; stateId = ( String ) xpath . evaluate ( "//ase:content-scan-job/ase:state/ase:id/text()" , response , XPathConstants . STRING ) ; state = ( String ) xpath . evaluate ( "//ase:content-scan-job/ase:state/ase:name/text()" , response , XPathConstants . STRING ) ; if ( ! AppScanUtils . isNotNull ( stateId ) ) { LOGGER . error ( " Error inside AppScanEnterpriseRestService. checkForScanStarted." ) ; throw new DASTProxyException ( AppScanConstants . APPSCAN_ERROR_CODE_SCAN_JOB_ID_NOT_FOUND , "Scan Status for Job Id has returned as null. Contact the administrator" ) ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Scan Action ID: " + stateId ) ; LOGGER . debug ( "Scan Action: " + state ) ; } return state ; }
this method check the status of scan
