[lsc-changes] r489 - in lsc/trunk/src/main/java/org/lsc: . jndi service

jclarke at lsc-project.org jclarke at lsc-project.org
Sun Nov 29 22:09:57 CET 2009


Author: jclarke
Date: 2009-11-29 22:09:57 +0100 (Sun, 29 Nov 2009)
New Revision: 489

Modified:
   lsc/trunk/src/main/java/org/lsc/AbstractSynchronize.java
   lsc/trunk/src/main/java/org/lsc/SimpleSynchronize.java
   lsc/trunk/src/main/java/org/lsc/jndi/AbstractSimpleJndiService.java
   lsc/trunk/src/main/java/org/lsc/jndi/IJndiDstService.java
   lsc/trunk/src/main/java/org/lsc/jndi/SimpleJndiSrcService.java
   lsc/trunk/src/main/java/org/lsc/service/AbstractJdbcService.java
   lsc/trunk/src/main/java/org/lsc/service/ISrcService.java
Log:
Replace all occurences of AbstractBean by IBean in synchronization and service classes. References #22.

Modified: lsc/trunk/src/main/java/org/lsc/AbstractSynchronize.java
===================================================================
--- lsc/trunk/src/main/java/org/lsc/AbstractSynchronize.java	2009-11-29 20:42:55 UTC (rev 488)
+++ lsc/trunk/src/main/java/org/lsc/AbstractSynchronize.java	2009-11-29 21:09:57 UTC (rev 489)
@@ -58,10 +58,8 @@
 import org.apache.commons.cli.GnuParser;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.lsc.beans.AbstractBean;
 import org.lsc.beans.BeanComparator;
+import org.lsc.beans.IBean;
 import org.lsc.beans.syncoptions.ForceSyncOptions;
 import org.lsc.beans.syncoptions.ISyncOptions;
 import org.lsc.beans.syncoptions.SyncOptionsFactory;
@@ -73,6 +71,8 @@
 import org.lsc.utils.I18n;
 import org.lsc.utils.JScriptEvaluator;
 import org.lsc.utils.LSCStructuralLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Abstract main class to derive.
@@ -133,7 +133,7 @@
 	 *                the jndi destination service
 	 */
 	protected final void clean2Ldap(final String syncName,
-					final Class<AbstractBean> taskBeanClass,
+					final Class<IBean> taskBeanClass,
 					final ISrcService srcService,
 					final IJndiDstService dstJndiService) {
 
@@ -165,7 +165,7 @@
 		/** Hash table to pass objects into JavaScript condition */
 		Map<String, Object> conditionObjects = null;
 
-		AbstractBean taskBean;
+		IBean taskBean;
 
 		// Loop on all entries in the destination and delete them if they're not found in the source
 		while (ids.hasNext()) {
@@ -203,7 +203,7 @@
 						// If condition is based on dstBean, retrieve the full object from destination
 						if (conditionString.contains("dstBean")) {
 
-							AbstractBean dstBean = dstJndiService.getBean(id);
+							IBean dstBean = dstJndiService.getBean(id);
 							// Log an error if the bean could not be retrieved! This shouldn't happen.
 							if (dstBean == null) {
 								LOGGER.error("Could not retrieve the object {} from the directory!", id.getKey());
@@ -289,7 +289,7 @@
 	protected final void synchronize2Ldap(final String syncName,
 					final ISrcService srcService,
 					final IJndiDstService dstService,
-					final Class<AbstractBean> objectBean,
+					final Class<IBean> objectBean,
 					final Object customLibrary) {
 
 		// Get list of all entries from the source
@@ -316,8 +316,8 @@
 		JndiModifications jm = null;
 		ISyncOptions syncOptions = this.getSyncOptions(syncName);
 		// store method to obtain source bean
-		AbstractBean srcBean = null;
-		AbstractBean dstBean = null;
+		IBean srcBean = null;
+		IBean dstBean = null;
 
 		/** Hash table to pass objects into JavaScript condition */
 		Map<String, Object> conditionObjects = null;

Modified: lsc/trunk/src/main/java/org/lsc/SimpleSynchronize.java
===================================================================
--- lsc/trunk/src/main/java/org/lsc/SimpleSynchronize.java	2009-11-29 20:42:55 UTC (rev 488)
+++ lsc/trunk/src/main/java/org/lsc/SimpleSynchronize.java	2009-11-29 21:09:57 UTC (rev 489)
@@ -52,12 +52,12 @@
 import java.util.StringTokenizer;
 
 import org.apache.commons.lang.ArrayUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.lsc.beans.AbstractBean;
+import org.lsc.beans.IBean;
 import org.lsc.jndi.IJndiDstService;
 import org.lsc.service.ISrcService;
 import org.lsc.utils.LSCStructuralLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Extends AbstractSynchronize to instantiate a simple synchronization engine
@@ -250,7 +250,7 @@
             	srcService = (ISrcService) constrSrcService.newInstance();
             }
 
-            Class<AbstractBean> taskBean = (Class<AbstractBean>) Class.forName(beanClassName);
+            Class<IBean> taskBean = (Class<IBean>) Class.forName(beanClassName);
             // Do the work!
             switch(taskMode) {
                 case clean:

Modified: lsc/trunk/src/main/java/org/lsc/jndi/AbstractSimpleJndiService.java
===================================================================
--- lsc/trunk/src/main/java/org/lsc/jndi/AbstractSimpleJndiService.java	2009-11-29 20:42:55 UTC (rev 488)
+++ lsc/trunk/src/main/java/org/lsc/jndi/AbstractSimpleJndiService.java	2009-11-29 21:09:57 UTC (rev 489)
@@ -62,12 +62,12 @@
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
+import org.lsc.Configuration;
+import org.lsc.LscObject;
+import org.lsc.LscAttributes;
+import org.lsc.beans.IBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.lsc.Configuration;
-import org.lsc.LscAttributes;
-import org.lsc.LscObject;
-import org.lsc.beans.AbstractBean;
 
 /**
  * This class is an abstract generic but configurable implementation to get data
@@ -226,8 +226,8 @@
 	 *             thrown if a directory exception is encountered while
 	 *             switching to the Java POJO
 	 */
-	public final AbstractBean getBeanFromSR(final SearchResult sr,
-			final AbstractBean beanToFill) throws NamingException {
+	public final IBean getBeanFromSR(final SearchResult sr,
+			final IBean beanToFill) throws NamingException {
 
 		if (sr == null)
 			return null;

Modified: lsc/trunk/src/main/java/org/lsc/jndi/IJndiDstService.java
===================================================================
--- lsc/trunk/src/main/java/org/lsc/jndi/IJndiDstService.java	2009-11-29 20:42:55 UTC (rev 488)
+++ lsc/trunk/src/main/java/org/lsc/jndi/IJndiDstService.java	2009-11-29 21:09:57 UTC (rev 489)
@@ -51,7 +51,7 @@
 import javax.naming.NamingException;
 
 import org.lsc.LscAttributes;
-import org.lsc.beans.AbstractBean;
+import org.lsc.beans.IBean;
 
 /**
  * @author rschermesser
@@ -64,11 +64,12 @@
      * @return the object or null if not found
      * @throws NamingException when a directory exception is encountered
      */
-    AbstractBean getBean(final Entry<String, LscAttributes> id) throws NamingException;
+    IBean getBean(final Entry<String, LscAttributes> id) throws NamingException;
 
     /**
      * Returns a list of all the objects identifiers.
      * @return Map of DNs of all entries that are returned by the directory with an associated map of attribute names and values (never null)
+     * @throws NamingException 
      */
     Map<String, LscAttributes> getListPivots() throws NamingException;
     

Modified: lsc/trunk/src/main/java/org/lsc/jndi/SimpleJndiSrcService.java
===================================================================
--- lsc/trunk/src/main/java/org/lsc/jndi/SimpleJndiSrcService.java	2009-11-29 20:42:55 UTC (rev 488)
+++ lsc/trunk/src/main/java/org/lsc/jndi/SimpleJndiSrcService.java	2009-11-29 21:09:57 UTC (rev 489)
@@ -53,7 +53,7 @@
 import javax.naming.directory.SearchControls;
 
 import org.lsc.LscAttributes;
-import org.lsc.beans.AbstractBean;
+import org.lsc.beans.IBean;
 import org.lsc.service.ISrcService;
 
 
@@ -89,7 +89,7 @@
 	 * @throws NamingException thrown if an directory exception is encountered
 	 *         while getting the identified bean
 	 */
-	public final AbstractBean getBean(AbstractBean bean, final Entry<String, LscAttributes> ids) throws NamingException {
+	public final IBean getBean(IBean bean, final Entry<String, LscAttributes> ids) throws NamingException {
 		return this.getBeanFromSR(get(ids), bean);
 	}
 

Modified: lsc/trunk/src/main/java/org/lsc/service/AbstractJdbcService.java
===================================================================
--- lsc/trunk/src/main/java/org/lsc/service/AbstractJdbcService.java	2009-11-29 20:42:55 UTC (rev 488)
+++ lsc/trunk/src/main/java/org/lsc/service/AbstractJdbcService.java	2009-11-29 21:09:57 UTC (rev 489)
@@ -57,11 +57,11 @@
 
 import org.apache.commons.collections.map.ListOrderedMap;
 import org.apache.commons.lang.StringUtils;
+import org.lsc.LscAttributes;
+import org.lsc.beans.IBean;
+import org.lsc.persistence.DaoConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.lsc.LscAttributes;
-import org.lsc.beans.AbstractBean;
-import org.lsc.persistence.DaoConfig;
 
 import com.ibatis.sqlmap.client.SqlMapClient;
 
@@ -90,12 +90,12 @@
 		this.cb = cb;
 	}
 
-	public AbstractBean getBean(AbstractBean nonUsed, Entry<String, LscAttributes> ids) throws NamingException {
+	public IBean getBean(IBean nonUsed, Entry<String, LscAttributes> ids) throws NamingException {
 		String id = ids.getKey();
 		Map<String, Object> attributeMap = ids.getValue().getAttributes();
 		try {
 			Object o = sqlMapper.queryForObject(getRequestNameForObject(), attributeMap);
-			return (AbstractBean) o;
+			return (IBean) o;
 		} catch (SQLException e) {
 			LOGGER.warn("Error while looking for a specific entry with id={} ({})", id, e);
 			LOGGER.debug(e.toString(), e);

Modified: lsc/trunk/src/main/java/org/lsc/service/ISrcService.java
===================================================================
--- lsc/trunk/src/main/java/org/lsc/service/ISrcService.java	2009-11-29 20:42:55 UTC (rev 488)
+++ lsc/trunk/src/main/java/org/lsc/service/ISrcService.java	2009-11-29 21:09:57 UTC (rev 489)
@@ -51,7 +51,7 @@
 import javax.naming.NamingException;
 
 import org.lsc.LscAttributes;
-import org.lsc.beans.AbstractBean;
+import org.lsc.beans.IBean;
 
 /**
  * Interface used by source services.
@@ -69,19 +69,20 @@
 public interface ISrcService {
     /**
      * The simple object getter according to its identifier.
-     * @param bean Base object to fill
+     * @param taskBean Base object to fill
      * @param obj
      * 		The data identifier in the source such as returned by getListPivots().
      * 		It must identify a unique entry in the source.
      * @return The bean, or null if not found
-     * @throws May throw a NamingException if the object is not found in the directory,
+     * @throws NamingException May throw a NamingException if the object is not found in the directory,
      * 			or if more than one object would be returned.
      */
-    AbstractBean getBean(AbstractBean bean, Entry<String, LscAttributes> obj) throws NamingException;
+    IBean getBean(IBean taskBean, Entry<String, LscAttributes> obj) throws NamingException;
 
     /**
      * Returns a list of all the objects' identifiers.
      * @return Map of DNs of all entries that are returned by the directory with an associated map of attribute names and values (never null)
+     * @throws NamingException 
      */
     Map<String, LscAttributes> getListPivots() throws NamingException;
 }



More information about the lsc-changes mailing list