AddJobCmd addJobCmd =
(AddJobCmd) CommandFactory.createCommand(
AddJobCmd.class.getName(),
commandContext.getStoreId());
addJobCmd.setQueryString();
addJobCmd.setForUserId();
addJobCmd.setStartTime();
addJobCmd.setPathInfo("");
addJobCmd.setUrl(); //Even though this is not checked in validate parameters, this is required
addJobCmd.setStoreId(new Integer(SITE_STORE));
addJobCmd.setCommandContext(commandContext);
addJobCmd.setAccCheck(false);
addJobCmd.execute();
addJobCmd.setAccCheck(true);
recurring Jobs needs these extra methods to be configured:
addJobCmd.setAttempts()
addJobCmd.setDelay()
addJobCmd.setInterval()