Class BwPrincipal
- java.lang.Object
-
- org.bedework.bwcli.copiedCalFacade.BwPrincipal
-
- All Implemented Interfaces:
Serializable,Comparable<BwPrincipal>,Comparator<BwPrincipal>,org.bedework.access.AccessPrincipal
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
-
-
Field Summary
Fields Modifier and Type Field Description static StringbwadmingroupPrincipalRootprotected StringcategoryAccessDefault access to category entriesprotected StringcontactAccessDefault access to contact entriesprotected Timestampcreatedprotected Collection<String>groupNamesstatic StringgroupPrincipalRootprotected Collection<BwGroup>groupsstatic StringhostPrincipalRootprotected TimestamplastAccessLast time principal did something in our system.protected TimestamplastModifyLast time principal modified something in our system.protected StringlocationAccessDefault access to location entriesprotected TimestamplogonLast time we saw this principal appear in our system.static StringprincipalRootstatic StringpublicUserstatic StringresourcePrincipalRootstatic StringticketPrincipalRootprotected booleanunauthenticatedstatic StringuserPrincipalRootstatic StringvenuePrincipalRoot
-
Constructor Summary
Constructors Constructor Description BwPrincipal()Create a guest BwPrincipal
-
Method Summary
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Field Detail
-
principalRoot
public static final String principalRoot
- See Also:
- Constant Field Values
-
groupPrincipalRoot
public static final String groupPrincipalRoot
- See Also:
- Constant Field Values
-
hostPrincipalRoot
public static final String hostPrincipalRoot
- See Also:
- Constant Field Values
-
resourcePrincipalRoot
public static final String resourcePrincipalRoot
- See Also:
- Constant Field Values
-
ticketPrincipalRoot
public static final String ticketPrincipalRoot
- See Also:
- Constant Field Values
-
userPrincipalRoot
public static final String userPrincipalRoot
- See Also:
- Constant Field Values
-
venuePrincipalRoot
public static final String venuePrincipalRoot
- See Also:
- Constant Field Values
-
bwadmingroupPrincipalRoot
public static final String bwadmingroupPrincipalRoot
- See Also:
- Constant Field Values
-
publicUser
public static final String publicUser
- See Also:
- Constant Field Values
-
created
protected Timestamp created
-
logon
protected Timestamp logon
Last time we saw this principal appear in our system.
-
lastAccess
protected Timestamp lastAccess
Last time principal did something in our system.
-
lastModify
protected Timestamp lastModify
Last time principal modified something in our system.
-
categoryAccess
protected String categoryAccess
Default access to category entries
-
contactAccess
protected String contactAccess
Default access to contact entries
-
locationAccess
protected String locationAccess
Default access to location entries
-
unauthenticated
protected boolean unauthenticated
-
groups
protected Collection<BwGroup> groups
-
groupNames
protected Collection<String> groupNames
-
-
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:
getKindin interfaceorg.bedework.access.AccessPrincipal
-
setKind
public void setKind(int val)
-
setUnauthenticated
public void setUnauthenticated(boolean val)
- Specified by:
setUnauthenticatedin interfaceorg.bedework.access.AccessPrincipal
-
getUnauthenticated
public boolean getUnauthenticated()
- Specified by:
getUnauthenticatedin interfaceorg.bedework.access.AccessPrincipal
-
setAccount
public void setAccount(String val)
- Specified by:
setAccountin interfaceorg.bedework.access.AccessPrincipal
-
getAccount
public String getAccount()
- Specified by:
getAccountin interfaceorg.bedework.access.AccessPrincipal
-
getAclAccount
public String getAclAccount()
- Specified by:
getAclAccountin interfaceorg.bedework.access.AccessPrincipal
-
setPrincipalRef
public void setPrincipalRef(String val)
- Specified by:
setPrincipalRefin interfaceorg.bedework.access.AccessPrincipal
-
setDescription
public void setDescription(String val)
- Specified by:
setDescriptionin interfaceorg.bedework.access.AccessPrincipal
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceorg.bedework.access.AccessPrincipal
-
getPrincipalRef
public String getPrincipalRef()
- Specified by:
getPrincipalRefin interfaceorg.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:
setGroupNamesin interfaceorg.bedework.access.AccessPrincipal
-
getGroupNames
public Collection<String> getGroupNames()
- Specified by:
getGroupNamesin interfaceorg.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 objectname- tagval- BwPrincipal
-
copyTo
public void copyTo(BwPrincipal val)
Copy this to val- Parameters:
val- BwPrincipal target
-
compareTo
public int compareTo(BwPrincipal o)
- Specified by:
compareToin interfaceComparable<BwPrincipal>
-
compare
public int compare(BwPrincipal p1, BwPrincipal p2)
- Specified by:
comparein interfaceComparator<BwPrincipal>
-
equals
public boolean equals(Object o)
- Specified by:
equalsin interfaceComparator<BwPrincipal>- Overrides:
equalsin classObject
-
-