You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by fm...@apache.org on 2013/11/05 12:39:31 UTC
svn commit: r1538950 - in /syncope/branches/1_1_X:
common/src/main/java/org/apache/syncope/common/services/
core/src/main/java/org/apache/syncope/core/notification/
core/src/main/java/org/apache/syncope/core/propagation/impl/
core/src/test/java/org/apa...
Author: fmartelli
Date: Tue Nov 5 11:39:30 2013
New Revision: 1538950
URL: http://svn.apache.org/r1538950
Log:
Fix jaxrs failures
Modified:
syncope/branches/1_1_X/common/src/main/java/org/apache/syncope/common/services/LoggerService.java
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/notification/NotificationManager.java
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/propagation/impl/PriorityPropagationTaskExecutor.java
syncope/branches/1_1_X/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java
Modified: syncope/branches/1_1_X/common/src/main/java/org/apache/syncope/common/services/LoggerService.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/common/src/main/java/org/apache/syncope/common/services/LoggerService.java?rev=1538950&r1=1538949&r2=1538950&view=diff
==============================================================================
--- syncope/branches/1_1_X/common/src/main/java/org/apache/syncope/common/services/LoggerService.java (original)
+++ syncope/branches/1_1_X/common/src/main/java/org/apache/syncope/common/services/LoggerService.java Tue Nov 5 11:39:30 2013
@@ -30,7 +30,7 @@ import org.apache.syncope.common.to.Even
import org.apache.syncope.common.to.LoggerTO;
import org.apache.syncope.common.types.LoggerType;
-@Path("logger/{type}")
+@Path("logger")
public interface LoggerService {
/**
@@ -38,7 +38,7 @@ public interface LoggerService {
* @param name Logger name to be deleted.
*/
@DELETE
- @Path("{name}")
+ @Path("{type}/{name}")
void delete(@PathParam("type") LoggerType type, @PathParam("name") String name);
/**
@@ -46,6 +46,7 @@ public interface LoggerService {
* @return List of logger with matching type.
*/
@GET
+ @Path("{type}")
List<LoggerTO> list(@PathParam("type") LoggerType type);
/**
@@ -54,7 +55,7 @@ public interface LoggerService {
* @return Returns logger with matching type and name.
*/
@GET
- @Path("{name}")
+ @Path("{type}/{name}")
LoggerTO read(@PathParam("type") LoggerType type, @PathParam("name") final String name);
/**
@@ -63,9 +64,10 @@ public interface LoggerService {
* @param logger Logger to be created or updated.
*/
@PUT
- @Path("{name}/level")
+ @Path("{type}/{name}/level")
void update(@PathParam("type") LoggerType type, @PathParam("name") String name, LoggerTO logger);
@GET
+ @Path("events")
List<EventCategoryTO> events();
}
Modified: syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/notification/NotificationManager.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/notification/NotificationManager.java?rev=1538950&r1=1538949&r2=1538950&view=diff
==============================================================================
--- syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/notification/NotificationManager.java (original)
+++ syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/notification/NotificationManager.java Tue Nov 5 11:39:30 2013
@@ -238,10 +238,10 @@ public class NotificationManager {
}
}
- LOG.info("Search notification for [{}]{}", attributableType, attributable);
+ LOG.debug("Search notification for [{}]{}", attributableType, attributable);
for (Notification notification : notificationDAO.findAll()) {
- LOG.info("Notification available about {}", notification.getAbout());
+ LOG.debug("Notification available about {}", notification.getAbout());
final Set<String> events = new HashSet<String>(notification.getEvents());
events.retainAll(Collections.<String>singleton(LoggerEventUtils.buildEvent(
@@ -250,8 +250,8 @@ public class NotificationManager {
if (events.isEmpty()) {
LOG.debug("No events found about {}", attributable);
} else {
- if (attributableType == null || attributable == null || notification.getAbout() == null || searchDAO.
- matches(
+ if (attributableType == null || attributable == null || notification.getAbout() == null
+ || searchDAO.matches(
attributable, notification.getAbout(), AttributableUtil.getInstance(attributableType))) {
LOG.debug("Creating notification task for events {} about {}", events, attributable);
Modified: syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/propagation/impl/PriorityPropagationTaskExecutor.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/propagation/impl/PriorityPropagationTaskExecutor.java?rev=1538950&r1=1538949&r2=1538950&view=diff
==============================================================================
--- syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/propagation/impl/PriorityPropagationTaskExecutor.java (original)
+++ syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/propagation/impl/PriorityPropagationTaskExecutor.java Tue Nov 5 11:39:30 2013
@@ -25,6 +25,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.apache.syncope.common.types.AuditElements;
+import org.apache.syncope.common.types.AuditElements.Result;
import org.apache.syncope.common.types.PropagationTaskExecStatus;
import org.apache.syncope.core.persistence.beans.PropagationTask;
import org.apache.syncope.core.persistence.beans.TaskExec;
@@ -42,6 +43,8 @@ public class PriorityPropagationTaskExec
final List<PropagationTask> prioritizedTasks = new ArrayList<PropagationTask>(tasks);
Collections.sort(prioritizedTasks, new PriorityComparator());
+ Result result = Result.SUCCESS;
+
try {
for (PropagationTask task : prioritizedTasks) {
LOG.debug("Execution started for {}", task);
@@ -60,6 +63,7 @@ public class PriorityPropagationTaskExec
execStatus = PropagationTaskExecStatus.FAILURE;
}
if (task.getResource().isPropagationPrimary() && !execStatus.isSuccessful()) {
+ result = Result.FAILURE;
throw new PropagationException(task.getResource().getName(), execution.getMessage());
}
}
@@ -69,7 +73,7 @@ public class PriorityPropagationTaskExec
null,
null,
null,
- null,
+ result,
reporter instanceof DefaultPropagationReporter
? ((DefaultPropagationReporter) reporter).getStatuses() : null,
tasks);
@@ -79,7 +83,7 @@ public class PriorityPropagationTaskExec
null,
null,
null,
- null,
+ result,
reporter instanceof DefaultPropagationReporter
? ((DefaultPropagationReporter) reporter).getStatuses() : null,
tasks);
Modified: syncope/branches/1_1_X/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_1_X/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java?rev=1538950&r1=1538949&r2=1538950&view=diff
==============================================================================
--- syncope/branches/1_1_X/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java (original)
+++ syncope/branches/1_1_X/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java Tue Nov 5 11:39:30 2013
@@ -530,6 +530,7 @@ public class TaskTestITCase extends Abst
NotificationTO notification = new NotificationTO();
notification.setTraceLevel(TraceLevel.FAILURES);
notification.addEvent("[REST]:[UserController]:[]:[create]:[SUCCESS]");
+ notification.addEvent("[REST]:[UserController]:[]:[createInternal]:[SUCCESS]");
MembershipCond membCond = new MembershipCond();
membCond.setRoleId(7L);