public static PollStatusCollection buildFromBeanCollection(ims.vo.LookupInstanceBean[] beans) { PollStatusCollection coll = new PollStatusCollection(); if (beans == null) return coll; for (int x = 0; x < beans.length; x++) { coll.add(PollStatus.buildLookup(beans[x])); } return coll; }
public static PollStatusCollection buildFromBeanCollection(java.util.Collection beans) { PollStatusCollection coll = new PollStatusCollection(); if (beans == null) return coll; java.util.Iterator iter = beans.iterator(); while (iter.hasNext()) { coll.add(PollStatus.buildLookup((ims.vo.LookupInstanceBean) iter.next())); } return coll; }
// logic run during a build @Override public void perform(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException { api.authenticate(); final PrintStream logger = listener.getLogger(); taskListener.set(listener); logger.println("Starting FoD Upload."); if (getAssessmentTypeId() == 0) { logger.println("Assessment Type is empty."); build.setResult(Result.FAILURE); } // zips the file in a temporary location File payload = CreateZipFile(workspace); if (payload.length() == 0) { logger.println("Source is empty for given Technology Stack and Language Level."); build.setResult(Result.FAILURE); } logger.println(jobModel.toString()); jobModel.setUploadFile(payload); boolean success = api.getStaticScanController().startStaticScan(jobModel); boolean deleted = payload.delete(); if (success && deleted) { logger.println("Scan Uploaded Successfully."); if (getDescriptor().getDoPollFortify() && jobModel.getPollingInterval() > 0) { PollStatus /*Amy*/ poller = new PollStatus(api, jobModel); success = poller.releaseStatus(getReleaseId()); } } // Success could be true then set to false from polling. api.retireToken(); build.setResult(success ? Result.SUCCESS : Result.UNSTABLE); }
public Object clone() { PollStatusCollection newCol = new PollStatusCollection(); PollStatus item; for (int i = 0; i < super.size(); i++) { item = this.get(i); newCol.add( new PollStatus( item.getID(), item.getText(), item.isActive(), item.getParent(), item.getImage(), item.getColor(), item.getOrder())); } for (int i = 0; i < newCol.size(); i++) { item = newCol.get(i); if (item.getParent() != null) { int parentIndex = this.indexOf(item.getParent()); if (parentIndex >= 0) item.setParent(newCol.get(parentIndex)); else item.setParent((PollStatus) item.getParent().clone()); } } return newCol; }