class JobDelegator extends BaseDelegator implements IJobDelegator {

    @Override
    public IJob createJob(@Nonnull final Map<String, Object> fieldMap)
            throws ConnectionException, RequestException, AccessException {
        Validate.notNull(fieldMap);
        final int wordLength = 3;
        List<Map<String, Object>> resultMaps = execMapCmdList(JOB, new String[] { "-i" }, fieldMap);

        if (nonNull(resultMaps)) {
            // What comes back is a simple info message that contains the
            // job ID, a trigger output info message, or an error message; in
            // the first instance we retrieve
            // the new ID then get the job; otherwise we throw the error.
            for (Map<String, Object> map : resultMaps) {
                ResultMapParser.handleErrorStr(map);
                String infoStr = ResultMapParser.getInfoStr(map);

                if (contains(infoStr, "Job ") && contains(infoStr, " saved")) {
                    // usually in format "Job jobid saved"
                    String[] words = split(infoStr, SPACE);
                    if (words.length == wordLength) {
                        String potentialJobId = words[1];
                        if (isNotBlank(potentialJobId)) {
                            return getJob(potentialJobId);
                        }
                    }
                }
            }
        }

        return null;
    }

    public  JobDelegator(final IOptionsServer server);

}