summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lookup/LDAPLookup.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-05-07 17:33:13 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-05-08 16:37:39 +0200
commita1f0ecbb6a2bea6aa214322c412af2f3c5ce124b (patch)
tree4d74229b6dd9cfd7ce054e06bf740b9a63a578d6 /src/main/java/com/c2kernel/lookup/LDAPLookup.java
parent6dfa1bbe05a712174e937af89d5223e98d9d7d06 (diff)
Agent now extends Item, so they can have workflows. All traces of the
old 'Entity' superclasses should be removed, including proxies and paths. Very large change, breaks API compatibility with CRISTAL 2.x. Fixes #135
Diffstat (limited to 'src/main/java/com/c2kernel/lookup/LDAPLookup.java')
-rw-r--r--src/main/java/com/c2kernel/lookup/LDAPLookup.java36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/main/java/com/c2kernel/lookup/LDAPLookup.java b/src/main/java/com/c2kernel/lookup/LDAPLookup.java
index 4ea6e68..116362e 100644
--- a/src/main/java/com/c2kernel/lookup/LDAPLookup.java
+++ b/src/main/java/com/c2kernel/lookup/LDAPLookup.java
@@ -12,7 +12,7 @@ import com.c2kernel.common.ObjectCannotBeUpdated;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.entity.TraceableEntity;
import com.c2kernel.entity.agent.ActiveEntity;
-import com.c2kernel.entity.proxy.EntityProxyManager;
+import com.c2kernel.entity.proxy.ProxyManager;
import com.c2kernel.entity.proxy.ProxyMessage;
import com.c2kernel.process.Gateway;
import com.c2kernel.property.PropertyDescription;
@@ -67,13 +67,13 @@ public class LDAPLookup
Path.mRootPath=props.mRootPath;
Path.mLocalPath=props.mLocalPath;
- EntityPath.mTypeRoot = "cn=entity,"+props.mLocalPath;
+ ItemPath.mTypeRoot = "cn=entity,"+props.mLocalPath;
DomainPath.mTypeRoot = "cn=domain,"+props.mLocalPath;
- mNextKeyManager = new NextKeyManager(this, "cn=last,"+EntityPath.mTypeRoot);
+ mNextKeyManager = new NextKeyManager(this, "cn=last,"+ItemPath.mTypeRoot);
Logger.msg(7, "LDAP.useOldProps="+Gateway.getProperties().getBoolean("LDAP.useOldProps", false));
mPropManager = new LDAPPropertyManager(this);
- mRoleManager = new LDAPRoleManager(this, "cn=agent,"+DomainPath.mTypeRoot, EntityPath.mTypeRoot);
+ mRoleManager = new LDAPRoleManager(this, "cn=agent,"+DomainPath.mTypeRoot, ItemPath.mTypeRoot);
}
@@ -199,12 +199,12 @@ public class LDAPLookup
*
* @param domPath
* @return
- * @throws InvalidEntityPathException
+ * @throws InvalidItemPathException
* @throws ObjectNotFoundException
*/
- protected EntityPath resolvePath(DomainPath domPath)
- throws InvalidEntityPathException, ObjectNotFoundException {
- EntityPath referencedPath = null;
+ protected ItemPath resolvePath(DomainPath domPath)
+ throws InvalidItemPathException, ObjectNotFoundException {
+ ItemPath referencedPath = null;
LDAPEntry domEntry = LDAPLookupUtils.getEntry(getConnection(), domPath
.getFullDN(), LDAPSearchConstraints.DEREF_ALWAYS);
String entityKey = LDAPLookupUtils.getFirstAttributeValue(domEntry,
@@ -216,7 +216,7 @@ public class LDAPLookup
if (objClass.equals("cristalagent"))
referencedPath = new AgentPath(Integer.parseInt(entityKey));
else
- referencedPath = new EntityPath(Integer.parseInt(entityKey));
+ referencedPath = new ItemPath(Integer.parseInt(entityKey));
return referencedPath;
}
@@ -231,7 +231,7 @@ public class LDAPLookup
LDAPEntry newEntry = new LDAPEntry(path.getFullDN(),attrSet);
LDAPLookupUtils.addEntry(getConnection(),newEntry);
if (path instanceof DomainPath)
- EntityProxyManager.sendProxyEvent(new ProxyMessage(ProxyMessage.NA, path.toString(), ProxyMessage.ADDED));
+ ProxyManager.sendProxyEvent(new ProxyMessage(ProxyMessage.NA, path.toString(), ProxyMessage.ADDED));
return newEntry;
} catch (LDAPException ex) {
if (ex.getResultCode() == LDAPException.ENTRY_ALREADY_EXISTS)
@@ -251,7 +251,7 @@ public class LDAPLookup
throw new ObjectCannotBeUpdated(ex.getLDAPErrorMessage(), "");
}
if (path instanceof DomainPath) {
- EntityProxyManager.sendProxyEvent(new ProxyMessage(ProxyMessage.NA, path.toString(), ProxyMessage.DELETED));
+ ProxyManager.sendProxyEvent(new ProxyMessage(ProxyMessage.NA, path.toString(), ProxyMessage.DELETED));
}
}
@@ -393,7 +393,7 @@ public class LDAPLookup
return search(start.getFullDN(), LDAPConnection.SCOPE_SUB, "objectClass=aliasObject", searchCons);
}
- public LDAPPathSet searchAliases(EntityPath entity) {
+ public LDAPPathSet searchAliases(ItemPath entity) {
LDAPSearchConstraints searchCons = new LDAPSearchConstraints();
searchCons.setBatchSize(0);
searchCons.setDereference(LDAPSearchConstraints.DEREF_NEVER);
@@ -431,7 +431,7 @@ public class LDAPLookup
* @throws ObjectNotFoundException
* @throws ObjectNotFoundException
*/
- protected Path nodeToPath(LDAPEntry entry) throws InvalidEntityPathException, ObjectNotFoundException
+ protected Path nodeToPath(LDAPEntry entry) throws InvalidItemPathException, ObjectNotFoundException
{
String dn = entry.getDN();
@@ -470,14 +470,14 @@ public class LDAPLookup
thisPath = domainPath;
}
else if (LDAPLookupUtils.existsAttributeValue(entry,"objectclass","cristalentity") ||
- (LDAPLookupUtils.existsAttributeValue(entry,"objectclass","cristalcontext") && dn.endsWith(EntityPath.mTypeRoot)))
+ (LDAPLookupUtils.existsAttributeValue(entry,"objectclass","cristalcontext") && dn.endsWith(ItemPath.mTypeRoot)))
{
- if(dn.endsWith(EntityPath.mTypeRoot)) {
- EntityPath entityPath;
+ if(dn.endsWith(ItemPath.mTypeRoot)) {
+ ItemPath entityPath;
if (entityKey != -1)
- entityPath = new EntityPath(entityKey);
+ entityPath = new ItemPath(entityKey);
else {
- entityPath = new EntityPath();
+ entityPath = new ItemPath();
entityPath.setDN(dn);
}
thisPath = entityPath;