diff --git a/hideauto.sh b/hideauto.sh deleted file mode 100755 index bc6b18d0..00000000 --- a/hideauto.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -subdir=src/main/java/org/lsc/configuration - -find $subdir -name '*.java' | xargs grep -l -e '\(Généré le\)\|\(Generated on\)' | { - while read file; do git rm --cached $file ; done -} - -pushd $subdir -{ - echo "# ignore autogenerated java files" - find -name '*.java' | xargs grep -l -e '\(Généré le\)\|\(Generated on\)' | sed 's/^\.\/\(.*\)$/\/\1/' -} > .gitignore - - -popd diff --git a/pom.xml b/pom.xml index fdc5fa16..cff4f867 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,6 @@ ${project.build.directory}/staging 1.5 22.3.1 - 2.12.7.1 ${project.build.directory}/compiler @@ -256,10 +255,9 @@ ${project.build.directory}/${project.build.finalName}-dist/lsc-${project.version} - src/install/install.xml + ${project.basedir}/src/install/install.xml true ${project.artifactId}-${project.version}-installer.jar - false true @@ -309,11 +307,11 @@ true - ${basedir}/lsc.episode - src/main/java org.lsc.configuration src/main/resources/schemas - lsc-core-2.2.xjc + + lsc-core-2.2.xjc + src/main/resources/schemas lsc-core-2.2.xsd @@ -696,7 +694,7 @@ commons-io commons-io - 2.11.0 + 2.16.1 jar false @@ -710,7 +708,7 @@ commons-logging commons-logging - 1.2 + 1.3.4 com.thoughtworks.xstream @@ -722,7 +720,7 @@ org.slf4j slf4j-api - 2.0.9 + 2.0.16 jar false @@ -750,7 +748,7 @@ org.mozilla rhino - 1.7.14 + 1.7.15 jar false @@ -762,21 +760,21 @@ org.bouncycastle bcprov-jdk18on - 1.75 + 1.78.1 jar false commons-cli commons-cli - 1.5.0 + 1.9.0 jar false - org.samba.jcifs + jcifs jcifs - 1.3.3 + 1.3.17 jar false @@ -802,7 +800,7 @@ junit junit - 4.13.1 + 4.13.2 jar false @@ -814,7 +812,7 @@ com.google.guava guava - 32.0.0-jre + 33.3.0-jre javax.transaction @@ -830,19 +828,19 @@ jaxb 2.3.6 with maven-jaxb2-plugin 0.15.1 --> - javax.xml.bind - jaxb-api - 2.3.1 + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.3 org.glassfish.jaxb jaxb-core - 2.3.0.1 + 3.0.0 com.sun.xml.bind jaxb-impl - 2.3.6 + 4.0.5 net.java.xadisk @@ -850,9 +848,9 @@ 1.2.2 - javax.resource - connector-api - 1.5 + jakarta.resource + jakarta.resource-api + 2.1.0 org.codehaus.btm @@ -860,24 +858,25 @@ 2.1.4 - org.codehaus.groovy + org.apache.groovy groovy-all - 2.4.21 + 4.0.22 + pom org.apache.directory.api api-all - 2.1.3 + 2.1.7 xml-apis xml-apis - 1.4.01 + 2.0.2 com.fasterxml.jackson.core jackson-databind - ${jackson.version} + 2.17.2 diff --git a/src/install/check_lsc.sh b/src/install/check_lsc.sh deleted file mode 100755 index 7de8a9a7..00000000 --- a/src/install/check_lsc.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash - -#========================================================================== -# Summary -#========================================================================== -# Log file analyzer for LSC for Nagios -# -# This can read LSC logs to detect time since last succesful execution. -# An alert will be thrown if either of these durations exceeds a limit. -# -# -# Copyright (c) 2009 - 2011 LSC Project -# Copyright (C) 2008 Jonathan Clarke -# Copyright (C) 2008 LINAGORA -# -#========================================================================== -# Original license: GPLv2, -#========================================================================== -# Contributed by jclarke@linagora.com under LSC original BSD license -#========================================================================== - -#========================================================================== -# Changelog -#========================================================================== -# Version 1.0 (2008/02/28): -# - First version -# Author: Jonathan Clarke -#========================================================================== - -# -# Usage: ./check_lsc -F -w -c -# - -# Pattern to match in log file -SUCCESS_PATTERN="Starting LSC" - -# Paths to commands used in this script. These -# may have to be modified to match your system setup. - -PROGNAME=`basename $0` -PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision: 1.0 $' | sed -e 's/[^0-9.]//g'` - -. $PROGPATH/utils.sh - -print_usage() { - echo "Usage: $PROGNAME -F logfile -w warnlevel -c criticallevel" - echo "Usage: $PROGNAME --help" - echo "Usage: $PROGNAME --version" -} - -print_help() { - print_revision $PROGNAME $REVISION - echo "" - print_usage - echo "" - echo "Log file analyzer for LSC for Nagios" - echo "" - support -} - -# Make sure the correct number of command line -# arguments have been supplied - -if [ $# -lt 6 ]; then - print_usage - exit $STATE_UNKNOWN -fi - -# Grab the command line arguments - -exitstatus=$STATE_UNKNOWN #default -while test -n "$1"; do - case "$1" in - --help) - print_help - exit $STATE_OK - ;; - -h) - print_help - exit $STATE_OK - ;; - --version) - print_revision $PROGNAME $REVISION - exit $STATE_OK - ;; - -V) - print_revision $PROGNAME $REVISION - exit $STATE_OK - ;; - --filename) - logfile=$2 - shift - ;; - -F) - logfile=$2 - shift - ;; - -w) - warnlevel=$2 - shift - ;; - -c) - criticallevel=$2 - shift - ;; - *) - echo "Unknown argument: $1" - print_usage - exit $STATE_UNKNOWN - ;; - esac - shift -done - -# If the log file doesn't exist, exit - -if [ ! -e $logfile ]; then - echo "Log check error: Log file $logfile does not exist!\n" - exit $STATE_UNKNOWN -elif [ ! -r $logfile ] ; then - echo "Log check error: Log file $logfile is not readable!\n" - exit $STATE_UNKNOWN -fi - -# Get the last matching entry in the diff file -lastentry=`grep "$SUCCESS_PATTERN" $logfile | tail -1` - -timeLastEntry=`echo $lastentry | sed 's/\([0-9]\{4\}\/[0-9]\{2\}\/[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}\).*/\1/'` -timestampLastEntry=`date -d "$timeLastEntry" +%s` -timestampNow=`date +%s` -age=$(( ($timestampNow - $timestampLastEntry) / 60)) - -if [[ $age -lt $warnlevel ]]; then # recent execution, exit with no error - echo "OK: Last successful execution $age minutes ago" - exitstatus=$STATE_OK -elif [[ $age -ge $warnlevel && $age -lt $criticallevel ]]; then - echo "WARN: Last successful execution $age minutes ago" - exitstatus=$STATE_WARNING -elif [[ $age -ge $criticallevel ]]; then - echo "CRITICAL: Last successful execution $age minutes ago" - exitstatus=$STATE_CRITICAL -fi - -exit $exitstatus diff --git a/src/install/check_lsc_status_file.pl b/src/install/check_lsc_status_file.pl index 5c64b42e..7c6a50cd 100755 --- a/src/install/check_lsc_status_file.pl +++ b/src/install/check_lsc_status_file.pl @@ -205,9 +205,9 @@ sub check_critical_param { } # Get statistics -my ( $all, $modify, $modified, $errors ) = +my ( $taskname, $taskmode, $all, $modify, $modified, $errors ) = ( $last =~ -/All entries: (\d+), to modify entries: (\d+), (?:successfully )?modified entries: (\d+), errors: (\d+)/mi +/(\w+) - (\w+) - All entries: (\d+), to modify entries: (\d+), (?:successfully )?modified entries: (\d+), errors: (\d+)/mi ); #========================================================================== @@ -224,17 +224,17 @@ sub check_critical_param { # Test the errors and exit if ( $errors == 0 or $errors < $warning ) { print -"OK - LSC is running with $errors errors (W:$warning - C:$critical)$perfparse\n"; +"OK - LSC task $taskname in mode $taskmode is running with $errors errors (W:$warning - C:$critical)$perfparse\n"; exit $ERRORS{'OK'}; } elsif ( $errors >= $warning and $errors < $critical ) { print -"WARNING - LSC is running with $errors errors (W:$warning - C:$critical)$perfparse\n"; +"WARNING - LSC task $taskname in mode $taskmode is running with $errors errors (W:$warning - C:$critical)$perfparse\n"; exit $ERRORS{'WARNING'}; } else { print -"CRITICAL - LSC is running with $errors errors (W:$warning - C:$critical)$perfparse\n"; +"CRITICAL - LSC task $taskname in mode $taskmode is running with $errors errors (W:$warning - C:$critical)$perfparse\n"; exit $ERRORS{'CRITICAL'}; } diff --git a/src/main/java/org/lsc/AbstractSynchronize.java b/src/main/java/org/lsc/AbstractSynchronize.java index 9fac88ff..d8dd0517 100644 --- a/src/main/java/org/lsc/AbstractSynchronize.java +++ b/src/main/java/org/lsc/AbstractSynchronize.java @@ -45,8 +45,6 @@ */ package org.lsc; -import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -54,23 +52,16 @@ import java.util.Set; import java.util.concurrent.TimeUnit; -import javax.naming.CommunicationException; - import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Options; -import org.lsc.LscDatasetModification.LscDatasetModificationType; -import org.lsc.beans.BeanComparator; import org.lsc.beans.IBean; import org.lsc.beans.InfoCounter; -import org.lsc.beans.syncoptions.ISyncOptions; import org.lsc.configuration.LscConfiguration; -import org.lsc.configuration.PivotTransformationType.Transformation; -import org.lsc.exception.LscServiceCommunicationException; +import org.lsc.configuration.PivotTransformationType; import org.lsc.exception.LscServiceException; import org.lsc.runnable.AsynchronousRunner; import org.lsc.runnable.CleanEntryRunner; import org.lsc.runnable.SynchronizeEntryRunner; -import org.lsc.service.IAsynchronousService; import org.lsc.service.IService; import org.lsc.utils.LSCStructuralLogger; import org.lsc.utils.ScriptingEvaluator; @@ -192,7 +183,7 @@ protected final boolean clean2Ldap(Task task) { LOGGER.info("If you want to avoid this message, " + "increase the time limit by using dedicated parameter."); } - logStatus(counter); + logStatus(task.getName(), Task.Mode.clean.toString(), counter); return counter.getCountError() == 0; } @@ -240,7 +231,7 @@ protected final boolean synchronize2Ldap(final Task task) { LOGGER.info("If you want to avoid this message, " + "increase the time limit by using dedicated parameter."); } - logStatus(counter); + logStatus(task.getName(), Task.Mode.sync.toString(), counter); return counter.getCountError() == 0; } @@ -307,7 +298,7 @@ public final String getTaskFullStatus(final String syncName) { if(asyncThread != null && asyncThread.isAlive()) { AsynchronousRunner asyncRunner = mapSTasks.get(syncName); InfoCounter counter = asyncRunner.getCounter(); - return getLogStatus(counter); + return getLogStatus(syncName, Task.Mode.async.toString(), counter); } else { return null; } @@ -320,8 +311,8 @@ public final String getTaskFullStatus(final String syncName) { /** * Log all effective action. * - * @param jm List of modification to do on the Ldap server - * @param identifier object identifier + * @param lm List of modification to do on the Ldap server + * @param data object identifier * @param except synchronization process name */ public final void logActionError(final LscModifications lm, @@ -340,7 +331,7 @@ public final void logActionError(final LscModifications lm, /** * Log all effective action. * - * @param jm List of modification to do on the Ldap server + * @param lm List of modification to do on the Ldap server * @param id object identifier * @param syncName synchronization process name */ @@ -372,9 +363,8 @@ public final void logAction(final LscModifications lm, } /** - * @param jm - * @param id - * @param syncName + * @param lm List of modification to do on the Ldap server + * @param syncName synchronization process name */ public final void logShouldAction(final LscModifications lm, final String syncName) { switch (lm.getOperation()) { @@ -402,8 +392,8 @@ public final void logShouldAction(final LscModifications lm, final String syncNa LSCStructuralLogger.DESTINATION.debug("", lm); } - protected void logStatus(InfoCounter counter) { - String totalsLogMessage = getLogStatus(counter); + protected void logStatus(String taskName, String taskMode, InfoCounter counter) { + String totalsLogMessage = getLogStatus(taskName, taskMode, counter); if (counter.getCountError() > 0) { LOGGER.error(totalsLogMessage); } else { @@ -411,21 +401,23 @@ protected void logStatus(InfoCounter counter) { } } - protected String getLogStatus(InfoCounter counter) { + protected String getLogStatus(String taskName, String taskMode, InfoCounter counter) { + String totalsLogMessage = - "All entries: "+ counter.getCountAll() + - ", to modify entries: "+ counter.getCountModifiable() + - ", successfully modified entries: "+counter.getCountCompleted()+ - ", errors: "+counter.getCountError(); + taskName + " - " + taskMode + + " - All entries: "+ counter.getCountAll() + + ", to modify entries: "+ counter.getCountModifiable() + + ", successfully modified entries: "+counter.getCountCompleted()+ + ", errors: "+counter.getCountError(); return totalsLogMessage; } public IBean getBean(Task task, IService service, String pivotName, LscDatasets pivotAttributes, boolean fromSameService, boolean fromSource) throws LscServiceException { - List transformations = LscConfiguration.getPivotTransformation(task.getTaskType()); + List transformations = LscConfiguration.getPivotTransformation(task.getTaskType()); if (! fromSameService && transformations != null) { LscDatasets newPivots = new LscDatasets(pivotAttributes.getDatasets()); for (Entry pivot: pivotAttributes.getDatasets().entrySet()) { - for (Transformation transformation: transformations) { + for (PivotTransformationType.Transformation transformation: transformations) { if (pivot.getKey().equalsIgnoreCase(transformation.getFromAttribute()) && LscConfiguration.pivotOriginMatchesFromSource(transformation.getPivotOrigin(), fromSource)) { newPivots.put(transformation.getToAttribute(), transform(task, transformation, pivot.getValue())); } @@ -436,7 +428,7 @@ public IBean getBean(Task task, IService service, String pivotName, LscDatasets return service.getBean(pivotName, pivotAttributes, fromSameService); } - protected Object transform(Task task, Transformation transformation, Object value) throws LscServiceException{ + protected Object transform(Task task, PivotTransformationType.Transformation transformation, Object value) throws LscServiceException{ Map javaScriptObjects = new HashMap(); javaScriptObjects.put("value", value); if (task.getCustomLibraries() != null) { diff --git a/src/main/java/org/lsc/Hooks.java b/src/main/java/org/lsc/Hooks.java index f8aa0a36..ab4f4b61 100644 --- a/src/main/java/org/lsc/Hooks.java +++ b/src/main/java/org/lsc/Hooks.java @@ -41,6 +41,7 @@ */ package org.lsc; +import org.slf4j.event.Level; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.ProcessBuilder; @@ -125,13 +126,15 @@ public final static void callHook( LscModificationType operationType, operationType.getDescription(), hook, outputFormat.toString(), - identifier); + identifier, + Level.INFO); printHookOutput(p.getErrorStream(), "stderr", operationType.getDescription(), hook, outputFormat.toString(), - identifier); + identifier, + Level.ERROR); } catch(IOException e) { LOGGER.error("Error while calling {} posthook {} with format {} for {}", @@ -162,18 +165,20 @@ public final static String getJsonModifications(final LscModifications lm) { private static void printHookOutput( final InputStream src, String output, String operation, String hook, - String outputFormat, String identifier) { + String outputFormat, String identifier, + Level level) { new Thread(new Runnable() { public void run() { Scanner sc = new Scanner(src); while (sc.hasNextLine()) { - LOGGER.warn("Hook {} with format {} for identifier {} and operation {} returned {}: {}", - hook, - outputFormat, - identifier, - operation, - output, - sc.nextLine()); + LOGGER.atLevel(level).log( + "Hook {} with format {} for identifier {} and operation {} returned on {}: {}", + hook, + outputFormat, + identifier, + operation, + output, + sc.nextLine()); } } }).start(); diff --git a/src/main/java/org/lsc/beans/BeanComparator.java b/src/main/java/org/lsc/beans/BeanComparator.java index 632f3655..dea42ecf 100644 --- a/src/main/java/org/lsc/beans/BeanComparator.java +++ b/src/main/java/org/lsc/beans/BeanComparator.java @@ -66,7 +66,6 @@ import org.lsc.LscModificationType; import org.lsc.LscModifications; import org.lsc.Task; -import org.lsc.beans.syncoptions.ISyncOptions; import org.lsc.configuration.LscConfiguration; import org.lsc.configuration.PolicyType; import org.lsc.exception.LscServiceException; @@ -442,9 +441,6 @@ private static LscDatasetModificationType getRequiredOperationForAttribute ( * attributes, and all force valued/default valued/create valued attributes. *

* - * @param syncOptions - * Instance of {@link ISyncOptions} to provide transformation - * configuration * @param srcBean * The original bean read from the source * @return Set of attribute names to be updated @@ -592,9 +588,6 @@ private static IBean cloneSrcBean(Task task, IBean srcBean, IBean dstBean) throw * @param srcAttrValues * {@link Set} All values of the considered attribute * read from the source. - * @param syncOptions - * {@link ISyncOptions} Object to read syncoptions from - * configuration. * @param javaScriptObjects * {@link Map} Object map to pass objects into * JavaScript environment. diff --git a/src/main/java/org/lsc/beans/syncoptions/PropertiesBasedSyncOptions.java b/src/main/java/org/lsc/beans/syncoptions/PropertiesBasedSyncOptions.java index f482bea6..233f5b14 100644 --- a/src/main/java/org/lsc/beans/syncoptions/PropertiesBasedSyncOptions.java +++ b/src/main/java/org/lsc/beans/syncoptions/PropertiesBasedSyncOptions.java @@ -52,12 +52,7 @@ import java.util.Optional; import org.lsc.LscModificationType; -import org.lsc.configuration.DatasetType; -import org.lsc.configuration.LscConfiguration; -import org.lsc.configuration.PolicyType; -import org.lsc.configuration.PropertiesBasedSyncOptionsType; -import org.lsc.configuration.TaskType; -import org.lsc.configuration.ValuesType; +import org.lsc.configuration.*; /** * Synchronization options based on a properties file diff --git a/src/main/java/org/lsc/configuration/.gitignore b/src/main/java/org/lsc/configuration/.gitignore deleted file mode 100644 index 01609eda..00000000 --- a/src/main/java/org/lsc/configuration/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# ignore autogenerated java files - -# Ignore all java files... -*.java - -# But these three files -!/JaxbXmlConfigurationHelper.java -!/LscConfiguration.java -!/XsdForLscComparator.java diff --git a/src/main/java/org/lsc/configuration/LscConfiguration.java b/src/main/java/org/lsc/configuration/LscConfiguration.java index 6bfcca29..41aba54a 100644 --- a/src/main/java/org/lsc/configuration/LscConfiguration.java +++ b/src/main/java/org/lsc/configuration/LscConfiguration.java @@ -57,7 +57,6 @@ import org.lsc.beans.syncoptions.ForceSyncOptions; import org.lsc.beans.syncoptions.PropertiesBasedSyncOptions; -import org.lsc.configuration.PivotTransformationType.Transformation; import org.lsc.exception.LscConfigurationException; import org.lsc.exception.LscException; import org.lsc.jndi.PullableJndiSrcService; @@ -534,7 +533,7 @@ public static boolean isLdapBinaryAttribute(String attributeName) { return false; } - public static List getPivotTransformation(TaskType task) { + public static List getPivotTransformation(TaskType task) { SyncOptionsType syncOptions = LscConfiguration.getSyncOptions(task); if (! LscConfiguration.getSyncOptionsImplementation(syncOptions).equals(PropertiesBasedSyncOptions.class)) { return null; diff --git a/src/main/java/org/lsc/jndi/AbstractSimpleJndiService.java b/src/main/java/org/lsc/jndi/AbstractSimpleJndiService.java index 72a11c3a..a7d64c43 100644 --- a/src/main/java/org/lsc/jndi/AbstractSimpleJndiService.java +++ b/src/main/java/org/lsc/jndi/AbstractSimpleJndiService.java @@ -175,7 +175,7 @@ public AbstractSimpleJndiService(final LdapServiceType ldapService) throws LscSe for (String attr: ldapService.getFetchedAttributes().getString()) { attrs.add(attr); } - jndiServices = JndiServices.getInstance((LdapConnectionType)ldapService.getConnection().getReference()); + jndiServices = JndiServices.getInstance((LdapConnectionType) ldapService.getConnection().getReference()); if(!baseDn.endsWith(jndiServices.getContextDn())) { LOGGER.warn("Your baseDn settings (" + baseDn + ") does not end with the LDAP naming context (" + jndiServices.getContextDn() + "). This is probably an error ! For LSC 1.X users, this is part of the changelog to 2.X."); } @@ -327,7 +327,7 @@ public final String getFilterId() { /** - * @see org.lsc.service.IService.getSupportedConnectionType() + * @see org.lsc.service.IService#getSupportedConnectionType() */ public Collection> getSupportedConnectionType() { Collection> list = new ArrayList>(); diff --git a/src/main/java/org/lsc/jndi/JndiServices.java b/src/main/java/org/lsc/jndi/JndiServices.java index 1b65c962..3a1fb896 100644 --- a/src/main/java/org/lsc/jndi/JndiServices.java +++ b/src/main/java/org/lsc/jndi/JndiServices.java @@ -102,11 +102,7 @@ import org.apache.directory.api.ldap.model.url.LdapUrl; import org.lsc.Configuration; import org.lsc.LscDatasets; -import org.lsc.configuration.LdapAuthenticationType; -import org.lsc.configuration.LdapConnectionType; -import org.lsc.configuration.LdapDerefAliasesType; -import org.lsc.configuration.LdapReferralType; -import org.lsc.configuration.LdapVersionType; +import org.lsc.configuration.*; import org.lsc.exception.LscConfigurationException; import org.lsc.exception.LscServiceException; import org.slf4j.Logger; @@ -1080,10 +1076,10 @@ public Map getAttrsList(final String base, /** * Retrieve a specific attribute from an object * - * @param objectDn - * @param attribute - * @return - * @throws LscServiceException + * @param objectDn Distinguished Name of object attributes + * @param attribute Attributes returned by query + * @return List of objects returned from Source + * @throws LscServiceException Thrown when LSC fails to general issues */ public List getAttributeValues(String objectDn, String attribute) throws LscServiceException { List values = null; @@ -1262,7 +1258,7 @@ public LdapContext getContext() throws NamingException { * Get the initial JNDI context or get a derived context to be able to use controls without * impacting or being impacted by other threads sharing a same context * @param forUpdates if this derived context is for updates - * @return + * @return {@link LdapContext} object for LDAPv3 connection * @throws NamingException */ public LdapContext getContext(boolean forUpdates) throws NamingException { diff --git a/src/main/java/org/lsc/jndi/ScriptableJndiServices.java b/src/main/java/org/lsc/jndi/ScriptableJndiServices.java index 4bd0cdcb..c43e15ad 100644 --- a/src/main/java/org/lsc/jndi/ScriptableJndiServices.java +++ b/src/main/java/org/lsc/jndi/ScriptableJndiServices.java @@ -135,7 +135,7 @@ protected final List _list(final String base, final String filter) throw * * @param base The base DN to search from. * @param filter The LDAP filter to use. - * @attribute attribute The attribute to search. + * @param attribute The attribute to search. * @return List List of attributes values returned by the search. * @throws NamingException */ @@ -150,7 +150,7 @@ public final List searchAttribute(final Object base, final Object filter * * @param base The base DN to search from. * @param filter The LDAP filter to use. - * @attribute attribute The attribute to search. + * @param attribute The attribute to search. * @return List List of attributes values returned by the search. * @throws NamingException */ diff --git a/src/main/java/org/lsc/service/AbstractJdbcService.java b/src/main/java/org/lsc/service/AbstractJdbcService.java index a2603da8..9ff1c00e 100644 --- a/src/main/java/org/lsc/service/AbstractJdbcService.java +++ b/src/main/java/org/lsc/service/AbstractJdbcService.java @@ -294,7 +294,7 @@ public static String getValue(Object value) { /** - * @see org.lsc.service.IService.getSupportedConnectionType() + * @see org.lsc.service.IService#getSupportedConnectionType() */ public Collection> getSupportedConnectionType() { Collection> list = new ArrayList>(); diff --git a/src/main/java/org/lsc/service/MultipleDstService.java b/src/main/java/org/lsc/service/MultipleDstService.java index 80838073..d9771a04 100644 --- a/src/main/java/org/lsc/service/MultipleDstService.java +++ b/src/main/java/org/lsc/service/MultipleDstService.java @@ -169,7 +169,7 @@ public List getWriteDatasetIds() { } /** - * @see org.lsc.service.IService.getSupportedConnectionType() + * @see org.lsc.service.IService#getSupportedConnectionType() */ public Collection> getSupportedConnectionType() { Collection> list = new ArrayList>(); diff --git a/src/main/java/org/lsc/service/SimpleJdbcSrcService.java b/src/main/java/org/lsc/service/SimpleJdbcSrcService.java index 909b8b97..2463f9c9 100644 --- a/src/main/java/org/lsc/service/SimpleJdbcSrcService.java +++ b/src/main/java/org/lsc/service/SimpleJdbcSrcService.java @@ -50,18 +50,13 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import java.util.Properties; -import org.lsc.Configuration; import org.lsc.LscDatasets; import org.lsc.configuration.DatabaseConnectionType; import org.lsc.configuration.DatabaseSourceServiceType; import org.lsc.configuration.TaskType; -import org.lsc.exception.LscConfigurationException; -import org.lsc.exception.LscServiceConfigurationException; import org.lsc.exception.LscServiceException; import org.lsc.exception.LscServiceInitializationException; -import org.lsc.persistence.DaoConfig; /** * @author Jonathan Clarke <jonathan@phillipoux.net> diff --git a/src/main/java/org/lsc/service/SyncReplSourceService.java b/src/main/java/org/lsc/service/SyncReplSourceService.java index 09061ddb..24df8985 100644 --- a/src/main/java/org/lsc/service/SyncReplSourceService.java +++ b/src/main/java/org/lsc/service/SyncReplSourceService.java @@ -57,9 +57,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -90,11 +88,7 @@ import org.apache.directory.ldap.client.api.future.SearchFuture; import org.lsc.LscDatasets; import org.lsc.beans.IBean; -import org.lsc.configuration.AsyncLdapSourceServiceType; -import org.lsc.configuration.LdapConnectionType; -import org.lsc.configuration.LdapDerefAliasesType; -import org.lsc.configuration.LdapServerType; -import org.lsc.configuration.TaskType; +import org.lsc.configuration.*; import org.lsc.exception.LscServiceCommunicationException; import org.lsc.exception.LscServiceConfigurationException; import org.lsc.exception.LscServiceException; diff --git a/src/main/java/org/lsc/service/XALdifDstService.java b/src/main/java/org/lsc/service/XALdifDstService.java index 9c937efc..0982d48b 100644 --- a/src/main/java/org/lsc/service/XALdifDstService.java +++ b/src/main/java/org/lsc/service/XALdifDstService.java @@ -263,7 +263,7 @@ public List getWriteDatasetIds() { /** - * @see org.lsc.service.IService.getSupportedConnectionType() + * @see org.lsc.service.IService#getSupportedConnectionType() */ public Collection> getSupportedConnectionType() { Collection> list = new ArrayList>(); diff --git a/src/main/java/org/lsc/utils/RhinoDebugger.java b/src/main/java/org/lsc/utils/RhinoDebugger.java index d07da7cf..dc9f5816 100755 --- a/src/main/java/org/lsc/utils/RhinoDebugger.java +++ b/src/main/java/org/lsc/utils/RhinoDebugger.java @@ -118,7 +118,7 @@ public void run() { /** * Is Debugger visible? * - * @return + * @return true if {@link SwingGui} is visible */ public boolean isVisible() { return debugGui != null && debugGui.isVisible(); diff --git a/src/main/java/org/lsc/utils/SetUtils.java b/src/main/java/org/lsc/utils/SetUtils.java index 59416c6e..968ee32e 100644 --- a/src/main/java/org/lsc/utils/SetUtils.java +++ b/src/main/java/org/lsc/utils/SetUtils.java @@ -68,8 +68,7 @@ private SetUtils() { * Return a new HashSet containing all the Objects that are an Attribute's * values. * - * @param attr - * An Attribute containing values to extract. + * @param attr An Attribute containing values to extract. * @return {@link HashSet} Values as a set. Never null. * @throws NamingException */ @@ -207,11 +206,9 @@ public static Set findMissingNeedles(Set haystack, Set needle * in the same order. This method is type-aware and will intelligently compare * byte[], String, etc. * - * @param first - * First set of Objects to compare. - * @param second - * Second set of Objects. - * @return {@link boolean} if the order is the same. + * @param first First set of Objects to compare. + * @param second Second set of Objects. + * @return true if the order is the same. */ public static boolean checkOrder(Set first, Set second) { if (first.size() != second.size()) { diff --git a/src/test/java/org/lsc/beans/BeanComparatorTest.java b/src/test/java/org/lsc/beans/BeanComparatorTest.java index 314dc2df..ab0dfd94 100644 --- a/src/test/java/org/lsc/beans/BeanComparatorTest.java +++ b/src/test/java/org/lsc/beans/BeanComparatorTest.java @@ -68,10 +68,10 @@ import org.junit.Test; import org.lsc.LscModificationType; import org.lsc.LscModifications; +import org.lsc.Task; import org.lsc.beans.syncoptions.ISyncOptions; import org.lsc.configuration.PolicyType; import org.lsc.exception.LscServiceException; -import org.lsc.jndi.JndiModificationType; import org.lsc.utils.SetUtils; /** @@ -84,8 +84,8 @@ public class BeanComparatorTest { @Mocked org.lsc.jndi.SimpleJndiDstService dstService; /** - * Test method for {@link org.lsc.beans.BeanComparator#calculateModificationType(ISyncOptions, IBean, IBean, Object)}. - * @throws CloneNotSupportedException As thrown by {@link org.lsc.beans.BeanComparator#calculateModificationType(ISyncOptions, IBean, IBean, Object)}. + * Test method for {@link org.lsc.beans.BeanComparator#calculateModificationType(Task, IBean, IBean)}. + * @throws CloneNotSupportedException As thrown by {@link org.lsc.beans.BeanComparator#calculateModificationType(Task, IBean, IBean)}. * @throws LscServiceException */ @Test @@ -141,7 +141,7 @@ public void testCalculateModificationType() throws CloneNotSupportedException, L * * With an invalid syntax error. * @throws NamingException As thrown when reading JNDI Attribute values. - * @throws CloneNotSupportedException As thrown by {@link org.lsc.beans.BeanComparator#calculateModificationType(ISyncOptions, IBean, IBean, Object)}. + * @throws CloneNotSupportedException As thrown by {@link org.lsc.beans.BeanComparator#calculateModificationType(Task, IBean, IBean)}. * @throws LscServiceException */ @Test @@ -210,7 +210,7 @@ public void testCalculateModificationsWithEmptyFieldsModify() throws NamingExcep } /** - * Test method for {@link org.lsc.beans.BeanComparator#getValuesToSet(String, Set, ISyncOptions, Map, JndiModificationType)}. + * Test method for {@link org.lsc.beans.BeanComparator#getValuesToSet(Task, String, Set, Set, Map, LscModificationType)}. * @throws LscServiceException */ @Test diff --git a/src/test/java/org/lsc/beans/syncoptions/ForceSyncOptionsTest.java b/src/test/java/org/lsc/beans/syncoptions/ForceSyncOptionsTest.java index 7708e635..9c74fe90 100644 --- a/src/test/java/org/lsc/beans/syncoptions/ForceSyncOptionsTest.java +++ b/src/test/java/org/lsc/beans/syncoptions/ForceSyncOptionsTest.java @@ -49,6 +49,7 @@ import org.junit.Test; import org.lsc.configuration.PolicyType; + /** * Simple tests. */ diff --git a/src/test/java/org/lsc/beans/syncoptions/PropertiesBasedSyncOptionsTest.java b/src/test/java/org/lsc/beans/syncoptions/PropertiesBasedSyncOptionsTest.java index 3bd92acc..409b0691 100644 --- a/src/test/java/org/lsc/beans/syncoptions/PropertiesBasedSyncOptionsTest.java +++ b/src/test/java/org/lsc/beans/syncoptions/PropertiesBasedSyncOptionsTest.java @@ -55,11 +55,7 @@ import org.junit.Before; import org.junit.Test; -import org.lsc.configuration.DatasetType; -import org.lsc.configuration.PolicyType; -import org.lsc.configuration.PropertiesBasedSyncOptionsType; -import org.lsc.configuration.TaskType; -import org.lsc.configuration.ValuesType; +import org.lsc.configuration.*; import org.lsc.exception.LscServiceException; import org.lsc.utils.ScriptingEvaluator; @@ -72,7 +68,8 @@ public class PropertiesBasedSyncOptionsTest { PropertiesBasedSyncOptionsType conf ; DatasetType pbsoNonExistingAttr; DatasetType pbsoExistingAttr; - @Injectable @NonStrict TaskType task; + @Injectable @NonStrict + TaskType task; @Injectable @NonStrict org.lsc.Task taskExec; @Before diff --git a/src/test/java/org/lsc/connectors/xmlrpc/XmlRpcUserProvisioning.java b/src/test/java/org/lsc/connectors/xmlrpc/XmlRpcUserProvisioning.java index d51906a8..4c0e5f8f 100644 --- a/src/test/java/org/lsc/connectors/xmlrpc/XmlRpcUserProvisioning.java +++ b/src/test/java/org/lsc/connectors/xmlrpc/XmlRpcUserProvisioning.java @@ -242,7 +242,7 @@ public List getWriteDatasetIds() { } /** - * @see org.lsc.service.IService.getSupportedConnectionType() + * @see org.lsc.service.IService#getSupportedConnectionType() */ public Collection> getSupportedConnectionType() { Collection> list = new ArrayList>();