com.atlassian.crowd.openid.server.manager.site
Interface SiteManager

All Known Implementing Classes:
SiteManagerGeneric

public interface SiteManager


Method Summary
 void addRPAddressRestriction(AddressRestriction restriction)
           
 java.util.List findAllRPAddressRestrictions()
          Finds all of the whitelist or blacklist server approvals.
 java.util.List getAllAlwaysAllowSites(User user)
          Returns all the sites marked 'always allow' for a user.
 Site getSite(java.lang.String url)
          Gets the Site object corresponding to the URL or creates a Site object corresponding to the URL.
 SiteApproval getSiteApproval(User user, java.lang.String url)
          Gets the SiteApproval of a user for a URL.
 boolean isSiteAllowedToAuthenticate(java.net.URL url)
          Determines is a URL is allowed to authenticate.
 void removeAllRPAddressRestrictions()
           
 void removeRPAddressRestriction(java.lang.String address)
           
 void removeSiteApproval(SiteApproval approval)
          Removes an allow always approval from the database.
 SiteApproval setSiteApproval(User user, java.lang.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 updateAlwaysAllowApprovals(User user, java.util.List urls, java.util.List profileIDs)
          Updates which sites are always allowed to authenticate.
 

Method Detail

getSiteApproval

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

Parameters:
user - user to search in.
url - URL of Site in SiteApproval.
Returns:
SiteApproval or null if none exists.

getSite

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

Parameters:
url - URL of the Site.
Returns:
Site.

setSiteApproval

SiteApproval setSiteApproval(User user,
                             java.lang.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.

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

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

Parameters:
user - user to search for.
Returns:
List

updateAlwaysAllowApprovals

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

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

java.util.List findAllRPAddressRestrictions()
Finds all of the whitelist or blacklist server approvals.

Returns:
The list of whitelist or blacklist mode to enforce.
See Also:
OpenIDPropertyManager.getTrustRelationShipMode()

addRPAddressRestriction

void addRPAddressRestriction(AddressRestriction restriction)

removeAllRPAddressRestrictions

void removeAllRPAddressRestrictions()

removeRPAddressRestriction

void removeRPAddressRestriction(java.lang.String address)

isSiteAllowedToAuthenticate

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

Parameters:
url - url of the site.
Returns:
true if site is allowed to authenticate, false otherwise.

removeSiteApproval

void removeSiteApproval(SiteApproval approval)
Removes an allow always approval from the database.

Parameters:
approval - The site approval to remove.


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.