From d6cfc7505be13b3b09adf423206cf75d9f806c12 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Mon, 18 Feb 2013 15:01:46 +0100 Subject: Initial Interface creation. Some compilation problems remain. --- src/main/java/com/c2kernel/lookup/LDAPLookup.java | 39 +++++++++++++++-------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'src/main/java/com/c2kernel/lookup/LDAPLookup.java') diff --git a/src/main/java/com/c2kernel/lookup/LDAPLookup.java b/src/main/java/com/c2kernel/lookup/LDAPLookup.java index d581dfd..ab5992c 100644 --- a/src/main/java/com/c2kernel/lookup/LDAPLookup.java +++ b/src/main/java/com/c2kernel/lookup/LDAPLookup.java @@ -37,7 +37,7 @@ import com.novell.ldap.LDAPSearchResults; * @author $Author: abranson $ */ -public class LDAPLookup +public class LDAPLookup implements Lookup { private LDAPConnection mLDAPConn; @@ -111,7 +111,8 @@ public class LDAPLookup * Gets the entity key generator, used to get a unique system key for new entities. * @return the global NextKeyManager */ - public NextKeyManager getNextKeyManager() + @Override + public NextKeyManager getNextKeyManager() { return mNextKeyManager; } @@ -127,7 +128,8 @@ public class LDAPLookup * Gets the role manager, that is used to add and remove roles and agents. * @return Returns the mRoleManager. */ - public LDAPRoleManager getRoleManager() { + @Override + public LDAPRoleManager getRoleManager() { return mRoleManager; } @@ -149,7 +151,8 @@ public class LDAPLookup /** * Disconnects the connection with the LDAP server during shutdown */ - public void disconnect() { + @Override + public void disconnect() { Logger.msg(1, "LDAP Lookup: Shutting down LDAP connection."); if (mLDAPConn != null) { try { @@ -167,7 +170,8 @@ public class LDAPLookup * @return the CORBA object * @throws ObjectNotFoundException When the path does not exist */ - public org.omg.CORBA.Object getIOR(Path path) + @Override + public org.omg.CORBA.Object resolve(Path path) throws ObjectNotFoundException { return resolveObject(path.getFullDN()); @@ -208,7 +212,8 @@ public class LDAPLookup * @throws InvalidEntityPathException * @throws ObjectNotFoundException */ - protected EntityPath resolvePath(DomainPath domPath) + @Override + public EntityPath resolvePath(DomainPath domPath) throws InvalidEntityPathException, ObjectNotFoundException { EntityPath referencedPath = null; LDAPEntry domEntry = LDAPLookupUtils.getEntry(getConnection(), domPath @@ -228,7 +233,8 @@ public class LDAPLookup } - public LDAPEntry add(Path path) + @Override + public void add(Path path) throws ObjectCannotBeUpdated, ObjectAlreadyExistsException { try { @@ -238,7 +244,6 @@ public class LDAPLookup LDAPLookupUtils.addEntry(getConnection(),newEntry); if (path instanceof DomainPath) EntityProxyManager.sendProxyEvent(new ProxyMessage(ProxyMessage.NA, path.toString(), ProxyMessage.ADDED)); - return newEntry; } catch (LDAPException ex) { if (ex.getResultCode() == LDAPException.ENTRY_ALREADY_EXISTS) throw new ObjectAlreadyExistsException(ex.getLDAPErrorMessage(), ""); @@ -249,7 +254,8 @@ public class LDAPLookup //deletes a node //throws LDAPexception if node cannot be deleted (eg node is not a leaf) - public void delete(Path path) throws ObjectCannotBeUpdated + @Override + public void delete(Path path) throws ObjectCannotBeUpdated { try { LDAPLookupUtils.delete(getConnection(),path.getDN()+Path.mLocalPath); @@ -302,7 +308,8 @@ public class LDAPLookup LDAPLookupUtils.createCristalContext(getConnection(), Path.mLocalPath); } - public void install() throws ObjectNotFoundException + @Override + public void install() throws ObjectNotFoundException { createBootTree(); initTree( Resource.getTextResource(null, "boot/LDAPboot.txt")); @@ -322,7 +329,8 @@ public class LDAPLookup } //typically search for cn=barcode - public LDAPPathSet search(Path start, String filter) + @Override + public LDAPPathSet search(Path start, String filter) { Logger.msg(8,"LDAPLookup::search() From " + start.getDN() + " for cn=" + filter ); return search(start.getFullDN(),"cn="+LDAPLookupUtils.escapeSearchFilter(filter)); @@ -364,7 +372,8 @@ public class LDAPLookup return search(startDN,LDAPConnection.SCOPE_SUB,filter,searchCons); } - public LDAPPathSet searchEntities(Path start) { + @Override + public LDAPPathSet searchEntities(Path start) { LDAPSearchConstraints searchCons = new LDAPSearchConstraints(); searchCons.setBatchSize(0); searchCons.setDereference(LDAPSearchConstraints.DEREF_SEARCHING); @@ -378,11 +387,13 @@ public class LDAPLookup return search(start.getFullDN(), LDAPConnection.SCOPE_SUB, "objectClass=aliasObject", searchCons); } - public boolean exists(Path path) { + @Override + public boolean exists(Path path) { return LDAPLookupUtils.exists(getConnection(), path.getFullDN()); } - public Class getEntityClass(Path path) throws ObjectNotFoundException { + @Override + public Class getEntityClass(Path path) throws ObjectNotFoundException { String[] attr = { LDAPConnection.ALL_USER_ATTRS }; try { LDAPEntry anEntry=getConnection().read(path.getDN()+Path.mLocalPath,attr); -- cgit v1.2.3