andrea-patricelli commented on a change in pull request #213:
URL: https://github.com/apache/syncope/pull/213#discussion_r491926651



##########
File path: 
core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
##########
@@ -448,7 +448,7 @@ public NumbersInfo numbers() {
         numbersInfo.getConfCompleteness().put(
                 NumbersInfo.ConfItem.NOTIFICATION.name(), 
!notificationDAO.findAll().isEmpty());
         numbersInfo.getConfCompleteness().put(
-                NumbersInfo.ConfItem.PULL_TASK.name(), 
!taskDAO.findAll(TaskType.PULL).isEmpty());

Review comment:
       Nope, going to remove it.

##########
File path: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPATaskDAO.java
##########
@@ -436,7 +413,13 @@ public int count(
     @Transactional(rollbackFor = { Throwable.class })
     @Override
     public <T extends Task> T save(final T task) {
-        return entityManager().merge(task);
+        T merged = entityManager().merge(task);
+
+        // propagate the event only for Propagation tasks
+        if (merged instanceof PropagationTask) {
+            publisher.publishEvent(new TaskCreatedUpdatedEvent<>(this, merged, 
AuthContextUtils.getDomain()));

Review comment:
       Yes, I left the implementation in a way "open" also to other tasks. 
There are some cases in which would be useful also to have `NotificationTask` 
on ES.

##########
File path: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/AbstractSchedTask.java
##########
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.jpa.entity.task;
+
+import java.util.Date;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.OneToOne;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.validation.constraints.NotNull;
+import org.apache.syncope.common.lib.types.ImplementationType;
+import org.apache.syncope.core.persistence.api.entity.Implementation;
+import org.apache.syncope.core.persistence.api.entity.task.SchedTask;
+import org.apache.syncope.core.persistence.jpa.entity.JPAImplementation;
+
+@MappedSuperclass
+public abstract class AbstractSchedTask extends AbstractTask implements 
SchedTask {

Review comment:
       So each class that extends `AbstractSchedTask` has to define sched task 
(`JPAPullTask`, `JPAPushTask`, `JPASchedTask`) specific attributes and 
implement specific methods?

##########
File path: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/AbstractSchedTask.java
##########
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.jpa.entity.task;
+
+import java.util.Date;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.OneToOne;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.validation.constraints.NotNull;
+import org.apache.syncope.common.lib.types.ImplementationType;
+import org.apache.syncope.core.persistence.api.entity.Implementation;
+import org.apache.syncope.core.persistence.api.entity.task.SchedTask;
+import org.apache.syncope.core.persistence.jpa.entity.JPAImplementation;
+
+@MappedSuperclass
+public abstract class AbstractSchedTask extends AbstractTask implements 
SchedTask {

Review comment:
       So each class that extends `AbstractSchedTask` (`JPAPullTask`, 
`JPAPushTask`, `JPASchedTask`) has to define sched task  specific attributes 
and implement specific methods?

##########
File path: 
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/AbstractSchedTask.java
##########
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.jpa.entity.task;
+
+import java.util.Date;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.OneToOne;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.validation.constraints.NotNull;
+import org.apache.syncope.common.lib.types.ImplementationType;
+import org.apache.syncope.core.persistence.api.entity.Implementation;
+import org.apache.syncope.core.persistence.api.entity.task.SchedTask;
+import org.apache.syncope.core.persistence.jpa.entity.JPAImplementation;
+
+@MappedSuperclass
+public abstract class AbstractSchedTask extends AbstractTask implements 
SchedTask {

Review comment:
       Oh ok, now I got. Yes, I agree, I'll leave it in `AbstractSchedTask` and 
remove in `JPASchedTask.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to