/** * Add an event to be dispatched when this context is committed. * * @param event event to be dispatched */ public void addEvent(Event event) { /* * invalid condition if in read-only mode: events - which * indicate mutation - are firing: no recourse but to bail */ if (isReadOnly()) { throw new IllegalStateException("Attempt to mutate object in read-only context"); } if (events == null) { events = new LinkedList<Event>(); } events.add(event); }
public Boolean getCachedAuthorizationResult(DSpaceObject dspaceObject, int action, EPerson eperson) { if (isReadOnly()) { return readOnlyCache.getCachedAuthorizationResult(dspaceObject, action, eperson); } else { return null; } }
public void cacheGroupMembership(Group group, EPerson eperson, Boolean isMember) { if (isReadOnly()) { readOnlyCache.cacheGroupMembership(group, eperson, isMember); } }
public Boolean getCachedGroupMembership(Group group, EPerson eperson) { if (isReadOnly()) { return readOnlyCache.getCachedGroupMembership(group, eperson); } else { return null; } }
public Set<Group> getCachedAllMemberGroupsSet(EPerson ePerson) { if (isReadOnly()) { return readOnlyCache.getCachedAllMemberGroupsSet(ePerson); } else { return null; } }
public void cacheAllMemberGroupsSet(EPerson ePerson, Set<Group> groups) { if (isReadOnly()) { readOnlyCache.cacheAllMemberGroupsSet(ePerson, groups); } }
public void cacheAuthorizedAction(DSpaceObject dspaceObject, int action, EPerson eperson, Boolean result, ResourcePolicy rp) { if (isReadOnly()) { readOnlyCache.cacheAuthorizedAction(dspaceObject, action, eperson, result); try { uncacheEntity(rp); } catch (SQLException e) { log.warn("Unable to uncache a resource policy when in read-only mode", e); } } }
if (isValid() && !isReadOnly()) { dbConnection.rollback();
if (isReadOnly()) { throw new UnsupportedOperationException("You cannot commit a read-only context");
if (isReadOnly()) { abort(); } else {
if (c.isReadOnly()) { if (c.isReadOnly()) {
if (c.isReadOnly()) {