public class SiteManagerGeneric extends Object implements SiteManager
Constructor and Description |
---|
SiteManagerGeneric(SiteDAO siteDAO,
SiteApprovalDAO siteApprovalDAO,
ProfileManager profileManager,
AddressRestrictionDAO addressRestrictionDAO,
OpenIDPropertyManager openIDPropertyManager,
ApprovalWhitelist siteApprovalWhitelist) |
Modifier and Type | Method and Description |
---|---|
void |
addRPAddressRestriction(String address) |
SiteApproval |
createApprovalFromWhitelist(User user,
String url)
Generate approval if this site is configured in the server's white list,
otherwise return
null . |
List<AddressRestriction> |
findAllRPAddressRestrictions()
Finds all of the whitelist or blacklist server approvals.
|
Site |
findOrCreateSite(String url)
Gets the Site object corresponding to the URL or
creates a Site object corresponding to the URL.
|
SiteApproval |
findSiteApproval(User user,
String url)
Finds the SiteApproval of a user for a given URL.
|
List<SiteApproval> |
getAllAlwaysAllowSites(User user)
Returns all the sites marked 'always allow' for a user.
|
boolean |
isSiteAllowedToAuthenticate(URL url)
Determines is a URL is allowed to authenticate.
|
void |
removeRPAddressRestriction(String address) |
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 |
updateAlwaysAllowApprovals(User user,
List<String> urls,
List<String> profileIDs)
Updates which sites are always allowed to authenticate.
|
public SiteManagerGeneric(SiteDAO siteDAO, SiteApprovalDAO siteApprovalDAO, ProfileManager profileManager, AddressRestrictionDAO addressRestrictionDAO, OpenIDPropertyManager openIDPropertyManager, ApprovalWhitelist siteApprovalWhitelist)
public SiteApproval findSiteApproval(User user, String url)
SiteManager
findSiteApproval
in interface SiteManager
user
- user to search in.url
- URL of Site in SiteApproval.public SiteApproval createApprovalFromWhitelist(User user, String url)
SiteManager
null
.createApprovalFromWhitelist
in interface SiteManager
user
- user which this approval is forurl
- the url which the approval is fornull
public Site findOrCreateSite(String url)
SiteManager
findOrCreateSite
in interface SiteManager
url
- URL of the Site.public SiteApproval setSiteApproval(User user, String url, long profileID, boolean alwaysAllow) throws SiteManagerException
SiteManager
setSiteApproval
in interface SiteManager
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.SiteManagerException
- thrown if profile with given profileID does not exist OR user does not own profile.public List<SiteApproval> getAllAlwaysAllowSites(User user)
SiteManager
getAllAlwaysAllowSites
in interface SiteManager
user
- user to search for.public void updateAlwaysAllowApprovals(User user, List<String> urls, List<String> profileIDs) throws SiteManagerException
SiteManager
updateAlwaysAllowApprovals
in interface SiteManager
user
- user to update.urls
- list of URLS of sites.profileIDs
- corresponding list of default profile IDs for the sites.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.public List<AddressRestriction> findAllRPAddressRestrictions()
SiteManager
findAllRPAddressRestrictions
in interface SiteManager
OpenIDPropertyManager.getTrustRelationshipMode()
public void addRPAddressRestriction(String address)
addRPAddressRestriction
in interface SiteManager
public void removeRPAddressRestriction(String address)
removeRPAddressRestriction
in interface SiteManager
public boolean isSiteAllowedToAuthenticate(URL url)
isSiteAllowedToAuthenticate
in interface SiteManager
url
- url of the site.Copyright © 2021 Atlassian. All rights reserved.