org.sakaiproject.entitybroker.providers.model
Class EntityMember

java.lang.Object
  extended by org.sakaiproject.entitybroker.providers.model.EntityMember
All Implemented Interfaces:
Serializable, Comparable, org.sakaiproject.authz.api.Member

@ReflectIgnoreClassFields(value="role")
public class EntityMember
extends Object
implements org.sakaiproject.authz.api.Member

Represents a membership in something (probably a site or group)

Author:
Aaron Zeckoski (azeckoski @ gmail.com)
See Also:
Serialized Form

Nested Class Summary
static class EntityMember.MemberDisplayName
           
static class EntityMember.MemberEmail
           
static class EntityMember.MemberLastLogin
           
static class EntityMember.MemberSortName
           
 
Field Summary
static long serialVersionUID
           
 
Constructor Summary
EntityMember()
           
EntityMember(org.sakaiproject.authz.api.Member member, String locationReference, EntityUser user)
           
EntityMember(String userId, String locationReference, String memberRole, boolean active, EntityUser user)
           
 
Method Summary
 int compareTo(Object obj)
           
 String getId()
           
 Date getLastLoginTime()
           
 String getLocationReference()
           
 String getMemberRole()
           
 org.sakaiproject.authz.api.Role getRole()
           
 String getUserDisplayId()
           
 String getUserDisplayName()
           
 String getUserEid()
           
 String getUserEmail()
           
 String getUserId()
           
 String getUserSortName()
           
 boolean isActive()
           
 boolean isProvided()
           
static String makeId(String userId, String locationReference)
          Constructs a membership id from the user and member references
static String[] parseId(String membershipId)
          Tries to parse a membershipId into three parts: 1) the userId 2) the location reference 3) the location entity prefix
 void setActive(boolean active)
           
 void setLocationReference(String locationReference)
           
 void setMemberRole(String memberRole)
           
 void setProvided(boolean provided)
           
 void setUserId(String userId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

EntityMember

public EntityMember()

EntityMember

public EntityMember(String userId,
                    String locationReference,
                    String memberRole,
                    boolean active,
                    EntityUser user)
Parameters:
userId - a unique user id (not the username), e.g. 59307d75-7863-4560-9abc-6d1c4e62a63e or 'admin'
locationReference - the reference to the location (e.g. site or group) this is a membership in (e.g. '/site/mysite', '/site/mysite/group/mygroup')
memberRole - the id of the membership role (e.g. maintain, access, etc.)
active - true if this membership should be active, false otherwise
user - the user object for this membership

EntityMember

public EntityMember(org.sakaiproject.authz.api.Member member,
                    String locationReference,
                    EntityUser user)
Parameters:
member - a legacy Member object
locationReference - the reference to the location (e.g. site or group) this is a membership in (e.g. '/site/mysite', '/site/mysite/group/mygroup')
user - the user object for this membership
Method Detail

makeId

public static String makeId(String userId,
                            String locationReference)
Constructs a membership id from the user and member references

Parameters:
userId - a unique user id (not the username), e.g. 59307d75-7863-4560-9abc-6d1c4e62a63e or 'admin'
locationReference - the reference to the thing this is a membership in, site or group (e.g. '/site/mysite', '/site/mysite/group/mygroup')
Returns:
a membership id which is unique

parseId

public static String[] parseId(String membershipId)
Tries to parse a membershipId into three parts: 1) the userId 2) the location reference 3) the location entity prefix

Parameters:
membershipId - an id structured like 'userId::site:siteId'
Returns:
an array with the 3 parts in order

getId

public String getId()

getUserId

public String getUserId()
Specified by:
getUserId in interface org.sakaiproject.authz.api.Member

setUserId

public void setUserId(String userId)

getLocationReference

public String getLocationReference()

setLocationReference

public void setLocationReference(String locationReference)

getMemberRole

public String getMemberRole()

setMemberRole

public void setMemberRole(String memberRole)

getUserEid

public String getUserEid()
Specified by:
getUserEid in interface org.sakaiproject.authz.api.Member

isProvided

public boolean isProvided()
Specified by:
isProvided in interface org.sakaiproject.authz.api.Member

setProvided

public void setProvided(boolean provided)

isActive

public boolean isActive()
Specified by:
isActive in interface org.sakaiproject.authz.api.Member

getUserDisplayName

public String getUserDisplayName()

getUserSortName

public String getUserSortName()

getUserEmail

public String getUserEmail()

getLastLoginTime

public Date getLastLoginTime()

getRole

public org.sakaiproject.authz.api.Role getRole()
Specified by:
getRole in interface org.sakaiproject.authz.api.Member

getUserDisplayId

public String getUserDisplayId()
Specified by:
getUserDisplayId in interface org.sakaiproject.authz.api.Member

setActive

public void setActive(boolean active)
Specified by:
setActive in interface org.sakaiproject.authz.api.Member

compareTo

public int compareTo(Object obj)
Specified by:
compareTo in interface Comparable


Copyright © 2007-2012 Sakai Project. All Rights Reserved.