Author: bdaw
Date: 2011-09-29 20:07:13 -0400 (Thu, 29 Sep 2011)
New Revision: 7567
Modified:
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
Log:
JBEPP-1188 Cluster profile: Attempt to replicate non-serializable class
PicketlinkIDMServiceImpl
Modified:
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2011-09-29
23:21:31 UTC (rev 7566)
+++
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2011-09-30
00:07:13 UTC (rev 7567)
@@ -20,6 +20,8 @@
package org.exoplatform.services.organization.idm;
import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
import org.exoplatform.services.organization.impl.UserImpl;
@@ -41,10 +43,6 @@
{
private static Logger log = LoggerFactory.getLogger(IDMUserListAccess.class);
- private final UserDAOImpl userDAO;
-
- private final PicketLinkIDMService idmService;
-
private final UserQueryBuilder userQueryBuilder;
private final int pageSize;
@@ -55,11 +53,8 @@
private int size = -1;
- public IDMUserListAccess(UserDAOImpl userDAO, PicketLinkIDMService idmService,
UserQueryBuilder userQueryBuilder,
- int pageSize, boolean countAll)
+ public IDMUserListAccess(UserQueryBuilder userQueryBuilder, int pageSize, boolean
countAll)
{
- this.userDAO = userDAO;
- this.idmService = idmService;
this.userQueryBuilder = userQueryBuilder;
this.pageSize = pageSize;
this.countAll = countAll;
@@ -84,11 +79,11 @@
if (fullResults == null)
{
- userDAO.getOrgService().flush();
+ getOrganizationService().flush();
userQueryBuilder.page(index, length);
UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
- users = idmService.getIdentitySession().list(query);
+ users = getIDMService().getIdentitySession().list(query);
}
else
{
@@ -102,7 +97,8 @@
org.picketlink.idm.api.User user = users.get(i);
User gtnUser = new UserImpl(user.getId());
- userDAO.populateUser(gtnUser, idmService.getIdentitySession());
+ ((UserDAOImpl)getOrganizationService().getUserHandler())
+ .populateUser(gtnUser, getIDMService().getIdentitySession());
exoUsers[i] = gtnUser;
}
@@ -131,7 +127,7 @@
);
}
- userDAO.getOrgService().flush();
+ getOrganizationService().flush();
int result;
@@ -144,13 +140,13 @@
}
else if (countAll)
{
- result =
idmService.getIdentitySession().getPersistenceManager().getUserCount();
+ result =
getIDMService().getIdentitySession().getPersistenceManager().getUserCount();
}
else
{
userQueryBuilder.page(0, 0);
UserQuery query = userQueryBuilder.sort(SortOrder.ASCENDING).createQuery();
- fullResults = idmService.getIdentitySession().list(query);
+ fullResults = getIDMService().getIdentitySession().list(query);
result = fullResults.size();
}
@@ -174,4 +170,16 @@
return result;
}
+
+ PicketLinkIDMService getIDMService()
+ {
+ return (PicketLinkIDMService)
+
PortalContainer.getInstance().getComponentInstanceOfType(PicketLinkIDMService.class);
+ }
+
+ PicketLinkIDMOrganizationServiceImpl getOrganizationService()
+ {
+ return (PicketLinkIDMOrganizationServiceImpl)
+
PortalContainer.getInstance().getComponentInstanceOfType(OrganizationService.class);
+ }
}
Modified:
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-09-29
23:21:31 UTC (rev 7566)
+++
epp/portal/branches/EPP_5_2_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2011-09-30
00:07:13 UTC (rev 7567)
@@ -337,7 +337,7 @@
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
- return new LazyPageList(new IDMUserListAccess(this, service_, qb, pageSize, true),
pageSize);
+ return new LazyPageList(new IDMUserListAccess(qb, pageSize, true), pageSize);
}
public ListAccess<User> findAllUsers() throws Exception
@@ -354,7 +354,7 @@
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
- return new IDMUserListAccess(this, service_, qb, 20, true);
+ return new IDMUserListAccess(qb, 20, true);
}
//
@@ -540,11 +540,11 @@
q.getFirstName() == null &&
q.getLastName() == null)
{
- list = new IDMUserListAccess(this, service_, qb, 20, true);
+ list = new IDMUserListAccess(qb, 20, true);
}
else
{
- list = new IDMUserListAccess(this, service_, qb, 20, false);
+ list = new IDMUserListAccess(qb, 20, false);
}
if (cache != null)
@@ -655,7 +655,7 @@
qb.addRelatedGroup(jbidGroup);
- return new IDMUserListAccess(this, service_, qb, 20, false);
+ return new IDMUserListAccess(qb, 20, false);
}
//