Skip to content

Commit

Permalink
Merge pull request #250 from georchestra/synchronizing-mails-for-orga…
Browse files Browse the repository at this point in the history
…nizations

georchestra-integration - Synchronizing mails for organizations
  • Loading branch information
pmauduit authored Oct 2, 2023
2 parents 1845d0e + a853dd6 commit 51c2980
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public GroupLink synchronize(CanonicalGroup canonical) {
Group group = this.gnGroupRepository.findByName(canonical.getName());
if (null == group) {
group = new Group();
log.info("Creatinng GN group {} (Id: {}, version '{}')", //
log.info("Creating GN group {} (Id: {}, version '{}')", //
canonical.getName(), canonical.getId(), canonical.getLastUpdated());
} else {
log.info("Reconciling existing GN group {} with canonical group (id: {})", group.getName(),
Expand All @@ -157,6 +157,7 @@ public GroupLink synchronize(CanonicalGroup canonical) {
group.setName(canonical.getName());
group.setDescription(canonical.getDescription());
group.setWebsite(canonical.getLinkage());
group.setEmail(canonical.getMail());
link.setCanonical(canonical);
link = externalGroupLinks.save(link);
assert link.isUpToDateWith(canonical);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public interface CanonicalGroup {
*/
String getLinkage();

String getMail();

static CanonicalGroupImpl.Builder builder() {
return CanonicalGroupImpl.builder();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class CanonicalGroupImpl implements CanonicalGroup {
private String linkage;
private String orgTitle;

private String orgMail;
private GroupSyncMode origin;

@Generated("SparkTools")
Expand All @@ -52,6 +53,7 @@ private CanonicalGroupImpl(Builder builder) {
this.lastUpdated = builder.lastUpdated;
this.origin = builder.origin;
this.orgTitle = builder.orgTitle;
this.orgMail = builder.orgMail;
}

public @Override String getId() {
Expand All @@ -78,6 +80,9 @@ private CanonicalGroupImpl(Builder builder) {
return linkage;
}

@Override
public String getMail() { return orgMail; }

public @Override String getLastUpdated() {
return lastUpdated;
}
Expand Down Expand Up @@ -122,6 +127,8 @@ public static final class Builder {
private String linkage;
private String lastUpdated;
private String orgTitle;

private String orgMail;
private GroupSyncMode origin;

private Builder() {
Expand All @@ -135,6 +142,7 @@ public Builder init(CanonicalGroup group) {
this.linkage = group.getLinkage();
this.lastUpdated = group.getLastUpdated();
this.origin = group.getOrigin();
this.orgMail = group.getMail();
return this;
}

Expand Down Expand Up @@ -173,6 +181,12 @@ public Builder withOrigin(GroupSyncMode origin) {
return this;
}

public Builder withMail(String mail) {
this.orgMail = mail;
return this;
}


public CanonicalGroup build() {
return new CanonicalGroupImpl(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public CanonicalGroup toCanonical(Organization org) {
.withLastUpdated(org.getLastUpdated())//
.withLinkage(org.getLinkage())//
.withOrigin(GroupSyncMode.orgs)//
.withMail(org.getMail())//
.build();
}

Expand Down
2 changes: 1 addition & 1 deletion georchestra-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<name>geOrchestra integration</name>
<properties>
<rootProjectDir>${basedir}/..</rootProjectDir>
<georchestra.version>23.0.3-SNAPSHOT</georchestra.version>
<georchestra.version>23.1-SNAPSHOT</georchestra.version>
</properties>
<modules>
<module>georchestra-utils</module>
Expand Down

0 comments on commit 51c2980

Please sign in to comment.