rogerrut 2004/12/03 15:32:18
Modified: components/sso/src/java/org/apache/jetspeed/sso/impl
PersistenceBrokerSSOProvider.java
SSOPrincipalImpl.java
Log:
Fixed problem for RemotePrincipal which was not unique for a site
Revision Changes Path
1.7 +16 -7
jakarta-jetspeed-2/components/sso/src/java/org/apache/jetspeed/sso/impl/PersistenceBrokerSSOProvider.java
Index: PersistenceBrokerSSOProvider.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/components/sso/src/java/org/apache/jetspeed/sso/impl/PersistenceBrokerSSOProvider.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PersistenceBrokerSSOProvider.java 1 Dec 2004 01:29:08 -0000 1.6
+++ PersistenceBrokerSSOProvider.java 3 Dec 2004 23:32:18 -0000 1.7
@@ -180,7 +180,7 @@
}
// Clear cache
- this.mapSite.clear();
+ //this.mapSite.clear();
}
@@ -241,7 +241,7 @@
}
// Clear cache
- this.mapSite.clear();
+ // this.mapSite.clear();
}
/**
@@ -301,7 +301,7 @@
}
// Clear cache
- this.mapSite.clear();
+ // this.mapSite.clear();
}
@@ -387,7 +387,9 @@
while (itPrincipals.hasNext() && principal == null /*not found
yet*/)
{
SSOPrincipal tmp = (SSOPrincipal)itPrincipals.next();
- if ( tmp != null &&
tmp.getFullPath().compareToIgnoreCase(fullPath) == 0)
+ if ( tmp != null
+ &&
tmp.getFullPath().compareToIgnoreCase(fullPath) == 0
+ && tmp.getSiteID() == ssoSite.getSiteId())
{
// Found it stop iteration
principal = tmp;
@@ -445,7 +447,9 @@
while (ixPrincipals.hasNext())
{
SSOPrincipal principal =
(SSOPrincipal)ixPrincipals.next();
- if ( principal != null &&
principal.getFullPath().compareToIgnoreCase(fullPath) == 0)
+ if ( principal != null
+ &&
principal.getFullPath().compareToIgnoreCase(fullPath) == 0
+ && principal.getSiteID() == ssoSite.getSiteId())
{
// Found Principal -- extract remote principals
return principal.getRemotePrincipals();
@@ -470,7 +474,9 @@
while (itPrincipals.hasNext() && principal == null)
{
SSOPrincipal tmp =
(SSOPrincipal)itPrincipals.next();
- if ( tmp != null &&
tmp.getFullPath().compareToIgnoreCase(fullPath) == 0)
+ if ( tmp != null
+ &&
tmp.getFullPath().compareToIgnoreCase(fullPath) == 0
+ && tmp.getSiteID() ==
ssoSite.getSiteId())
principal = tmp; // Found
existing entry
}
}
@@ -493,6 +499,8 @@
principal = (SSOPrincipal) itPrincipals.next();
try
{
+ // Set the Site ID for this principal
+ principal.setSiteID(ssoSite.getSiteId());
ssoSite.addPrincipal(principal);
}
catch (SSOException ssoex)
@@ -544,7 +552,8 @@
while (itPrincipals.hasNext())
{
SSOPrincipal tmp =
(SSOPrincipal)itPrincipals.next();
- if (
tmp.getFullPath().compareToIgnoreCase(fullPath) == 0)
+ if (
tmp.getFullPath().compareToIgnoreCase(fullPath) == 0
+ && tmp.getSiteID() == site.getSiteId())
{
// Found -- get the remotePrincipal
Collection collRemotePrincipals =
tmp.getRemotePrincipals() ;
1.3 +15 -0
jakarta-jetspeed-2/components/sso/src/java/org/apache/jetspeed/sso/impl/SSOPrincipalImpl.java
Index: SSOPrincipalImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/components/sso/src/java/org/apache/jetspeed/sso/impl/SSOPrincipalImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SSOPrincipalImpl.java 30 Nov 2004 18:19:10 -0000 1.2
+++ SSOPrincipalImpl.java 3 Dec 2004 23:32:18 -0000 1.3
@@ -59,6 +59,9 @@
/** Remote principals for Principal */
private Collection remotePrincipals;
+ /** SIteID for Remote principal */
+ private int siteID;
+
/**
* <p>
@@ -251,5 +254,17 @@
public void setRemotePrincipals(Collection remotePrincipals) {
this.remotePrincipals = remotePrincipals;
}
+ /**
+ * @return Returns the siteID.
+ */
+ public int getSiteID() {
+ return siteID;
+ }
+ /**
+ * @param siteID The siteID to set.
+ */
+ public void setSiteID(int siteID) {
+ this.siteID = siteID;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]