Author: jbernhardt Date: Tue Jan 29 14:08:34 2013 New Revision: 1439899 URL: http://svn.apache.org/viewvc?rev=1439899&view=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=1439899&r1=1439898&r2=1439899&view=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=1439899&r1=1439898&r2=1439899&view=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=1439899&r1=1439898&r2=1439899&view=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) { return userController.activate(userId, token); } @Override - public UserTO activate(final long userId, final String token, - final PropagationRequestTO propagationRequestTO) { + public UserTO activate(final long userId, final String token, final PropagationRequestTO propagationRequestTO) { return userController.activate(userId, token, propagationRequestTO); } @Override - public UserTO activateByUsername(final String username, final @MatrixParam("token") String token) { + public UserTO activateByUsername(final String username, final String token) { return userController.activate(username, token); } @@ -133,8 +130,7 @@ public class UserServiceImpl implements } @Override - public UserTO reactivateByUsername(final String username, - PropagationRequestTO propagationRequestTO) { + public UserTO reactivateByUsername(final String username, final PropagationRequestTO propagationRequestTO) { return userController.reactivate(username, propagationRequestTO); } @@ -204,9 +200,7 @@ public class UserServiceImpl implements } @Override - @Context public void setUriInfo(final UriInfo uriInfo) { this.uriInfo = uriInfo; } - }