summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/lookup/LDAPRoleManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'source/com/c2kernel/lookup/LDAPRoleManager.java')
-rw-r--r--source/com/c2kernel/lookup/LDAPRoleManager.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/com/c2kernel/lookup/LDAPRoleManager.java b/source/com/c2kernel/lookup/LDAPRoleManager.java
index 1df2f29..0536d6c 100644
--- a/source/com/c2kernel/lookup/LDAPRoleManager.java
+++ b/source/com/c2kernel/lookup/LDAPRoleManager.java
@@ -28,8 +28,8 @@ public class LDAPRoleManager {
*
*/
LDAPLookup mLdap;
- private String mRolePath;
- private String mEntityPath;
+ private final String mRolePath;
+ private final String mEntityPath;
public LDAPRoleManager(LDAPLookup ldap, String rolePath, String entityPath) {
super();
@@ -100,8 +100,7 @@ public class LDAPRoleManager {
LDAPSearchConstraints searchCons = new LDAPSearchConstraints();
searchCons.setBatchSize(0);
searchCons.setDereference(LDAPSearchConstraints.DEREF_NEVER );
- Enumeration<?> roles = mLdap.search(mRolePath,LDAPConnection.SCOPE_SUB,filter,searchCons);
- return roles.hasMoreElements();
+ return mLdap.search(mRolePath,LDAPConnection.SCOPE_SUB,filter,searchCons).hasMoreElements();
}
protected AgentPath[] getAgents(RolePath role)
@@ -171,10 +170,10 @@ public class LDAPRoleManager {
searchCons.setBatchSize(0);
searchCons.setDereference(LDAPSearchConstraints.DEREF_NEVER );
String filter = "(&(objectclass=cristalagent)(uid="+agentName+"))";
- Enumeration<?> res = mLdap.search(mEntityPath,LDAPConnection.SCOPE_SUB,filter,searchCons);
+ Enumeration<Path> res = mLdap.search(mEntityPath,LDAPConnection.SCOPE_SUB,filter,searchCons);
if (!res.hasMoreElements())
throw new ObjectNotFoundException("Agent not found");
- Path result = (Path)res.nextElement();
+ Path result = res.nextElement();
if (result instanceof AgentPath)
return (AgentPath)result;
else
@@ -187,10 +186,10 @@ public class LDAPRoleManager {
searchCons.setBatchSize(0);
searchCons.setDereference(LDAPSearchConstraints.DEREF_NEVER );
String filter = "(&(objectclass=cristalrole)(cn="+roleName+"))";
- Enumeration<?> res = mLdap.search(mRolePath,LDAPConnection.SCOPE_SUB,filter,searchCons);
+ Enumeration<Path> res = mLdap.search(mRolePath,LDAPConnection.SCOPE_SUB,filter,searchCons);
if (!res.hasMoreElements())
throw new ObjectNotFoundException("Role not found");
- Path result = (Path)res.nextElement();
+ Path result = res.nextElement();
if (result instanceof RolePath)
return (RolePath)result;
else