Class BasicEventContext

  • All Implemented Interfaces:
    java.io.Serializable, ome.system.EventContext
    Direct Known Subclasses:
    BasicSecurityWiring.CloseOnNoSessionContext

    public class BasicEventContext
    extends ome.system.SimpleEventContext
    EventContext implementation for use within the security system. Holds various other information needed for proper functioning of a Thread. Not-thread-safe. Intended to be held by a ThreadLocal
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class ome.system.SimpleEventContext

        adminPrivileges, ceId, ceType, cgId, cgName, csId, csName, csuId, csuName, cuId, cuName, isAdmin, isReadOnly, leaderOfGroups, memberOfGroups, shareId, umask
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicEventContext​(ome.system.Principal p, SessionStats stats)  
      BasicEventContext​(ome.system.Principal p, SessionStats stats, ome.system.EventContext ec)
      Copy-constructor to not have to allow the mutator SimpleEventContext.copy(EventContext) or copyContext(EventContext) out of the EventContext hierarchy.
    • Constructor Detail

      • BasicEventContext

        public BasicEventContext​(ome.system.Principal p,
                                 SessionStats stats)
      • BasicEventContext

        public BasicEventContext​(ome.system.Principal p,
                                 SessionStats stats,
                                 ome.system.EventContext ec)
        Copy-constructor to not have to allow the mutator SimpleEventContext.copy(EventContext) or copyContext(EventContext) out of the EventContext hierarchy.
    • Method Detail

      • getCallContext

        public java.util.Map<java.lang.String,​java.lang.String> getCallContext()
      • setCallContext

        public java.util.Map<java.lang.String,​java.lang.String> setCallContext​(java.util.Map<java.lang.String,​java.lang.String> ctx)
      • setUmask

        public void setUmask​(ome.model.internal.Permissions umask)
      • setAdmin

        public void setAdmin​(boolean admin)
      • setAdminPrivileges

        public void setAdminPrivileges​(java.util.Set<ome.model.enums.AdminPrivilege> adminPrivileges)
      • getAdminPrivileges

        public java.util.Set<ome.model.enums.AdminPrivilege> getAdminPrivileges()
      • setReadOnly

        public void setReadOnly​(boolean readOnly)
      • setShareId

        public void setShareId​(java.lang.Long id)
      • getPrincipal

        public ome.system.Principal getPrincipal()
      • getEvent

        public ome.model.meta.Event getEvent()
      • setEvent

        public void setEvent​(ome.model.meta.Event event)
      • getOwner

        public ome.model.meta.Experimenter getOwner()
      • setOwner

        public void setOwner​(ome.model.meta.Experimenter owner)
      • getSudoer

        public ome.model.meta.Experimenter getSudoer()
      • setSudoer

        public void setSudoer​(ome.model.meta.Experimenter sudoer)
      • getGroup

        public ome.model.meta.ExperimenterGroup getGroup()
      • setGroup

        public void setGroup​(ome.model.meta.ExperimenterGroup group,
                             ome.model.internal.Permissions p)
      • getDisabledSubsystems

        public java.util.Set<java.lang.String> getDisabledSubsystems()
      • setDisabledSubsystems

        public void setDisabledSubsystems​(java.util.Set<java.lang.String> disabledSubsystems)
      • getLockCandidates

        public java.util.Set<ome.model.IObject> getLockCandidates()
      • setLockCandidates

        public void setLockCandidates​(java.util.Set<ome.model.IObject> lockCandidates)
      • getLogs

        public java.util.List<ome.model.meta.EventLog> getLogs()
      • setLogs

        public void setLogs​(java.util.List<ome.model.meta.EventLog> logs)
      • getMemberOfGroupsList

        public java.util.List<java.lang.Long> getMemberOfGroupsList()
        Specified by:
        getMemberOfGroupsList in interface ome.system.EventContext
        Overrides:
        getMemberOfGroupsList in class ome.system.SimpleEventContext
      • getLeaderOfGroupsList

        public java.util.List<java.lang.Long> getLeaderOfGroupsList()
        Specified by:
        getLeaderOfGroupsList in interface ome.system.EventContext
        Overrides:
        getLeaderOfGroupsList in class ome.system.SimpleEventContext
      • setMemberOfGroups

        public void setMemberOfGroups​(java.util.List<java.lang.Long> groupIds)
      • setLeaderOfGroups

        public void setLeaderOfGroups​(java.util.List<java.lang.Long> groupIds)
      • getPermissionsForGroup

        public ome.model.internal.Permissions getPermissionsForGroup​(java.lang.Long group)
        Never returns Permissions.DUMMY.
        Parameters:
        group - a group ID, may be null
        Returns:
        the group's permissions, may be null
      • setPermissionsForGroup

        public ome.model.internal.Permissions setPermissionsForGroup​(java.lang.Long group,
                                                                     ome.model.internal.Permissions perms)
        Called during BasicACLVoter.allowLoad(org.hibernate.Session, Class, ome.model.internal.Details, long) to track groups that will need resolving later.
        Parameters:
        group - a group ID, not null
        perms - the group's permissions
        Returns:
        the group's previous permissions, or null if none are noted
      • loadPermissions

        public void loadPermissions​(org.hibernate.Session session)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object