From c6204281c819ea4514952ed7623e282babcb5f8c Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Wed, 27 Feb 2013 21:36:23 +0100 Subject: More --- src/main/java/com/c2kernel/lookup/AgentPath.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/c2kernel/lookup/AgentPath.java') diff --git a/src/main/java/com/c2kernel/lookup/AgentPath.java b/src/main/java/com/c2kernel/lookup/AgentPath.java index c200d75..5dd177b 100644 --- a/src/main/java/com/c2kernel/lookup/AgentPath.java +++ b/src/main/java/com/c2kernel/lookup/AgentPath.java @@ -16,9 +16,8 @@ import java.security.NoSuchAlgorithmException; import org.apache.xerces.impl.dv.util.Base64; import com.c2kernel.common.ObjectNotFoundException; -import com.c2kernel.lookup.ldap.LDAPLookupUtils; import com.c2kernel.process.Gateway; -import com.novell.ldap.LDAPEntry; +import com.c2kernel.utils.Logger; /** @@ -68,11 +67,11 @@ public class AgentPath extends EntityPath if (mAgentName==null) { try { - LDAPEntry agentEntry = LDAPLookupUtils.getEntry(Gateway.getLookup().getConnection(), this.getDN() + mLocalPath); - mAgentName = LDAPLookupUtils.getFirstAttributeValue(agentEntry,"uid"); - } catch (ObjectNotFoundException e) { - mAgentName = ""; - } + mAgentName = Gateway.getLookup().getRoleManager().getAgentName(this); + } catch (ObjectNotFoundException e) { + Logger.error(e); + mAgentName=""; + } } return mAgentName; } @@ -111,7 +110,7 @@ public class AgentPath extends EntityPath mAgentName; } - static String generateUserPassword(String pass, String algo) throws NoSuchAlgorithmException { + public static String generateUserPassword(String pass, String algo) throws NoSuchAlgorithmException { MessageDigest sha = MessageDigest.getInstance(algo); sha.reset(); sha.update(pass.getBytes()); -- cgit v1.2.3