Skip to content

Commit

Permalink
Realigning ClassPathScanImplementationLookup with IdRepoImplementatio…
Browse files Browse the repository at this point in the history
…nType and IdMImplementationType
  • Loading branch information
ilgrosso committed Dec 24, 2024
1 parent 7860bac commit 0adeec3
Showing 1 changed file with 38 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.apache.syncope.core.provisioning.api.job.report.ReportConfClass;
import org.apache.syncope.core.provisioning.api.job.report.ReportJobDelegate;
import org.apache.syncope.core.provisioning.api.macro.Command;
import org.apache.syncope.core.provisioning.api.macro.MacroActions;
import org.apache.syncope.core.provisioning.api.notification.RecipientsProvider;
import org.apache.syncope.core.provisioning.api.propagation.PropagationActions;
import org.apache.syncope.core.provisioning.api.pushpull.PullActions;
Expand Down Expand Up @@ -138,15 +139,7 @@ public void load() {
continue;
}

if (ReportJobDelegate.class.isAssignableFrom(clazz)) {
ReportConfClass annotation = clazz.getAnnotation(ReportConfClass.class);
if (annotation == null) {
LOG.warn("Found Report {} without declared configuration", clazz.getName());
} else {
classNames.get(IdRepoImplementationType.REPORT_DELEGATE).add(clazz.getName());
reportJobDelegateClasses.put(annotation.value(), (Class<? extends ReportJobDelegate>) clazz);
}
} else if (AccountRule.class.isAssignableFrom(clazz)) {
if (AccountRule.class.isAssignableFrom(clazz)) {
AccountRuleConfClass annotation = clazz.getAnnotation(AccountRuleConfClass.class);
if (annotation == null) {
LOG.warn("Found account policy rule {} without declared configuration", clazz.getName());
Expand All @@ -162,6 +155,42 @@ public void load() {
classNames.get(IdRepoImplementationType.PASSWORD_RULE).add(clazz.getName());
passwordRuleClasses.put(annotation.value(), (Class<? extends PasswordRule>) clazz);
}
} else if (SchedTaskJobDelegate.class.isAssignableFrom(clazz)
&& !PullJobDelegate.class.isAssignableFrom(clazz)
&& !PushJobDelegate.class.isAssignableFrom(clazz)
&& !GroupMemberProvisionTaskJobDelegate.class.isAssignableFrom(clazz)) {

classNames.get(IdRepoImplementationType.TASKJOB_DELEGATE).add(bd.getBeanClassName());
} else if (ReportJobDelegate.class.isAssignableFrom(clazz)) {
ReportConfClass annotation = clazz.getAnnotation(ReportConfClass.class);
if (annotation == null) {
LOG.warn("Found Report {} without declared configuration", clazz.getName());
} else {
classNames.get(IdRepoImplementationType.REPORT_DELEGATE).add(clazz.getName());
reportJobDelegateClasses.put(annotation.value(), (Class<? extends ReportJobDelegate>) clazz);
}
} else if (LogicActions.class.isAssignableFrom(clazz)) {
classNames.get(IdRepoImplementationType.LOGIC_ACTIONS).add(bd.getBeanClassName());
} else if (MacroActions.class.isAssignableFrom(clazz)) {
classNames.get(IdRepoImplementationType.MACRO_ACTIONS).add(bd.getBeanClassName());
} else if (PlainAttrValueValidator.class.isAssignableFrom(clazz)) {
classNames.get(IdRepoImplementationType.ATTR_VALUE_VALIDATOR).add(bd.getBeanClassName());
} else if (Command.class.isAssignableFrom(clazz)) {
classNames.get(IdRepoImplementationType.COMMAND).add(bd.getBeanClassName());
} else if (RecipientsProvider.class.isAssignableFrom(clazz)) {
classNames.get(IdRepoImplementationType.RECIPIENTS_PROVIDER).add(bd.getBeanClassName());
} else if (ItemTransformer.class.isAssignableFrom(clazz)
&& !clazz.equals(JEXLItemTransformerImpl.class)) {

classNames.get(IdRepoImplementationType.ITEM_TRANSFORMER).add(clazz.getName());
} else if (ReconFilterBuilder.class.isAssignableFrom(clazz)) {
classNames.get(IdMImplementationType.RECON_FILTER_BUILDER).add(bd.getBeanClassName());
} else if (PropagationActions.class.isAssignableFrom(clazz)) {
classNames.get(IdMImplementationType.PROPAGATION_ACTIONS).add(bd.getBeanClassName());
} else if (PullActions.class.isAssignableFrom(clazz)) {
classNames.get(IdMImplementationType.PULL_ACTIONS).add(bd.getBeanClassName());
} else if (PushActions.class.isAssignableFrom(clazz)) {
classNames.get(IdMImplementationType.PUSH_ACTIONS).add(bd.getBeanClassName());
} else if (PullCorrelationRule.class.isAssignableFrom(clazz)) {
PullCorrelationRuleConfClass annotation = clazz.getAnnotation(PullCorrelationRuleConfClass.class);
if (annotation == null) {
Expand All @@ -178,34 +207,8 @@ public void load() {
classNames.get(IdMImplementationType.PUSH_CORRELATION_RULE).add(clazz.getName());
pushCRClasses.put(annotation.value(), (Class<? extends PushCorrelationRule>) clazz);
}
} else if (ItemTransformer.class.isAssignableFrom(clazz)
&& !clazz.equals(JEXLItemTransformerImpl.class)) {

classNames.get(IdRepoImplementationType.ITEM_TRANSFORMER).add(clazz.getName());
} else if (SchedTaskJobDelegate.class.isAssignableFrom(clazz)
&& !PullJobDelegate.class.isAssignableFrom(clazz)
&& !PushJobDelegate.class.isAssignableFrom(clazz)
&& !GroupMemberProvisionTaskJobDelegate.class.isAssignableFrom(clazz)) {

classNames.get(IdRepoImplementationType.TASKJOB_DELEGATE).add(bd.getBeanClassName());
} else if (ReconFilterBuilder.class.isAssignableFrom(clazz)) {
classNames.get(IdMImplementationType.RECON_FILTER_BUILDER).add(bd.getBeanClassName());
} else if (LogicActions.class.isAssignableFrom(clazz)) {
classNames.get(IdRepoImplementationType.LOGIC_ACTIONS).add(bd.getBeanClassName());
} else if (PropagationActions.class.isAssignableFrom(clazz)) {
classNames.get(IdMImplementationType.PROPAGATION_ACTIONS).add(bd.getBeanClassName());
} else if (PullActions.class.isAssignableFrom(clazz)) {
classNames.get(IdMImplementationType.PULL_ACTIONS).add(bd.getBeanClassName());
} else if (PushActions.class.isAssignableFrom(clazz)) {
classNames.get(IdMImplementationType.PUSH_ACTIONS).add(bd.getBeanClassName());
} else if (PlainAttrValueValidator.class.isAssignableFrom(clazz)) {
classNames.get(IdRepoImplementationType.ATTR_VALUE_VALIDATOR).add(bd.getBeanClassName());
} else if (RecipientsProvider.class.isAssignableFrom(clazz)) {
classNames.get(IdRepoImplementationType.RECIPIENTS_PROVIDER).add(bd.getBeanClassName());
} else if (ProvisionSorter.class.isAssignableFrom(clazz)) {
classNames.get(IdMImplementationType.PROVISION_SORTER).add(bd.getBeanClassName());
} else if (Command.class.isAssignableFrom(clazz)) {
classNames.get(IdRepoImplementationType.COMMAND).add(bd.getBeanClassName());
} else {
extImplTypes.forEach((typeName, typeInterface) -> {
Class<?> tic = ClassUtils.resolveClassName(typeInterface, ClassUtils.getDefaultClassLoader());
Expand Down

0 comments on commit 0adeec3

Please sign in to comment.