svn commit: r1442631 - in /syncope/trunk/legal_ext: LICENSE NOTICE
Author: jbernhardt Date: Tue Feb 5 15:48:30 2013 New Revision: 1442631 URL: http://svn.apache.org/viewvc?rev=1442631view=rev Log: [SYNCOPE-252] Modified: syncope/trunk/legal_ext/LICENSE syncope/trunk/legal_ext/NOTICE Modified: syncope/trunk/legal_ext/LICENSE URL: http://svn.apache.org/viewvc/syncope/trunk/legal_ext/LICENSE?rev=1442631r1=1442630r2=1442631view=diff == --- syncope/trunk/legal_ext/LICENSE (original) +++ syncope/trunk/legal_ext/LICENSE Tue Feb 5 15:48:30 2013 @@ -845,3 +845,41 @@ xmlpure.js This is licensed under the terms of the MIT license, see above. == +== + +For javax.ws.rs-api (http://www.oracle.com/): +This is licensed under CDDL 1.0, see above. + +== + +For JAX-B (http://jaxb.java.net/): +This is licensed under CDDL 1.0, see above. + +== + +For SERB (http://serp.sourceforge.net/): +This is licensed under the BSD license, see above. + +== + +For STAX (http://www.sun.com/): +This is licensed under CDDL 1.0, see above. + +== + +For Bean Validation API (http://beanvalidation.org/): +This is licensed under the AL 2.0, see above. + +== + +For WSDL4J (http://sf.net/projects/wsdl4j): +This is licensed under CPL 1.0. + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE (AGREEMENT). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 1. DEFINITIONS Contribution means: a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and b) in the case of each subsequent Contributor: i) changes to the Program, and ii) additions to the Program; where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. Contributor means any pe rson or entity that distributes the Program. Licensed Patents mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. Program means the Contributions distributed in accordance with this Agreement. Recipient means anyone who receives the Program under this Agreement, including all Contributors. 2. GRANT OF RIGHTS a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import an d otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 3. REQUIREMENTS A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: a) it complies with the terms and conditions of this Agreement; and b) its license agreement: i) effectively disclaims on behalf
svn commit: r1442048 - /syncope/branches/cxf/
Author: jbernhardt Date: Mon Feb 4 08:42:27 2013 New Revision: 1442048 URL: http://svn.apache.org/viewvc?rev=1442048view=rev Log: Not needed any longer. Trunk is working successfully with CXF by now. Removed: syncope/branches/cxf/
svn commit: r1442164 - in /syncope/trunk/common/src/main/java/org/apache/syncope/common: services/UserService.java to/AttributeTO.java
Author: jbernhardt Date: Mon Feb 4 16:20:01 2013 New Revision: 1442164 URL: http://svn.apache.org/viewvc?rev=1442164view=rev Log: [SYNCOPE-231] * Updating UserService to match with Documentation Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java?rev=1442164r1=1442163r2=1442164view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java Mon Feb 4 16:20:01 2013 @@ -19,10 +19,10 @@ package org.apache.syncope.common.services; import java.util.List; + import javax.ws.rs.DELETE; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; -import javax.ws.rs.MatrixParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; @@ -39,23 +39,25 @@ import org.apache.syncope.common.to.Work public interface UserService { @POST -@Path(activate/{userId}) -UserTO activate(@PathParam(userId) long userId, String token); +@Path({userId}/status/activate) +UserTO activate(@PathParam(userId) long userId, @QueryParam(token) String token); @POST -@Path(activate/{userId}) -UserTO activate(@PathParam(userId) long userId, String token, PropagationRequestTO propagationRequestTO); +@Path({userId}/status/activate) +UserTO activate(@PathParam(userId) long userId, @QueryParam(token) String token, +PropagationRequestTO propagationRequestTO); @POST @Path(activateByUsername/{username}) -UserTO activateByUsername(@PathParam(username) String username, @MatrixParam(token) String token); +UserTO activateByUsername(@PathParam(username) String username, @QueryParam(token) String token); @POST @Path(activateByUsername/{username}) -UserTO activateByUsername(@PathParam(username) String username, @MatrixParam(token) String token, PropagationRequestTO propagationRequestTO); +UserTO activateByUsername(@PathParam(username) String username, @QueryParam(token) String token, +PropagationRequestTO propagationRequestTO); @POST -@Path(workflow/task/{taskId}/claim) +@Path(workflow/tasks/{taskId}/claim) WorkflowFormTO claimForm(@PathParam(taskId) String taskId); @GET @@ -70,6 +72,7 @@ public interface UserService { UserTO delete(@PathParam(userId) Long userId); @POST +@Path(workflow/tasks/{taskId}/execute) UserTO executeWorkflow(@PathParam(taskId) String taskId, UserTO userTO); @GET @@ -87,11 +90,11 @@ public interface UserService { ListUserTO list(@QueryParam(page) int page, @QueryParam(size) @DefaultValue(25) int size); @POST -@Path(reactivate/{userId}) +@Path({userId}/status/reactivate) UserTO reactivate(@PathParam(userId) long userId); @POST -@Path(reactivate/{userId}) +@Path({userId}/status/reactivate) UserTO reactivate(@PathParam(userId) long userId, PropagationRequestTO propagationRequestTO); @POST @@ -107,11 +110,10 @@ public interface UserService { UserTO read(@PathParam(userId) Long userId); @GET -@Path(readByUsername/{username}) -UserTO read(@PathParam(username) String username); +UserTO read(@QueryParam(username) String username); @GET -@Path(read/self) +@Path(self) UserTO readSelf(); @POST @@ -132,11 +134,11 @@ public interface UserService { UserTO submitForm(WorkflowFormTO form); @POST -@Path(suspend/{userId}) +@Path({userId}/status/suspend) UserTO suspend(@PathParam(userId) long userId); @POST -@Path(suspend/{userId}) +@Path({userId}/status/suspend) UserTO suspend(@PathParam(userId) long userId, PropagationRequestTO propagationRequestTO); @POST @@ -152,6 +154,6 @@ public interface UserService { UserTO update(@PathParam(userId) Long userId, UserMod userMod); @GET -@Path(verifyPassword) -Boolean verifyPassword(@MatrixParam(uname) String username, @MatrixParam(pwd) String password); +Boolean verifyPassword(@QueryParam(username) String username, @QueryParam(pwd) String password); + } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java?rev=1442164r1=1442163r2=1442164view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java
svn commit: r1441462 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ core/src/main/java/org/apache/syncope/
Author: jbernhardt Date: Fri Feb 1 14:46:13 2013 New Revision: 1441462 URL: http://svn.apache.org/viewvc?rev=1441462view=rev Log: [SYNCOPE-231] * Adding Java Doc for TaskService * changing return type from report(..) to void, since console does not care about it and read operation can be used to get updated status Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/TaskServiceProxy.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/TaskServiceImpl.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/TaskServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/TaskServiceProxy.java?rev=1441462r1=1441461r2=1441462view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/TaskServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/TaskServiceProxy.java Fri Feb 1 14:46:13 2013 @@ -187,8 +187,8 @@ public class TaskServiceProxy extends Sp } @Override -public TaskExecTO report(final Long executionId, final ReportExecTO report) { -return getRestTemplate().getForObject( +public void report(final Long executionId, final ReportExecTO report) { +getRestTemplate().getForObject( baseUrl + task/execution/report/{executionId}.json + ?executionStatus={status}message={message}, TaskExecTO.class, executionId, report.getStatus(), report.getMessage()); } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java?rev=1441462r1=1441461r2=1441462view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java Fri Feb 1 14:46:13 2013 @@ -42,60 +42,60 @@ import org.apache.syncope.common.types.T public interface TaskService { /** - * @param taskType - * @return + * @param taskType filter for task count + * @return Returns number of tasks with matching type */ @GET @Path({type}/count) int count(@PathParam(type) TaskType taskType); /** - * @param taskTO - * @return + * @param taskTO Task to be created + * @return Response containing URI location for created resource */ @POST Response create(TaskTO taskTO); /** - * @param taskId + * @param taskId Id of task to be deleted */ @DELETE @Path({taskId}) void delete(@PathParam(taskId) Long taskId); /** - * @param executionId + * @param executionId ID of task execution to be deleted */ @DELETE @Path(executions/{executionId}) void deleteExecution(@PathParam(executionId) Long executionId); /** - * @param taskId - * @param dryRun - * @return + * @param taskId Id of task to be executed + * @param dryRun if true, task will only be simulated + * @return Returns TaskExcecution */ @POST @Path({taskId}/execute) TaskExecTO execute(@PathParam(taskId) Long taskId, @QueryParam(dryRun) @DefaultValue(false) boolean dryRun); /** - * @return + * @return Returns list of JobClasses */ @GET @Path(jobClasses) SetJobClassTO getJobClasses(); /** - * @return + * @return Returns list of SyncActionClasses */ @GET @Path(syncActionsClasses) SetSyncActionClassTO getSyncActionsClasses(); /** - * @param taskType - * @return + * @param taskType Type of tasks to be listed + * @return Returns list of tasks with matching type */ @GET @Path({type}/list) @@ -103,10 +103,10 @@ public interface TaskService { List? extends TaskTO list(@PathParam(type) TaskType taskType); /** - * @param taskType - * @param page - * @param size - * @return + * @param taskType Type of tasks to be listed + * @param page Page number of tasks in relation to page size + * @param size Number of tasks listed per page + * @return Returns paginated list of task with matching type */ @GET @Path({type}) @@ -114,44 +114,42 @@ public interface TaskService { @QueryParam(size) @DefaultValue(25) int size); /** - * @param taskType - * @return + * @param taskType Type of task executions
svn commit: r1440895 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ core/src/main/java/org/apache/syncope/
Author: jbernhardt Date: Thu Jan 31 10:16:08 2013 New Revision: 1440895 URL: http://svn.apache.org/viewvc?rev=1440895view=rev Log: [SYNCOPE-231] * adding JAVA DOC for Service Interfaces * Fixing getOptions Bug in UserRequestService (implementations) * Code cleanup Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserRequestServiceProxy.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserRequestServiceImpl.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserRequestTestITCase.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserRequestServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserRequestServiceProxy.java?rev=1440895r1=1440894r2=1440895view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserRequestServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserRequestServiceProxy.java Thu Jan 31 10:16:08 2013 @@ -36,7 +36,10 @@ public class UserRequestServiceProxy ext @Override public Response getOptions() { -return Response.ok().allow(GET, POST, DELETE).header(SYNCOPE_CREATE_ALLOWED, isCreateAllowed()).build(); +return Response.ok() +.header(Allow, GET,POST,OPTIONS,HEAD) +.header(SYNCOPE_CREATE_ALLOWED, isCreateAllowed()) +.build(); } @Override @@ -75,13 +78,13 @@ public class UserRequestServiceProxy ext @Override public UserRequestTO read(final Long requestId) { -return getRestTemplate().getForObject( -baseUrl + user/request/read/{requestId}.json, UserRequestTO.class, requestId); +return getRestTemplate().getForObject(baseUrl + user/request/read/{requestId}.json, UserRequestTO.class, +requestId); } @Override public void delete(final Long requestId) { -getRestTemplate().getForObject( -baseUrl + user/request/deleteRequest/{requestId}.json, UserRequestTO.class, requestId); +getRestTemplate().getForObject(baseUrl + user/request/deleteRequest/{requestId}.json, UserRequestTO.class, +requestId); } } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java?rev=1440895r1=1440894r2=1440895view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java Thu Jan 31 10:16:08 2013 @@ -28,9 +28,7 @@ import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.apache.syncope.common.to.ReportExecTO; Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java?rev=1440895r1=1440894r2=1440895view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java Thu Jan 31 10:16:08 2013 @@ -37,37 +37,71 @@ import org.apache.syncope.common.types.A @Path(resources) public interface ResourceService { +/** + * @param resourceTO Resource to be checked + * @return Returns true, if connection to resource could be established + */ @POST -@Path(validate) +@Path(check) boolean check(ResourceTO resourceTO); +/** + * @param resourceTO Resource to be created + * @return Response containing URI location for created resource + */ @POST Response create(ResourceTO resourceTO); +/** + * @param resourceName Name of resource to be deleted + */ @DELETE @Path({resourceName}) void delete(@PathParam(resourceName) String
svn commit: r1440902 - in /syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs: DerivedSchemaTestITCaseJAXRS.java SearchTestITCaseJAXRS.java TaskTestITCaseJAXRS.java UserTestITCaseJAXR
Author: jbernhardt Date: Thu Jan 31 10:57:51 2013 New Revision: 1440902 URL: http://svn.apache.org/viewvc?rev=1440902view=rev Log: [SYNCOPE-231] * adding missing JAX-RS Tests Added: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/DerivedSchemaTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/SearchTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/UserTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/VirtualSchemaTestITCaseJAXRS.java Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/TaskTestITCaseJAXRS.java Added: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/DerivedSchemaTestITCaseJAXRS.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/DerivedSchemaTestITCaseJAXRS.java?rev=1440902view=auto == --- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/DerivedSchemaTestITCaseJAXRS.java (added) +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/DerivedSchemaTestITCaseJAXRS.java Thu Jan 31 10:57:51 2013 @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.core.rest.jaxrs; + +import org.apache.syncope.core.rest.DerivedSchemaTestITCase; +import org.junit.FixMethodOrder; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.JVM) +public class DerivedSchemaTestITCaseJAXRS extends DerivedSchemaTestITCase { + +public DerivedSchemaTestITCaseJAXRS() { +super(); +setEnabledCXF(true); +// JSON is currently not working (fix after CXF migration is complete) +setContentType(CONTENT_TYPE_XML); +} +} Added: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/SearchTestITCaseJAXRS.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/SearchTestITCaseJAXRS.java?rev=1440902view=auto == --- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/SearchTestITCaseJAXRS.java (added) +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/SearchTestITCaseJAXRS.java Thu Jan 31 10:57:51 2013 @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.core.rest.jaxrs; + +import org.apache.syncope.core.rest.SearchTestITCase; +import org.junit.FixMethodOrder; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.JVM) +public class SearchTestITCaseJAXRS extends SearchTestITCase { + +public SearchTestITCaseJAXRS() { +super(); +setEnabledCXF(true); +} +} Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/TaskTestITCaseJAXRS.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/TaskTestITCaseJAXRS.java?rev=1440902r1=1440901r2=1440902view=diff == --- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/TaskTestITCaseJAXRS.java (original) +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs
svn commit: r1441023 - in /syncope/trunk/common/src/main/java/org/apache/syncope/common: services/SchemaService.java services/UserRequestService.java services/WorkflowService.java to/WorkflowDefinitio
Author: jbernhardt Date: Thu Jan 31 15:39:15 2013 New Revision: 1441023 URL: http://svn.apache.org/viewvc?rev=1441023view=rev Log: [SYNCOPE-231] * adding JAVA DOC for Service Interfaces * Code cleanup Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/WorkflowDefinitionTO.java Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java?rev=1441023r1=1441022r2=1441023view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java Thu Jan 31 15:39:15 2013 @@ -36,45 +36,85 @@ public interface SchemaService { @XmlEnum enum SchemaType { -NORMAL(schema), +/** + * Derived schema calculated based on other attributes. + */ DERIVED(derivedSchema), + +/** + * Standard schema for normal attributes to be stored within syncope. + */ +NORMAL(schema), + +/** + * Virtual schema for attributes fetched from remote resources only. + */ VIRTUAL(virtualSchema); +public static SchemaType fromString(String value) { +return SchemaType.valueOf(value.toUpperCase()); +} + +// TODO remove name once CXF migration is complete private final String name; private SchemaType(String name) { this.name = name; } -// TODO remove once CXF migration is complete public String toSpringURL() { return name; } - -public static SchemaType fromString(String value) { -return SchemaType.valueOf(value.toUpperCase()); -} } +/** + * @param kind Kind for schema to be created + * @param type Type for schema to be created + * @param schemaTO Schema to be created + * @return Response containing URI location for created resource. + */ @POST T extends AbstractSchemaTO Response create(@PathParam(kind) AttributableType kind, @PathParam(type) SchemaType type, T schemaTO); +/** + * @param kind Kind for schema to be deleted + * @param type Type for schema to be deleted + * @param schemaName Name of schema to be deleted + */ @DELETE @Path({name}) void delete(@PathParam(kind) AttributableType kind, @PathParam(type) SchemaType type, @PathParam(name) String schemaName); +/** + * @param kind Kind for schemas to be listed + * @param type Type for schemas to be listed + * @return List of schemas with matching kind and type + */ @GET List? extends AbstractSchemaTO list(@PathParam(kind) AttributableType kind, @PathParam(type) SchemaType type); +/** + * @param kind Kind for schemas to be read + * @param type Type for schemas to be read + * @param schemaName Name of schema to be read + * @return Returns schema with matching name, kind and type + */ @GET @Path({name}) T extends AbstractSchemaTO T read(@PathParam(kind) AttributableType kind, @PathParam(type) SchemaType type, @PathParam(name) String schemaName); +/** + * @param kind Kind for schemas to be updated + * @param type Type for schemas to be updated + * @param schemaName Name of schema to be updated + * @param schemaTO New schema to be stored + */ @PUT @Path({name}) T extends AbstractSchemaTO void update(@PathParam(kind) AttributableType kind, @PathParam(type) SchemaType type, @PathParam(name) String schemaName, T schemaTO); + } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java?rev=1441023r1=1441022r2=1441023view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java Thu Jan 31 15:39:15 2013 @@ -32,26 +32,53 @@ import org.apache.syncope.common.to.User @Path(requests/user) public interface UserRequestService { + public static final String SYNCOPE_CREATE_ALLOWED = Syncope-Create-Allowed
svn commit: r1440323 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ console/src/main/java/org/apache/syncope/console/rest/ core/src/main/java/org/apache/syncope/co
Author: jbernhardt Date: Wed Jan 30 09:55:40 2013 New Revision: 1440323 URL: http://svn.apache.org/viewvc?rev=1440323view=rev Log: [SYNCOPE-231][SYNCOPE-289] * Fixing UserService * Removing RestTemplate dependencies from IT tests * Code cleanup Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserRequestServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserServiceProxy.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRequestRestClient.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ResourceServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserRequestServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AuthenticationTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/RoleTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserRequestTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java?rev=1440323r1=1440322r2=1440323view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java Wed Jan 30 09:55:40 2013 @@ -54,7 +54,10 @@ public class RoleServiceProxy extends Sp RoleTO role = getRestTemplate().postForObject(baseUrl + role/create, roleTO, RoleTO.class); URI location = URI.create(baseUrl + role/read/ + role.getId() + .json); -return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, role.getId()).entity(role).build(); +return Response.created(location) +.header(SyncopeConstants.REST_HEADER_ID, role.getId()) +.entity(role) +.build(); } @Override Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserRequestServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserRequestServiceProxy.java?rev=1440323r1=1440322r2=1440323view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserRequestServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/UserRequestServiceProxy.java Wed Jan 30 09:55:40 2013 @@ -22,6 +22,8 @@ import java.net.URI; import java.util.Arrays; import java.util.List; import javax.ws.rs.core.Response; + +import org.apache.syncope.common.SyncopeConstants; import org.apache.syncope.common.services.UserRequestService; import org.apache.syncope.common.to.UserRequestTO; import org.springframework.web.client.RestTemplate; @@ -39,7 +41,7 @@ public class UserRequestServiceProxy ext @Override public boolean isCreateAllowed() { -return getRestTemplate().getForObject(baseUrl + user/request/create/allowed, Boolean.class); +return getRestTemplate().getForObject(baseUrl + user/request/create/allowed.json, Boolean.class); } @Override @@ -62,24 +64,24 @@ public class UserRequestServiceProxy ext UserRequestTO.class); } -URI location = URI.create(baseUrl + user/request/read/ + created.getId()); -return Response.created(location).entity(created.getId()).build(); +URI location = URI.create(baseUrl + user/request/read/ + created.getId() + .json); +return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, created.getId()).build(); } @Override
svn commit: r1440409 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/ common/src/main/java/org/apache/syncope/common/
Author: jbernhardt Date: Wed Jan 30 13:32:20 2013 New Revision: 1440409 URL: http://svn.apache.org/viewvc?rev=1440409view=rev Log: [SYNCOPE-231] * adding JAVA DOC * renaming validate to check for connector service * Code cleanup Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConnectorServiceProxy.java syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ConnectorRestClient.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConnectorServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConnectorServiceProxy.java?rev=1440409r1=1440408r2=1440409view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConnectorServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConnectorServiceProxy.java Wed Jan 30 13:32:20 2013 @@ -106,7 +106,7 @@ public class ConnectorServiceProxy exten } @Override -public boolean validate(final ConnInstanceTO connectorTO) { +public boolean check(final ConnInstanceTO connectorTO) { return getRestTemplate().postForObject(baseUrl + connector/check.json, connectorTO, Boolean.class); } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java?rev=1440409r1=1440408r2=1440409view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java Wed Jan 30 13:32:20 2013 @@ -36,7 +36,7 @@ public class SyncopeConstants { * to an object after its creation. HTTP Response after PUT operation should contain this * key with resource id as its value. */ -public static final String REST_HEADER_ID = org.apache.syncope.id; +public static final String REST_HEADER_ID = org.apache.syncope.resource.id; public static final String DEFAULT_ENCODING = UTF-8; Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java?rev=1440409r1=1440408r2=1440409view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java Wed Jan 30 13:32:20 2013 @@ -36,33 +36,63 @@ import org.apache.syncope.common.to.Vali @Path(configurations) public interface ConfigurationService { +/** + * Creates a new configuration element. + * + * @param configurationTO Configuration to be stored. + * @return Response containing URI location for created resource. + */ @POST Response create(ConfigurationTO configurationTO); +/** + * @return Returns configuration as an downloadable content.xml database export file. + */ @GET @Path(dbDump) Response dbExport(); +/** + * @param key Deletes configuration with matching key. + */ @DELETE @Path({key}) void delete(@PathParam(key) String key); +/** + * @return Returns a list of known mail-template names. + */ @GET @Path(mailTemplates) SetMailTemplateTO getMailTemplates(); +/** + * @return Returns a list of known validator names. + */ @GET @Path(validators) SetValidatorTO getValidators(); +/** + * @return Returns a list of all configuration elements. + */ @GET ListConfigurationTO list(); +/** + * @param key Identifier of configuration to be read. + * @return Returns configuration element with matching key. + */ @GET @Path({key}) ConfigurationTO read(@PathParam(key) String key); +/** + * @param key Overwrites configuration element with matching key. + * @param configurationTO New configuration + */ @PUT @Path({key}) void
svn commit: r1440427 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ console/src/main/java/org/apache/synco
Author: jbernhardt Date: Wed Jan 30 14:16:17 2013 New Revision: 1440427 URL: http://svn.apache.org/viewvc?rev=1440427view=rev Log: [SYNCOPE-231] * adding JAVA DOC for LoggerService * changing response type for update and delete NotificationService methods to void * Code cleanup Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/NotificationServiceProxy.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/NotificationRestClient.java syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/NotificationTestITCase.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/NotificationServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/NotificationServiceProxy.java?rev=1440427r1=1440426r2=1440427view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/NotificationServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/NotificationServiceProxy.java Wed Jan 30 14:16:17 2013 @@ -44,8 +44,8 @@ public class NotificationServiceProxy ex } @Override -public NotificationTO delete(final Long notificationId) { -return getRestTemplate().getForObject(baseUrl + notification/delete/{notificationId}.json, +public void delete(final Long notificationId) { +getRestTemplate().getForObject(baseUrl + notification/delete/{notificationId}.json, NotificationTO.class, notificationId); } @@ -62,8 +62,8 @@ public class NotificationServiceProxy ex } @Override -public NotificationTO update(final Long notificationId, final NotificationTO notificationTO) { -return getRestTemplate().postForObject(baseUrl + notification/update.json, notificationTO, +public void update(final Long notificationId, final NotificationTO notificationTO) { +getRestTemplate().postForObject(baseUrl + notification/update.json, notificationTO, NotificationTO.class); } } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java?rev=1440427r1=1440426r2=1440427view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java Wed Jan 30 14:16:17 2013 @@ -32,19 +32,37 @@ import org.apache.syncope.common.types.L @Path(logger/{type}) public interface LoggerService { -@GET +/** + * @param type LoggerType to be selected. + * @param name Logger name to be deleted. + */ +@DELETE @Path({name}) -LoggerTO read(@PathParam(type) LoggerType type, @PathParam(name) final String name); +void delete(@PathParam(type) LoggerType type, @PathParam(name) String name); +/** + * @param type LoggerType to be selected. + * @return List of logger with matching type. + */ @GET ListLoggerTO list(@PathParam(type) LoggerType type); +/** + * @param type LoggerType to be selected. + * @param name Logger name to be read. + * @return Returns logger with matching type and name. + */ +@GET +@Path({name}) +LoggerTO read(@PathParam(type) LoggerType type, @PathParam(name) final String name); + +/** + * @param type LoggerType to be selected. + * @param name Logger name to be updated. + * @param logger Logger to be created or updated. + */ @PUT @Path({name}/level) void update(@PathParam(type) LoggerType type, @PathParam(name) String name, LoggerTO logger); -@DELETE -@Path({name}) -void delete(@PathParam(type) LoggerType type, @PathParam(name) String name); - } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java?rev=1440427r1=1440426r2=1440427view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java
svn commit: r1439782 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/
Author: jbernhardt Date: Tue Jan 29 08:28:59 2013 New Revision: 1439782 URL: http://svn.apache.org/viewvc?rev=1439782view=rev Log: [SYNCOPE-231] * Added missing URLEncoder.encode() * Code cleanup Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/NotificationServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ResourceServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java?rev=1439782r1=1439781r2=1439782view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java Tue Jan 29 08:28:59 2013 @@ -19,14 +19,18 @@ package org.apache.syncope.client.services.proxy; import java.io.InputStream; +import java.io.UnsupportedEncodingException; import java.net.URI; +import java.net.URLEncoder; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; +import javax.ws.rs.InternalServerErrorException; import javax.ws.rs.core.Response; +import org.apache.syncope.common.SyncopeConstants; import org.apache.syncope.common.services.ConfigurationService; import org.apache.syncope.common.to.ConfigurationTO; import org.apache.syncope.common.to.MailTemplateTO; @@ -42,10 +46,19 @@ public class ConfigurationServiceProxy e @Override public Response create(final ConfigurationTO configurationTO) { -ConfigurationTO created = getRestTemplate().postForObject(baseUrl + configuration/create, -configurationTO, ConfigurationTO.class); -URI location = URI.create(baseUrl + configuration/read/ + created.getKey() + .json); -return Response.created(location).build(); +ConfigurationTO created = getRestTemplate().postForObject(baseUrl + configuration/create, configurationTO, +ConfigurationTO.class); +try { +URI location = URI.create(baseUrl ++ configuration/read/ ++ URLEncoder.encode(created.getKey(), SyncopeConstants.DEFAULT_ENCODING) ++ .json); +return Response.created(location) +.header(SyncopeConstants.REST_HEADER_ID, created.getKey()) +.build(); +} catch (UnsupportedEncodingException e) { +throw new InternalServerErrorException(e); +} } @Override @@ -66,8 +79,7 @@ public class ConfigurationServiceProxy e @Override public void update(final String key, final ConfigurationTO configurationTO) { -getRestTemplate().postForObject(baseUrl + configuration/update, configurationTO, -ConfigurationTO.class); +getRestTemplate().postForObject(baseUrl + configuration/update, configurationTO, ConfigurationTO.class); } @Override Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/NotificationServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/NotificationServiceProxy.java?rev=1439782r1=1439781r2=1439782view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/NotificationServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/NotificationServiceProxy.java Tue Jan 29 08:28:59 2013 @@ -36,23 +36,29 @@ public class NotificationServiceProxy ex } @Override -public NotificationTO read(final Long notificationId) { -return getRestTemplate().getForObject(baseUrl + notification/read/{notificationId}.json, +public Response create(final NotificationTO notificationTO) { +NotificationTO notification = getRestTemplate().postForObject(baseUrl + notification/create.json, +notificationTO, NotificationTO.class); +URI location = URI.create(baseUrl + notification/read/ + notification.getId() + .json); +return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, notification.getId()).build(); +} + +@Override +public NotificationTO delete(final Long notificationId) { +return
svn commit: r1439885 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/rest/utils/ core/src/main/java/org/apache/syncope/core/services/
Author: jbernhardt Date: Tue Jan 29 13:21:10 2013 New Revision: 1439885 URL: http://svn.apache.org/viewvc?rev=1439885view=rev Log: [SYNCOPE-231] * Fixing LoggerService * Code Cleanup Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/utils/RestClientExceptionMapper.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserRequestServiceImpl.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/utils/RestClientExceptionMapper.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/utils/RestClientExceptionMapper.java?rev=1439885r1=1439884r2=1439885view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/utils/RestClientExceptionMapper.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/utils/RestClientExceptionMapper.java Tue Jan 29 13:21:10 2013 @@ -39,67 +39,68 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Provider -public class RestClientExceptionMapper implements ExceptionMapperException, - ResponseExceptionMapperException { +public class RestClientExceptionMapper implements ExceptionMapperException, ResponseExceptionMapperException { private static final Logger LOG = LoggerFactory.getLogger(RestClientExceptionMapper.class); @Override - public Response toResponse(Exception e) { - throw new UnsupportedOperationException(Call of toResponse() method is not expected in RestClientExceptionnMapper); - } - - @Override - public Exception fromResponse(Response response) { - Exception ex = null; - int statusCode = response.getStatus(); - - // 1. Check for composite exception in HTTP header - SyncopeClientCompositeErrorException scce = checkCompositeException(response); - if (scce != null) { - ex = scce; - - // TODO reduce SCCEE to really composite ones and use normal exception for others -// } else if (statusCode == HttpStatus.SC_FORBIDDEN) { -// ex = new UnauthorizedRoleException(-1L); - - // 2. Map SC_UNAUTHORIZED - } else if (statusCode == HttpStatus.SC_UNAUTHORIZED) { - ex = new AccessControlException(Remote unauthorized exception); - -// 3. Map SC_BAD_REQUEST +public Response toResponse(final Exception e) { +throw new UnsupportedOperationException( +Call of toResponse() method is not expected in RestClientExceptionnMapper); +} + +@Override +public Exception fromResponse(final Response response) { +Exception ex = null; +int statusCode = response.getStatus(); + +// 1. Check for composite exception in HTTP header +SyncopeClientCompositeErrorException scce = checkCompositeException(response); +if (scce != null) { +ex = scce; + +// TODO reduce SCCEE to really composite ones and use normal exception for others +// } else if (statusCode == HttpStatus.SC_FORBIDDEN) { +// ex = new UnauthorizedRoleException(-1L); + +// 2. Map SC_UNAUTHORIZED +} else if (statusCode == HttpStatus.SC_UNAUTHORIZED) { +ex = new AccessControlException(Remote unauthorized exception); + +// 3. Map SC_BAD_REQUEST } else if (statusCode == HttpStatus.SC_BAD_REQUEST) { ex = new BadRequestException(); } else { - // 4. All other codes are mapped to runtime exception with HTTP code information - ex = new RuntimeException(String.format( - Remote exception with status code: %s, - Response.Status.fromStatusCode(statusCode).name())); - } +// 4. All other codes are mapped to runtime exception with HTTP code information +ex = new RuntimeException(String.format(Remote exception with status code: %s, Response.Status +.fromStatusCode(statusCode).name())); +} LOG.error(Exception thrown by REST methods: + ex.getMessage(), ex); - return ex; - } - - private SyncopeClientCompositeErrorException checkCompositeException(Response response) { - int statusCode = response.getStatus(); -ListObject exceptionTypesInHeaders = response.getHeaders().get(SyncopeClientErrorHandler.EXCEPTION_TYPE_HEADER); +return ex; +} + +private
svn commit: r1439890 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ core/src/test/java/org/apache/syncope/
Author: jbernhardt Date: Tue Jan 29 13:41:06 2013 New Revision: 1439890 URL: http://svn.apache.org/viewvc?rev=1439890view=rev Log: [SYNCOPE-231] * Adding JAX-RS annotations to RoleService * Code Cleanup Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java?rev=1439890r1=1439889r2=1439890view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java Tue Jan 29 13:41:06 2013 @@ -22,8 +22,6 @@ import java.net.URI; import java.util.Arrays; import java.util.List; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.NotSupportedException; import javax.ws.rs.ServiceUnavailableException; import javax.ws.rs.core.Response; Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java?rev=1439890r1=1439889r2=1439890view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java Tue Jan 29 13:41:06 2013 @@ -77,7 +77,9 @@ public interface RoleService { @Path(search/count) int searchCount(NodeCond searchCondition); -RoleTO selfRead(Long roleId); +@GET +@Path({roleId}/own) +RoleTO selfRead(@PathParam(roleId) Long roleId); @POST @Path({roleId}) Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java?rev=1439890r1=1439889r2=1439890view=diff == --- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java (original) +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java Tue Jan 29 13:41:06 2013 @@ -47,7 +47,7 @@ import org.springframework.web.client.Ht @FixMethodOrder(MethodSorters.JVM) public class ReportTestITCase extends AbstractTest { -ReportTO createReport(final ReportTO report) { +public ReportTO createReport(final ReportTO report) { Response response = reportService.create(report); return getObject(response, ReportTO.class, reportService); }
svn commit: r1439899 - in /syncope/trunk/core/src/main/java/org/apache/syncope/core/services: LoggerServiceImpl.java ReportServiceImpl.java UserServiceImpl.java
Author: jbernhardt Date: Tue Jan 29 14:08:34 2013 New Revision: 1439899 URL: http://svn.apache.org/viewvc?rev=1439899view=rev Log: [SYNCOPE-231] * Fixing UserServiceImpl annotations * Code Cleanup Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java?rev=1439899r1=1439898r2=1439899view=diff == --- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/LoggerServiceImpl.java Tue Jan 29 14:08:34 2013 @@ -18,6 +18,7 @@ */ package org.apache.syncope.core.services; +import java.text.ParseException; import java.util.List; import javax.ws.rs.BadRequestException; @@ -74,7 +75,9 @@ public class LoggerServiceImpl implement case AUDIT: try { loggerController.enableAudit(AuditLoggerName.fromLoggerName(name)); -} catch (Exception e) { +} catch (IllegalArgumentException e) { +throw new BadRequestException(e); +} catch (ParseException e) { throw new BadRequestException(e); } break; @@ -94,7 +97,9 @@ public class LoggerServiceImpl implement case AUDIT: try { loggerController.disableAudit(AuditLoggerName.fromLoggerName(name)); -} catch (Exception e) { +} catch (IllegalArgumentException e) { +throw new BadRequestException(e); +} catch (ParseException e) { throw new BadRequestException(e); } break; Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java?rev=1439899r1=1439898r2=1439899view=diff == --- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java Tue Jan 29 14:08:34 2013 @@ -40,12 +40,13 @@ import org.springframework.stereotype.Se @Service public class ReportServiceImpl implements ReportService, ContextAware { + @Autowired -ReportController reportController; - +private ReportController reportController; + @Autowired private ReportDAO reportDAO; - + private UriInfo uriInfo; @Override @@ -100,6 +101,7 @@ public class ReportServiceImpl implement final ReportExecExportFormat format = (fmt == null) ? ReportExecExportFormat.XML : fmt; final ReportExec reportExec = reportController.getAndCheckReportExecInternal(executionId); return Response.ok(new StreamingOutput() { +@Override public void write(final OutputStream os) throws IOException { reportController.exportExecutionResultInternal(os, reportExec, format); } Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java?rev=1439899r1=1439898r2=1439899view=diff == --- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java Tue Jan 29 14:08:34 2013 @@ -21,10 +21,7 @@ package org.apache.syncope.core.services import java.net.URI; import java.util.List; -import javax.ws.rs.MatrixParam; import javax.ws.rs.POST; -import javax.ws.rs.PathParam; -import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; @@ -41,24 +38,24 @@ import org.springframework.stereotype.Se @Service public class UserServiceImpl implements UserService, ContextAware { + @Autowired -UserController userController; - +private UserController userController; + private UriInfo uriInfo; @Override -public UserTO activate(final @PathParam(userId) long userId, final String token) { +public UserTO activate(final long userId, final String token
svn commit: r1440300 - /syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/
Author: jbernhardt Date: Wed Jan 30 07:58:13 2013 New Revision: 1440300 URL: http://svn.apache.org/viewvc?rev=1440300view=rev Log: [SYNCOPE-289] * Adding missing TestCases * Code cleanup Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ConfigurationTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ConnectorTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/EntitlementTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/LoggerTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/NotificationTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/PolicyTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ReportTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ResourceTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/RoleTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/SchemaTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/TaskTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/UserRequestTestITCaseJAXRS.java Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ConfigurationTestITCaseJAXRS.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ConfigurationTestITCaseJAXRS.java?rev=1440300r1=1440299r2=1440300view=diff == --- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ConfigurationTestITCaseJAXRS.java (original) +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ConfigurationTestITCaseJAXRS.java Wed Jan 30 07:58:13 2013 @@ -24,8 +24,9 @@ import org.junit.runners.MethodSorters; @FixMethodOrder(MethodSorters.JVM) public class ConfigurationTestITCaseJAXRS extends ConfigurationTestITCase { - + public ConfigurationTestITCaseJAXRS() { - setEnabledCXF(true); +super(); +setEnabledCXF(true); } } Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ConnectorTestITCaseJAXRS.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ConnectorTestITCaseJAXRS.java?rev=1440300r1=1440299r2=1440300view=diff == --- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ConnectorTestITCaseJAXRS.java (original) +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ConnectorTestITCaseJAXRS.java Wed Jan 30 07:58:13 2013 @@ -24,8 +24,9 @@ import org.junit.runners.MethodSorters; @FixMethodOrder(MethodSorters.JVM) public class ConnectorTestITCaseJAXRS extends ConnInstanceTestITCase { - + public ConnectorTestITCaseJAXRS() { - setEnabledCXF(true); +super(); +setEnabledCXF(true); } } Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/EntitlementTestITCaseJAXRS.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/EntitlementTestITCaseJAXRS.java?rev=1440300r1=1440299r2=1440300view=diff == --- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/EntitlementTestITCaseJAXRS.java (original) +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/EntitlementTestITCaseJAXRS.java Wed Jan 30 07:58:13 2013 @@ -26,8 +26,9 @@ import org.junit.runners.MethodSorters; public class EntitlementTestITCaseJAXRS extends AuthenticationTestITCase { public EntitlementTestITCaseJAXRS() { - setEnabledCXF(true); - //JSON is currently not working (fix after CXF migration is complete) - setContentType(CONTENT_TYPE_XML); +super(); +setEnabledCXF(true); +// JSON is currently not working (fix after CXF migration is complete) +setContentType(CONTENT_TYPE_XML); } } Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/LoggerTestITCaseJAXRS.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/LoggerTestITCaseJAXRS.java?rev=1440300r1=1440299r2=1440300view=diff == --- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/LoggerTestITCaseJAXRS.java (original) +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/LoggerTestITCaseJAXRS.java Wed Jan 30 07:58:13 2013 @@ -24,8
svn commit: r1439342 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ core/src/main/resources/ core/src/test
Author: jbernhardt Date: Mon Jan 28 11:01:17 2013 New Revision: 1439342 URL: http://svn.apache.org/viewvc?rev=1439342view=rev Log: [SYNCOPE-231] Fixing CXF Tests Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java syncope/trunk/core/src/main/resources/restContext.xml syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/EntitlementTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/SchemaTestITCaseJAXRS.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java?rev=1439342r1=1439341r2=1439342view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java Mon Jan 28 11:01:17 2013 @@ -42,32 +42,32 @@ public class SchemaServiceProxy extends @Override public T extends AbstractSchemaTO Response create(final AttributableType kind, final SchemaType type, final T schemaTO) { -AbstractSchemaTO schema = getRestTemplate().postForObject(baseUrl + type + /{kind}/create, schemaTO, -getTOClass(type), kind); -return Response.created(URI.create(baseUrl + type + / + kind + /read/ + schema.getName() + .json)) -.build(); +AbstractSchemaTO schema = getRestTemplate().postForObject(baseUrl + type.toSpringURL() + /{kind}/create, +schemaTO, getTOClass(type), kind); +return Response.created( +URI.create(baseUrl + type.toSpringURL() + / + kind + /read/ + schema.getName() + .json)).build(); } @Override public void delete(final AttributableType kind, final SchemaType type, final String schemaName) { -getRestTemplate().getForObject(baseUrl + type + /{kind}/delete/{name}.json, getTOClass(type), kind, -schemaName); +getRestTemplate().getForObject(baseUrl + type.toSpringURL() + /{kind}/delete/{name}.json, getTOClass(type), +kind, schemaName); } @Override public List? extends AbstractSchemaTO list(final AttributableType kind, final SchemaType type) { switch (type) { case NORMAL: -return Arrays.asList(getRestTemplate().getForObject(baseUrl + type + /{kind}/list.json, +return Arrays.asList(getRestTemplate().getForObject(baseUrl + type.toSpringURL() + /{kind}/list.json, SchemaTO[].class, kind)); case DERIVED: -return Arrays.asList(getRestTemplate().getForObject(baseUrl + type + /{kind}/list.json, +return Arrays.asList(getRestTemplate().getForObject(baseUrl + type.toSpringURL() + /{kind}/list.json, DerivedSchemaTO[].class, kind)); case VIRTUAL: -return Arrays.asList(getRestTemplate().getForObject(baseUrl + type + /{kind}/list.json, +return Arrays.asList(getRestTemplate().getForObject(baseUrl + type.toSpringURL() + /{kind}/list.json, VirtualSchemaTO[].class, kind)); default: @@ -79,15 +79,15 @@ public class SchemaServiceProxy extends public T extends AbstractSchemaTO T read(final AttributableType kind, final SchemaType type, final String schemaName) { -return (T) getRestTemplate().getForObject(baseUrl + type + /{kind}/read/{name}.json, getTOClass(type), kind, -schemaName); +return (T) getRestTemplate().getForObject(baseUrl + type.toSpringURL() + /{kind}/read/{name}.json, +getTOClass(type), kind, schemaName); } @Override public T extends AbstractSchemaTO void update(final AttributableType kind, final SchemaType type, final String schemaName, final T schemaTO) { -getRestTemplate().postForObject(baseUrl + type + /{kind}/update, schemaTO, getTOClass(type), kind); +getRestTemplate().postForObject(baseUrl + type.toSpringURL() + /{kind}/update, schemaTO, getTOClass(type), kind); } private Class? extends AbstractSchemaTO getTOClass(final SchemaType type) { Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java?rev=1439342r1=1439341r2=1439342view=diff
svn commit: r1439361 - /syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java
Author: jbernhardt Date: Mon Jan 28 12:19:41 2013 New Revision: 1439361 URL: http://svn.apache.org/viewvc?rev=1439361view=rev Log: SYNCOPE-292 Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java?rev=1439361r1=1439360r2=1439361view=diff == --- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java (original) +++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java Mon Jan 28 12:19:41 2013 @@ -47,12 +47,15 @@ public class PolicyRestClient extends Ba } catch (Exception e) { LOG.warn(No global + type + policy found, e); switch (type) { +case ACCOUNT: case GLOBAL_ACCOUNT: policy = (T) new AccountPolicyTO(); break; +case PASSWORD: case GLOBAL_PASSWORD: policy = (T) new PasswordPolicyTO(); break; +case SYNC: case GLOBAL_SYNC: policy = (T) new SyncPolicyTO(); break;
svn commit: r1439466 - /syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java
Author: jbernhardt Date: Mon Jan 28 16:05:56 2013 New Revision: 1439466 URL: http://svn.apache.org/viewvc?rev=1439466view=rev Log: SYNCOPE-292 Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java?rev=1439466r1=1439465r2=1439466view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java Mon Jan 28 16:05:56 2013 @@ -26,6 +26,8 @@ import java.util.List; import java.util.Set; import javax.ws.rs.core.Response; + +import org.apache.syncope.common.SyncopeConstants; import org.apache.syncope.common.services.ReportService; import org.apache.syncope.common.to.ReportExecTO; import org.apache.syncope.common.to.ReportTO; @@ -42,7 +44,7 @@ public class ReportServiceProxy extends public Response create(final ReportTO reportTO) { ReportTO createdReportTO = getRestTemplate().postForObject(baseUrl + report/create, reportTO, ReportTO.class); URI location = URI.create(baseUrl + report/read/ + createdReportTO.getId() + .json); -return Response.created(location).entity(createdReportTO.getId()).build(); +return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, createdReportTO.getId()).build(); } @Override @@ -73,8 +75,8 @@ public class ReportServiceProxy extends @Override public SetString getReportletConfClasses() { -ListString confClasses = Arrays.asList(getRestTemplate().getForObject(baseUrl + report/reportletConfClasses.json, -String[].class)); +ListString confClasses = Arrays.asList(getRestTemplate().getForObject( +baseUrl + report/reportletConfClasses.json, String[].class)); return new HashSetString(confClasses); }
svn commit: r1439469 - in /syncope/trunk: common/src/main/java/org/apache/syncope/common/report/ console/src/main/java/org/apache/syncope/console/rest/ core/src/main/java/org/apache/syncope/core/servi
Author: jbernhardt Date: Mon Jan 28 16:08:27 2013 New Revision: 1439469 URL: http://svn.apache.org/viewvc?rev=1439469view=rev Log: [SYNCOPE-231] * Adding (fixing) JAX-B Annotations Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/EntitlementTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/PolicyTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/ReportTestITCaseJAXRS.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/jaxrs/SchemaTestITCaseJAXRS.java Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java?rev=1439469r1=1439468r2=1439469view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java Mon Jan 28 16:08:27 2013 @@ -22,11 +22,15 @@ import java.util.ArrayList; import java.util.Date; 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.XmlType; import org.apache.syncope.common.types.TraceLevel; @XmlRootElement +@XmlType public class StaticReportletConf extends AbstractReportletConf { private static final long serialVersionUID = -4814950086361753689L; @@ -72,6 +76,8 @@ public class StaticReportletConf extends this.doubleField = doubleField; } +@XmlElementWrapper(name = listField) +@XmlElement(name = field) public ListString getListField() { return listField; } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java?rev=1439469r1=1439468r2=1439469view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java Mon Jan 28 16:08:27 2013 @@ -21,15 +21,22 @@ package org.apache.syncope.common.report 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.XmlEnum; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; import org.apache.syncope.common.annotation.FormAttributeField; import org.apache.syncope.common.search.NodeCond; import org.apache.syncope.common.types.IntMappingType; -@XmlRootElement +@XmlRootElement(name = UserReportletConfiguration) +@XmlType public class UserReportletConf extends AbstractReportletConf { +@XmlEnum +@XmlType(name = UserReportletConfigurationFeature) public enum Feature { id, @@ -74,6 +81,8 @@ public class UserReportletConf extends A features = new ArrayListFeature(); } +@XmlElementWrapper(name = normalAttributes) +@XmlElement(name = attribute) public ListString getAttrs() { return attrs; } @@ -82,6 +91,8 @@ public class UserReportletConf extends A this.attrs = attrs; } +@XmlElementWrapper(name = derivedAttributes) +@XmlElement(name = attribute) public ListString getDerAttrs() { return derAttrs; } @@ -90,6 +101,8 @@ public class UserReportletConf extends A this.derAttrs = derAttrs; } +@XmlElementWrapper(name = features) +@XmlElement(name = feature) public ListFeature getFeatures() { return features; } @@ -106,6 +119,8 @@ public class UserReportletConf extends A this.matchingCond = matchingCond; } +@XmlElementWrapper(name = virtualAttributes) +@XmlElement(name = attribute) public ListString getVirAttrs() { return virAttrs; } Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest
svn commit: r1438426 - in /syncope/trunk/common/src/main/java/org/apache/syncope/common: to/ types/
Author: jbernhardt Date: Fri Jan 25 10:28:27 2013 New Revision: 1438426 URL: http://svn.apache.org/viewvc?rev=1438426view=rev Log: [SYNCOPE-231] * Adding JAX-B Annotations for all missing TO and Enum Type classes Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/LoggerTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationRequestTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ReportExecTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ReportTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ValidatorTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/WorkflowDefinitionTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/WorkflowFormPropertyTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/WorkflowFormTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AuditElements.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AuditLoggerName.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/CipherAlgorithm.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ConflictResolutionAction.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ConnParameterType.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ConnectorCapability.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/EntityViolationType.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ReportExecExportFormat.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ReportExecStatus.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeLoggerLevel.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeLoggerType.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/WorkflowFormPropertyType.java Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java?rev=1438426r1=1438425r2=1438426view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java Fri Jan 25 10:28:27 2013 @@ -20,8 +20,11 @@ package org.apache.syncope.common.to; import java.util.Date; +import javax.xml.bind.annotation.XmlType; + import org.apache.syncope.common.AbstractBaseBean; +@XmlType public class AbstractExecTO extends AbstractBaseBean { private static final long serialVersionUID = -4621191979198357081L; Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/LoggerTO.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/LoggerTO.java?rev=1438426r1=1438425r2=1438426view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/LoggerTO.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/LoggerTO.java Fri Jan 25 10:28:27 2013 @@ -18,9 +18,14 @@ */ package org.apache.syncope.common.to; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + import org.apache.syncope.common.AbstractBaseBean; import org.apache.syncope.common.types.SyncopeLoggerLevel; +@XmlRootElement(name = logger) +@XmlType public class LoggerTO extends AbstractBaseBean { private static final long serialVersionUID = -7794833835668648505L; Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java?rev=1438426r1=1438425r2=1438426view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java Fri Jan 25 10:28:27 2013 @@ -21,11 +21,18 @@ package org.apache.syncope.common.to; import java.util.ArrayList; import java.util.List; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import
svn commit: r1438530 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ console/src/main/java/org/apache/syncope/console/rest/ core/src/main/java/org/apache/syncope/co
Author: jbernhardt Date: Fri Jan 25 14:18:47 2013 New Revision: 1438530 URL: http://svn.apache.org/viewvc?rev=1438530view=rev Log: [SYNCOPE-231] * RoleService Added: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/RoleRestClient.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java?rev=1438530r1=1438529r2=1438530view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/RoleServiceProxy.java Fri Jan 25 14:18:47 2013 @@ -56,7 +56,7 @@ public class RoleServiceProxy extends Sp RoleTO role = getRestTemplate().postForObject(baseUrl + role/create, roleTO, RoleTO.class); URI location = URI.create(baseUrl + role/read/ + role.getId() + .json); -return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, role.getId()).build(); +return Response.created(location).header(SyncopeConstants.REST_HEADER_ID, role.getId()).entity(role).build(); } @Override Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/RoleRestClient.java URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/RoleRestClient.java?rev=1438530r1=1438529r2=1438530view=diff == --- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/RoleRestClient.java (original) +++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/RoleRestClient.java Fri Jan 25 14:18:47 2013 @@ -70,7 +70,7 @@ public class RoleRestClient extends Abst public RoleTO create(final RoleTO roleTO) { Response response = getService(RoleService.class).create(roleTO); -return (RoleTO) response.getEntity(); // FIXME after CXF migration +return response.readEntity(RoleTO.class); } public RoleTO read(final Long id) { Added: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java?rev=1438530view=auto == --- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java (added) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java Fri Jan 25 14:18:47 2013 @@ -0,0 +1,186 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.core.services; + +import java.net.URI; +import java.util.List; + +import javax.ws.rs.BadRequestException; +import javax.ws.rs.ServiceUnavailableException; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriInfo; + +import org.apache.syncope.common.SyncopeConstants; +import org.apache.syncope.common.mod.RoleMod; +import org.apache.syncope.common.search.NodeCond; +import org.apache.syncope.common.services.RoleService; +import org.apache.syncope.common.to.RoleTO; +import org.apache.syncope.core.persistence.dao.InvalidSearchConditionException; +import org.apache.syncope.core.propagation.PropagationException; +import org.apache.syncope.core.rest.controller.RoleController; +import org.apache.syncope.core.rest.controller.UnauthorizedRoleException; +import org.apache.syncope.core.util.NotFoundException; +import org.apache.syncope.core.workflow.WorkflowException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class RoleServiceImpl implements RoleService, ContextAware { + +@Autowired
svn commit: r1437912 - in /syncope/trunk/common/src/main/java/org/apache/syncope/common: ./ to/ types/
Author: jbernhardt Date: Thu Jan 24 09:01:07 2013 New Revision: 1437912 URL: http://svn.apache.org/viewvc?rev=1437912view=rev Log: [SYNCOPE-231] Reverted last changes to trunk Removed: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/JobClassTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/SyncActionClassTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/LoggerType.java Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MembershipTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTaskTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationTaskTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/RoleTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/SchedTaskTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/SyncTaskTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/TaskExecTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/TaskTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/UserTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/PropagationMode.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/PropagationTaskExecStatus.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ResourceOperation.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TaskType.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TraceLevel.java Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java?rev=1437912r1=1437911r2=1437912view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java Thu Jan 24 09:01:07 2013 @@ -31,11 +31,4 @@ public class SyncopeConstants { public static final String DEFAULT_DATE_PATTERN = -MM-dd'T'HH:mm:ssZ; -/** - * This constant will be used to identify HTTP header key to look for object ID assigned - * to an object after its creation. HTTP Response after PUT operation should contain this - * key with resource id as its value. - */ -public static final String REST_HEADER_ID = org.apache.syncope.id; - } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java?rev=1437912r1=1437911r2=1437912view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java Thu Jan 24 09:01:07 2013 @@ -21,15 +21,8 @@ package org.apache.syncope.common.to; 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.XmlType; - import org.apache.syncope.common.AbstractBaseBean; -@XmlRootElement(name = attribute) -@XmlType public class AttributeTO extends AbstractBaseBean { private static final long serialVersionUID = 4941691338796323623L; @@ -96,8 +89,6 @@ public class AttributeTO extends Abstrac /** * @return attribute values as strings */ -@XmlElementWrapper(name = values) -@XmlElement(name = value) public ListString getValues() { return values; } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java?rev=1437912r1=1437911r2=1437912view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java Thu Jan 24 09:01:07 2013 @@ -24,16 +24,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.xml.bind.annotation.XmlElement; -import
svn commit: r1438055 - in /syncope/trunk: common/src/main/java/org/apache/syncope/common/ common/src/main/java/org/apache/syncope/common/mod/ common/src/main/java/org/apache/syncope/common/to/ common/
Author: jbernhardt Date: Thu Jan 24 15:52:51 2013 New Revision: 1438055 URL: http://svn.apache.org/viewvc?rev=1438055view=rev Log: [SYNCOPE-231] * Adding JAX-B Annotations for TOs and Types * Adding REST Header constant for IDs Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/JobClassTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/SyncActionClassTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/LoggerType.java Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AttributeMod.java syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/MembershipMod.java syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConnObjectTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MembershipTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/NotificationTaskTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationStatusTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationTaskTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/RoleTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/SchedTaskTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/SyncTaskTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/TaskExecTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/TaskTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/UserRequestTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/UserTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/PropagationMode.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/PropagationTaskExecStatus.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ResourceOperation.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TaskType.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/TraceLevel.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/UserRequestType.java syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java?rev=1438055r1=1438054r2=1438055view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java Thu Jan 24 15:52:51 2013 @@ -31,4 +31,11 @@ public class SyncopeConstants { public static final String DEFAULT_DATE_PATTERN = -MM-dd'T'HH:mm:ssZ; +/** + * This constant will be used to identify HTTP header key to look for object ID assigned + * to an object after its creation. HTTP Response after PUT operation should contain this + * key with resource id as its value. + */ +public static final String REST_HEADER_ID = org.apache.syncope.id; + } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java?rev=1438055r1=1438054r2=1438055view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java Thu Jan 24 15:52:51 2013 @@ -21,13 +21,18 @@ package org.apache.syncope.common.mod; import java.util.HashSet; import java.util.Set; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlType; + import org.apache.syncope.common.AbstractBaseBean; /** * Abstract base class for objects that can have attributes removed, added
svn commit: r1438058 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ console/src/main/java/org/apache/synco
Author: jbernhardt Date: Thu Jan 24 16:19:11 2013 New Revision: 1438058 URL: http://svn.apache.org/viewvc?rev=1438058view=rev Log: [SYNCOPE-231] * Adding LoggerService * Adding Response Header resource ID for CXF services Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/LoggerServiceProxy.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/LoggerRestClient.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConfigurationServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/LoggerTestITCase.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/LoggerServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/LoggerServiceProxy.java?rev=1438058r1=1438057r2=1438058view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/LoggerServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/LoggerServiceProxy.java Thu Jan 24 16:19:11 2013 @@ -18,12 +18,17 @@ */ package org.apache.syncope.client.services.proxy; -import ch.qos.logback.classic.Level; import java.util.Arrays; import java.util.List; + +import javax.ws.rs.BadRequestException; +import javax.ws.rs.NotFoundException; + import org.apache.syncope.common.services.LoggerService; import org.apache.syncope.common.to.LoggerTO; import org.apache.syncope.common.types.AuditLoggerName; +import org.apache.syncope.common.types.LoggerType; +import org.apache.syncope.common.util.CollectionWrapper; import org.springframework.web.client.RestTemplate; public class LoggerServiceProxy extends SpringServiceProxy implements LoggerService { @@ -33,33 +38,70 @@ public class LoggerServiceProxy extends } @Override -public ListLoggerTO listLogs() { -return Arrays.asList(getRestTemplate().getForObject(baseUrl + logger/log/list, LoggerTO[].class)); -} - -@Override -public ListAuditLoggerName listAudits() { -return Arrays.asList(getRestTemplate().getForObject(baseUrl + logger/audit/list, AuditLoggerName[].class)); -} - -@Override -public LoggerTO update(final String name, final Level level) { -return getRestTemplate().postForObject(baseUrl + logger/log/{name}/{level}, null, LoggerTO.class, name, -level); -} - -@Override -public LoggerTO delete(final String name) { -return getRestTemplate().getForObject(baseUrl + logger/log/delete/{name}, LoggerTO.class, name); -} +public ListLoggerTO list(final LoggerType type) { +switch (type) { +case NORMAL: +return Arrays.asList(getRestTemplate().getForObject(baseUrl + logger/log/list, LoggerTO[].class)); + +case AUDIT: +ListAuditLoggerName auditNames = Arrays.asList(getRestTemplate().getForObject( +baseUrl + logger/audit/list, AuditLoggerName[].class)); +return CollectionWrapper.unwrapLogger(auditNames); + +default: +throw new BadRequestException(); +} +} + +@Override +public LoggerTO read(final LoggerType type, final String name) { +ListLoggerTO logger = list(type); +for (LoggerTO l : logger) { +if (l.getName().equals(name)) { +return l; +} +} +throw new NotFoundException(); +} + +@Override +public void update(final LoggerType type, final String name, final LoggerTO logger) { +switch (type) { +case NORMAL: +getRestTemplate().postForObject(baseUrl + logger/log/{name}/{level}, null, LoggerTO.class, name, +logger.getLevel()); +break; + +case AUDIT: +try { +getRestTemplate().put(baseUrl + logger/audit/enable, AuditLoggerName.fromLoggerName(name)); +} catch (Exception e) { +throw new BadRequestException(e); +} +break; + +default: +throw new BadRequestException(); +} +} + +@Override +public void delete(final LoggerType type, final String name) { +switch (type) { +case NORMAL: +getRestTemplate().getForObject(baseUrl + logger/log/delete/{name}, LoggerTO.class
svn commit: r1436899 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ client/src/test/java/org/apache/syncope/client/test/ common/src/main/java/org/apache/syncope/co
Author: jbernhardt Date: Tue Jan 22 13:23:51 2013 New Revision: 1436899 URL: http://svn.apache.org/viewvc?rev=1436899view=rev Log: [SYNCOPE-231] * Added SchemaService implementation * Adding JAX-B Annotations for related TOs * Changes create response from CXF Services * Code cleanup (according to checkstyle and PMD) Added: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConnectorServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java syncope/trunk/client/src/test/java/org/apache/syncope/client/test/JSONTest.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractSchemaTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/DerivedSchemaTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/to/VirtualSchemaTO.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/AttributableType.java syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SchemaType.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ConfigurationRestClient.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ConnectorRestClient.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConfigurationServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java syncope/trunk/core/src/main/resources/restContext.xml syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/DerSchemaTest.java syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/VirSchemaTest.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AuthenticationTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/DerivedSchemaTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/SchemaTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserRequestTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirtualSchemaTestITCase.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java?rev=1436899r1=1436898r2=1436899view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java Tue Jan 22 13:23:51 2013 @@ -45,7 +45,7 @@ public class ConfigurationServiceProxy e ConfigurationTO created = getRestTemplate().postForObject(baseUrl + configuration/create, configurationTO, ConfigurationTO.class); URI location = URI.create(baseUrl + configuration/read/ + created.getKey() + .json); -return Response.created(location).entity(created).build(); +return Response.created(location).build(); } @Override Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConnectorServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConnectorServiceProxy.java?rev=1436899r1=1436898r2=1436899view=diff == --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConnectorServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConnectorServiceProxy.java Tue Jan 22 13:23:51 2013 @@ -42,8 +42,8 @@ public class ConnectorServiceProxy exten public Response create(final ConnInstanceTO connectorTO) { ConnInstanceTO response = getRestTemplate().postForObject(baseUrl + connector/create.json, connectorTO, ConnInstanceTO.class); -URI location = URI.create(baseUrl + connector/read + response.getId()); -return Response.created
svn commit: r1436350 - in /syncope/trunk/common/src/main/java/org/apache/syncope/common/services: ConnectorService.java LoggerService.java ReportService.java
Author: jbernhardt Date: Mon Jan 21 13:57:47 2013 New Revision: 1436350 URL: http://svn.apache.org/viewvc?rev=1436350view=rev Log: [SYNCOPE-281] Removed redundant annotations Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java?rev=1436350r1=1436349r2=1436350view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java Mon Jan 21 13:57:47 2013 @@ -19,6 +19,7 @@ package org.apache.syncope.common.services; import java.util.List; + import javax.ws.rs.DELETE; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; @@ -34,8 +35,6 @@ import org.apache.syncope.common.to.Conn import org.apache.syncope.common.to.ConnInstanceTO; import org.apache.syncope.common.to.SchemaTO; import org.apache.syncope.common.types.ConnConfProperty; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; @Path(connectors) public interface ConnectorService { @@ -71,7 +70,6 @@ public interface ConnectorService { ConnInstanceTO read(@PathParam(connectorId) Long connectorId); @GET -@RequestMapping(method = RequestMethod.GET, value = /{resourceName}/connectorBean) ConnInstanceTO readConnectorBean( @MatrixParam(resourceName) String resourceName); @@ -82,6 +80,5 @@ public interface ConnectorService { @POST @Path(validate) -@RequestMapping(method = RequestMethod.POST, value = /check) boolean validate(ConnInstanceTO connectorTO); } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java?rev=1436350r1=1436349r2=1436350view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java Mon Jan 21 13:57:47 2013 @@ -18,8 +18,8 @@ */ package org.apache.syncope.common.services; -import ch.qos.logback.classic.Level; import java.util.List; + import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.PUT; @@ -28,30 +28,26 @@ import javax.ws.rs.PathParam; import org.apache.syncope.common.to.LoggerTO; import org.apache.syncope.common.types.AuditLoggerName; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; + +import ch.qos.logback.classic.Level; @Path(logger) public interface LoggerService { //TODO use list(LoggerType) signature for both normal logger and audit logger instead of two different methods @GET -@RequestMapping(method = RequestMethod.GET, value = /log/list) ListLoggerTO listLogs(); @GET @Path(audit) -@RequestMapping(method = RequestMethod.GET, value = /audit/list) ListAuditLoggerName listAudits(); @PUT @Path({name}/level) -@RequestMapping(method = RequestMethod.POST, value = /log/{name}/{level}) LoggerTO update(@PathParam(name) String name, Level level); @DELETE @Path({name}) -@RequestMapping(method = RequestMethod.GET, value = /log/delete/{name}) LoggerTO delete(@PathParam(name) String name); // TODO refactor this method to use update() Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java?rev=1436350r1=1436349r2=1436350view=diff == --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java Mon Jan 21 13:57:47 2013 @@ -19,6 +19,7 @@ package org.apache.syncope.common.services; import java.util.List; + import javax.ws.rs.DELETE; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; @@ -34,8 +35,6 @@ import javax.ws.rs.core.Response; import org.apache.syncope.common.to.ReportExecTO; import org.apache.syncope.common.to.ReportTO; import
svn commit: r1427754 - in /syncope/trunk: archetype/ build-tools/ client/ console/ core/ standalone/
Author: jbernhardt Date: Wed Jan 2 11:57:14 2013 New Revision: 1427754 URL: http://svn.apache.org/viewvc?rev=1427754view=rev Log: Added eclipse artifacts to ignore list Modified: syncope/trunk/archetype/ (props changed) syncope/trunk/build-tools/ (props changed) syncope/trunk/client/ (props changed) syncope/trunk/console/ (props changed) syncope/trunk/core/ (props changed) syncope/trunk/standalone/ (props changed) Propchange: syncope/trunk/archetype/ -- --- svn:ignore (original) +++ svn:ignore Wed Jan 2 11:57:14 2013 @@ -1 +1,3 @@ +*.project +*.settings target Propchange: syncope/trunk/build-tools/ -- --- svn:ignore (original) +++ svn:ignore Wed Jan 2 11:57:14 2013 @@ -1,3 +1,9 @@ -target -nb-configuration.xml +* +*.classpath +*.externalToolBuilders +*.project +*.settings +*.xml .pom.xml.swp +nb-configuration.xml +target Propchange: syncope/trunk/client/ -- --- svn:ignore (original) +++ svn:ignore Wed Jan 2 11:57:14 2013 @@ -1,2 +1,7 @@ -target +.classpath +.externalToolBuilders +.project +.settings +maven-eclipse.xml nb-configuration.xml +target Propchange: syncope/trunk/console/ -- --- svn:ignore (original) +++ svn:ignore Wed Jan 2 11:57:14 2013 @@ -1,4 +1,9 @@ -target -nbactions.xml -nb-configuration.xml +.classpath +.externalToolBuilders .pom.xml.swp +.project +.settings +maven-eclipse.xml +nb-configuration.xml +nbactions.xml +target Propchange: syncope/trunk/core/ -- --- svn:ignore (original) +++ svn:ignore Wed Jan 2 11:57:14 2013 @@ -1,10 +1,10 @@ -target -nb-configuration.xml -nbactions.xml -.pom.xml.swp - -.settings - .classpath - +.externalToolBuilders +.pom.xml.swp .project +.settings +maven-eclipse.xml +maven.log +nb-configuration.xml +nbactions.xml +target Propchange: syncope/trunk/standalone/ -- --- svn:ignore (original) +++ svn:ignore Wed Jan 2 11:57:14 2013 @@ -1 +1,6 @@ +.classpath +.externalToolBuilders +.project +.settings +maven-eclipse.xml target
svn commit: r1417319 [1/3] - in /syncope/branches/cxf: console/ console/src/main/java/org/apache/syncope/console/pages/panels/ core/ core/src/main/java/org/apache/syncope/core/rest/ core/src/main/java
Author: jbernhardt Date: Wed Dec 5 09:04:17 2012 New Revision: 1417319 URL: http://svn.apache.org/viewvc?rev=1417319view=rev Log: Fixes from previous merging Removed: syncope/branches/cxf/core/src/main/java/org/apache/syncope/core/rest/controller/RoleControllerImpl.java syncope/branches/cxf/core/src/main/java/org/apache/syncope/core/rest/controller/UnauthorizedRoleException.java syncope/branches/cxf/core/src/main/java/org/apache/syncope/core/rest/controller/UserControllerImpl.java syncope/branches/cxf/core/src/main/java/org/apache/syncope/core/util/NotFoundException.java syncope/branches/cxf/core/src/test/java/org/apache/syncope/core/notification/NotificationTests.java syncope/branches/cxf/core/src/test/java/org/apache/syncope/core/rest/RoleTestITCase.java syncope/branches/cxf/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java Modified: syncope/branches/cxf/console/ (props changed) syncope/branches/cxf/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java syncope/branches/cxf/core/ (props changed) syncope/branches/cxf/core/pom.xml syncope/branches/cxf/core/src/main/java/org/apache/syncope/core/rest/QueryResourceInfoComperator.java syncope/branches/cxf/core/src/main/java/org/apache/syncope/core/rest/controller/RoleController.java syncope/branches/cxf/core/src/main/resources/ (props changed) syncope/branches/cxf/core/src/test/java/org/apache/syncope/core/notification/NotificationTest.java Propchange: syncope/branches/cxf/console/ -- --- svn:ignore (original) +++ svn:ignore Wed Dec 5 09:04:17 2012 @@ -4,3 +4,6 @@ nb-configuration.xml .pom.xml.swp .classpath .project +.externalToolBuilders +.settings +maven-eclipse.xml Modified: syncope/branches/cxf/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java URL: http://svn.apache.org/viewvc/syncope/branches/cxf/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java?rev=1417319r1=1417318r2=1417319view=diff == --- syncope/branches/cxf/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java (original) +++ syncope/branches/cxf/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java Wed Dec 5 09:04:17 2012 @@ -88,7 +88,7 @@ public class RolePanel extends Panel { this.add(new ResourcesPanel(resources, roleTO)); // -ListModelString selectedEntitlements = new ListModelString(roleTO.getEntitlements()); +ListModelString selectedEntitlements = new ListModelString(roleTO.getEntitlementList()); ListModelString availableEntitlements = new ListModelString(entitlementRestClient.getAllEntitlements()); Propchange: syncope/branches/cxf/core/ -- --- svn:ignore (original) +++ svn:ignore Wed Dec 5 09:04:17 2012 @@ -1,6 +1,10 @@ -target nb-configuration.xml nbactions.xml .pom.xml.swp +target .classpath +.externalToolBuilders +.settings .project +maven-eclipse.xml +maven.log