You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2018/02/13 21:26:39 UTC
[1/4] syncope git commit: [SYNCOPE-1262] Last matrix parameter still
there
Repository: syncope
Updated Branches:
refs/heads/2_0_X 6bc2cac16 -> f15408393
refs/heads/master eb1cd3ff2 -> 08c1aa43b
[SYNCOPE-1262] Last matrix parameter still there
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/7958ebd4
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/7958ebd4
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/7958ebd4
Branch: refs/heads/master
Commit: 7958ebd48fadf04ad4b6d4f8a10507b6d5d078a0
Parents: eb1cd3f
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Feb 13 17:15:41 2018 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Feb 13 17:23:40 2018 +0100
----------------------------------------------------------------------
.../panels/CamelRoutesDirectoryPanel.java | 4 +--
.../console/rest/CamelRoutesRestClient.java | 8 +++---
.../syncope/core/logic/CamelRouteLogic.java | 19 +++++++++++--
.../rest/api/service/CamelRouteService.java | 16 ++++++-----
.../rest/cxf/service/CamelRouteServiceImpl.java | 8 +++---
.../syncope/fit/core/CamelRouteITCase.java | 28 ++++++++++----------
6 files changed, 51 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/7958ebd4/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDirectoryPanel.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDirectoryPanel.java
index 007dda8..6b32959 100644
--- a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDirectoryPanel.java
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDirectoryPanel.java
@@ -115,7 +115,7 @@ public class CamelRoutesDirectoryPanel extends DirectoryPanel<
@Override
public void onClick(final AjaxRequestTarget target, final CamelRouteTO ignore) {
- final CamelRouteTO route = restClient.read(model.getObject().getKey());
+ final CamelRouteTO route = restClient.read(anyTypeKind, model.getObject().getKey());
utilityModal.header(Model.of(route.getKey()));
utilityModal.setContent(new XMLEditorPanel(
@@ -126,7 +126,7 @@ public class CamelRoutesDirectoryPanel extends DirectoryPanel<
@Override
public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
try {
- restClient.update(route);
+ restClient.update(anyTypeKind, route);
info(getString(Constants.OPERATION_SUCCEEDED));
modal.close(target);
} catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/7958ebd4/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
index 92d6118..aac5498 100644
--- a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
@@ -36,12 +36,12 @@ public class CamelRoutesRestClient extends BaseRestClient {
: Collections.<CamelRouteTO>emptyList();
}
- public CamelRouteTO read(final String key) {
- return getService(CamelRouteService.class).read(key);
+ public CamelRouteTO read(final AnyTypeKind anyTypeKind, final String key) {
+ return getService(CamelRouteService.class).read(anyTypeKind, key);
}
- public void update(final CamelRouteTO routeTO) {
- getService(CamelRouteService.class).update(routeTO);
+ public void update(final AnyTypeKind anyTypeKind, final CamelRouteTO routeTO) {
+ getService(CamelRouteService.class).update(anyTypeKind, routeTO);
}
public boolean isCamelEnabledFor(final AnyTypeKind anyTypeKind) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/7958ebd4/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
----------------------------------------------------------------------
diff --git a/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java b/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
index 0969e13..bb3d20b 100644
--- a/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
+++ b/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
@@ -27,10 +27,12 @@ import java.util.List;
import org.apache.camel.component.metrics.routepolicy.MetricsRegistryService;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.to.CamelMetrics;
import org.apache.syncope.common.lib.to.CamelRouteTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.CamelEntitlement;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.core.persistence.api.dao.CamelRouteDAO;
import org.apache.syncope.core.persistence.api.dao.NotFoundException;
import org.apache.syncope.core.persistence.api.entity.CamelRoute;
@@ -67,21 +69,34 @@ public class CamelRouteLogic extends AbstractTransactionalLogic<CamelRouteTO> {
@PreAuthorize("hasRole('" + CamelEntitlement.ROUTE_READ + "')")
@Transactional(readOnly = true)
- public CamelRouteTO read(final String key) {
+ public CamelRouteTO read(final AnyTypeKind anyTypeKind, final String key) {
CamelRoute route = routeDAO.find(key);
if (route == null) {
throw new NotFoundException("CamelRoute with key=" + key);
}
+ if (route.getAnyTypeKind() != anyTypeKind) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + anyTypeKind + ", expected " + route.getAnyTypeKind());
+ throw sce;
+ }
+
return binder.getRouteTO(route);
}
@PreAuthorize("hasRole('" + CamelEntitlement.ROUTE_UPDATE + "')")
- public void update(final CamelRouteTO routeTO) {
+ public void update(final AnyTypeKind anyTypeKind, final CamelRouteTO routeTO) {
CamelRoute route = routeDAO.find(routeTO.getKey());
if (route == null) {
throw new NotFoundException("CamelRoute with key=" + routeTO.getKey());
}
+
+ if (route.getAnyTypeKind() != anyTypeKind) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + anyTypeKind + ", expected " + route.getAnyTypeKind());
+ throw sce;
+ }
+
String originalContent = route.getContent();
LOG.debug("Updating route {} with content {}", routeTO.getKey(), routeTO.getContent());
http://git-wip-us.apache.org/repos/asf/syncope/blob/7958ebd4/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
----------------------------------------------------------------------
diff --git a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
index 1de6313..9dd5bca 100644
--- a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
+++ b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
@@ -25,7 +25,6 @@ import java.util.List;
import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
-import javax.ws.rs.MatrixParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
@@ -54,31 +53,36 @@ public interface CamelRouteService extends JAXRSService {
* @return all routes for the given any type kind
*/
@GET
+ @Path("{anyTypeKind}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- List<CamelRouteTO> list(@NotNull @MatrixParam("anyTypeKind") AnyTypeKind anyTypeKind);
+ List<CamelRouteTO> list(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind);
/**
* Read the route with the given key.
*
+ * @param anyTypeKind any type kind
* @param key route key
* @return route with given key
*/
@GET
- @Path("{key}")
+ @Path("{anyTypeKind}/{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- CamelRouteTO read(@NotNull @PathParam("key") String key);
+ CamelRouteTO read(
+ @NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind,
+ @NotNull @PathParam("key") String key);
/**
* Update the given route.
*
+ * @param anyTypeKind any type kind
* @param route to be updated
* @return an empty response if operation was successful
*/
@PUT
- @Path("{key}")
+ @Path("{anyTypeKind}/{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response update(@NotNull CamelRouteTO route);
+ Response update(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind, @NotNull CamelRouteTO route);
/**
* Restart the underlying Apache Camel context.
http://git-wip-us.apache.org/repos/asf/syncope/blob/7958ebd4/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java b/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
index a7f6fbd..eb1db19 100644
--- a/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
+++ b/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
@@ -40,13 +40,13 @@ public class CamelRouteServiceImpl extends AbstractServiceImpl implements CamelR
}
@Override
- public CamelRouteTO read(final String key) {
- return logic.read(key);
+ public CamelRouteTO read(final AnyTypeKind anyTypeKind, final String key) {
+ return logic.read(anyTypeKind, key);
}
@Override
- public Response update(final CamelRouteTO route) {
- logic.update(route);
+ public Response update(final AnyTypeKind anyTypeKind, final CamelRouteTO route) {
+ logic.update(anyTypeKind, route);
return Response.noContent().build();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/7958ebd4/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
index 95516a8..9316ad2 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
@@ -59,19 +59,19 @@ public class CamelRouteITCase extends AbstractITCase {
groupRoutes.forEach(route -> assertNotNull(route.getContent()));
}
- private CamelRouteTO doUpdate(final String key, final String content) {
- CamelRouteTO route = camelRouteService.read(key);
+ private CamelRouteTO doUpdate(final AnyTypeKind anyTypeKind, final String key, final String content) {
+ CamelRouteTO route = camelRouteService.read(anyTypeKind, key);
route.setContent(content);
- camelRouteService.update(route);
+ camelRouteService.update(anyTypeKind, route);
// getting new route definition
- return camelRouteService.read(key);
+ return camelRouteService.read(anyTypeKind, key);
}
@Test
public void update() {
assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
- CamelRouteTO oldRoute = camelRouteService.read("createUser");
+ CamelRouteTO oldRoute = camelRouteService.read(AnyTypeKind.USER, "createUser");
assertNotNull(oldRoute);
String routeContent = "<route id=\"createUser\">\n"
+ " <from uri=\"direct:createUser\"/>\n"
@@ -94,10 +94,10 @@ public class CamelRouteITCase extends AbstractITCase {
+ " </doTry>\n"
+ "</route>";
try {
- CamelRouteTO route = doUpdate("createUser", routeContent);
+ CamelRouteTO route = doUpdate(AnyTypeKind.USER, "createUser", routeContent);
assertEquals(routeContent, route.getContent());
} finally {
- doUpdate(oldRoute.getKey(), oldRoute.getContent());
+ doUpdate(AnyTypeKind.USER, oldRoute.getKey(), oldRoute.getContent());
}
}
@@ -105,7 +105,7 @@ public class CamelRouteITCase extends AbstractITCase {
public void scriptingUpdate() {
assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
- CamelRouteTO oldRoute = camelRouteService.read("createUser");
+ CamelRouteTO oldRoute = camelRouteService.read(AnyTypeKind.USER, "createUser");
// updating route content including new attribute management
String routeContent = ""
@@ -135,7 +135,7 @@ public class CamelRouteITCase extends AbstractITCase {
+ " </doTry>\n"
+ " </route> ";
try {
- doUpdate("createUser", routeContent);
+ doUpdate(AnyTypeKind.USER, "createUser", routeContent);
// creating new schema attribute for user
PlainSchemaTO schemaTO = new PlainSchemaTO();
@@ -163,7 +163,7 @@ public class CamelRouteITCase extends AbstractITCase {
assertNotNull(userTO);
assertEquals("true", userTO.getPlainAttr("camelAttribute").get().getValues().get(0));
} finally {
- doUpdate(oldRoute.getKey(), oldRoute.getContent());
+ doUpdate(AnyTypeKind.USER, oldRoute.getKey(), oldRoute.getContent());
}
}
@@ -171,7 +171,7 @@ public class CamelRouteITCase extends AbstractITCase {
public void issueSYNCOPE931() {
assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
- CamelRouteTO oldRoute = camelRouteService.read("createUser");
+ CamelRouteTO oldRoute = camelRouteService.read(AnyTypeKind.USER, "createUser");
assertNotNull(oldRoute);
String routeContent = "<route id=\"createUser\">\n"
+ " <from uri=\"direct:createUser\"/>\n"
@@ -196,7 +196,7 @@ public class CamelRouteITCase extends AbstractITCase {
// Try to update a route with an incorrect propagation type
try {
- doUpdate("createUser", routeContent);
+ doUpdate(AnyTypeKind.USER, "createUser", routeContent);
fail("Error expected on an incorrect propagation type");
} catch (Exception ex) {
// Expected
@@ -205,10 +205,10 @@ public class CamelRouteITCase extends AbstractITCase {
// Now update the route again with the correct propagation type
routeContent = routeContent.replaceFirst("create123", "create");
try {
- CamelRouteTO route = doUpdate("createUser", routeContent);
+ CamelRouteTO route = doUpdate(AnyTypeKind.USER, "createUser", routeContent);
assertEquals(routeContent, route.getContent());
} finally {
- doUpdate(oldRoute.getKey(), oldRoute.getContent());
+ doUpdate(AnyTypeKind.USER, oldRoute.getKey(), oldRoute.getContent());
}
}
[3/4] syncope git commit: [SYNCOPE-1262] Last matrix parameter still
there
Posted by il...@apache.org.
[SYNCOPE-1262] Last matrix parameter still there
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/f1540839
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/f1540839
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/f1540839
Branch: refs/heads/2_0_X
Commit: f154083938cf76e2f0835573c2c1a7d4614bcff5
Parents: 6bc2cac
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Feb 13 17:15:41 2018 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Feb 13 18:59:47 2018 +0100
----------------------------------------------------------------------
.../syncope/common/lib/types/AuditElements.java | 7 +++--
.../common/lib/types/AuditLoggerName.java | 6 +----
.../panels/CamelRoutesDirectoryPanel.java | 4 +--
.../console/rest/CamelRoutesRestClient.java | 8 +++---
.../syncope/core/logic/CamelRouteLogic.java | 19 +++++++++++--
.../rest/api/service/CamelRouteService.java | 16 ++++++-----
.../rest/cxf/service/CamelRouteServiceImpl.java | 8 +++---
.../syncope/fit/core/CamelRouteITCase.java | 28 ++++++++++----------
8 files changed, 55 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/f1540839/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditElements.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditElements.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditElements.java
index 16f6d69..32e87a2 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditElements.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditElements.java
@@ -20,7 +20,6 @@ package org.apache.syncope.common.lib.types;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlEnum;
-import org.apache.commons.lang3.StringUtils;
public final class AuditElements implements Serializable {
@@ -33,12 +32,12 @@ public final class AuditElements implements Serializable {
@XmlEnum
public enum EventCategoryType {
- LOGIC(StringUtils.EMPTY),
- TASK(StringUtils.EMPTY),
+ LOGIC("LOGIC"),
+ TASK("TASK"),
PROPAGATION("PropagationTask"),
PULL("PullTask"),
PUSH("PushTask"),
- CUSTOM(StringUtils.EMPTY);
+ CUSTOM("CUSTOM");
private final String value;
http://git-wip-us.apache.org/repos/asf/syncope/blob/f1540839/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
index a595e9b..31622ec 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
@@ -185,11 +185,7 @@ public class AuditLoggerName extends AbstractBaseBean {
eventBuilder.append('[');
if (type != null) {
- if (StringUtils.isNotBlank(type.toString())) {
- eventBuilder.append(type.toString());
- } else {
- eventBuilder.append(type.name());
- }
+ eventBuilder.append(type.toString());
}
eventBuilder.append("]:[");
if (StringUtils.isNotBlank(category)) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/f1540839/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDirectoryPanel.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDirectoryPanel.java
index f6f37a6..353985f 100644
--- a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDirectoryPanel.java
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/panels/CamelRoutesDirectoryPanel.java
@@ -115,7 +115,7 @@ public class CamelRoutesDirectoryPanel extends DirectoryPanel<
@Override
public void onClick(final AjaxRequestTarget target, final CamelRouteTO ignore) {
- final CamelRouteTO route = restClient.read(model.getObject().getKey());
+ final CamelRouteTO route = restClient.read(anyTypeKind, model.getObject().getKey());
utilityModal.header(Model.of(route.getKey()));
utilityModal.setContent(new XMLEditorPanel(
@@ -126,7 +126,7 @@ public class CamelRoutesDirectoryPanel extends DirectoryPanel<
@Override
public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
try {
- restClient.update(route);
+ restClient.update(anyTypeKind, route);
info(getString(Constants.OPERATION_SUCCEEDED));
modal.close(target);
} catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/f1540839/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
----------------------------------------------------------------------
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
index 92d6118..aac5498 100644
--- a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
@@ -36,12 +36,12 @@ public class CamelRoutesRestClient extends BaseRestClient {
: Collections.<CamelRouteTO>emptyList();
}
- public CamelRouteTO read(final String key) {
- return getService(CamelRouteService.class).read(key);
+ public CamelRouteTO read(final AnyTypeKind anyTypeKind, final String key) {
+ return getService(CamelRouteService.class).read(anyTypeKind, key);
}
- public void update(final CamelRouteTO routeTO) {
- getService(CamelRouteService.class).update(routeTO);
+ public void update(final AnyTypeKind anyTypeKind, final CamelRouteTO routeTO) {
+ getService(CamelRouteService.class).update(anyTypeKind, routeTO);
}
public boolean isCamelEnabledFor(final AnyTypeKind anyTypeKind) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/f1540839/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
----------------------------------------------------------------------
diff --git a/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java b/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
index 2856daf..64a1914 100644
--- a/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
+++ b/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
@@ -30,10 +30,12 @@ import java.util.Map;
import org.apache.commons.collections4.ComparatorUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.to.CamelMetrics;
import org.apache.syncope.common.lib.to.CamelRouteTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.CamelEntitlement;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.core.persistence.api.dao.CamelRouteDAO;
import org.apache.syncope.core.persistence.api.dao.NotFoundException;
import org.apache.syncope.core.persistence.api.entity.CamelRoute;
@@ -70,21 +72,34 @@ public class CamelRouteLogic extends AbstractTransactionalLogic<CamelRouteTO> {
@PreAuthorize("hasRole('" + CamelEntitlement.ROUTE_READ + "')")
@Transactional(readOnly = true)
- public CamelRouteTO read(final String key) {
+ public CamelRouteTO read(final AnyTypeKind anyTypeKind, final String key) {
CamelRoute route = routeDAO.find(key);
if (route == null) {
throw new NotFoundException("CamelRoute with key=" + key);
}
+ if (route.getAnyTypeKind() != anyTypeKind) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + anyTypeKind + ", expected " + route.getAnyTypeKind());
+ throw sce;
+ }
+
return binder.getRouteTO(route);
}
@PreAuthorize("hasRole('" + CamelEntitlement.ROUTE_UPDATE + "')")
- public void update(final CamelRouteTO routeTO) {
+ public void update(final AnyTypeKind anyTypeKind, final CamelRouteTO routeTO) {
CamelRoute route = routeDAO.find(routeTO.getKey());
if (route == null) {
throw new NotFoundException("CamelRoute with key=" + routeTO.getKey());
}
+
+ if (route.getAnyTypeKind() != anyTypeKind) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + anyTypeKind + ", expected " + route.getAnyTypeKind());
+ throw sce;
+ }
+
String originalContent = route.getContent();
LOG.debug("Updating route {} with content {}", routeTO.getKey(), routeTO.getContent());
http://git-wip-us.apache.org/repos/asf/syncope/blob/f1540839/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
----------------------------------------------------------------------
diff --git a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
index 00a14d1..3e0913a 100644
--- a/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
+++ b/ext/camel/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CamelRouteService.java
@@ -24,7 +24,6 @@ import java.util.List;
import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
-import javax.ws.rs.MatrixParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
@@ -52,31 +51,36 @@ public interface CamelRouteService extends JAXRSService {
* @return all routes for the given any type kind
*/
@GET
+ @Path("{anyTypeKind}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- List<CamelRouteTO> list(@NotNull @MatrixParam("anyTypeKind") AnyTypeKind anyTypeKind);
+ List<CamelRouteTO> list(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind);
/**
* Read the route with the given key.
*
+ * @param anyTypeKind any type kind
* @param key route key
* @return route with given key
*/
@GET
- @Path("{key}")
+ @Path("{anyTypeKind}/{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- CamelRouteTO read(@NotNull @PathParam("key") String key);
+ CamelRouteTO read(
+ @NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind,
+ @NotNull @PathParam("key") String key);
/**
* Update the given route.
*
+ * @param anyTypeKind any type kind
* @param route to be updated
* @return an empty response if operation was successful
*/
@PUT
- @Path("{key}")
+ @Path("{anyTypeKind}/{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response update(@NotNull CamelRouteTO route);
+ Response update(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind, @NotNull CamelRouteTO route);
/**
* Restart the underlying Apache Camel context.
http://git-wip-us.apache.org/repos/asf/syncope/blob/f1540839/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java b/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
index a7f6fbd..eb1db19 100644
--- a/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
+++ b/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java
@@ -40,13 +40,13 @@ public class CamelRouteServiceImpl extends AbstractServiceImpl implements CamelR
}
@Override
- public CamelRouteTO read(final String key) {
- return logic.read(key);
+ public CamelRouteTO read(final AnyTypeKind anyTypeKind, final String key) {
+ return logic.read(anyTypeKind, key);
}
@Override
- public Response update(final CamelRouteTO route) {
- logic.update(route);
+ public Response update(final AnyTypeKind anyTypeKind, final CamelRouteTO route) {
+ logic.update(anyTypeKind, route);
return Response.noContent().build();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/f1540839/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
index 4f4f475..1b9f7a5 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
@@ -63,19 +63,19 @@ public class CamelRouteITCase extends AbstractITCase {
}
}
- private CamelRouteTO doUpdate(final String key, final String content) {
- CamelRouteTO route = camelRouteService.read(key);
+ private CamelRouteTO doUpdate(final AnyTypeKind anyTypeKind, final String key, final String content) {
+ CamelRouteTO route = camelRouteService.read(anyTypeKind, key);
route.setContent(content);
- camelRouteService.update(route);
+ camelRouteService.update(anyTypeKind, route);
// getting new route definition
- return camelRouteService.read(key);
+ return camelRouteService.read(anyTypeKind, key);
}
@Test
public void update() {
Assume.assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
- CamelRouteTO oldRoute = camelRouteService.read("createUser");
+ CamelRouteTO oldRoute = camelRouteService.read(AnyTypeKind.USER, "createUser");
assertNotNull(oldRoute);
String routeContent = "<route id=\"createUser\">\n"
+ " <from uri=\"direct:createUser\"/>\n"
@@ -98,10 +98,10 @@ public class CamelRouteITCase extends AbstractITCase {
+ " </doTry>\n"
+ "</route>";
try {
- CamelRouteTO route = doUpdate("createUser", routeContent);
+ CamelRouteTO route = doUpdate(AnyTypeKind.USER, "createUser", routeContent);
assertEquals(routeContent, route.getContent());
} finally {
- doUpdate(oldRoute.getKey(), oldRoute.getContent());
+ doUpdate(AnyTypeKind.USER, oldRoute.getKey(), oldRoute.getContent());
}
}
@@ -109,7 +109,7 @@ public class CamelRouteITCase extends AbstractITCase {
public void scriptingUpdate() {
Assume.assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
- CamelRouteTO oldRoute = camelRouteService.read("createUser");
+ CamelRouteTO oldRoute = camelRouteService.read(AnyTypeKind.USER, "createUser");
// updating route content including new attribute management
String routeContent = ""
@@ -139,7 +139,7 @@ public class CamelRouteITCase extends AbstractITCase {
+ " </doTry>\n"
+ " </route> ";
try {
- doUpdate("createUser", routeContent);
+ doUpdate(AnyTypeKind.USER, "createUser", routeContent);
// creating new schema attribute for user
PlainSchemaTO schemaTO = new PlainSchemaTO();
@@ -167,7 +167,7 @@ public class CamelRouteITCase extends AbstractITCase {
assertNotNull(userTO);
assertEquals("true", userTO.getPlainAttr("camelAttribute").getValues().get(0));
} finally {
- doUpdate(oldRoute.getKey(), oldRoute.getContent());
+ doUpdate(AnyTypeKind.USER, oldRoute.getKey(), oldRoute.getContent());
}
}
@@ -175,7 +175,7 @@ public class CamelRouteITCase extends AbstractITCase {
public void issueSYNCOPE931() {
Assume.assumeTrue(CamelDetector.isCamelEnabledForUsers(syncopeService));
- CamelRouteTO oldRoute = camelRouteService.read("createUser");
+ CamelRouteTO oldRoute = camelRouteService.read(AnyTypeKind.USER, "createUser");
assertNotNull(oldRoute);
String routeContent = "<route id=\"createUser\">\n"
+ " <from uri=\"direct:createUser\"/>\n"
@@ -200,7 +200,7 @@ public class CamelRouteITCase extends AbstractITCase {
// Try to update a route with an incorrect propagation type
try {
- doUpdate("createUser", routeContent);
+ doUpdate(AnyTypeKind.USER, "createUser", routeContent);
Assert.fail("Error expected on an incorrect propagation type");
} catch (Exception ex) {
// Expected
@@ -209,10 +209,10 @@ public class CamelRouteITCase extends AbstractITCase {
// Now update the route again with the correct propagation type
routeContent = routeContent.replaceFirst("create123", "create");
try {
- CamelRouteTO route = doUpdate("createUser", routeContent);
+ CamelRouteTO route = doUpdate(AnyTypeKind.USER, "createUser", routeContent);
assertEquals(routeContent, route.getContent());
} finally {
- doUpdate(oldRoute.getKey(), oldRoute.getContent());
+ doUpdate(AnyTypeKind.USER, oldRoute.getKey(), oldRoute.getContent());
}
}
[2/4] syncope git commit: [SYNCOPE-1262] Last matrix parameter still
there
Posted by il...@apache.org.
[SYNCOPE-1262] Last matrix parameter still there
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/5cbdfe7b
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/5cbdfe7b
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/5cbdfe7b
Branch: refs/heads/master
Commit: 5cbdfe7bc58c37a026226b743d2ed9685ad19c37
Parents: 7958ebd
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Feb 13 18:24:07 2018 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Feb 13 18:24:07 2018 +0100
----------------------------------------------------------------------
.../panels/ImplementationDirectoryPanel.java | 2 +-
.../policies/PolicyRuleDirectoryPanel.java | 8 ++++++-
.../policies/PolicyRuleWizardBuilder.java | 15 ++++++++----
.../reports/ReportletDirectoryPanel.java | 11 +++++----
.../console/reports/ReportletWizardBuilder.java | 12 ++++++----
.../console/rest/ImplementationRestClient.java | 8 +++----
.../syncope/common/lib/to/ImplementationTO.java | 1 +
.../syncope/common/lib/types/AuditElements.java | 7 +++---
.../common/lib/types/AuditLoggerName.java | 6 +----
.../rest/api/service/ImplementationService.java | 16 ++++++++-----
.../syncope/core/logic/ImplementationLogic.java | 16 +++++++++++--
.../cxf/service/ImplementationServiceImpl.java | 8 +++----
.../syncope/fit/core/ImplementationITCase.java | 10 ++++----
.../fit/core/NotificationTaskITCase.java | 5 ++--
.../apache/syncope/fit/core/PolicyITCase.java | 8 +++----
.../apache/syncope/fit/core/PullTaskITCase.java | 25 +++++++++++++-------
.../syncope/fit/core/SchedTaskITCase.java | 9 ++++---
.../syncope/fit/core/UserIssuesITCase.java | 10 ++++----
18 files changed, 108 insertions(+), 69 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/client/console/src/main/java/org/apache/syncope/client/console/panels/ImplementationDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ImplementationDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ImplementationDirectoryPanel.java
index 60a56d1..4aaea78 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ImplementationDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ImplementationDirectoryPanel.java
@@ -160,7 +160,7 @@ public class ImplementationDirectoryPanel extends DirectoryPanel<
@Override
public void onClick(final AjaxRequestTarget target, final ImplementationTO ignore) {
try {
- restClient.delete(model.getObject().getKey());
+ restClient.delete(model.getObject().getType(), model.getObject().getKey());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
} catch (SyncopeClientException e) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
index 150c359..600ebd8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
@@ -48,6 +48,7 @@ import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.policy.RuleConf;
import org.apache.syncope.common.lib.to.ImplementationTO;
import org.apache.syncope.common.lib.types.ImplementationEngine;
+import org.apache.syncope.common.lib.types.ImplementationType;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -82,6 +83,8 @@ public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel
private final PolicyType type;
+ private final ImplementationType implementationType;
+
private final String policy;
protected PolicyRuleDirectoryPanel(
@@ -92,6 +95,9 @@ public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel
this.baseModal = baseModal;
this.type = type;
+ this.implementationType = type == PolicyType.ACCOUNT
+ ? ImplementationType.ACCOUNT_RULE
+ : ImplementationType.PASSWORD_RULE;
this.policy = policy;
this.restClient = new PolicyRestClient();
@@ -234,7 +240,7 @@ public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel
@SuppressWarnings("unchecked")
private List<PolicyRuleWrapper> getPolicyRuleWrappers(final ComposablePolicy policy) {
return policy.getRules().stream().map(rule -> {
- ImplementationTO implementation = implementationClient.read(rule);
+ ImplementationTO implementation = implementationClient.read(implementationType, rule);
PolicyRuleWrapper wrapper = new PolicyRuleWrapper(false).
setImplementationKey(implementation.getKey()).
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
index eb93982..855837e 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
@@ -59,6 +59,8 @@ public class PolicyRuleWizardBuilder extends AjaxWizardBuilder<PolicyRuleWrapper
private final PolicyType type;
+ private final ImplementationType implementationType;
+
public PolicyRuleWizardBuilder(
final String policy,
final PolicyType type,
@@ -69,6 +71,9 @@ public class PolicyRuleWizardBuilder extends AjaxWizardBuilder<PolicyRuleWrapper
this.policy = policy;
this.type = type;
+ this.implementationType = type == PolicyType.ACCOUNT
+ ? ImplementationType.ACCOUNT_RULE
+ : ImplementationType.PASSWORD_RULE;
}
@Override
@@ -83,7 +88,7 @@ public class PolicyRuleWizardBuilder extends AjaxWizardBuilder<PolicyRuleWrapper
}
if (modelObject.getImplementationEngine() == ImplementationEngine.JAVA) {
- ImplementationTO rule = implementationClient.read(modelObject.getImplementationKey());
+ ImplementationTO rule = implementationClient.read(implementationType, modelObject.getImplementationKey());
try {
rule.setBody(MAPPER.writeValueAsString(modelObject.getConf()));
implementationClient.update(rule);
@@ -145,11 +150,11 @@ public class PolicyRuleWizardBuilder extends AjaxWizardBuilder<PolicyRuleWrapper
@Override
protected void onEvent(final AjaxRequestTarget target) {
- ImplementationTO implementation = implementationClient.read(conf.getModelObject());
- rule.setImplementationEngine(implementation.getEngine());
- if (implementation.getEngine() == ImplementationEngine.JAVA) {
+ ImplementationTO impl = implementationClient.read(implementationType, conf.getModelObject());
+ rule.setImplementationEngine(impl.getEngine());
+ if (impl.getEngine() == ImplementationEngine.JAVA) {
try {
- RuleConf ruleConf = MAPPER.readValue(implementation.getBody(), RuleConf.class);
+ RuleConf ruleConf = MAPPER.readValue(impl.getBody(), RuleConf.class);
rule.setConf(ruleConf);
} catch (Exception e) {
LOG.error("During deserialization", e);
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
index db7f4b8..6ac03e2 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletDirectoryPanel.java
@@ -47,6 +47,7 @@ import org.apache.syncope.common.lib.report.ReportletConf;
import org.apache.syncope.common.lib.to.ImplementationTO;
import org.apache.syncope.common.lib.to.ReportTO;
import org.apache.syncope.common.lib.types.ImplementationEngine;
+import org.apache.syncope.common.lib.types.ImplementationType;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
@@ -224,14 +225,14 @@ public class ReportletDirectoryPanel extends DirectoryPanel<
private List<ReportletWrapper> getReportletWrappers(final ReportTO reportTO) {
return reportTO.getReportlets().stream().map(reportlet -> {
- ImplementationTO implementation = implementationClient.read(reportlet);
+ ImplementationTO impl = implementationClient.read(ImplementationType.REPORTLET, reportlet);
ReportletWrapper wrapper = new ReportletWrapper(false).
- setImplementationKey(implementation.getKey()).
- setImplementationEngine(implementation.getEngine());
- if (implementation.getEngine() == ImplementationEngine.JAVA) {
+ setImplementationKey(impl.getKey()).
+ setImplementationEngine(impl.getEngine());
+ if (impl.getEngine() == ImplementationEngine.JAVA) {
try {
- ReportletConf reportletConf = MAPPER.readValue(implementation.getBody(), ReportletConf.class);
+ ReportletConf reportletConf = MAPPER.readValue(impl.getBody(), ReportletConf.class);
wrapper.setConf(reportletConf);
} catch (Exception e) {
LOG.error("During deserialization", e);
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletWizardBuilder.java
index 8668103..17785b0 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/reports/ReportletWizardBuilder.java
@@ -64,7 +64,8 @@ public class ReportletWizardBuilder extends AjaxWizardBuilder<ReportletWrapper>
@Override
protected Serializable onApplyInternal(final ReportletWrapper modelObject) {
if (modelObject.getImplementationEngine() == ImplementationEngine.JAVA) {
- ImplementationTO reportlet = implementationClient.read(modelObject.getImplementationKey());
+ ImplementationTO reportlet = implementationClient.read(
+ ImplementationType.REPORTLET, modelObject.getImplementationKey());
try {
reportlet.setBody(MAPPER.writeValueAsString(modelObject.getConf()));
implementationClient.update(reportlet);
@@ -109,11 +110,12 @@ public class ReportletWizardBuilder extends AjaxWizardBuilder<ReportletWrapper>
@Override
protected void onEvent(final AjaxRequestTarget target) {
- ImplementationTO implementation = implementationClient.read(conf.getModelObject());
- reportlet.setImplementationEngine(implementation.getEngine());
- if (implementation.getEngine() == ImplementationEngine.JAVA) {
+ ImplementationTO impl = implementationClient.read(
+ ImplementationType.REPORTLET, conf.getModelObject());
+ reportlet.setImplementationEngine(impl.getEngine());
+ if (impl.getEngine() == ImplementationEngine.JAVA) {
try {
- ReportletConf conf = MAPPER.readValue(implementation.getBody(), ReportletConf.class);
+ ReportletConf conf = MAPPER.readValue(impl.getBody(), ReportletConf.class);
reportlet.setConf(conf);
} catch (Exception e) {
LOG.error("During deserialization", e);
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/client/console/src/main/java/org/apache/syncope/client/console/rest/ImplementationRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/ImplementationRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/ImplementationRestClient.java
index 106d271..7d99c7c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/ImplementationRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/ImplementationRestClient.java
@@ -32,8 +32,8 @@ public class ImplementationRestClient extends BaseRestClient {
return getService(ImplementationService.class).list(type);
}
- public ImplementationTO read(final String key) {
- return getService(ImplementationService.class).read(key);
+ public ImplementationTO read(final ImplementationType type, final String key) {
+ return getService(ImplementationService.class).read(type, key);
}
public ImplementationTO create(final ImplementationTO implementation) {
@@ -46,8 +46,8 @@ public class ImplementationRestClient extends BaseRestClient {
getService(ImplementationService.class).update(implementation);
}
- public void delete(final String key) {
- getService(ImplementationService.class).delete(key);
+ public void delete(final ImplementationType type, final String key) {
+ getService(ImplementationService.class).delete(type, key);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ImplementationTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ImplementationTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ImplementationTO.java
index b212021..842045e 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ImplementationTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ImplementationTO.java
@@ -62,6 +62,7 @@ public class ImplementationTO extends AbstractBaseBean implements EntityTO {
return type;
}
+ @PathParam("type")
public void setType(final ImplementationType type) {
this.type = type;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditElements.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditElements.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditElements.java
index 16f6d69..32e87a2 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditElements.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditElements.java
@@ -20,7 +20,6 @@ package org.apache.syncope.common.lib.types;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlEnum;
-import org.apache.commons.lang3.StringUtils;
public final class AuditElements implements Serializable {
@@ -33,12 +32,12 @@ public final class AuditElements implements Serializable {
@XmlEnum
public enum EventCategoryType {
- LOGIC(StringUtils.EMPTY),
- TASK(StringUtils.EMPTY),
+ LOGIC("LOGIC"),
+ TASK("TASK"),
PROPAGATION("PropagationTask"),
PULL("PullTask"),
PUSH("PushTask"),
- CUSTOM(StringUtils.EMPTY);
+ CUSTOM("CUSTOM");
private final String value;
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
index a595e9b..31622ec 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/types/AuditLoggerName.java
@@ -185,11 +185,7 @@ public class AuditLoggerName extends AbstractBaseBean {
eventBuilder.append('[');
if (type != null) {
- if (StringUtils.isNotBlank(type.toString())) {
- eventBuilder.append(type.toString());
- } else {
- eventBuilder.append(type.name());
- }
+ eventBuilder.append(type.toString());
}
eventBuilder.append("]:[");
if (StringUtils.isNotBlank(category)) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ImplementationService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ImplementationService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ImplementationService.java
index fa5e59d..620d3fc 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ImplementationService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ImplementationService.java
@@ -26,7 +26,6 @@ import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
-import javax.ws.rs.MatrixParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
@@ -54,19 +53,21 @@ public interface ImplementationService extends JAXRSService {
* @return list of all implementations.
*/
@GET
+ @Path("{type}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- List<ImplementationTO> list(@NotNull @MatrixParam("type") ImplementationType type);
+ List<ImplementationTO> list(@NotNull @PathParam("type") ImplementationType type);
/**
* Returns implementation with matching key.
*
+ * @param type implementation type
* @param key key of implementation to be read
* @return implementation with matching key
*/
@GET
- @Path("{key}")
+ @Path("{type}/{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- ImplementationTO read(@NotNull @PathParam("key") String key);
+ ImplementationTO read(@NotNull @PathParam("type") ImplementationType type, @NotNull @PathParam("key") String key);
/**
* Creates a new implementation.
@@ -75,6 +76,7 @@ public interface ImplementationService extends JAXRSService {
* @return Response object featuring Location header of created implementation
*/
@POST
+ @Path("{type}/{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response create(@NotNull ImplementationTO implementationTO);
@@ -86,6 +88,7 @@ public interface ImplementationService extends JAXRSService {
* @return an empty response if operation was successful
*/
@PUT
+ @Path("{type}/{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
Response update(@NotNull ImplementationTO implementationTO);
@@ -93,12 +96,13 @@ public interface ImplementationService extends JAXRSService {
/**
* Deletes the implementation matching the given key.
*
+ * @param type implementation type
* @param key key for implementation to be deleted
* @return an empty response if operation was successful
*/
@DELETE
- @Path("{key}")
+ @Path("{type}/{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response delete(@NotNull @PathParam("key") String key);
+ Response delete(@NotNull @PathParam("type") ImplementationType type, @NotNull @PathParam("key") String key);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/core/logic/src/main/java/org/apache/syncope/core/logic/ImplementationLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/ImplementationLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/ImplementationLogic.java
index 65e6290..83bc933 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/ImplementationLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/ImplementationLogic.java
@@ -81,7 +81,7 @@ public class ImplementationLogic extends AbstractTransactionalLogic<Implementati
}
@PreAuthorize("hasRole('" + StandardEntitlement.IMPLEMENTATION_READ + "')")
- public ImplementationTO read(final String key) {
+ public ImplementationTO read(final ImplementationType type, final String key) {
Implementation implementation = implementationDAO.find(key);
if (implementation == null) {
LOG.error("Could not find implementation '" + key + "'");
@@ -89,6 +89,12 @@ public class ImplementationLogic extends AbstractTransactionalLogic<Implementati
throw new NotFoundException(key);
}
+ if (implementation.getType() != type) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + type + ", expected " + implementation.getType());
+ throw sce;
+ }
+
return binder.getImplementationTO(implementation);
}
@@ -124,7 +130,7 @@ public class ImplementationLogic extends AbstractTransactionalLogic<Implementati
}
@PreAuthorize("hasRole('" + StandardEntitlement.IMPLEMENTATION_DELETE + "')")
- public void delete(final String key) {
+ public void delete(final ImplementationType type, final String key) {
Implementation implementation = implementationDAO.find(key);
if (implementation == null) {
LOG.error("Could not find implementation '" + key + "'");
@@ -132,6 +138,12 @@ public class ImplementationLogic extends AbstractTransactionalLogic<Implementati
throw new NotFoundException(key);
}
+ if (implementation.getType() != type) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + type + ", expected " + implementation.getType());
+ throw sce;
+ }
+
boolean inUse = false;
switch (implementation.getType()) {
case REPORTLET:
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ImplementationServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ImplementationServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ImplementationServiceImpl.java
index c85793b..6113c81 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ImplementationServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ImplementationServiceImpl.java
@@ -41,8 +41,8 @@ public class ImplementationServiceImpl extends AbstractServiceImpl implements Im
}
@Override
- public ImplementationTO read(final String key) {
- return logic.read(key);
+ public ImplementationTO read(final ImplementationType type, final String key) {
+ return logic.read(type, key);
}
@Override
@@ -61,8 +61,8 @@ public class ImplementationServiceImpl extends AbstractServiceImpl implements Im
}
@Override
- public Response delete(final String key) {
- logic.delete(key);
+ public Response delete(final ImplementationType type, final String key) {
+ logic.delete(type, key);
return Response.noContent().build();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ImplementationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ImplementationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ImplementationITCase.java
index 109e750..7b5bb7e 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ImplementationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ImplementationITCase.java
@@ -31,7 +31,7 @@ import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.common.lib.types.ImplementationEngine;
import org.apache.syncope.common.lib.types.ImplementationType;
import org.apache.syncope.common.lib.types.TaskType;
-import org.apache.syncope.common.rest.api.service.ImplementationService;
+import org.apache.syncope.common.rest.api.RESTHeaders;
import org.apache.syncope.fit.AbstractITCase;
import org.apache.syncope.fit.core.reference.TestPullActions;
import org.junit.jupiter.api.Test;
@@ -63,8 +63,8 @@ public class ImplementationITCase extends AbstractITCase {
}
}
- ImplementationTO actual =
- getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ ImplementationTO actual = implementationService.read(
+ implementationTO.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(actual);
assertEquals(actual, implementationTO);
}
@@ -95,7 +95,7 @@ public class ImplementationITCase extends AbstractITCase {
// fails because the implementation is used
try {
- implementationService.delete(implementationTO.getKey());
+ implementationService.delete(implementationTO.getType(), implementationTO.getKey());
fail("Unexpected");
} catch (SyncopeClientException e) {
assertEquals(e.getType(), ClientExceptionType.InUse);
@@ -104,7 +104,7 @@ public class ImplementationITCase extends AbstractITCase {
pullTask.getActions().remove(implementationTO.getKey());
taskService.update(TaskType.PULL, pullTask);
- implementationService.delete(implementationTO.getKey());
+ implementationService.delete(implementationTO.getType(), implementationTO.getKey());
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java
index 8ac0cea..ea2714f 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java
@@ -39,9 +39,9 @@ import org.apache.syncope.common.lib.types.ImplementationEngine;
import org.apache.syncope.common.lib.types.ImplementationType;
import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.common.lib.types.TraceLevel;
+import org.apache.syncope.common.rest.api.RESTHeaders;
import org.apache.syncope.common.rest.api.beans.ExecuteQuery;
import org.apache.syncope.common.rest.api.beans.TaskQuery;
-import org.apache.syncope.common.rest.api.service.ImplementationService;
import org.apache.syncope.common.rest.api.service.NotificationService;
import org.apache.syncope.core.provisioning.java.job.notification.NotificationJob;
import org.apache.syncope.fit.core.reference.TestNotificationRecipientsProvider;
@@ -231,7 +231,8 @@ public class NotificationTaskITCase extends AbstractNotificationTaskITCase {
recipientsProvider.setType(ImplementationType.RECIPIENTS_PROVIDER);
recipientsProvider.setBody(TestNotificationRecipientsProvider.class.getName());
Response response = implementationService.create(recipientsProvider);
- recipientsProvider = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ recipientsProvider = implementationService.read(
+ recipientsProvider.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(recipientsProvider);
NotificationTO notification = new NotificationTO();
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
index 943ce6a..7ae759f 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
@@ -45,7 +45,6 @@ import org.apache.syncope.common.lib.to.ImplementationTO;
import org.apache.syncope.common.lib.types.ImplementationEngine;
import org.apache.syncope.common.lib.types.ImplementationType;
import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.ImplementationService;
import org.apache.syncope.core.provisioning.api.serialization.POJOHelper;
import org.apache.syncope.fit.AbstractITCase;
import org.apache.syncope.fit.core.reference.DummyPullCorrelationRule;
@@ -56,7 +55,7 @@ public class PolicyITCase extends AbstractITCase {
private PullPolicyTO buildPullPolicyTO() throws IOException {
ImplementationTO corrRule = null;
try {
- corrRule = implementationService.read("TestPullRule");
+ corrRule = implementationService.read(ImplementationType.PULL_CORRELATION_RULE, "TestPullRule");
} catch (SyncopeClientException e) {
if (e.getType().getResponseStatus() == Response.Status.NOT_FOUND) {
corrRule = new ImplementationTO();
@@ -66,7 +65,8 @@ public class PolicyITCase extends AbstractITCase {
corrRule.setBody(IOUtils.toString(
getClass().getResourceAsStream("/TestPullRule.groovy"), StandardCharsets.UTF_8));
Response response = implementationService.create(corrRule);
- corrRule = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ corrRule = implementationService.read(
+ corrRule.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(corrRule);
}
}
@@ -132,7 +132,7 @@ public class PolicyITCase extends AbstractITCase {
assertNotNull(policy);
assertNotEquals("ce93fcda-dc3a-4369-a7b0-a6108c261c85", policy.getKey());
- ImplementationTO rule = implementationService.read(policy.getRules().get(0));
+ ImplementationTO rule = implementationService.read(ImplementationType.PASSWORD_RULE, policy.getRules().get(0));
assertNotNull(rule);
DefaultPasswordRuleConf ruleConf = POJOHelper.deserialize(rule.getBody(), DefaultPasswordRuleConf.class);
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
index 708c2fa..3e6d67a 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
@@ -78,10 +78,10 @@ import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.syncope.common.lib.types.ResourceDeassociationAction;
import org.apache.syncope.common.lib.types.PullMode;
import org.apache.syncope.common.lib.types.TaskType;
+import org.apache.syncope.common.rest.api.RESTHeaders;
import org.apache.syncope.common.rest.api.beans.AnyQuery;
import org.apache.syncope.common.rest.api.beans.TaskQuery;
import org.apache.syncope.common.rest.api.service.ConnectorService;
-import org.apache.syncope.common.rest.api.service.ImplementationService;
import org.apache.syncope.common.rest.api.service.TaskService;
import org.apache.syncope.core.provisioning.java.pushpull.DBPasswordPullActions;
import org.apache.syncope.core.provisioning.java.pushpull.LDAPPasswordPullActions;
@@ -105,7 +105,8 @@ public class PullTaskITCase extends AbstractTaskITCase {
public static void testPullActionsSetup() {
ImplementationTO pullActions = null;
try {
- pullActions = implementationService.read(TestPullActions.class.getSimpleName());
+ pullActions = implementationService.read(
+ ImplementationType.PULL_ACTIONS, TestPullActions.class.getSimpleName());
} catch (SyncopeClientException e) {
if (e.getType().getResponseStatus() == Response.Status.NOT_FOUND) {
pullActions = new ImplementationTO();
@@ -114,7 +115,8 @@ public class PullTaskITCase extends AbstractTaskITCase {
pullActions.setType(ImplementationType.PULL_ACTIONS);
pullActions.setBody(TestPullActions.class.getName());
Response response = implementationService.create(pullActions);
- pullActions = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ pullActions = implementationService.read(
+ pullActions.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(pullActions);
}
}
@@ -444,7 +446,8 @@ public class PullTaskITCase extends AbstractTaskITCase {
transformer.setBody(IOUtils.toString(
getClass().getResourceAsStream("/PrefixItemTransformer.groovy"), StandardCharsets.UTF_8));
Response response = implementationService.create(transformer);
- transformer = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ transformer = implementationService.read(
+ transformer.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(transformer);
mappingItem.getTransformers().clear();
@@ -534,7 +537,8 @@ public class PullTaskITCase extends AbstractTaskITCase {
reconFilterBuilder.setBody(IOUtils.toString(
getClass().getResourceAsStream("/TestReconFilterBuilder.groovy"), StandardCharsets.UTF_8));
Response response = implementationService.create(reconFilterBuilder);
- reconFilterBuilder = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ reconFilterBuilder = implementationService.read(
+ reconFilterBuilder.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(reconFilterBuilder);
task = taskService.read(TaskType.PULL, "7c2242f4-14af-4ab5-af31-cdae23783655", true);
@@ -763,7 +767,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
// -----------------------------
ImplementationTO corrRule = null;
try {
- corrRule = implementationService.read("TestPullRule");
+ corrRule = implementationService.read(ImplementationType.PULL_CORRELATION_RULE, "TestPullRule");
} catch (SyncopeClientException e) {
if (e.getType().getResponseStatus() == Response.Status.NOT_FOUND) {
corrRule = new ImplementationTO();
@@ -773,7 +777,8 @@ public class PullTaskITCase extends AbstractTaskITCase {
corrRule.setBody(IOUtils.toString(
getClass().getResourceAsStream("/TestPullRule.groovy"), StandardCharsets.UTF_8));
Response response = implementationService.create(corrRule);
- corrRule = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ corrRule = implementationService.read(
+ corrRule.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(corrRule);
}
}
@@ -927,7 +932,8 @@ public class PullTaskITCase extends AbstractTaskITCase {
pullActions.setType(ImplementationType.PULL_ACTIONS);
pullActions.setBody(DBPasswordPullActions.class.getName());
Response response = implementationService.create(pullActions);
- pullActions = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ pullActions = implementationService.read(
+ pullActions.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(pullActions);
PullTaskTO pullTask = new PullTaskTO();
@@ -1016,7 +1022,8 @@ public class PullTaskITCase extends AbstractTaskITCase {
pullActions.setType(ImplementationType.PULL_ACTIONS);
pullActions.setBody(LDAPPasswordPullActions.class.getName());
Response response = implementationService.create(pullActions);
- pullActions = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ pullActions = implementationService.read(
+ pullActions.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(pullActions);
pullTask = new PullTaskTO();
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
index 358506a..48cbe70 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
@@ -89,7 +89,8 @@ public class SchedTaskITCase extends AbstractTaskITCase {
@Test
public void deferred() {
- ImplementationTO taskJobDelegate = implementationService.read(TestSampleJobDelegate.class.getSimpleName());
+ ImplementationTO taskJobDelegate = implementationService.read(
+ ImplementationType.TASKJOB_DELEGATE, TestSampleJobDelegate.class.getSimpleName());
assertNotNull(taskJobDelegate);
SchedTaskTO task = new SchedTaskTO();
@@ -134,7 +135,8 @@ public class SchedTaskITCase extends AbstractTaskITCase {
@Test
public void issueSYNCOPE144() {
- ImplementationTO taskJobDelegate = implementationService.read(TestSampleJobDelegate.class.getSimpleName());
+ ImplementationTO taskJobDelegate = implementationService.read(
+ ImplementationType.TASKJOB_DELEGATE, TestSampleJobDelegate.class.getSimpleName());
assertNotNull(taskJobDelegate);
SchedTaskTO task = new SchedTaskTO();
@@ -168,7 +170,8 @@ public class SchedTaskITCase extends AbstractTaskITCase {
List<JobTO> jobs = taskService.listJobs();
int old_size = jobs.size();
- ImplementationTO taskJobDelegate = implementationService.read(TestSampleJobDelegate.class.getSimpleName());
+ ImplementationTO taskJobDelegate = implementationService.read(
+ ImplementationType.TASKJOB_DELEGATE, TestSampleJobDelegate.class.getSimpleName());
assertNotNull(taskJobDelegate);
SchedTaskTO task = new SchedTaskTO();
http://git-wip-us.apache.org/repos/asf/syncope/blob/5cbdfe7b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
index 8ff08a0..3e9024e 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
@@ -74,7 +74,6 @@ import org.apache.syncope.common.lib.types.PatchOperation;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.syncope.common.rest.api.RESTHeaders;
-import org.apache.syncope.common.rest.api.service.ImplementationService;
import org.apache.syncope.core.provisioning.api.serialization.POJOHelper;
import org.apache.syncope.core.provisioning.java.propagation.DBPasswordPropagationActions;
import org.apache.syncope.core.provisioning.java.propagation.LDAPPasswordPropagationActions;
@@ -806,7 +805,8 @@ public class UserIssuesITCase extends AbstractITCase {
logicActions.setBody(org.apache.commons.io.IOUtils.toString(
getClass().getResourceAsStream("/DoubleValueLogicActions.groovy"), StandardCharsets.UTF_8));
Response response = implementationService.create(logicActions);
- logicActions = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ logicActions = implementationService.read(
+ logicActions.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(logicActions);
RealmTO realm = realmService.list("/even/two").iterator().next();
@@ -987,7 +987,8 @@ public class UserIssuesITCase extends AbstractITCase {
propagationActions.setType(ImplementationType.PROPAGATION_ACTIONS);
propagationActions.setBody(DBPasswordPropagationActions.class.getName());
Response response = implementationService.create(propagationActions);
- propagationActions = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ propagationActions = implementationService.read(
+ propagationActions.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(propagationActions);
ResourceTO resourceTO = resourceService.read(RESOURCE_NAME_TESTDB);
@@ -1036,7 +1037,8 @@ public class UserIssuesITCase extends AbstractITCase {
propagationActions.setType(ImplementationType.PROPAGATION_ACTIONS);
propagationActions.setBody(LDAPPasswordPropagationActions.class.getName());
Response response = implementationService.create(propagationActions);
- propagationActions = getObject(response.getLocation(), ImplementationService.class, ImplementationTO.class);
+ propagationActions = implementationService.read(
+ propagationActions.getType(), response.getHeaderString(RESTHeaders.RESOURCE_KEY));
assertNotNull(propagationActions);
ResourceTO resourceTO = resourceService.read(RESOURCE_NAME_LDAP);
[4/4] syncope git commit: [SYNCOPE-1274] Missing some OpenApi stuff
Posted by il...@apache.org.
[SYNCOPE-1274] Missing some OpenApi stuff
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/08c1aa43
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/08c1aa43
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/08c1aa43
Branch: refs/heads/master
Commit: 08c1aa43b3f6a3e700bf3675120b5315c0dffb3a
Parents: 5cbdfe7
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Feb 13 21:46:12 2018 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Feb 13 21:46:12 2018 +0100
----------------------------------------------------------------------
.../org/apache/syncope/common/lib/patch/AnyObjectPatch.java | 1 +
.../java/org/apache/syncope/common/lib/patch/GroupPatch.java | 1 +
.../java/org/apache/syncope/common/lib/patch/UserPatch.java | 1 +
.../org/apache/syncope/common/lib/policy/AccountPolicyTO.java | 1 +
.../org/apache/syncope/common/lib/policy/PasswordPolicyTO.java | 1 +
.../java/org/apache/syncope/common/lib/policy/PullPolicyTO.java | 1 +
.../main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java | 1 +
.../main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java | 1 +
.../src/main/java/org/apache/syncope/common/lib/to/GroupTO.java | 1 +
.../org/apache/syncope/common/lib/to/NotificationTaskTO.java | 1 +
.../java/org/apache/syncope/common/lib/to/PlainSchemaTO.java | 1 +
.../org/apache/syncope/common/lib/to/PropagationTaskTO.java | 1 +
.../org/apache/syncope/common/lib/to/ProvisioningTaskTO.java | 5 +++--
.../main/java/org/apache/syncope/common/lib/to/PullTaskTO.java | 1 +
.../main/java/org/apache/syncope/common/lib/to/PushTaskTO.java | 1 +
.../main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java | 2 +-
.../src/main/java/org/apache/syncope/common/lib/to/UserTO.java | 1 +
.../main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java | 1 +
18 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyObjectPatch.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyObjectPatch.java b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyObjectPatch.java
index 9a37cae..8b0bff2 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyObjectPatch.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyObjectPatch.java
@@ -29,6 +29,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "anyObjectPatch")
@XmlType
+@Schema(allOf = { AnyPatch.class })
public class AnyObjectPatch extends AnyPatch {
private static final long serialVersionUID = -1644118942622556097L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
index 0ddddfb..2ff1ebb 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
@@ -36,6 +36,7 @@ import org.apache.syncope.common.lib.to.TypeExtensionTO;
@XmlRootElement(name = "groupPatch")
@XmlType
+@Schema(allOf = { AnyPatch.class })
public class GroupPatch extends AnyPatch {
private static final long serialVersionUID = -460284378124440077L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/patch/UserPatch.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/UserPatch.java b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/UserPatch.java
index c9e7038..79795ae 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/UserPatch.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/UserPatch.java
@@ -29,6 +29,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "userPatch")
@XmlType
+@Schema(allOf = { AnyPatch.class })
public class UserPatch extends AnyPatch {
private static final long serialVersionUID = 2872795537911821448L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java
index bf05ea3..95c6433 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java
@@ -30,6 +30,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "accountPolicy")
@XmlType
+@Schema(allOf = { PolicyTO.class })
public class AccountPolicyTO extends PolicyTO implements ComposablePolicy {
private static final long serialVersionUID = -1557150042828800134L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java
index 9f71072..4b480e5 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java
@@ -30,6 +30,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "passwordPolicy")
@XmlType
+@Schema(allOf = { PolicyTO.class })
public class PasswordPolicyTO extends PolicyTO implements ComposablePolicy {
private static final long serialVersionUID = -5606086441294799690L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PullPolicyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PullPolicyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PullPolicyTO.java
index 6ac847a..967f04d 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PullPolicyTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PullPolicyTO.java
@@ -31,6 +31,7 @@ import org.apache.syncope.common.lib.types.ConflictResolutionAction;
@XmlRootElement(name = "pullPolicy")
@XmlType
+@Schema(allOf = { PolicyTO.class })
public class PullPolicyTO extends PolicyTO {
private static final long serialVersionUID = 993024634238024242L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
index 61c7173..4ac3fd8 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
@@ -32,6 +32,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "anyObject")
@XmlType
+@Schema(allOf = { AnyTO.class })
public class AnyObjectTO extends AnyTO implements GroupableRelatableTO {
private static final long serialVersionUID = 8841697496476959639L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java
index d2242b5..5508265 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java
@@ -26,6 +26,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "derSchema")
@XmlType
+@Schema(allOf = { SchemaTO.class })
public class DerSchemaTO extends SchemaTO {
private static final long serialVersionUID = -6747399803792103108L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
index e1de0d7..dcc6ae9 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
@@ -37,6 +37,7 @@ import org.apache.syncope.common.lib.types.AnyTypeKind;
@XmlRootElement(name = "group")
@XmlType
+@Schema(allOf = { AnyTO.class })
public class GroupTO extends AnyTO {
private static final long serialVersionUID = -7785920258290147542L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java
index 0f6b4f1..a0ae3e7 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java
@@ -32,6 +32,7 @@ import org.apache.syncope.common.lib.types.TraceLevel;
@XmlRootElement(name = "notificationTask")
@XmlType
+@Schema(allOf = { TaskTO.class })
public class NotificationTaskTO extends TaskTO {
private static final long serialVersionUID = 371671242591093846L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java
index 2eba6f6..7e5d3de 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java
@@ -30,6 +30,7 @@ import org.apache.syncope.common.lib.types.CipherAlgorithm;
@XmlRootElement(name = "plainSchema")
@XmlType
+@Schema(allOf = { SchemaTO.class })
public class PlainSchemaTO extends SchemaTO {
private static final long serialVersionUID = -8133983392476990308L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java
index 66f804e..5d6ee20 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java
@@ -29,6 +29,7 @@ import org.apache.syncope.common.lib.types.ResourceOperation;
@XmlRootElement(name = "propagationTask")
@XmlType
+@Schema(allOf = { TaskTO.class })
public class PropagationTaskTO extends TaskTO {
private static final long serialVersionUID = 386450127003321197L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java
index c152190..27d4f9b 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java
@@ -24,7 +24,6 @@ import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
-
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
@@ -34,7 +33,9 @@ import org.apache.syncope.common.lib.types.UnmatchingRule;
@XmlRootElement(name = "provisioningTask")
@XmlType
@XmlSeeAlso({ PushTaskTO.class, PullTaskTO.class })
-@Schema(subTypes = { PushTaskTO.class, PullTaskTO.class }, discriminatorProperty = "@class")
+@Schema(
+ allOf = { SchedTaskTO.class },
+ subTypes = { PushTaskTO.class, PullTaskTO.class }, discriminatorProperty = "@class")
public abstract class ProvisioningTaskTO extends SchedTaskTO {
private static final long serialVersionUID = -5722284116974636425L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java
index 16e578d..2638ad6 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java
@@ -35,6 +35,7 @@ import org.apache.syncope.common.lib.types.PullMode;
@XmlRootElement(name = "pullTask")
@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
+@Schema(allOf = { ProvisioningTaskTO.class })
public class PullTaskTO extends ProvisioningTaskTO implements TemplatableTO {
private static final long serialVersionUID = -2143537546915809017L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java
index 2dc02c1..d9f8d6e 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java
@@ -34,6 +34,7 @@ import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
@XmlRootElement(name = "pushTask")
@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
+@Schema(allOf = { ProvisioningTaskTO.class })
public class PushTaskTO extends ProvisioningTaskTO {
private static final long serialVersionUID = -2143537546915809018L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java
index d903ad3..69f5b95 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java
@@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "schedTask")
@XmlType
@XmlSeeAlso({ ProvisioningTaskTO.class })
-@Schema(subTypes = { ProvisioningTaskTO.class }, discriminatorProperty = "@class")
+@Schema(allOf = { TaskTO.class }, subTypes = { ProvisioningTaskTO.class }, discriminatorProperty = "@class")
public class SchedTaskTO extends TaskTO {
private static final long serialVersionUID = -5722284116974636425L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
index 79d5c12..0341f48 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
@@ -34,6 +34,7 @@ import org.apache.syncope.common.lib.types.AnyTypeKind;
@XmlRootElement(name = "user")
@XmlType
+@Schema(allOf = { AnyTO.class })
public class UserTO extends AnyTO implements GroupableRelatableTO {
private static final long serialVersionUID = 7791304495192615740L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/08c1aa43/common/lib/src/main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java
index df7121b..300e129 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java
@@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
@XmlRootElement(name = "virSchema")
+@Schema(allOf = { SchemaTO.class })
public class VirSchemaTO extends SchemaTO {
private static final long serialVersionUID = -8198557479659701343L;