/** * @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer) */ public List<String> processOptions(IServer server) throws OptionsException { this.optionList = this.processFields(OPTIONS_SPECS, this.getStatus(), this.isDelete()); return this.optionList; }
@Override public List<IFix> fixJobs(final List<String> jobIds, final int changeListId, final String status, final boolean delete) throws ConnectionException, RequestException, AccessException { try { FixJobsOptions fixJobsOptions = new FixJobsOptions().setDelete(delete) .setStatus(status); return fixJobs(jobIds, changeListId, fixJobsOptions); // TODO Why are P4JavaException and RequestException handled // differently for each method? } catch (final ConnectionException | AccessException | RequestException exc) { throw exc; } catch (P4JavaException exc) { throw new RequestException(exc.getMessage(), exc); } }
private AddJobToChangelistResult addJobToChangelist(IClient client, ClientConfig config, AddJobToChangelistAction action) throws P4JavaException { if (LOG.isDebugEnabled()) { LOG.debug("Running add job to changelist against the server for " + action.getChangelistId() + " / " + action.getJob()); } IChangelist changelist = cmd.getChangelistDetails(client.getServer(), action.getChangelistId().getChangelistId()); if (changelist == null) { throw new P4JavaException("No such changelist " + action.getChangelistId().getChangelistId()); } IJob job = cmd.getJob(client.getServer(), action.getJob().getJobId()); if (job == null) { throw new P4JavaException("No such job " + action.getJob().getJobId()); } // FIXME use P4CommandUtil LOG.warn("FIXME use P4CommandUtil"); List<IFix> res = client.getServer().fixJobs(Collections.singletonList(action.getJob().getJobId()), action.getChangelistId().getChangelistId(), new FixJobsOptions(null, false)); return new AddJobToChangelistResult(config, res); }
@Override public List<IFix> fixJobs(final List<String> jobIds, final int changeListId, final String status, final boolean delete) throws ConnectionException, RequestException, AccessException { try { FixJobsOptions fixJobsOptions = new FixJobsOptions().setDelete(delete) .setStatus(status); return fixJobs(jobIds, changeListId, fixJobsOptions); // TODO Why are P4JavaException and RequestException handled // differently for each method? } catch (final ConnectionException | AccessException | RequestException exc) { throw exc; } catch (P4JavaException exc) { throw new RequestException(exc.getMessage(), exc); } }
/** * @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer) */ public List<String> processOptions(IServer server) throws OptionsException { this.optionList = this.processFields(OPTIONS_SPECS, this.getStatus(), this.isDelete()); return this.optionList; }