Class BwPrincipal

  • All Implemented Interfaces:
    Serializable, Comparable<BwPrincipal>, Comparator<BwPrincipal>, org.bedework.access.AccessPrincipal
    Direct Known Subclasses:
    BwGroup, BwUser

    public abstract class BwPrincipal
    extends Object
    implements org.bedework.access.AccessPrincipal, Comparable<BwPrincipal>, Comparator<BwPrincipal>
    Value object to represent a calendar principal. Principals may be users, groups or other special obects. Principals may own objects within the system or simply identify a client to the system.

    We need to address a problem that might occur with groups. If we choose to allow a group all the facilities of a single user (subscriptions, ownership etc) then we need to be careful with names and their uniqueness.

    That is to say, the name will probably not be unique, for example, I might have the id douglm and be a member of the group douglm.

    Allowing groups all the rights of a user gives us the current functionality of administrative groups as well as the functions we need for departmental sites.

    Version:
    1.0
    Author:
    Mike Douglass douglm rpi.edu
    See Also:
    Serialized Form
    • Constructor Detail

      • BwPrincipal

        public BwPrincipal()
        Create a guest BwPrincipal
    • Method Detail

      • isPrincipal

        public static boolean isPrincipal​(String href)
      • makePrincipalHref

        public static String makePrincipalHref​(String id,
                                               int whoType)
                                        throws org.bedework.access.AccessException
        Throws:
        org.bedework.access.AccessException
      • getKind

        public abstract int getKind()
        Specified by:
        getKind in interface org.bedework.access.AccessPrincipal
      • setKind

        public void setKind​(int val)
      • setUnauthenticated

        public void setUnauthenticated​(boolean val)
        Specified by:
        setUnauthenticated in interface org.bedework.access.AccessPrincipal
      • getUnauthenticated

        public boolean getUnauthenticated()
        Specified by:
        getUnauthenticated in interface org.bedework.access.AccessPrincipal
      • setAccount

        public void setAccount​(String val)
        Specified by:
        setAccount in interface org.bedework.access.AccessPrincipal
      • getAccount

        public String getAccount()
        Specified by:
        getAccount in interface org.bedework.access.AccessPrincipal
      • getAclAccount

        public String getAclAccount()
        Specified by:
        getAclAccount in interface org.bedework.access.AccessPrincipal
      • setPrincipalRef

        public void setPrincipalRef​(String val)
        Specified by:
        setPrincipalRef in interface org.bedework.access.AccessPrincipal
      • setDescription

        public void setDescription​(String val)
        Specified by:
        setDescription in interface org.bedework.access.AccessPrincipal
      • getDescription

        public String getDescription()
        Specified by:
        getDescription in interface org.bedework.access.AccessPrincipal
      • getPrincipalRef

        public String getPrincipalRef()
        Specified by:
        getPrincipalRef in interface org.bedework.access.AccessPrincipal
      • setCreated

        public void setCreated​(Timestamp val)
        Parameters:
        val - timestamp
      • getCreated

        public Timestamp getCreated()
        Returns:
        Timestamp created
      • setLogon

        public void setLogon​(Timestamp val)
        Parameters:
        val - timestamp
      • getLogon

        public Timestamp getLogon()
        Returns:
        Timetstamp last logon
      • setLastAccess

        public void setLastAccess​(Timestamp val)
        Parameters:
        val - timestamp
      • getLastAccess

        public Timestamp getLastAccess()
        Returns:
        Timestamp last access
      • setLastModify

        public void setLastModify​(Timestamp val)
        Parameters:
        val - timestamp
      • getLastModify

        public Timestamp getLastModify()
        Returns:
        Timestamp last mod
      • setQuota

        public void setQuota​(long val)
        Quota for this user. This will have to be an estimate I imagine.
        Parameters:
        val - quota
      • getQuota

        public long getQuota()
        Returns:
        long
      • setCategoryAccess

        public void setCategoryAccess​(String val)
        Parameters:
        val - The categoryAccess to set.
      • getCategoryAccess

        public String getCategoryAccess()
        Returns:
        Returns the categoryAccess.
      • setLocationAccess

        public void setLocationAccess​(String val)
        Parameters:
        val - The locationAccess to set.
      • getLocationAccess

        public String getLocationAccess()
        Returns:
        Returns the locationAccess.
      • setContactAccess

        public void setContactAccess​(String val)
        Parameters:
        val - The contactAccess to set.
      • getContactAccess

        public String getContactAccess()
        Returns:
        Returns the contactAccess.
      • setGroups

        public void setGroups​(Collection<BwGroup> val)
        Set of groups of which principal is a member. These are not just those of which the principal is a direct member but also those it is a member of by virtue of membership of other groups. For example
        If the principal is a member of groupA and groupA is a member of groupB the groupB should appear in the list.
        Parameters:
        val - Collection of BwPrincipal
      • getGroups

        public Collection<BwGroup> getGroups()
        Get the groups of which principal is a member.
        Returns:
        Collection of BwGroup
      • addGroup

        public void addGroup​(BwGroup val)
        Parameters:
        val - BwPrincipal
      • setGroupNames

        public void setGroupNames​(Collection<String> val)
        Specified by:
        setGroupNames in interface org.bedework.access.AccessPrincipal
      • getGroupNames

        public Collection<String> getGroupNames()
        Specified by:
        getGroupNames in interface org.bedework.access.AccessPrincipal
      • toStringSegment

        protected void toStringSegment​(org.bedework.util.misc.ToString ts)
      • toStringSegment

        public static void toStringSegment​(org.bedework.util.misc.ToString ts,
                                           String name,
                                           BwPrincipal val)
        Add a principal to the ToString object
        Parameters:
        ts - ToString object
        name - tag
        val - BwPrincipal
      • copyTo

        public void copyTo​(BwPrincipal val)
        Copy this to val
        Parameters:
        val - BwPrincipal target
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object