/** * @inheritDoc */ public DigestEdit add(String id) throws IdUsedException { // check security (throws if not permitted) // unlock(SECURE_ADD_DIGEST, digestReference(id)); // one add/edit at a time, please, to make sync. only one digest per user synchronized (m_storage) { // reserve a user with this id from the info store - if it's in use, this will return null DigestEdit edit = m_storage.put(id); if (edit == null) { throw new IdUsedException(id); } return edit; } }
log.error("InconsistentException:" + e.getMessage()); } catch (IdUsedException e) { log.error("IdUsedException:" + e.getMessage()); } catch (OverQuotaException e) { log.error("OverQuotaException:" + e.getMessage());
/** * {@inheritDoc} */ @Override public Site addSite(final String id, final String type) { Site site = null; try { site = this.siteService.addSite(id, type); } catch (final IdInvalidException e) { e.printStackTrace(); } catch (final IdUsedException e) { e.printStackTrace(); } catch (final PermissionException e) { e.printStackTrace(); } return site; }
log.error("ResourcesHandler.addContentResource: {}", e.toString()); } catch (IdUsedException e) { log.warn("ResourcesHandler.addContentResource IdUsedException: {}", e.toString()); } catch (IdInvalidException e) { log.error(e.getMessage(), e);
log.error("ResourcesHandler.addContentResource: {}", e.toString()); } catch (IdUsedException e) { log.warn("ResourcesHandler.addContentResource IdUsedException: {}", e.toString()); } catch (IdInvalidException e) { log.error(e.getMessage(), e);
/** * @inheritDoc */ public PreferencesEdit add(String id) throws PermissionException, IdUsedException { // check security (throws if not permitted) unlock(SECURE_ADD_PREFS, preferencesReference(id)); // reserve a user with this id from the info store - if it's in use, this will return null PreferencesEdit edit = m_storage.put(id); if (edit == null) { throw new IdUsedException(id); } ((BasePreferences) edit).setEvent(SECURE_ADD_PREFS); return edit; }
/** * {@inheritDoc} */ public Calendar getCalendarById(String calendarId) throws PermissionException { Calendar calendar = null; try { calendar = calendarService.getCalendar(calendarId); } catch (IdUnusedException e) { try { CalendarEdit calendarEdit = calendarService.addCalendar(calendarId); calendarService.commitCalendar(calendarEdit); calendar = getCalendarById(calendarId); } catch (IdInvalidException highlyUnlikely) { log.error(highlyUnlikely.getMessage()); } catch (IdUsedException extremelyUnlikely) { log.error(extremelyUnlikely.getMessage()); } } return calendar; }
if (a == null) throw new IdUsedException(id);
log.error("InconsistentException:" + e.getMessage()); } catch (IdUsedException e) { log.error("IdUsedException:" + e.getMessage()); } catch (OverQuotaException e) { log.error("OverQuotaException:" + e.getMessage());
if (edit == null) throw new IdUsedException(id);
log.warn("access post IdUsedException:" + e.getMessage());
throw new IdUsedException(ref);
} catch (final IdUsedException e) { this.contentHostingService.cancelResource(resource); log.error("SakaiProxy.saveFile(): id= " + fullResourceId + " is in use : " + e.getClass() + " : " + e.getMessage()); result = false; } catch (final Exception e) {
if (submission == null) throw new IdUsedException(submissionFromXml.getId());
if (a == null) throw new IdUsedException(alias);
if (msg == null) throw new IdUsedException(msgFromXml.getId());
if (edit == null) throw new IdUsedException(id);
if (msg == null) throw new IdUsedException(msgFromXml.getId());