Skip to content

Commit

Permalink
[SYNCOPE-1829] Introducing support for Live Sync (#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso authored Dec 23, 2024
1 parent 3a7ce47 commit 36fdaa6
Show file tree
Hide file tree
Showing 308 changed files with 5,141 additions and 2,703 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,7 @@ under the License.

<profile>
<id>standalone</id>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,7 @@ under the License.

<profile>
<id>standalone</id>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,6 @@ under the License.
<profile>
<id>standalone</id>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down
7 changes: 0 additions & 7 deletions archetype/src/main/resources/archetype-resources/wa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ under the License.
<profiles>
<profile>
<id>standalone</id>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.stream.Collectors;
import org.apache.syncope.client.console.init.ClassPathScanImplementationLookup;
import org.apache.syncope.client.console.rest.ImplementationRestClient;
import org.apache.syncope.common.lib.policy.PullCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.InboundCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.PushCorrelationRuleConf;
import org.apache.syncope.common.lib.to.ImplementationTO;
import org.apache.syncope.common.lib.types.IdMImplementationType;
Expand All @@ -44,7 +44,7 @@ public IdMImplementationInfoProvider(

@Override
public ViewMode getViewMode(final ImplementationTO implementation) {
return IdMImplementationType.PULL_CORRELATION_RULE.equals(implementation.getType())
return IdMImplementationType.INBOUND_CORRELATION_RULE.equals(implementation.getType())
|| IdMImplementationType.PUSH_CORRELATION_RULE.equals(implementation.getType())
? ViewMode.JSON_BODY
: super.getViewMode(implementation);
Expand All @@ -55,8 +55,8 @@ public List<String> getClasses(final ImplementationTO implementation, final View
List<String> classes = new ArrayList<>();
if (viewMode == ViewMode.JSON_BODY && IdMImplementationType.values().containsKey(implementation.getType())) {
switch (implementation.getType()) {
case IdMImplementationType.PULL_CORRELATION_RULE:
classes = lookup.getClasses(PullCorrelationRuleConf.class).stream().
case IdMImplementationType.INBOUND_CORRELATION_RULE:
classes = lookup.getClasses(InboundCorrelationRuleConf.class).stream().
map(Class::getName).collect(Collectors.toList());
break;

Expand Down Expand Up @@ -88,16 +88,16 @@ public String getGroovyTemplateClassName(final String implementationType) {
templateClassName = "MyPropagationActions";
break;

case IdMImplementationType.PULL_ACTIONS:
templateClassName = "MyPullActions";
case IdMImplementationType.INBOUND_ACTIONS:
templateClassName = "MyInboundActions";
break;

case IdMImplementationType.PUSH_ACTIONS:
templateClassName = "MyPushActions";
break;

case IdMImplementationType.PULL_CORRELATION_RULE:
templateClassName = "MyPullCorrelationRule";
case IdMImplementationType.INBOUND_CORRELATION_RULE:
templateClassName = "MyInboundCorrelationRule";
break;

case IdMImplementationType.PUSH_CORRELATION_RULE:
Expand All @@ -119,8 +119,8 @@ public String getGroovyTemplateClassName(final String implementationType) {
public Class<?> getClass(final String implementationType, final String name) {
Class<?> clazz;
switch (implementationType) {
case IdMImplementationType.PULL_CORRELATION_RULE:
clazz = lookup.getClasses(PullCorrelationRuleConf.class).stream().
case IdMImplementationType.INBOUND_CORRELATION_RULE:
clazz = lookup.getClasses(InboundCorrelationRuleConf.class).stream().
filter(c -> c.getName().equals(name)).findFirst().orElse(null);
break;

Expand Down Expand Up @@ -151,14 +151,28 @@ protected List<String> load() {
}

@Override
public IModel<List<String>> getPullActions() {
public IModel<List<String>> getLiveSyncDeltaMappers() {
return new LoadableDetachableModel<>() {

private static final long serialVersionUID = 5275935387613157437L;

@Override
protected List<String> load() {
return implementationRestClient.list(IdMImplementationType.PULL_ACTIONS).stream().
return implementationRestClient.list(IdMImplementationType.LIVE_SYNC_DELTA_MAPPER).stream().
map(ImplementationTO::getKey).sorted().collect(Collectors.toList());
}
};
}

@Override
public IModel<List<String>> getInboundActions() {
return new LoadableDetachableModel<>() {

private static final long serialVersionUID = 5275935387613157437L;

@Override
protected List<String> load() {
return implementationRestClient.list(IdMImplementationType.INBOUND_ACTIONS).stream().
map(ImplementationTO::getKey).sorted().collect(Collectors.toList());
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

import java.util.ArrayList;
import java.util.List;
import org.apache.syncope.client.console.policies.InboundPolicyDirectoryPanel;
import org.apache.syncope.client.console.policies.PropagationPolicyDirectoryPanel;
import org.apache.syncope.client.console.policies.PullPolicyDirectoryPanel;
import org.apache.syncope.client.console.policies.PushPolicyDirectoryPanel;
import org.apache.syncope.client.console.rest.PolicyRestClient;
import org.apache.wicket.PageReference;
Expand Down Expand Up @@ -54,13 +54,13 @@ public Panel getPanel(final String panelId) {
}
});

tabs.add(new AbstractTab(new ResourceModel("policy.pull")) {
tabs.add(new AbstractTab(new ResourceModel("policy.inbound")) {

private static final long serialVersionUID = -6815067322125799251L;

@Override
public Panel getPanel(final String panelId) {
return new PullPolicyDirectoryPanel(panelId, policyRestClient, pageRef);
return new InboundPolicyDirectoryPanel(panelId, policyRestClient, pageRef);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package org.apache.syncope.client.console.init;

import java.util.Optional;
import org.apache.syncope.common.lib.policy.PullCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.InboundCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.PushCorrelationRuleConf;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.filter.AssignableTypeFilter;
Expand All @@ -30,14 +30,14 @@ public class IdMClassPathScanImplementationContributor implements ClassPathScanI

@Override
public void extend(final ClassPathScanningCandidateComponentProvider scanner) {
scanner.addIncludeFilter(new AssignableTypeFilter(PullCorrelationRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(InboundCorrelationRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(PushCorrelationRuleConf.class));
}

@Override
public Optional<String> getLabel(final Class<?> clazz) {
if (PullCorrelationRuleConf.class.isAssignableFrom(clazz)) {
return Optional.of(PullCorrelationRuleConf.class.getName());
if (InboundCorrelationRuleConf.class.isAssignableFrom(clazz)) {
return Optional.of(InboundCorrelationRuleConf.class.getName());
}
if (PushCorrelationRuleConf.class.isAssignableFrom(clazz)) {
return Optional.of(PushCorrelationRuleConf.class.getName());
Expand Down
Loading

0 comments on commit 36fdaa6

Please sign in to comment.