com.atlassian.crowd.openid.server.manager.site
Class SiteManagerGeneric

java.lang.Object
  extended by com.atlassian.crowd.openid.server.manager.site.SiteManagerGeneric
All Implemented Interfaces:
SiteManager

public class SiteManagerGeneric
extends Object
implements SiteManager


Constructor Summary
SiteManagerGeneric()
           
 
Method Summary
 void addRPAddressRestriction(AddressRestriction restriction)
           
 List findAllRPAddressRestrictions()
          Finds all of the whitelist or blacklist server approvals.
 List getAllAlwaysAllowSites(User user)
          Returns all the sites marked 'always allow' for a user.
 AuthRecordDAO getAuthRecordDAO()
           
 ProfileManager getProfileManager()
           
 Site getSite(String url)
          Gets the Site object corresponding to the URL or creates a Site object corresponding to the URL.
 SiteApproval getSiteApproval(User user, String url)
          Gets the SiteApproval of a user for a URL.
 SiteApprovalDAO getSiteApprovalDAO()
           
 SiteDAO getSiteDAO()
           
 boolean isSiteAllowedToAuthenticate(URL url)
          Determines is a URL is allowed to authenticate.
 void removeAllRPAddressRestrictions()
           
 void removeRPAddressRestriction(String address)
           
 void removeSiteApproval(SiteApproval approval)
          Removes an allow always approval from the database.
 void setAddressRestrictionDAO(AddressRestrictionDAO addressRestrictionDAO)
           
 void setAuthRecordDAO(AuthRecordDAO authRecordDAO)
           
 void setOpenIDPropertyManager(OpenIDPropertyManager openIDPropertyManager)
           
 void setProfileManager(ProfileManager profileManager)
           
 SiteApproval setSiteApproval(User user, String url, long profileID, boolean alwaysAllow)
          Updates or creates site approval for a particular site (URL) associated with a user and a profile of that user.
 void setSiteApprovalDAO(SiteApprovalDAO siteApprovalDAO)
           
 void setSiteDAO(SiteDAO siteDAO)
           
 void updateAlwaysAllowApprovals(User user, List urls, List profileIDs)
          Updates which sites are always allowed to authenticate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteManagerGeneric

public SiteManagerGeneric()
Method Detail

getSiteApproval

public SiteApproval getSiteApproval(User user,
                                    String url)
Gets the SiteApproval of a user for a URL. Returns null if user does not have SiteApproval for the URL.

Specified by:
getSiteApproval in interface SiteManager
Parameters:
user - user to search in.
url - URL of Site in SiteApproval.
Returns:
SiteApproval or null if none exists.

getSite

public Site getSite(String url)
Gets the Site object corresponding to the URL or creates a Site object corresponding to the URL.

Specified by:
getSite in interface SiteManager
Parameters:
url - URL of the Site.
Returns:
Site.

setSiteApproval

public SiteApproval setSiteApproval(User user,
                                    String url,
                                    long profileID,
                                    boolean alwaysAllow)
                             throws SiteManagerException
Updates or creates site approval for a particular site (URL) associated with a user and a profile of that user.

Specified by:
setSiteApproval in interface SiteManager
Parameters:
user - user to associate to.
url - URL of site.
profileID - default profile to use for attribute information when interacting with site.
alwaysAllow - true if authentication with this site is always allowed.
Returns:
SiteApproval which just got added or updated.
Throws:
SiteManagerException - thrown if profile with given profileID does not exist OR user does not own profile.

getAllAlwaysAllowSites

public List getAllAlwaysAllowSites(User user)
Returns all the sites marked 'always allow' for a user.

Specified by:
getAllAlwaysAllowSites in interface SiteManager
Parameters:
user - user to search for.
Returns:
List

updateAlwaysAllowApprovals

public void updateAlwaysAllowApprovals(User user,
                                       List urls,
                                       List profileIDs)
                                throws SiteManagerException
Updates which sites are always allowed to authenticate.

Specified by:
updateAlwaysAllowApprovals in interface SiteManager
Parameters:
user - user to update.
urls - list of URLS of sites.
profileIDs - corresponding list of default profile IDs for the sites.
Throws:
SiteManagerException - thrown if URL/ProfileID lists are null or not the same size OR profile with given profileID does not exist OR user does not own profile.

findAllRPAddressRestrictions

public List findAllRPAddressRestrictions()
Description copied from interface: SiteManager
Finds all of the whitelist or blacklist server approvals.

Specified by:
findAllRPAddressRestrictions in interface SiteManager
Returns:
The list of whitelist or blacklist mode to enforce.
See Also:
OpenIDPropertyManager.getTrustRelationShipMode()

addRPAddressRestriction

public void addRPAddressRestriction(AddressRestriction restriction)
Specified by:
addRPAddressRestriction in interface SiteManager

removeAllRPAddressRestrictions

public void removeAllRPAddressRestrictions()
Specified by:
removeAllRPAddressRestrictions in interface SiteManager

removeRPAddressRestriction

public void removeRPAddressRestriction(String address)
Specified by:
removeRPAddressRestriction in interface SiteManager

isSiteAllowedToAuthenticate

public boolean isSiteAllowedToAuthenticate(URL url)
Determines is a URL is allowed to authenticate. 1. on blacklist: disallow. 2. on whitelist: allow. 3. otherwise: allow.

Specified by:
isSiteAllowedToAuthenticate in interface SiteManager
Parameters:
url - url of the site.
Returns:
true if site is allowed to authenticate, false otherwise.

removeSiteApproval

public void removeSiteApproval(SiteApproval approval)
Description copied from interface: SiteManager
Removes an allow always approval from the database.

Specified by:
removeSiteApproval in interface SiteManager
Parameters:
approval - The site approval to remove.

getSiteDAO

public SiteDAO getSiteDAO()

setSiteDAO

public void setSiteDAO(SiteDAO siteDAO)

getProfileManager

public ProfileManager getProfileManager()

setProfileManager

public void setProfileManager(ProfileManager profileManager)

getSiteApprovalDAO

public SiteApprovalDAO getSiteApprovalDAO()

setSiteApprovalDAO

public void setSiteApprovalDAO(SiteApprovalDAO siteApprovalDAO)

getAuthRecordDAO

public AuthRecordDAO getAuthRecordDAO()

setAuthRecordDAO

public void setAuthRecordDAO(AuthRecordDAO authRecordDAO)

setAddressRestrictionDAO

public void setAddressRestrictionDAO(AddressRestrictionDAO addressRestrictionDAO)

setOpenIDPropertyManager

public void setOpenIDPropertyManager(OpenIDPropertyManager openIDPropertyManager)


Copyright © 2012 Atlassian. All Rights Reserved.