log.warn("digest in use, will try send again at next digest attempt: " + e.getMessage());
if (resource == null) throw new InUseException(id);
} catch (InUseException e) { e.printStackTrace();
} catch (InUseException e) { log.warn("cannot remove resourceId=" + resourceId + ":" + e.getMessage()); log.warn("InUseException from ContentHostingService:" + e.getMessage());
/** * @inheritDoc */ public DigestEdit edit(String id) throws InUseException { // security // unlock(SECURE_EDIT_DIGEST, digestReference(id)); // one add/edit at a time, please, to make sync. only one digest per user // TODO: I don't link sync... could just do the add and let it fail if it already exists -ggolden synchronized (m_storage) { // check for existance if (!m_storage.check(id)) { try { return add(id); } catch (IdUsedException e) { log.warn(".edit: from the add: " + e); } } // ignore the cache - get the user with a lock from the info store DigestEdit edit = m_storage.edit(id); if (edit == null) throw new InUseException(id); ((BaseDigest) edit).setEvent(SECURE_EDIT_DIGEST); return edit; } }
} catch (InUseException e) { log.warn("cannot remove resourceId=" + resourceId + ":" + e.getMessage()); log.warn("InUseException from ContentHostingService:" + e.getMessage());
/** * @inheritDoc */ public PreferencesEdit edit(String id) throws PermissionException, InUseException, IdUnusedException { // security unlock(SECURE_EDIT_PREFS, preferencesReference(id)); // check for existance if (!m_storage.check(id)) { //Try to add and return this value try { return add(id); } catch (IdUsedException e) { //This should never happen log.warn("Could not add "+id+" even after checking that it didn't exist in storage. Throwing IdUnusedException but this shouldn't be possible.",e); throw new IdUnusedException(id); } } // ignore the cache - get the user with a lock from the info store PreferencesEdit edit = m_storage.edit(id); if (edit == null) throw new InUseException(id); ((BasePreferences) edit).setEvent(SECURE_EDIT_PREFS); return edit; }
log.error(e.getMessage(), e); } catch (InUseException e) { log.error(e.getMessage(), e);
/** * Return a specific channel, as specified by channel id, locked for update. Must commitEdit() to make official, or cancelEdit() when done! * * @param ref * The channel reference. * @return the Channel that has the specified id. * @exception IdUnusedException * If this name is not a defined channel. * @exception PermissionException * If the user does not have any permissions to edit the channel. * @exception InUseException * if the channel is locked for edit by someone else. */ public MessageChannelEdit editChannel(String ref) throws IdUnusedException, PermissionException, InUseException { // check for existance if (!m_storage.checkChannel(ref)) { throw new IdUnusedException(ref); } // check security (throws if not permitted) unlock3(SECURE_ADD, SECURE_UPDATE_ANY, SECURE_UPDATE_OWN, ref); // ignore the cache - get the channel with a lock from the info store MessageChannelEdit edit = m_storage.editChannel(ref); if (edit == null) throw new InUseException(ref); ((BaseMessageChannelEdit) edit).setEvent(SECURE_UPDATE_ANY); return edit; } // editChannel
log.error(e.getMessage(), e); } catch (InUseException e) { log.error(e.getMessage(), e);
/** * Return a specific channel, as specified by channel id, locked for update. Must commitEdit() to make official, or cancelEdit() when done! * * @param ref * The channel reference. * @return the Channel that has the specified id. * @exception IdUnusedException * If this name is not a defined channel. * @exception PermissionException * If the user does not have any permissions to edit the channel. * @exception InUseException * if the channel is locked for edit by someone else. */ public MessageChannelEdit editChannel(String ref) throws IdUnusedException, PermissionException, InUseException { // check for existance if (!m_storage.checkChannel(ref)) { throw new IdUnusedException(ref); } // check security (throws if not permitted) unlock3(SECURE_ADD, SECURE_UPDATE_ANY, SECURE_UPDATE_OWN, ref); // ignore the cache - get the channel with a lock from the info store MessageChannelEdit edit = m_storage.editChannel(ref); if (edit == null) throw new InUseException(ref); ((BaseMessageChannelEdit) edit).setEvent(SECURE_UPDATE_ANY); return edit; } // editChannel
+ " for site: " + siteId + ". " + e.getMessage(), e); throw e;
/** * Return a specific channel, as specified by channel id, locked for update. Must commitEdit() to make official, or cancelEdit() when done! * * @param ref * The channel reference. * @return the Channel that has the specified id. * @exception IdUnusedException * If this name is not a defined channel. * @exception PermissionException * If the user does not have any permissions to edit the channel. * @exception InUseException * if the channel is locked for edit by someone else. */ public MessageChannelEdit editChannel(String ref) throws IdUnusedException, PermissionException, InUseException { // check for existance if (!m_storage.checkChannel(ref)) { throw new IdUnusedException(ref); } // check security (throws if not permitted) unlock3(SECURE_ADD, SECURE_UPDATE_ANY, SECURE_UPDATE_OWN, ref); // ignore the cache - get the channel with a lock from the info store MessageChannelEdit edit = m_storage.editChannel(ref); if (edit == null) throw new InUseException(ref); ((BaseMessageChannelEdit) edit).setEvent(SECURE_UPDATE_ANY); return edit; } // editChannel
log.error(e1.getMessage(), e1); } catch (InUseException e1) { log.error(e1.getMessage(), e1); } catch (UserNotDefinedException e1) { log.error(e1.getMessage(), e1);
/** * Get a locked assignment object for editing. Must commitEdit() to make official, or cancelEdit() when done! * * @param id * The assignment id string. * @return An AssignmentEdit object for editing. * @exception IdUnusedException * if not found, or if not an AssignmentEdit object * @exception PermissionException * if the current user does not have permission to edit this assignment. * @exception InUseException * if the assignment is being edited by another user. */ public AssignmentEdit editAssignment(String assignmentReference) throws IdUnusedException, PermissionException, InUseException { // check security (throws if not permitted) unlock(SECURE_UPDATE_ASSIGNMENT, assignmentReference); String assignmentId = assignmentId(assignmentReference); // check for existance if (!m_assignmentStorage.check(assignmentId)) { throw new IdUnusedException(assignmentId); } // ignore the cache - get the assignment with a lock from the info store AssignmentEdit assignmentEdit = m_assignmentStorage.edit(assignmentId); if (assignmentEdit == null) throw new InUseException(assignmentId); ((BaseAssignmentEdit) assignmentEdit).setEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT); return assignmentEdit; } // editAssignment
log.error(e.getMessage(), e); } catch (InUseException e) { log.error(e.getMessage(), e); } catch (PermissionException e) { log.error(e.getMessage(), e);
/** * Get a locked AssignmentContent object for editing. Must commitEdit() to make official, or cancelEdit() when done! * * @param id * The content id string. * @return An AssignmentContentEdit object for editing. * @exception IdUnusedException * if not found, or if not an AssignmentContentEdit object * @exception PermissionException * if the current user does not have permission to edit this content. * @exception InUseException * if the assignment is being edited by another user. */ public AssignmentContentEdit editAssignmentContent(String contentReference) throws IdUnusedException, PermissionException, InUseException { // check security (throws if not permitted) unlock(SECURE_UPDATE_ASSIGNMENT_CONTENT, contentReference); String contentId = contentId(contentReference); // check for existance if (!m_contentStorage.check(contentId)) { throw new IdUnusedException(contentId); } // ignore the cache - get the AssignmentContent with a lock from the info store AssignmentContentEdit content = m_contentStorage.edit(contentId); if (content == null) throw new InUseException(contentId); ((BaseAssignmentContentEdit) content).setEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_CONTENT); return content; } // editAssignmentContent
log.error(e.getMessage(), e); } catch (InUseException e) { log.error(e.getMessage(), e); } catch (OverQuotaException e) { log.error(e.getMessage(), e); log.error(e.getMessage(), e); } catch (InUseException e) { log.error(e.getMessage(), e); } catch (OverQuotaException e) { log.error(e.getMessage(), e); log.error(e.getMessage(), e); } catch (InUseException e) { log.error(e.getMessage(), e); } catch (OverQuotaException e) { log.error(e.getMessage(), e);
/** * Get a locked alias object for editing. Must commit() to make official, or cancel() (or remove()) when done! * * @param id * The alias id string. * @return An AliasEdit object for editing. * @exception IdUnusedException * if not found. * @exception PermissionException * if the current user does not have permission to mess with this alias. * @exception InUseException * if the Alias object is locked by someone else. */ public AliasEdit edit(String id) throws IdUnusedException, PermissionException, InUseException { if (id == null) throw new IdUnusedException("null"); // check security (throws if not permitted) unlock(SECURE_UPDATE_ALIAS, aliasReference(id)); // check for existance if (!m_storage.check(id)) { throw new IdUnusedException(id); } // ignore the cache - get the user with a lock from the info store AliasEdit a = m_storage.edit(id); if (a == null) throw new InUseException(id); ((BaseAliasEdit) a).setEvent(SECURE_UPDATE_ALIAS); return a; } // edit
M_log.warn("removeAssignmentAndAllReference: submission " + sReference + " for assignment: " + assignment.getId() + " is in use. " + e.getMessage()); }catch (IdUnusedException e) M_log.warn(" removeAssignmentAndAllReferences(): AssignmentContent object for assignment = " + assignment.getId() + " is in used. " + e.getMessage());