public Job get(String jobID) throws JobNotFoundException { expectNotNull("jobID", jobID); Job job = getJobFromMap(jobID); Job ret = JobPersistenceUtil.deepCopy(job); ret.ownerSubject = job.ownerSubject; return ret; }
public Job put(Job job) { expectNotNull("job", job); AccessControlContext acContext = AccessController.getContext(); Subject caller = Subject.getSubject(acContext); String ownerID = null; if (caller != null) ownerID = identityManager.toOwnerString(caller); job.setOwnerID(ownerID); if (job.getID() == null) JobPersistenceUtil.assignID(job, idGenerator.getID()); Job keep = JobPersistenceUtil.deepCopy(job); if (ownerID != null) keep.ownerSubject = caller; synchronized(jobs) { jobs.put(keep.getID(), keep); } return job; }