/** * {@inheritDoc} */ @Override public String createUuid() { return this.idManager.createUuid(); }
public BasicCitationCollection() { m_id = m_idManager.createUuid(); }
@Override public void execute(JobExecutionContext context) throws JobExecutionException { if (idManager != null) { log.info("Autowiring worked, generated ID {}", idManager.createUuid()); } else { log.info("IdManager was not autowired :-("); } } }
@Override public void execute(JobExecutionContext context) throws JobExecutionException { if (idManager != null) { log.info("Autowiring worked, generated ID {}", idManager.createUuid()); } else { log.info("IdManager was not autowired :-("); } } }
@Override @Transactional(propagation = REQUIRES_NEW) public String createDelayedInvocation(Instant instant, String componentId, String opaqueContext) { String uuid = m_idManager.createUuid(); createDelayedInvocation(instant, componentId, opaqueContext, uuid); return uuid; }
public static java.lang.String createUuid() { org.sakaiproject.id.api.IdManager manager = getInstance(); if (manager == null) return null; return manager.createUuid(); } }
public String addCustomUrl(String label, String url) { UrlWrapper wrapper = new UrlWrapper(label, url); String id = m_idManager.createUuid(); m_urls.put(id, wrapper); return id; }
/** * Construct a citation not marked as temporary of a particular type. * * @param mediatype */ public BasicCitation(String mediatype) { m_id = m_idManager.createUuid(); m_citationProperties = new Hashtable(); m_urls = new Hashtable(); setType(mediatype); }
public static java.lang.String createUuid() { org.sakaiproject.id.api.IdManager manager = getInstance(); if (manager == null) return null; return manager.createUuid(); } }
@Override @Transactional(propagation = REQUIRES_NEW) public String createDelayedInvocation(Instant instant, String componentId, String opaqueContext) { String uuid = m_idManager.createUuid(); createDelayedInvocation(instant, componentId, opaqueContext, uuid); return uuid; }
public BasicCitationCollection(Map attributes, List citations) { m_id = m_idManager.createUuid(); m_order = new TreeSet<String>(m_comparator); if (citations != null) { Iterator citationIt = citations.iterator(); while (citationIt.hasNext()) { this.add((Citation) citationIt.next()); } } }
/** * @param b */ public BasicCitationCollection(boolean temporary) { m_order = new TreeSet<String>(m_comparator); m_temporary = temporary; if (temporary) { m_serialNumber = nextSerialNumber(); } else { m_id = m_idManager.createUuid(); } }
/** * Make sure we have a good uuid for a user record. If id is specified, use that. Otherwise get one from the provider or allocate a uuid. * * @param id * The proposed id. * @param eid * The proposed eid. * @return The id to use as the User's uuid. */ protected String assureUuid(String id, String eid) { // if we are not using separate id and eid, return the eid if (!m_separateIdEid) return eid; if (id != null) return id; // TODO: let the provider have a chance to set this? -ggolden // allocate a uuid id = idManager().createUuid(); return id; }
public String addCustomUrl(String label, String url, String prefixRequest) { UrlWrapper wrapper = new UrlWrapper(label, url, getPrefixBoolean(prefixRequest)); String id = m_idManager.createUuid(); m_urls.put(id, wrapper); return id; }
/** * Construct. Auto-generate the id. * * @param site * The site in which this page lives. */ protected BaseGroup(BaseSiteService siteService, Site site) { this.siteService = siteService; if (site == null) log.warn("BaseGroup(site) created with null site"); m_site = site; m_id = siteService.idManager().createUuid(); m_properties = new BaseResourcePropertiesEdit(); }
/** * @inheritDoc */ public Session startSession() { String id = idManager().createUuid(); return startSession(id); }
public String makeSessionId(HttpServletRequest req, Principal principal) { MessageDigest sha; String sessionId; try { sha = MessageDigest.getInstance("SHA-1"); sha.reset(); sha.update(principal.getName().getBytes("UTF-8")); sha.update((byte) 0x0a); String ua = req.getHeader("user-agent"); if (ua != null) { sha.update(ua.getBytes("UTF-8")); } sha.update(salt); sessionId = byteArrayToHexStr(sha.digest()); } catch (NoSuchAlgorithmException e) { // Fallback to new uuid rather than a non-hashed id sessionId = idManager().createUuid(); //This may need to be changed to a debug log.warn("makeSessionId fallback to Uuid!",e); } catch (UnsupportedEncodingException e) { sessionId = idManager().createUuid(); //This may need to be changed to a debug log.warn("makeSessionId fallback to Uuid!",e); } return sessionId; }
public void save(Citation citation) { if (citation instanceof BasicCitation && ((BasicCitation) citation).isTemporary()) { ((BasicCitation) citation).m_id = m_idManager.createUuid(); ((BasicCitation) citation).m_temporary = false; ((BasicCitation) citation).m_serialNumber = null; } this.m_storage.saveCitation(citation); }
/** * Set the file path for this resource * * @param time * The time on which to based the path. */ protected void setFilePath(Time time) { // compute file path: use now in ms mod m_bodyVolumes.length to pick a volume from m_bodyVolumes (if defined) // add /yyyy/DDD/HH year / day of year / hour / and a unique id for the final file name. // Don't include the body path. String volume = "/"; if ((m_bodyVolumes != null) && (m_bodyVolumes.length > 0)) { volume += m_bodyVolumes[(int) (Math.abs(time.getTime()) % ((long) m_bodyVolumes.length))]; volume += "/"; } m_filePath = volume + time.toStringFilePath() + idManager.createUuid(); }
/** * Construct using a tool registration for default information. * * @param reg * The tool registration. * @param page * The page in which this tool lives. */ protected BaseToolConfiguration(BaseSiteService siteService, SitePage page) { super(siteService.idManager().createUuid(), null, null, null, null, null); this.siteService = siteService; m_page = page; m_custom_title = getTitleCustom(page); }