org.jasig.schedassist.web.security
Class CalendarAccountUserDetailsImpl

java.lang.Object
  extended by org.jasig.schedassist.web.security.CalendarAccountUserDetailsImpl
All Implemented Interfaces:
Serializable, CalendarAccountUserDetails, org.springframework.security.core.userdetails.UserDetails

public class CalendarAccountUserDetailsImpl
extends Object
implements CalendarAccountUserDetails

CalendarAccountUserDetails implementation for standard people ICalendarAccounts.

Version:
$Id: CalendarAccountUserDetailsImpl.java 2979 2011-01-25 19:24:44Z npblair $
Author:
Nicholas Blair, nblair@doit.wisc.edu
See Also:
Serialized Form

Method Summary
 String getActiveDisplayName()
           
 Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()
          Returns an array of GrantedAuthoritys based on which fields are set: if the "unregistered" ICalendarAccount is set and ICalendarAccount.isEligible(), adds SecurityConstants.REGISTER. if the IScheduleVisitor field is set and is eligible, adds SecurityConstants.VISITOR. if the IScheduleOwner field is set and is eligible, adds SecurityConstants.OWNER.
 ICalendarAccount getCalendarAccount()
           
 String getPassword()
           
 IScheduleOwner getScheduleOwner()
           
 IScheduleVisitor getScheduleVisitor()
           
 String getUsername()
           
 boolean isAccountNonExpired()
           
 boolean isAccountNonLocked()
           
 boolean isCredentialsNonExpired()
           
 boolean isDelegate()
           
 boolean isEnabled()
           
 boolean isScheduleOwnerSet()
           
 boolean isScheduleVisitorSet()
           
 String toString()
           
 void updateScheduleOwner(IScheduleOwner scheduleOwner)
          Update the IScheduleOwner instance stored internally.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAuthorities

public Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()
Returns an array of GrantedAuthoritys based on which fields are set:
  1. if the "unregistered" ICalendarAccount is set and ICalendarAccount.isEligible(), adds SecurityConstants.REGISTER.
  2. if the IScheduleVisitor field is set and is eligible, adds SecurityConstants.VISITOR.
  3. if the IScheduleOwner field is set and is eligible, adds SecurityConstants.OWNER.

Specified by:
getAuthorities in interface org.springframework.security.core.userdetails.UserDetails
See Also:
org.springframework.security.userdetails.UserDetails#getAuthorities()

getPassword

public String getPassword()
Specified by:
getPassword in interface org.springframework.security.core.userdetails.UserDetails

getUsername

public String getUsername()
Specified by:
getUsername in interface org.springframework.security.core.userdetails.UserDetails

isAccountNonExpired

public boolean isAccountNonExpired()
Specified by:
isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetails

isAccountNonLocked

public boolean isAccountNonLocked()
Specified by:
isAccountNonLocked in interface org.springframework.security.core.userdetails.UserDetails

isCredentialsNonExpired

public boolean isCredentialsNonExpired()
Specified by:
isCredentialsNonExpired in interface org.springframework.security.core.userdetails.UserDetails

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface org.springframework.security.core.userdetails.UserDetails

getCalendarAccount

public ICalendarAccount getCalendarAccount()
Specified by:
getCalendarAccount in interface CalendarAccountUserDetails
Returns:
the ICalendarAccount for this account

getScheduleVisitor

public IScheduleVisitor getScheduleVisitor()
Returns:
the scheduleVisitor

getScheduleOwner

public IScheduleOwner getScheduleOwner()
                                throws NotRegisteredException
Specified by:
getScheduleOwner in interface CalendarAccountUserDetails
Returns:
the IScheduleOwner for this account (if registered)
Throws:
NotRegisteredException - if the is account is not yet registered

isDelegate

public final boolean isDelegate()
Specified by:
isDelegate in interface CalendarAccountUserDetails
Returns:
true if this account is a delegate

updateScheduleOwner

public void updateScheduleOwner(IScheduleOwner scheduleOwner)
Description copied from interface: CalendarAccountUserDetails
Update the IScheduleOwner instance stored internally. Future calls to CalendarAccountUserDetails.getScheduleOwner() should retrieve this new instance.

Specified by:
updateScheduleOwner in interface CalendarAccountUserDetails

isScheduleOwnerSet

public boolean isScheduleOwnerSet()

isScheduleVisitorSet

public boolean isScheduleVisitorSet()

getActiveDisplayName

public String getActiveDisplayName()
Specified by:
getActiveDisplayName in interface CalendarAccountUserDetails
Returns:
a friendly display name for this account

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Jasig. All Rights Reserved.