cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jer...@apache.org
Subject svn commit: r450069 - in /cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming: EntryManager.java LDAPEntryManager.java
Date Tue, 26 Sep 2006 14:55:23 GMT
Author: jeremy
Date: Tue Sep 26 07:55:22 2006
New Revision: 450069

URL: http://svn.apache.org/viewvc?view=rev&rev=450069
Log:
adding remove method, to allow sub-context deletion, many thanks to Ross McDonald for the
contribution

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/EntryManager.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/LDAPEntryManager.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/EntryManager.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/EntryManager.java?view=diff&rev=450069&r1=450068&r2=450069
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/EntryManager.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/EntryManager.java
Tue Sep 26 07:55:22 2006
@@ -45,6 +45,8 @@
 	public Map find(String context, Map match_attributes) throws ProcessingException;
 	
 	public void modify(String entry_name, int mod_operand, Map mod_attributes) throws ProcessingException;
+
+	public void remove(String entry_name) throws ProcessingException;
 	
 }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/LDAPEntryManager.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/LDAPEntryManager.java?view=diff&rev=450069&r1=450068&r2=450069
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/LDAPEntryManager.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/java/org/apache/cocoon/components/naming/LDAPEntryManager.java
Tue Sep 26 07:55:22 2006
@@ -50,7 +50,7 @@
  *   Example configuration (goes in cocoon.xconf)
  *   <pre><tt>
  *	&lt;component role="org.apache.cocoon.component.EntryManager" class="org.apache.cocoon.components.naming.LDAPEntryManager"
logger="flow.ldap"&gt;
- *	  &lt;parameter name="ldap-host" value="hostname:port"/&gt;
+ *	  &lt;parameter name="ldap-host" value="ldap://hostname:port"/&gt;
  *	  &lt;parameter name="ldap-base" value="dc=example,dc=com"/&gt;
  *	  &lt;parameter name="ldap-user" value="username"/&gt;
  *	  &lt;parameter name="ldap-pass" value="password"/&gt;
@@ -257,6 +257,24 @@
 			context.modifyAttributes (name, mod_op, map2Attributes (attributes));
 		} catch (Exception e) {
 			getLogger ().error ("LDAPEntryManager.modify() :" + e.getMessage());
+			throw new ProcessingException (e);
+		}
+	}
+
+	/**
+	 *	Deletes an Entry
+	 *
+	 * 	@param  name  The name of the Entry to delete
+	 */
+	public void remove(String name) throws ProcessingException {
+		try {
+			if (this.context == null) initialize ();
+			if (getLogger ().isDebugEnabled ()) {
+				getLogger ().debug ("LDAPEntryManager destorying Context: " + name);
+			}
+			context.destroySubcontext (name);
+		} catch (Exception e) {
+			getLogger ().error ("LDAPEntryManager.deleteSubcontext() :" + e.getStackTrace().toString());
 			throw new ProcessingException (e);
 		}
 	}



Mime
View raw message