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/20 10:09:54 UTC
[3/4] syncope git commit: [SYNCOPE-1262] Prefer to properly return
void but add @ApiResponse for 204
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceHistoryServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceHistoryServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceHistoryServiceImpl.java
index ef5aead..b69b5be 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceHistoryServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceHistoryServiceImpl.java
@@ -19,7 +19,6 @@
package org.apache.syncope.core.rest.cxf.service;
import java.util.List;
-import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.to.ResourceHistoryConfTO;
import org.apache.syncope.common.rest.api.service.ResourceHistoryService;
import org.apache.syncope.core.logic.ResourceHistoryLogic;
@@ -38,15 +37,13 @@ public class ResourceHistoryServiceImpl extends AbstractServiceImpl implements R
}
@Override
- public Response restore(final String key) {
+ public void restore(final String key) {
logic.restore(key);
- return Response.noContent().build();
}
@Override
- public Response delete(final String key) {
+ public void delete(final String key) {
logic.delete(key);
- return Response.noContent().build();
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
index e3c9992..2b76dfc 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
@@ -72,27 +72,23 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements Resource
}
@Override
- public Response update(final ResourceTO resourceTO) {
+ public void update(final ResourceTO resourceTO) {
logic.update(resourceTO);
- return Response.noContent().build();
}
@Override
- public Response setLatestSyncToken(final String key, final String anyTypeKey) {
+ public void setLatestSyncToken(final String key, final String anyTypeKey) {
logic.setLatestSyncToken(key, anyTypeKey);
- return Response.noContent().build();
}
@Override
- public Response removeSyncToken(final String key, final String anyTypeKey) {
+ public void removeSyncToken(final String key, final String anyTypeKey) {
logic.removeSyncToken(key, anyTypeKey);
- return Response.noContent().build();
}
@Override
- public Response delete(final String key) {
+ public void delete(final String key) {
logic.delete(key);
- return Response.noContent().build();
}
@Override
@@ -142,9 +138,8 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements Resource
}
@Override
- public Response check(final ResourceTO resourceTO) {
+ public void check(final ResourceTO resourceTO) {
logic.check(resourceTO);
- return Response.noContent().build();
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/RoleServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/RoleServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/RoleServiceImpl.java
index b31b4e1..6a0a75a 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/RoleServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/RoleServiceImpl.java
@@ -61,15 +61,13 @@ public class RoleServiceImpl extends AbstractServiceImpl implements RoleService
}
@Override
- public Response update(final RoleTO roleTO) {
+ public void update(final RoleTO roleTO) {
logic.update(roleTO);
- return Response.noContent().build();
}
@Override
- public Response delete(final String key) {
+ public void delete(final String key) {
logic.delete(key);
- return Response.noContent().build();
}
@Override
@@ -83,10 +81,9 @@ public class RoleServiceImpl extends AbstractServiceImpl implements RoleService
}
@Override
- public Response setConsoleLayoutInfo(final String key, final InputStream consoleLayoutIn) {
+ public void setConsoleLayoutInfo(final String key, final InputStream consoleLayoutIn) {
try {
logic.setConsoleLayoutInfo(key, IOUtils.toString(consoleLayoutIn, StandardCharsets.UTF_8.name()));
- return Response.noContent().build();
} catch (final IOException e) {
LOG.error("While setting console layout info for role {}", key, e);
throw new InternalServerErrorException("Could not read entity", e);
@@ -94,9 +91,8 @@ public class RoleServiceImpl extends AbstractServiceImpl implements RoleService
}
@Override
- public Response removeConsoleLayoutInfo(final String key) {
+ public void removeConsoleLayoutInfo(final String key) {
logic.setConsoleLayoutInfo(key, null);
- return Response.noContent().build();
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
index f650839..5c74e41 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
@@ -47,9 +47,8 @@ public class SchemaServiceImpl extends AbstractServiceImpl implements SchemaServ
}
@Override
- public Response delete(final SchemaType schemaType, final String key) {
+ public void delete(final SchemaType schemaType, final String key) {
logic.delete(schemaType, key);
- return Response.noContent().build();
}
@Override
@@ -63,8 +62,7 @@ public class SchemaServiceImpl extends AbstractServiceImpl implements SchemaServ
}
@Override
- public Response update(final SchemaType schemaType, final SchemaTO schemaTO) {
+ public void update(final SchemaType schemaType, final SchemaTO schemaTO) {
logic.update(schemaType, schemaTO);
- return Response.noContent().build();
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SecurityQuestionServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SecurityQuestionServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SecurityQuestionServiceImpl.java
index fbfd00a..5dca503 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SecurityQuestionServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SecurityQuestionServiceImpl.java
@@ -55,15 +55,13 @@ public class SecurityQuestionServiceImpl extends AbstractServiceImpl implements
}
@Override
- public Response update(final SecurityQuestionTO securityQuestionTO) {
+ public void update(final SecurityQuestionTO securityQuestionTO) {
logic.update(securityQuestionTO);
- return Response.noContent().build();
}
@Override
- public Response delete(final String key) {
+ public void delete(final String key) {
logic.delete(key);
- return Response.noContent().build();
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
index cd24751..6c3a10b 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
@@ -64,9 +64,8 @@ public class TaskServiceImpl extends AbstractExecutableService implements TaskSe
}
@Override
- public Response delete(final TaskType type, final String key) {
+ public void delete(final TaskType type, final String key) {
logic.delete(type, key);
- return Response.noContent().build();
}
@SuppressWarnings("unchecked")
@@ -91,9 +90,8 @@ public class TaskServiceImpl extends AbstractExecutableService implements TaskSe
}
@Override
- public Response update(final TaskType type, final SchedTaskTO taskTO) {
+ public void update(final TaskType type, final SchedTaskTO taskTO) {
logic.updateSchedTask(type, taskTO);
- return Response.noContent().build();
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserSelfServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserSelfServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserSelfServiceImpl.java
index 92b0144..82d9cbc 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserSelfServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserSelfServiceImpl.java
@@ -96,7 +96,7 @@ public class UserSelfServiceImpl extends AbstractServiceImpl implements UserSelf
}
@Override
- public Response requestPasswordReset(final String username, final String securityAnswer) {
+ public void requestPasswordReset(final String username, final String securityAnswer) {
if (!syncopeLogic.isPwdResetAllowed()) {
SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.DelegatedAdministration);
sce.getElements().add("Password reset forbidden by configuration");
@@ -104,11 +104,10 @@ public class UserSelfServiceImpl extends AbstractServiceImpl implements UserSelf
}
logic.requestPasswordReset(username, securityAnswer);
- return Response.noContent().build();
}
@Override
- public Response confirmPasswordReset(final String token, final String password) {
+ public void confirmPasswordReset(final String token, final String password) {
if (!syncopeLogic.isPwdResetAllowed()) {
SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.DelegatedAdministration);
sce.getElements().add("Password reset forbidden by configuration");
@@ -116,7 +115,6 @@ public class UserSelfServiceImpl extends AbstractServiceImpl implements UserSelf
}
logic.confirmPasswordReset(token, password);
- return Response.noContent().build();
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java
index b67e5bb..2321e0a 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/WorkflowServiceImpl.java
@@ -66,20 +66,18 @@ public class WorkflowServiceImpl extends AbstractServiceImpl implements Workflow
}
@Override
- public Response set(final String anyType, final String key, final String definition) {
+ public void set(final String anyType, final String key, final String definition) {
WorkflowDefinitionFormat format =
messageContext.getHttpHeaders().getMediaType().equals(MediaType.APPLICATION_JSON_TYPE)
? WorkflowDefinitionFormat.JSON
: WorkflowDefinitionFormat.XML;
logic.importDefinition(anyType, key, format, definition);
- return Response.noContent().build();
}
@Override
- public Response delete(final String anyType, final String key) {
+ public void delete(final String anyType, final String key) {
logic.delete(anyType, key);
- return Response.noContent().build();
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/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 9dd5bca..2d53b88 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
@@ -18,6 +18,8 @@
*/
package org.apache.syncope.common.rest.api.service;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityRequirements;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -31,7 +33,6 @@ import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.to.CamelMetrics;
import org.apache.syncope.common.lib.to.CamelRouteTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
@@ -76,23 +77,24 @@ public interface CamelRouteService extends JAXRSService {
*
* @param anyTypeKind any type kind
* @param route to be updated
- * @return an empty response if operation was successful
*/
+ @ApiResponses(
+ @ApiResponse(responseCode = "204", description = "Operation was successful"))
@PUT
@Path("{anyTypeKind}/{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response update(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind, @NotNull CamelRouteTO route);
+ void update(@NotNull @PathParam("anyTypeKind") AnyTypeKind anyTypeKind, @NotNull CamelRouteTO route);
/**
* Restart the underlying Apache Camel context.
- *
- * @return an empty response if operation was successful
*/
+ @ApiResponses(
+ @ApiResponse(responseCode = "204", description = "Operation was successful"))
@POST
@Path("restartContext")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response restartContext();
+ void restartContext();
/**
* Provides Camel metrics.
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/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 eb1db19..57b9242 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
@@ -19,7 +19,6 @@
package org.apache.syncope.core.rest.cxf.service;
import java.util.List;
-import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.to.CamelMetrics;
import org.apache.syncope.common.lib.to.CamelRouteTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
@@ -45,15 +44,13 @@ public class CamelRouteServiceImpl extends AbstractServiceImpl implements CamelR
}
@Override
- public Response update(final AnyTypeKind anyTypeKind, final CamelRouteTO route) {
+ public void update(final AnyTypeKind anyTypeKind, final CamelRouteTO route) {
logic.update(anyTypeKind, route);
- return Response.noContent().build();
}
@Override
- public Response restartContext() {
+ public void restartContext() {
logic.restartContext();
- return Response.noContent().build();
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
index 90c79e2..3123808 100644
--- a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
+++ b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPService.java
@@ -18,6 +18,8 @@
*/
package org.apache.syncope.common.rest.api.service;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityRequirements;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -92,22 +94,24 @@ public interface SAML2IdPService extends JAXRSService {
* Updates the SAML 2.0 Identity Provider with matching entityID.
*
* @param saml2IdpTO idp configuration to be stored
- * @return an empty response if operation was successful
*/
+ @ApiResponses(
+ @ApiResponse(responseCode = "204", description = "Operation was successful"))
@PUT
@Path("{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response update(@NotNull SAML2IdPTO saml2IdpTO);
+ void update(@NotNull SAML2IdPTO saml2IdpTO);
/**
* Deletes the SAML 2.0 Identity Provider with matching entityID.
*
* @param key SAML 2.0 Identity Provider's entityID
- * @return an empty response if operation was successful
*/
+ @ApiResponses(
+ @ApiResponse(responseCode = "204", description = "Operation was successful"))
@DELETE
@Path("{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response delete(@PathParam("key") String key);
+ void delete(@PathParam("key") String key);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
index 0718538..3cfbbc2 100644
--- a/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
+++ b/ext/saml2sp/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SPService.java
@@ -18,6 +18,8 @@
*/
package org.apache.syncope.common.rest.api.service;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityRequirements;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -95,11 +97,12 @@ public interface SAML2SPService extends JAXRSService {
* Validates the received SAML 2.0 logout response.
*
* @param response SAML response and relay state
- * @return an empty response if operation was successful
*/
+ @ApiResponses(
+ @ApiResponse(responseCode = "204", description = "Operation was successful"))
@POST
@Path("logoutResponse")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response validateLogoutResponse(SAML2ReceivedResponseTO response);
+ void validateLogoutResponse(SAML2ReceivedResponseTO response);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2IdPServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2IdPServiceImpl.java b/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2IdPServiceImpl.java
index bd2f5f9..ebda30d 100644
--- a/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2IdPServiceImpl.java
+++ b/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2IdPServiceImpl.java
@@ -61,15 +61,13 @@ public class SAML2IdPServiceImpl extends AbstractServiceImpl implements SAML2IdP
}
@Override
- public Response update(final SAML2IdPTO saml2IdpTO) {
+ public void update(final SAML2IdPTO saml2IdpTO) {
logic.update(saml2IdpTO);
- return Response.noContent().build();
}
@Override
- public Response delete(final String key) {
+ public void delete(final String key) {
logic.delete(key);
- return Response.noContent().build();
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2SPServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2SPServiceImpl.java b/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2SPServiceImpl.java
index 93cd87b..3b8c847 100644
--- a/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2SPServiceImpl.java
+++ b/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2SPServiceImpl.java
@@ -47,9 +47,7 @@ public class SAML2SPServiceImpl extends AbstractServiceImpl implements SAML2SPSe
}
@Override
- public SAML2RequestTO createLoginRequest(
- final String spEntityID, final String idpEntityID) {
-
+ public SAML2RequestTO createLoginRequest(final String spEntityID, final String idpEntityID) {
return logic.createLoginRequest(StringUtils.appendIfMissing(spEntityID, "/"), idpEntityID);
}
@@ -66,9 +64,8 @@ public class SAML2SPServiceImpl extends AbstractServiceImpl implements SAML2SPSe
}
@Override
- public Response validateLogoutResponse(final SAML2ReceivedResponseTO response) {
+ public void validateLogoutResponse(final SAML2ReceivedResponseTO response) {
logic.validateLogoutResponse(getJWTToken(), response);
- return Response.noContent().build();
}
private String getJWTToken() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
index 7bdc050..353ea34 100644
--- a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
+++ b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java
@@ -18,6 +18,8 @@
*/
package org.apache.syncope.common.rest.api.service;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityRequirements;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -28,7 +30,6 @@ import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.scim.SCIMConf;
/**
@@ -54,10 +55,11 @@ public interface SCIMConfService extends JAXRSService {
* Sets SCIM configuration.
*
* @param conf SCIM configuration
- * @return an empty response if operation was successful
*/
+ @ApiResponses(
+ @ApiResponse(responseCode = "204", description = "Operation was successful"))
@PUT
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response set(@NotNull SCIMConf conf);
+ void set(@NotNull SCIMConf conf);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/e725c72b/ext/scimv2/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SCIMConfServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/scimv2/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SCIMConfServiceImpl.java b/ext/scimv2/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SCIMConfServiceImpl.java
index 1d14701..223aca7 100644
--- a/ext/scimv2/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SCIMConfServiceImpl.java
+++ b/ext/scimv2/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SCIMConfServiceImpl.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.core.rest.cxf.service;
-import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.scim.SCIMConf;
import org.apache.syncope.common.rest.api.service.SCIMConfService;
import org.apache.syncope.core.logic.scim.SCIMConfManager;
@@ -35,9 +34,8 @@ public class SCIMConfServiceImpl extends AbstractServiceImpl implements SCIMConf
}
@Override
- public Response set(final SCIMConf conf) {
+ public void set(final SCIMConf conf) {
manager.set(conf);
- return Response.noContent().build();
}
}