You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2014/06/25 15:22:19 UTC
svn commit: r1605386 [1/3] - in /syncope/trunk: ./
build-tools/src/main/java/org/apache/syncope/buildtools/
build-tools/src/main/resources/ common/
common/src/main/java/org/apache/syncope/common/services/
common/src/main/java/org/apache/syncope/common/...
Author: ilgrosso
Date: Wed Jun 25 13:22:17 2014
New Revision: 1605386
URL: http://svn.apache.org/r1605386
Log:
[SYNCOPE-461] Implementation provided
Modified:
syncope/trunk/ (props changed)
syncope/trunk/build-tools/src/main/java/org/apache/syncope/buildtools/H2StartStopListener.java
syncope/trunk/build-tools/src/main/resources/testdb.sql
syncope/trunk/common/pom.xml
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/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/common/src/main/java/org/apache/syncope/common/services/PolicyService.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/common/src/main/java/org/apache/syncope/common/services/SchemaService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserSelfService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ClientExceptionType.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/PushTask.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/SyncTask.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/impl/ConnectorFacadeProxy.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/EntitlementController.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/SchemaController.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/AbstractServiceImpl.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/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/TaskServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/WorkflowServiceImpl.java
syncope/trunk/core/src/main/resources/restContext.xml
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnectorTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/SearchTestITCase.java
syncope/trunk/core/src/test/resources/connid.properties
syncope/trunk/core/src/test/resources/content.xml
syncope/trunk/pom.xml
Propchange: syncope/trunk/
------------------------------------------------------------------------------
Merged /syncope/branches/1_1_X:r1605077-1605302
Modified: syncope/trunk/build-tools/src/main/java/org/apache/syncope/buildtools/H2StartStopListener.java
URL: http://svn.apache.org/viewvc/syncope/trunk/build-tools/src/main/java/org/apache/syncope/buildtools/H2StartStopListener.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/build-tools/src/main/java/org/apache/syncope/buildtools/H2StartStopListener.java (original)
+++ syncope/trunk/build-tools/src/main/java/org/apache/syncope/buildtools/H2StartStopListener.java Wed Jun 25 13:22:17 2014
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.buildtools;
-import java.io.File;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
@@ -49,10 +48,9 @@ public class H2StartStopListener impleme
public void contextInitialized(final ServletContextEvent sce) {
final ServletContext context = sce.getServletContext();
- final File workDir = (File) sce.getServletContext().getAttribute("javax.servlet.context.tempdir");
try {
final Server h2TestDb = new Server();
- h2TestDb.runTool("-baseDir", workDir.getAbsolutePath(), "-tcp", "-tcpDaemon", "-web", "-webDaemon",
+ h2TestDb.runTool("-tcp", "-tcpDaemon", "-web", "-webDaemon",
"-webPort", sce.getServletContext().getInitParameter("testdb.webport"));
context.setAttribute(H2_TESTDB, h2TestDb);
@@ -69,6 +67,8 @@ public class H2StartStopListener impleme
conn = DataSourceUtils.getConnection(datasource);
stmt = conn.createStatement();
stmt.executeUpdate("RUNSCRIPT FROM 'classpath:/testdb.sql'");
+
+ LOG.info("Database successfully initialized");
} catch (Exception e) {
LOG.error("While loading data into testdb", e);
} finally {
Modified: syncope/trunk/build-tools/src/main/resources/testdb.sql
URL: http://svn.apache.org/viewvc/syncope/trunk/build-tools/src/main/resources/testdb.sql?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/build-tools/src/main/resources/testdb.sql (original)
+++ syncope/trunk/build-tools/src/main/resources/testdb.sql Wed Jun 25 13:22:17 2014
@@ -1,14 +1,19 @@
--- Licensed 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.
+-- 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.
ALTER USER sa SET PASSWORD '${testdb.password}';
DROP TABLE test IF EXISTS;
Modified: syncope/trunk/common/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/common/pom.xml?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/common/pom.xml (original)
+++ syncope/trunk/common/pom.xml Wed Jun 25 13:22:17 2014
@@ -43,6 +43,11 @@ under the License.
<dependencies>
<dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</dependency>
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=1605386&r1=1605385&r2=1605386&view=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 Jun 25 13:22:17 2014
@@ -19,6 +19,7 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@@ -86,7 +87,7 @@ public interface ConfigurationService ex
@GET
@Path("{key}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- AttributeTO read(@PathParam("key") String key);
+ AttributeTO read(@NotNull @PathParam("key") String key);
/**
* Creates / updates the configuration parameter with the given key.
@@ -97,7 +98,7 @@ public interface ConfigurationService ex
@PUT
@Path("{key}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void set(@PathParam("key") String key, AttributeTO value);
+ void set(@NotNull @PathParam("key") String key, @NotNull AttributeTO value);
/**
* Deletes the configuration parameter with matching key.
@@ -107,5 +108,5 @@ public interface ConfigurationService ex
@DELETE
@Path("{key}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void delete(@PathParam("key") String key);
+ void delete(@NotNull @PathParam("key") String key);
}
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=1605386&r1=1605385&r2=1605386&view=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 Wed Jun 25 13:22:17 2014
@@ -19,6 +19,7 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
@@ -69,7 +70,7 @@ public interface ConnectorService extend
@GET
@Path("{connInstanceId}/configuration")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<ConnConfProperty> getConfigurationProperties(@PathParam("connInstanceId") Long connInstanceId);
+ List<ConnConfProperty> getConfigurationProperties(@NotNull @PathParam("connInstanceId") Long connInstanceId);
/**
* Returns schema names for connector bundle matching the given connector instance id.
@@ -84,7 +85,8 @@ public interface ConnectorService extend
@Path("{connInstanceId}/schemaNames")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<SchemaTO> getSchemaNames(@PathParam("connInstanceId") Long connInstanceId, ConnInstanceTO connInstanceTO,
+ List<SchemaTO> getSchemaNames(@NotNull @PathParam("connInstanceId") Long connInstanceId,
+ @NotNull ConnInstanceTO connInstanceTO,
@QueryParam("includeSpecial") @DefaultValue("false") boolean includeSpecial);
/**
@@ -98,8 +100,9 @@ public interface ConnectorService extend
@Path("{connInstanceId}/supportedObjectClasses")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<ConnIdObjectClassTO> getSupportedObjectClasses(@PathParam("connInstanceId") Long connInstanceId,
- ConnInstanceTO connInstanceTO);
+ List<ConnIdObjectClassTO> getSupportedObjectClasses(
+ @NotNull @PathParam("connInstanceId") Long connInstanceId,
+ @NotNull ConnInstanceTO connInstanceTO);
/**
* Returns connector instance with matching id.
@@ -110,7 +113,7 @@ public interface ConnectorService extend
@GET
@Path("{connInstanceId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- ConnInstanceTO read(@PathParam("connInstanceId") Long connInstanceId);
+ ConnInstanceTO read(@NotNull @PathParam("connInstanceId") Long connInstanceId);
/**
* Returns connector instance for matching resource.
@@ -121,7 +124,7 @@ public interface ConnectorService extend
@GET
@Path("byResource/{resourceName}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- ConnInstanceTO readByResource(@PathParam("resourceName") String resourceName);
+ ConnInstanceTO readByResource(@NotNull @PathParam("resourceName") String resourceName);
/**
* Returns a list of all connector instances with property keys in the matching language.
@@ -146,7 +149,7 @@ public interface ConnectorService extend
})
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response create(ConnInstanceTO connInstanceTO);
+ Response create(@NotNull ConnInstanceTO connInstanceTO);
/**
* Updates the connector instance matching the provided id.
@@ -157,7 +160,7 @@ public interface ConnectorService extend
@PUT
@Path("{connInstanceId}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void update(@PathParam("connInstanceId") Long connInstanceId, ConnInstanceTO connInstaceTO);
+ void update(@NotNull @PathParam("connInstanceId") Long connInstanceId, @NotNull ConnInstanceTO connInstaceTO);
/**
* Deletes the connector instance matching the provided id.
@@ -166,7 +169,7 @@ public interface ConnectorService extend
*/
@DELETE
@Path("{connInstanceId}")
- void delete(@PathParam("connInstanceId") Long connInstanceId);
+ void delete(@NotNull @PathParam("connInstanceId") Long connInstanceId);
/**
* @param connInstaceTO connector instance to be used for connection check
@@ -176,7 +179,7 @@ public interface ConnectorService extend
@Path("check")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- boolean check(ConnInstanceTO connInstaceTO);
+ boolean check(@NotNull ConnInstanceTO connInstaceTO);
/**
* Reload all connector bundles and instances.
@@ -195,5 +198,5 @@ public interface ConnectorService extend
@Path("bulk")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- BulkActionResult bulk(BulkAction bulkAction);
+ BulkActionResult bulk(@NotNull BulkAction bulkAction);
}
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=1605386&r1=1605385&r2=1605386&view=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 Jun 25 13:22:17 2014
@@ -19,6 +19,7 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -59,7 +60,7 @@ public interface LoggerService extends J
@GET
@Path("{type}/{name}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- LoggerTO read(@PathParam("type") LoggerType type, @PathParam("name") final String name);
+ LoggerTO read(@NotNull @PathParam("type") LoggerType type, @NotNull @PathParam("name") final String name);
/**
* Returns a list of loggers with matching type.
@@ -70,7 +71,7 @@ public interface LoggerService extends J
@GET
@Path("{type}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<LoggerTO> list(@PathParam("type") LoggerType type);
+ List<LoggerTO> list(@NotNull @PathParam("type") LoggerType type);
/**
* Creates or updates (if existing) the logger with matching name.
@@ -80,9 +81,10 @@ public interface LoggerService extends J
* @param logger Logger to be created or updated
*/
@PUT
- @Path("{type}/{name}/level")
+ @Path("{type}/{name}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void update(@PathParam("type") LoggerType type, @PathParam("name") String name, LoggerTO logger);
+ void update(@NotNull @PathParam("type") LoggerType type, @NotNull @PathParam("name") String name,
+ @NotNull LoggerTO logger);
/**
* Deletes the logger with matching name.
@@ -92,6 +94,6 @@ public interface LoggerService extends J
*/
@DELETE
@Path("{type}/{name}")
- void delete(@PathParam("type") LoggerType type, @PathParam("name") String name);
+ void delete(@NotNull @PathParam("type") LoggerType type, @NotNull @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=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java Wed Jun 25 13:22:17 2014
@@ -19,6 +19,7 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@@ -50,7 +51,7 @@ public interface NotificationService ext
@GET
@Path("{notificationId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- NotificationTO read(@PathParam("notificationId") Long notificationId);
+ NotificationTO read(@NotNull @PathParam("notificationId") Long notificationId);
/**
* Returns a list of all notifications.
@@ -73,7 +74,7 @@ public interface NotificationService ext
})
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response create(NotificationTO notificationTO);
+ Response create(@NotNull NotificationTO notificationTO);
/**
* Updates the notification matching the given id.
@@ -84,7 +85,7 @@ public interface NotificationService ext
@PUT
@Path("{notificationId}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void update(@PathParam("notificationId") Long notificationId, NotificationTO notificationTO);
+ void update(@NotNull @PathParam("notificationId") Long notificationId, @NotNull NotificationTO notificationTO);
/**
* Deletes the notification matching the given id.
@@ -93,5 +94,5 @@ public interface NotificationService ext
*/
@DELETE
@Path("{notificationId}")
- void delete(@PathParam("notificationId") Long notificationId);
+ void delete(@NotNull @PathParam("notificationId") Long notificationId);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java Wed Jun 25 13:22:17 2014
@@ -19,6 +19,7 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@@ -63,7 +64,7 @@ public interface PolicyService extends J
@GET
@Path("{policyId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractPolicyTO> T read(@PathParam("policyId") Long policyId);
+ <T extends AbstractPolicyTO> T read(@NotNull @PathParam("policyId") Long policyId);
/**
* Returns the global policy for the given type.
@@ -75,7 +76,7 @@ public interface PolicyService extends J
@GET
@Path("global")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractPolicyTO> T readGlobal(@MatrixParam("type") PolicyType type);
+ <T extends AbstractPolicyTO> T readGlobal(@NotNull @MatrixParam("type") PolicyType type);
/**
* Returns a list of policies of the matching type.
@@ -86,7 +87,7 @@ public interface PolicyService extends J
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractPolicyTO> List<T> list(@MatrixParam("type") PolicyType type);
+ <T extends AbstractPolicyTO> List<T> list(@NotNull @MatrixParam("type") PolicyType type);
/**
* Create a new policy.
@@ -100,7 +101,7 @@ public interface PolicyService extends J
})
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractPolicyTO> Response create(T policyTO);
+ <T extends AbstractPolicyTO> Response create(@NotNull T policyTO);
/**
* Updates policy matching the given id.
@@ -112,7 +113,7 @@ public interface PolicyService extends J
@PUT
@Path("{policyId}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractPolicyTO> void update(@PathParam("policyId") Long policyId, T policyTO);
+ <T extends AbstractPolicyTO> void update(@NotNull @PathParam("policyId") Long policyId, @NotNull T policyTO);
/**
* Delete policy matching the given id.
@@ -122,6 +123,6 @@ public interface PolicyService extends J
*/
@DELETE
@Path("{policyId}")
- <T extends AbstractPolicyTO> void delete(@PathParam("policyId") Long policyId);
+ <T extends AbstractPolicyTO> void delete(@NotNull @PathParam("policyId") Long policyId);
}
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=1605386&r1=1605385&r2=1605386&view=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 Wed Jun 25 13:22:17 2014
@@ -19,6 +19,8 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
@@ -65,7 +67,7 @@ public interface ReportService extends J
@GET
@Path("{reportId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- ReportTO read(@PathParam("reportId") Long reportId);
+ ReportTO read(@NotNull @PathParam("reportId") Long reportId);
/**
* Returns report execution with matching id.
@@ -76,7 +78,7 @@ public interface ReportService extends J
@GET
@Path("executions/{executionId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- ReportExecTO readExecution(@PathParam("executionId") Long executionId);
+ ReportExecTO readExecution(@NotNull @PathParam("executionId") Long executionId);
/**
* Returns a paged list of all existing reports.
@@ -107,8 +109,8 @@ public interface ReportService extends J
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<ReportTO> list(
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size);
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size);
/**
* Returns a paged list of all existing reports matching page/size conditions.
@@ -121,8 +123,8 @@ public interface ReportService extends J
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<ReportTO> list(
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size,
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size,
@QueryParam(PARAM_ORDERBY) String orderBy);
/**
@@ -136,7 +138,7 @@ public interface ReportService extends J
})
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response create(ReportTO reportTO);
+ Response create(@NotNull ReportTO reportTO);
/**
* Updates report with matching id.
@@ -147,7 +149,7 @@ public interface ReportService extends J
@PUT
@Path("{reportId}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void update(@PathParam("reportId") Long reportId, ReportTO reportTO);
+ void update(@NotNull @PathParam("reportId") Long reportId, ReportTO reportTO);
/**
* Deletes report with matching id.
@@ -156,7 +158,7 @@ public interface ReportService extends J
*/
@DELETE
@Path("{reportId}")
- void delete(@PathParam("reportId") Long reportId);
+ void delete(@NotNull @PathParam("reportId") Long reportId);
/**
* Deletes report execution with matching id.
@@ -165,7 +167,7 @@ public interface ReportService extends J
*/
@DELETE
@Path("executions/{executionId}")
- void deleteExecution(@PathParam("executionId") Long executionId);
+ void deleteExecution(@NotNull @PathParam("executionId") Long executionId);
/**
* Executes the report with matching id.
@@ -176,7 +178,7 @@ public interface ReportService extends J
@POST
@Path("{reportId}/execute")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- ReportExecTO execute(@PathParam("reportId") Long reportId);
+ ReportExecTO execute(@NotNull @PathParam("reportId") Long reportId);
/**
* Exports the report execution with matching id in the requested format.
@@ -188,6 +190,6 @@ public interface ReportService extends J
@GET
@Path("executions/{executionId}/stream")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response exportExecutionResult(@PathParam("executionId") Long executionId,
+ Response exportExecutionResult(@NotNull @PathParam("executionId") Long executionId,
@QueryParam("format") ReportExecExportFormat fmt);
}
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=1605386&r1=1605385&r2=1605386&view=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 Wed Jun 25 13:22:17 2014
@@ -19,6 +19,7 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@@ -59,8 +60,8 @@ public interface ResourceService extends
@GET
@Path("{resourceName}/{type}/{id}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- ConnObjectTO getConnectorObject(@PathParam("resourceName") String resourceName,
- @PathParam("type") SubjectType type, @PathParam("id") Long id);
+ ConnObjectTO getConnectorObject(@NotNull @PathParam("resourceName") String resourceName,
+ @NotNull @PathParam("type") SubjectType type, @NotNull @PathParam("id") Long id);
/**
* Returns a list of classes that can be used to customize the propagation process.
@@ -81,7 +82,7 @@ public interface ResourceService extends
@GET
@Path("{resourceName}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- ResourceTO read(@PathParam("resourceName") String resourceName);
+ ResourceTO read(@NotNull @PathParam("resourceName") String resourceName);
/**
* Returns a list of all resources.
@@ -100,7 +101,7 @@ public interface ResourceService extends
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<ResourceTO> list(@MatrixParam("connectorId") Long connInstanceId);
+ List<ResourceTO> list(@NotNull @MatrixParam("connectorId") Long connInstanceId);
/**
* Creates a new resource.
@@ -114,7 +115,7 @@ public interface ResourceService extends
})
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response create(ResourceTO resourceTO);
+ Response create(@NotNull ResourceTO resourceTO);
/**
* Updates the resource matching the given name.
@@ -125,7 +126,7 @@ public interface ResourceService extends
@PUT
@Path("{resourceName}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void update(@PathParam("resourceName") String resourceName, ResourceTO resourceTO);
+ void update(@NotNull @PathParam("resourceName") String resourceName, @NotNull ResourceTO resourceTO);
/**
* Deletes the resource matching the given name.
@@ -135,7 +136,7 @@ public interface ResourceService extends
@DELETE
@Path("{resourceName}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void delete(@PathParam("resourceName") String resourceName);
+ void delete(@NotNull @PathParam("resourceName") String resourceName);
/**
* Checks wether the connection to resource could be established.
@@ -146,7 +147,7 @@ public interface ResourceService extends
@POST
@Path("check")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- boolean check(ResourceTO resourceTO);
+ boolean check(@NotNull ResourceTO resourceTO);
/**
* De-associate users or roles (depending on the provided subject type) from the given resource.
@@ -162,12 +163,12 @@ public interface ResourceService extends
value = "Featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>")
})
@POST
- @Path("{resourceName}/bulkDeassociation/{attrType}/{type}")
+ @Path("{resourceName}/bulkDeassociation/{subjType}/{type}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- BulkActionResult bulkDeassociation(@PathParam("resourceName") String resourceName,
- @PathParam("attrType") SubjectType subjectType,
- @PathParam("type") ResourceDeassociationActionType type, List<SubjectId> subjectIds);
+ BulkActionResult bulkDeassociation(@NotNull @PathParam("resourceName") String resourceName,
+ @NotNull @PathParam("subjType") SubjectType subjectType,
+ @NotNull @PathParam("type") ResourceDeassociationActionType type, @NotNull List<SubjectId> subjectIds);
/**
* Executes the provided bulk action.
@@ -179,5 +180,5 @@ public interface ResourceService extends
@Path("bulk")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- BulkActionResult bulk(BulkAction bulkAction);
+ BulkActionResult bulk(@NotNull BulkAction bulkAction);
}
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=1605386&r1=1605385&r2=1605386&view=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 Wed Jun 25 13:22:17 2014
@@ -19,6 +19,8 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
@@ -33,7 +35,6 @@ import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.model.wadl.Description;
import org.apache.cxf.jaxrs.model.wadl.Descriptions;
import org.apache.cxf.jaxrs.model.wadl.DocTarget;
-
import org.apache.syncope.common.reqres.PagedResult;
import org.apache.syncope.common.mod.RoleMod;
import org.apache.syncope.common.to.RoleTO;
@@ -56,7 +57,7 @@ public interface RoleService extends JAX
@GET
@Path("{roleId}/children")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<RoleTO> children(@PathParam("roleId") Long roleId);
+ List<RoleTO> children(@NotNull @PathParam("roleId") Long roleId);
/**
* Returns parent role of the given role (or null if no parent exists).
@@ -67,7 +68,7 @@ public interface RoleService extends JAX
@GET
@Path("{roleId}/parent")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- RoleTO parent(@PathParam("roleId") Long roleId);
+ RoleTO parent(@NotNull @PathParam("roleId") Long roleId);
/**
* Reads the role matching the provided roleId.
@@ -78,7 +79,7 @@ public interface RoleService extends JAX
@GET
@Path("{roleId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- RoleTO read(@PathParam("roleId") Long roleId);
+ RoleTO read(@NotNull @PathParam("roleId") Long roleId);
/**
* This method is similar to {@link #read(Long)}, but uses different authentication handling to ensure that a user
@@ -95,7 +96,7 @@ public interface RoleService extends JAX
@GET
@Path("{roleId}/own")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- RoleTO readSelf(@PathParam("roleId") Long roleId);
+ RoleTO readSelf(@NotNull @PathParam("roleId") Long roleId);
/**
* Returns a paged list of existing roles.
@@ -126,8 +127,8 @@ public interface RoleService extends JAX
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<RoleTO> list(
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size);
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size);
/**
* Returns a paged list of existing roles matching page/size conditions.
@@ -140,8 +141,8 @@ public interface RoleService extends JAX
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<RoleTO> list(
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size,
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size,
@QueryParam(PARAM_ORDERBY) String orderBy);
/**
@@ -153,7 +154,7 @@ public interface RoleService extends JAX
@GET
@Path("search")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<RoleTO> search(@QueryParam(PARAM_FIQL) String fiql);
+ PagedResult<RoleTO> search(@NotNull @QueryParam(PARAM_FIQL) String fiql);
/**
* Returns a paged list of roles matching the provided FIQL search condition.
@@ -165,7 +166,8 @@ public interface RoleService extends JAX
@GET
@Path("search")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<RoleTO> search(@QueryParam(PARAM_FIQL) String fiql, @QueryParam(PARAM_ORDERBY) String orderBy);
+ PagedResult<RoleTO> search(
+ @NotNull @QueryParam(PARAM_FIQL) String fiql, @QueryParam(PARAM_ORDERBY) String orderBy);
/**
* Returns a paged list of roles matching the provided FIQL search condition.
@@ -179,8 +181,8 @@ public interface RoleService extends JAX
@Path("search")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<RoleTO> search(@QueryParam(PARAM_FIQL) String fiql,
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size);
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size);
/**
* Returns a paged list of roles matching the provided FIQL search condition.
@@ -195,8 +197,8 @@ public interface RoleService extends JAX
@Path("search")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<RoleTO> search(@QueryParam(PARAM_FIQL) String fiql,
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size,
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size,
@QueryParam(PARAM_ORDERBY) String orderBy);
/**
@@ -214,7 +216,7 @@ public interface RoleService extends JAX
@POST
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response create(RoleTO roleTO);
+ Response create(@NotNull RoleTO roleTO);
/**
* Updates role matching the provided roleId.
@@ -233,7 +235,7 @@ public interface RoleService extends JAX
@Path("{roleId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response update(@PathParam("roleId") Long roleId, RoleMod roleMod);
+ Response update(@NotNull @PathParam("roleId") Long roleId, @NotNull RoleMod roleMod);
/**
* Deletes role matching provided roleId.
@@ -251,7 +253,7 @@ public interface RoleService extends JAX
@Path("{roleId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response delete(@PathParam("roleId") Long roleId);
+ Response delete(@NotNull @PathParam("roleId") Long roleId);
/**
* Executes resource-related operations on given role.
@@ -270,8 +272,9 @@ public interface RoleService extends JAX
@Path("{roleId}/deassociate/{type}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response bulkDeassociation(@PathParam("roleId") Long roleId,
- @PathParam("type") ResourceDeassociationActionType type, List<ResourceName> resourceNames);
+ Response bulkDeassociation(@NotNull @PathParam("roleId") Long roleId,
+ @NotNull @PathParam("type") ResourceDeassociationActionType type,
+ @NotNull List<ResourceName> resourceNames);
/**
* Executes resource-related operations on given role.
@@ -290,6 +293,7 @@ public interface RoleService extends JAX
@Path("{roleId}/associate/{type}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response bulkAssociation(@PathParam("roleId") Long roleId,
- @PathParam("type") ResourceAssociationActionType type, List<ResourceName> resourceNames);
+ Response bulkAssociation(@NotNull @PathParam("roleId") Long roleId,
+ @NotNull @PathParam("type") ResourceAssociationActionType type,
+ @NotNull List<ResourceName> resourceNames);
}
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=1605386&r1=1605385&r2=1605386&view=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 Wed Jun 25 13:22:17 2014
@@ -19,6 +19,7 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@@ -54,8 +55,8 @@ public interface SchemaService extends J
@GET
@Path("{name}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractSchemaTO> T read(@PathParam("kind") AttributableType attrType,
- @PathParam("type") SchemaType schemaType, @PathParam("name") String schemaName);
+ <T extends AbstractSchemaTO> T read(@NotNull @PathParam("kind") AttributableType attrType,
+ @NotNull @PathParam("type") SchemaType schemaType, @NotNull @PathParam("name") String schemaName);
/**
* Returns a list of schemas with matching kind and type.
@@ -68,7 +69,7 @@ public interface SchemaService extends J
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
<T extends AbstractSchemaTO> List<T> list(
- @PathParam("kind") AttributableType attrType, @PathParam("type") SchemaType schemaType);
+ @NotNull @PathParam("kind") AttributableType attrType, @NotNull @PathParam("type") SchemaType schemaType);
/**
* Creates a new schema.
@@ -84,8 +85,8 @@ public interface SchemaService extends J
})
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractSchemaTO> Response create(@PathParam("kind") AttributableType attrType,
- @PathParam("type") SchemaType schemaType, T schemaTO);
+ <T extends AbstractSchemaTO> Response create(@NotNull @PathParam("kind") AttributableType attrType,
+ @NotNull @PathParam("type") SchemaType schemaType, @NotNull T schemaTO);
/**
* Updates the schema matching the given kind, type and name.
@@ -99,8 +100,9 @@ public interface SchemaService extends J
@PUT
@Path("{name}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractSchemaTO> void update(@PathParam("kind") AttributableType attrType,
- @PathParam("type") SchemaType schemaType, @PathParam("name") String schemaName, T schemaTO);
+ <T extends AbstractSchemaTO> void update(@NotNull @PathParam("kind") AttributableType attrType,
+ @NotNull @PathParam("type") SchemaType schemaType,
+ @NotNull @PathParam("name") String schemaName, @NotNull T schemaTO);
/**
* Deletes the schema matching the given kind, type and name.
@@ -111,6 +113,7 @@ public interface SchemaService extends J
*/
@DELETE
@Path("{name}")
- void delete(@PathParam("kind") AttributableType attrType, @PathParam("type") SchemaType schemaType,
- @PathParam("name") String schemaName);
+ void delete(@NotNull @PathParam("kind") AttributableType attrType,
+ @NotNull @PathParam("type") SchemaType schemaType,
+ @NotNull @PathParam("name") String schemaName);
}
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=1605386&r1=1605385&r2=1605386&view=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 Wed Jun 25 13:22:17 2014
@@ -19,7 +19,8 @@
package org.apache.syncope.common.services;
import java.util.List;
-
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
@@ -36,7 +37,6 @@ import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.model.wadl.Description;
import org.apache.cxf.jaxrs.model.wadl.Descriptions;
import org.apache.cxf.jaxrs.model.wadl.DocTarget;
-
import org.apache.syncope.common.reqres.PagedResult;
import org.apache.syncope.common.reqres.BulkAction;
import org.apache.syncope.common.reqres.BulkActionResult;
@@ -95,7 +95,7 @@ public interface TaskService extends JAX
@GET
@Path("{taskId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractTaskTO> T read(@PathParam("taskId") Long taskId);
+ <T extends AbstractTaskTO> T read(@NotNull @PathParam("taskId") Long taskId);
/**
* Returns the task execution with the given id.
@@ -106,7 +106,7 @@ public interface TaskService extends JAX
@GET
@Path("executions/{executionId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- TaskExecTO readExecution(@PathParam("executionId") Long executionId);
+ TaskExecTO readExecution(@NotNull @PathParam("executionId") Long executionId);
/**
* Returns a list of tasks with matching type.
@@ -117,7 +117,7 @@ public interface TaskService extends JAX
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractTaskTO> PagedResult<T> list(@MatrixParam("type") TaskType taskType);
+ <T extends AbstractTaskTO> PagedResult<T> list(@NotNull @MatrixParam("type") TaskType taskType);
/**
* Returns a list of tasks with matching type.
@@ -129,7 +129,7 @@ public interface TaskService extends JAX
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractTaskTO> PagedResult<T> list(@MatrixParam("type") TaskType taskType,
+ <T extends AbstractTaskTO> PagedResult<T> list(@NotNull @MatrixParam("type") TaskType taskType,
@QueryParam(PARAM_ORDERBY) String orderBy);
/**
@@ -144,9 +144,9 @@ public interface TaskService extends JAX
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractTaskTO> PagedResult<T> list(@MatrixParam("type") TaskType taskType,
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size,
+ <T extends AbstractTaskTO> PagedResult<T> list(@NotNull @MatrixParam("type") TaskType taskType,
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size,
@QueryParam(PARAM_ORDERBY) String orderBy);
/**
@@ -161,8 +161,8 @@ public interface TaskService extends JAX
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
<T extends AbstractTaskTO> PagedResult<T> list(@MatrixParam("type") TaskType taskType,
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size);
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size);
/**
* Creates a new task.
@@ -176,7 +176,7 @@ public interface TaskService extends JAX
})
@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends SchedTaskTO> Response create(T taskTO);
+ <T extends SchedTaskTO> Response create(@NotNull T taskTO);
/**
* Updates the task matching the provided id.
@@ -187,7 +187,7 @@ public interface TaskService extends JAX
@PUT
@Path("{taskId}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void update(@PathParam("taskId") Long taskId, AbstractTaskTO taskTO);
+ void update(@NotNull @PathParam("taskId") Long taskId, @NotNull AbstractTaskTO taskTO);
/**
* Deletes the task matching the provided id.
@@ -196,7 +196,7 @@ public interface TaskService extends JAX
*/
@DELETE
@Path("{taskId}")
- void delete(@PathParam("taskId") Long taskId);
+ void delete(@NotNull @PathParam("taskId") Long taskId);
/**
* Deletes the task execution matching the provided id.
@@ -205,7 +205,7 @@ public interface TaskService extends JAX
*/
@DELETE
@Path("executions/{executionId}")
- void deleteExecution(@PathParam("executionId") Long executionId);
+ void deleteExecution(@NotNull @PathParam("executionId") Long executionId);
/**
* Executes the task matching the given id.
@@ -217,18 +217,19 @@ public interface TaskService extends JAX
@POST
@Path("{taskId}/execute")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- TaskExecTO execute(@PathParam("taskId") Long taskId, @QueryParam("dryRun") @DefaultValue("false") boolean dryRun);
+ TaskExecTO execute(@NotNull @PathParam("taskId") Long taskId,
+ @QueryParam("dryRun") @DefaultValue("false") boolean dryRun);
/**
* Reports task execution result.
*
* @param executionId id of task execution being reported
- * @param report execution being reported
+ * @param reportExec execution being reported
*/
@POST
@Path("executions/{executionId}/report")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void report(@PathParam("executionId") Long executionId, ReportExecTO report);
+ void report(@NotNull @PathParam("executionId") Long executionId, @NotNull ReportExecTO reportExec);
/**
* Executes the provided bulk action.
@@ -240,5 +241,5 @@ public interface TaskService extends JAX
@Path("bulk")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- BulkActionResult bulk(BulkAction bulkAction);
+ BulkActionResult bulk(@NotNull BulkAction bulkAction);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserSelfService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserSelfService.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserSelfService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserSelfService.java Wed Jun 25 13:22:17 2014
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.services;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@@ -77,7 +78,7 @@ public interface UserSelfService extends
@POST
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response create(UserTO userTO);
+ Response create(@NotNull UserTO userTO);
/**
* Self-updates user.
@@ -94,7 +95,7 @@ public interface UserSelfService extends
@Path("{userId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response update(@PathParam("userId") Long userId, UserMod userMod);
+ Response update(@NotNull @PathParam("userId") Long userId, @NotNull UserMod userMod);
/**
* Self-deletes user.
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=1605386&r1=1605385&r2=1605386&view=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 Wed Jun 25 13:22:17 2014
@@ -19,6 +19,8 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
@@ -64,7 +66,7 @@ public interface UserService extends JAX
})
@OPTIONS
@Path("{userId}/username")
- Response getUsername(@PathParam("userId") Long userId);
+ Response getUsername(@NotNull @PathParam("userId") Long userId);
/**
* Gives the user id for the provided username.
@@ -78,7 +80,7 @@ public interface UserService extends JAX
})
@OPTIONS
@Path("{username}/userId")
- Response getUserId(@PathParam("username") String username);
+ Response getUserId(@NotNull @PathParam("username") String username);
/**
* Reads the user matching the provided userId.
@@ -89,7 +91,7 @@ public interface UserService extends JAX
@GET
@Path("{userId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- UserTO read(@PathParam("userId") Long userId);
+ UserTO read(@NotNull @PathParam("userId") Long userId);
/**
* Returns a paged list of existing users.
@@ -120,8 +122,8 @@ public interface UserService extends JAX
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<UserTO> list(
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size);
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size);
/**
* Returns a paged list of existing users matching page/size conditions.
@@ -134,8 +136,8 @@ public interface UserService extends JAX
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<UserTO> list(
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size,
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size,
@QueryParam(PARAM_ORDERBY) String orderBy);
/**
@@ -147,7 +149,7 @@ public interface UserService extends JAX
@GET
@Path("search")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<UserTO> search(@QueryParam(PARAM_FIQL) String fiql);
+ PagedResult<UserTO> search(@NotNull @QueryParam(PARAM_FIQL) String fiql);
/**
* Returns a paged list of users matching the provided FIQL search condition.
@@ -159,7 +161,7 @@ public interface UserService extends JAX
@GET
@Path("search")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<UserTO> search(@QueryParam(PARAM_FIQL) String fiql, @QueryParam(PARAM_ORDERBY) String orderBy);
+ PagedResult<UserTO> search(@NotNull @QueryParam(PARAM_FIQL) String fiql, @QueryParam(PARAM_ORDERBY) String orderBy);
/**
* Returns a paged list of users matching the provided FIQL search condition.
@@ -173,8 +175,8 @@ public interface UserService extends JAX
@Path("search")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<UserTO> search(@QueryParam(PARAM_FIQL) String fiql,
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size);
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size);
/**
* Returns a paged list of users matching the provided FIQL search condition.
@@ -189,8 +191,8 @@ public interface UserService extends JAX
@Path("search")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<UserTO> search(@QueryParam(PARAM_FIQL) String fiql,
- @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
- @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size,
+ @NotNull @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) Integer page,
+ @NotNull @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) Integer size,
@QueryParam(PARAM_ORDERBY) String orderBy);
/**
@@ -208,7 +210,7 @@ public interface UserService extends JAX
@POST
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response create(UserTO userTO);
+ Response create(@NotNull UserTO userTO);
/**
* Updates user matching the provided userId.
@@ -227,7 +229,7 @@ public interface UserService extends JAX
@Path("{userId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response update(@PathParam("userId") Long userId, UserMod userMod);
+ Response update(@NotNull @PathParam("userId") Long userId, @NotNull UserMod userMod);
/**
* Performs a status update on user matching provided userId.
@@ -246,7 +248,7 @@ public interface UserService extends JAX
@Path("{userId}/status")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response status(@PathParam("userId") Long userId, StatusMod statusMod);
+ Response status(@NotNull @PathParam("userId") Long userId, @NotNull StatusMod statusMod);
/**
* Deletes user matching provided userId.
@@ -263,7 +265,7 @@ public interface UserService extends JAX
@DELETE
@Path("{userId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response delete(@PathParam("userId") Long userId);
+ Response delete(@NotNull @PathParam("userId") Long userId);
/**
* Executes resource-related operations on given user.
@@ -281,8 +283,9 @@ public interface UserService extends JAX
@Path("{userId}/bulkDeassociation/{type}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response bulkDeassociation(@PathParam("userId") Long userId,
- @PathParam("type") ResourceDeassociationActionType type, List<ResourceName> resourceNames);
+ Response bulkDeassociation(@NotNull @PathParam("userId") Long userId,
+ @NotNull @PathParam("type") ResourceDeassociationActionType type,
+ @NotNull List<ResourceName> resourceNames);
/**
* Executes resource-related operations on given user.
@@ -299,9 +302,9 @@ public interface UserService extends JAX
@Path("{userId}/bulkAssociation/{type}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response bulkAssociation(@PathParam("userId") Long userId,
- @PathParam("type") ResourceAssociationActionType type,
- ResourceAssociationMod associationMod);
+ Response bulkAssociation(@NotNull @PathParam("userId") Long userId,
+ @NotNull @PathParam("type") ResourceAssociationActionType type,
+ @NotNull ResourceAssociationMod associationMod);
/**
* Executes the provided bulk action.
@@ -313,5 +316,5 @@ public interface UserService extends JAX
@Path("bulk")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- BulkActionResult bulk(BulkAction bulkAction);
+ BulkActionResult bulk(@NotNull BulkAction bulkAction);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java Wed Jun 25 13:22:17 2014
@@ -19,6 +19,7 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
@@ -57,7 +58,8 @@ public interface UserWorkflowService ext
@GET
@Path("forms/{userId}/{name}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<WorkflowFormTO> getFormsByName(@PathParam("userId") final Long userId, @PathParam("name") final String name);
+ List<WorkflowFormTO> getFormsByName(
+ @NotNull @PathParam("userId") final Long userId, @NotNull @PathParam("name") final String name);
/**
* Returns a list of available forms for the given user id.
@@ -68,7 +70,7 @@ public interface UserWorkflowService ext
@GET
@Path("forms/{userId}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- WorkflowFormTO getFormForUser(@PathParam("userId") Long userId);
+ WorkflowFormTO getFormForUser(@NotNull @PathParam("userId") Long userId);
/**
* Claims the form for the given task id.
@@ -79,7 +81,7 @@ public interface UserWorkflowService ext
@POST
@Path("forms/{taskId}/claim")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- WorkflowFormTO claimForm(@PathParam("taskId") String taskId);
+ WorkflowFormTO claimForm(@NotNull @PathParam("taskId") String taskId);
/**
* Submits a workflow form.
@@ -91,7 +93,7 @@ public interface UserWorkflowService ext
@Path("forms")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- UserTO submitForm(WorkflowFormTO form);
+ UserTO submitForm(@NotNull WorkflowFormTO form);
/**
* Executes workflow task for matching id.
@@ -104,5 +106,5 @@ public interface UserWorkflowService ext
@Path("tasks/{taskId}/execute")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- UserTO executeTask(@PathParam("taskId") String taskId, UserTO userTO);
+ UserTO executeTask(@NotNull @PathParam("taskId") String taskId, @NotNull UserTO userTO);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java Wed Jun 25 13:22:17 2014
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.services;
+import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.OPTIONS;
@@ -53,7 +54,7 @@ public interface WorkflowService extends
value = "Contains special syncope HTTP header indicating if Activiti is enabled for users / roles")
})
@OPTIONS
- Response getOptions(@PathParam("kind") SubjectType kind);
+ Response getOptions(@NotNull @PathParam("kind") SubjectType kind);
/**
* Exports workflow definition for matching kind.
@@ -63,7 +64,7 @@ public interface WorkflowService extends
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response exportDefinition(@PathParam("kind") SubjectType kind);
+ Response exportDefinition(@NotNull @PathParam("kind") SubjectType kind);
/**
* Exports workflow diagram representation.
@@ -74,7 +75,7 @@ public interface WorkflowService extends
@GET
@Path("diagram.png")
@Produces({ RESTHeaders.MEDIATYPE_IMAGE_PNG })
- Response exportDiagram(@PathParam("kind") SubjectType kind);
+ Response exportDiagram(@NotNull @PathParam("kind") SubjectType kind);
/**
* Imports workflow definition for matching kind.
@@ -84,5 +85,5 @@ public interface WorkflowService extends
*/
@PUT
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void importDefinition(@PathParam("kind") SubjectType kind, String definition);
+ void importDefinition(@NotNull @PathParam("kind") SubjectType kind, @NotNull String definition);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ClientExceptionType.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ClientExceptionType.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ClientExceptionType.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ClientExceptionType.java Wed Jun 25 13:22:17 2014
@@ -60,6 +60,7 @@ public enum ClientExceptionType {
NotFound(Response.Status.NOT_FOUND),
RejectedUserCreate(Response.Status.BAD_REQUEST),
RequiredValuesMissing(Response.Status.BAD_REQUEST),
+ RESTValidation(Response.Status.BAD_REQUEST),
RoleOwnership(Response.Status.BAD_REQUEST),
Scheduling(Response.Status.BAD_REQUEST),
UnauthorizedRole(Response.Status.UNAUTHORIZED),
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/PushTask.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/PushTask.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/PushTask.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/PushTask.java Wed Jun 25 13:22:17 2014
@@ -19,20 +19,18 @@
package org.apache.syncope.core.persistence.beans;
import javax.persistence.Entity;
-import javax.persistence.Transient;
import org.apache.syncope.common.types.MatchingRule;
import org.apache.syncope.common.types.UnmatchingRule;
+import org.apache.syncope.core.sync.impl.PushJob;
@Entity
public class PushTask extends AbstractSyncTask {
private static final long serialVersionUID = -4141057723006682564L;
- @Transient
- private static UnmatchingRule DEF_UNMATCHIG_RULE = UnmatchingRule.ASSIGN;
+ private static final UnmatchingRule DEF_UNMATCHIG_RULE = UnmatchingRule.ASSIGN;
- @Transient
- private static MatchingRule DEF_MATCHIG_RULE = MatchingRule.UPDATE;
+ private static final MatchingRule DEF_MATCHIG_RULE = MatchingRule.UPDATE;
private String userFilter;
@@ -42,7 +40,7 @@ public class PushTask extends AbstractSy
* Default constructor.
*/
public PushTask() {
- super("org.apache.syncope.core.sync.impl.PushJob");
+ super(PushJob.class.getName());
}
public String getUserFilter() {
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/SyncTask.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/SyncTask.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/SyncTask.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/persistence/beans/SyncTask.java Wed Jun 25 13:22:17 2014
@@ -21,7 +21,6 @@ package org.apache.syncope.core.persiste
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Lob;
-import javax.persistence.Transient;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import org.apache.syncope.common.to.RoleTO;
@@ -36,11 +35,9 @@ public class SyncTask extends AbstractSy
private static final long serialVersionUID = -4141057723006682563L;
- @Transient
- private static UnmatchingRule DEF_UNMATCHIG_RULE = UnmatchingRule.PROVISION;
+ private static final UnmatchingRule DEF_UNMATCHIG_RULE = UnmatchingRule.PROVISION;
- @Transient
- private static MatchingRule DEF_MATCHIG_RULE = MatchingRule.UPDATE;
+ private static final MatchingRule DEF_MATCHIG_RULE = MatchingRule.UPDATE;
@Lob
private String userTemplate;
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/impl/ConnectorFacadeProxy.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/impl/ConnectorFacadeProxy.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/impl/ConnectorFacadeProxy.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/impl/ConnectorFacadeProxy.java Wed Jun 25 13:22:17 2014
@@ -64,10 +64,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ClassUtils;
-/**
- * Intercept calls to ConnectorFacade's methods and check if the corresponding connector instance has been configured to
- * allow every single operation: if not, simply do nothing.
- */
public class ConnectorFacadeProxy implements Connector {
/**
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/EntitlementController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/EntitlementController.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/EntitlementController.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/EntitlementController.java Wed Jun 25 13:22:17 2014
@@ -50,7 +50,9 @@ public class EntitlementController exten
}
@Override
- protected EntitlementTO resolveReference(Method method, Object... args) throws UnresolvedReferenceException {
+ protected EntitlementTO resolveReference(final Method method, final Object... args)
+ throws UnresolvedReferenceException {
+
throw new UnresolvedReferenceException();
}
}
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java Wed Jun 25 13:22:17 2014
@@ -34,8 +34,8 @@ import org.apache.syncope.common.Syncope
import org.apache.syncope.common.types.SubjectType;
import org.apache.syncope.core.connid.ConnObjectUtil;
import org.apache.syncope.core.init.ImplementationClassNamesLoader;
-import org.apache.syncope.core.persistence.beans.AbstractAttributable;
import org.apache.syncope.core.persistence.beans.AbstractMappingItem;
+import org.apache.syncope.core.persistence.beans.AbstractSubject;
import org.apache.syncope.core.persistence.beans.ConnInstance;
import org.apache.syncope.core.persistence.beans.ExternalResource;
import org.apache.syncope.core.persistence.dao.ConnInstanceDAO;
@@ -175,18 +175,10 @@ public class ResourceController extends
throw new NotFoundException("Resource '" + resourceName + "'");
}
- AbstractAttributable attributable = null;
- switch (type) {
- case USER:
- default:
- attributable = userDAO.find(id);
- break;
-
- case ROLE:
- attributable = roleDAO.find(id);
- break;
- }
- if (attributable == null) {
+ AbstractSubject subject = type == SubjectType.USER
+ ? userDAO.find(id)
+ : roleDAO.find(id);
+ if (subject == null) {
throw new NotFoundException(type + " " + id);
}
@@ -198,7 +190,7 @@ public class ResourceController extends
+ "'");
}
final String accountIdValue = MappingUtil.getAccountIdValue(
- attributable, resource, attrUtil.getAccountIdItem(resource));
+ subject, resource, attrUtil.getAccountIdItem(resource));
final ObjectClass objectClass = SubjectType.USER == type ? ObjectClass.ACCOUNT : ObjectClass.GROUP;
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/SchemaController.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/SchemaController.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/SchemaController.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/SchemaController.java Wed Jun 25 13:22:17 2014
@@ -227,19 +227,19 @@ public class SchemaController extends Ab
@PreAuthorize("hasRole('SCHEMA_UPDATE')")
public <T extends AbstractSchemaTO> void update(final AttributableType attrType, final SchemaType schemaType,
- final String schemaName, final T schemaTO) {
+ final T schemaTO) {
final AttributableUtil attrUtil = AttributableUtil.getInstance(attrType);
- if (!doesSchemaExist(schemaType, schemaName, attrUtil)) {
- throw new NotFoundException(schemaType + "/" + attrType + "/" + schemaName);
+ if (!doesSchemaExist(schemaType, schemaTO.getName(), attrUtil)) {
+ throw new NotFoundException(schemaType + "/" + attrType + "/" + schemaTO.getName());
}
switch (schemaType) {
case VIRTUAL:
- AbstractVirSchema virSchema = virSchemaDAO.find(schemaName, attrUtil.virSchemaClass());
+ AbstractVirSchema virSchema = virSchemaDAO.find(schemaTO.getName(), attrUtil.virSchemaClass());
if (virSchema == null) {
- throw new NotFoundException("Virtual Schema '" + schemaName + "'");
+ throw new NotFoundException("Virtual Schema '" + schemaTO.getName() + "'");
}
binder.update((VirSchemaTO) schemaTO, virSchema);
@@ -247,9 +247,9 @@ public class SchemaController extends Ab
break;
case DERIVED:
- AbstractDerSchema derSchema = derSchemaDAO.find(schemaName, attrUtil.derSchemaClass());
+ AbstractDerSchema derSchema = derSchemaDAO.find(schemaTO.getName(), attrUtil.derSchemaClass());
if (derSchema == null) {
- throw new NotFoundException("Derived schema '" + schemaName + "'");
+ throw new NotFoundException("Derived schema '" + schemaTO.getName() + "'");
}
binder.update((DerSchemaTO) schemaTO, derSchema);
@@ -258,9 +258,9 @@ public class SchemaController extends Ab
case NORMAL:
default:
- AbstractNormalSchema schema = schemaDAO.find(schemaName, attrUtil.schemaClass());
+ AbstractNormalSchema schema = schemaDAO.find(schemaTO.getName(), attrUtil.schemaClass());
if (schema == null) {
- throw new NotFoundException("Schema '" + schemaName + "'");
+ throw new NotFoundException("Schema '" + schemaTO.getName() + "'");
}
binder.update((SchemaTO) schemaTO, schema, attrUtil);
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java Wed Jun 25 13:22:17 2014
@@ -25,6 +25,7 @@ import java.util.Set;
import javax.persistence.EntityExistsException;
import javax.persistence.PersistenceException;
import javax.persistence.RollbackException;
+import javax.validation.ValidationException;
import javax.ws.rs.BadRequestException;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.HttpHeaders;
@@ -34,6 +35,7 @@ import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import org.apache.cxf.jaxrs.client.ResponseExceptionMapper;
import org.apache.cxf.jaxrs.utils.JAXRSUtils;
+import org.apache.cxf.jaxrs.validation.ValidationExceptionMapper;
import org.apache.syncope.common.types.EntityViolationType;
import org.apache.syncope.common.types.ClientExceptionType;
import org.apache.syncope.common.types.RESTHeaders;
@@ -60,6 +62,8 @@ public class RestServiceExceptionMapper
private static final Logger LOG = LoggerFactory.getLogger(RestServiceExceptionMapper.class);
+ private final ValidationExceptionMapper validationEM = new ValidationExceptionMapper();
+
@Override
public Response toResponse(final Exception ex) {
LOG.error("Exception thrown by REST method: " + ex.getMessage(), ex);
@@ -96,6 +100,18 @@ public class RestServiceExceptionMapper
if (builder == null) {
builder = processBadRequestExceptions(ex);
}
+ // process JAX-RS validation errors
+ if (builder == null && ex instanceof ValidationException) {
+ builder = JAXRSUtils.fromResponse(validationEM.toResponse((ValidationException) ex)).
+ header(RESTHeaders.ERROR_INFO,
+ ClientExceptionType.RESTValidation.getInfoHeaderValue(getExMessage(ex)));
+
+ ErrorTO error = new ErrorTO();
+ error.setStatus(ClientExceptionType.RESTValidation.getResponseStatus().getStatusCode());
+ error.setType(ClientExceptionType.RESTValidation);
+ error.getElements().add(getExMessage(ex));
+ builder.entity(error);
+ }
// ...or just report as InternalServerError
if (builder == null) {
builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR).
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/AbstractServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/AbstractServiceImpl.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/AbstractServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/AbstractServiceImpl.java Wed Jun 25 13:22:17 2014
@@ -132,27 +132,6 @@ abstract class AbstractServiceImpl imple
return builder;
}
- /**
- * Checks whether given page and size values are valid.
- *
- * [SYNCOPE-461] Keep this method until BVal 1.0 (implementing JSR 303 1.1 which will work with CXF JAX-RS
- * validation) is available.
- *
- * @param page result page number
- * @param size number of entries per page
- * @see https://issues.apache.org/jira/browse/SYNCOPE-461
- */
- protected void checkPageSize(final int page, final int size) {
- if (page <= 0 || size <= 0) {
- LOG.error("Invalid page / size specified: {},{}", page, size);
-
- SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidPageOrSize);
- sce.getElements().add(String.valueOf(page));
- sce.getElements().add(String.valueOf(size));
- throw sce;
- }
- }
-
protected SearchCond getSearchCond(final String fiql) {
try {
SearchCondVisitor visitor = new SearchCondVisitor();
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java Wed Jun 25 13:22:17 2014
@@ -69,6 +69,8 @@ public class ConnectorServiceImpl extend
public List<SchemaTO> getSchemaNames(final Long connInstanceId, final ConnInstanceTO connInstanceTO,
final boolean includeSpecial) {
+ connInstanceTO.setId(connInstanceId);
+
List<String> schemaNames = controller.getSchemaNames(connInstanceTO, includeSpecial);
List<SchemaTO> result = new ArrayList<SchemaTO>(schemaNames.size());
for (String name : schemaNames) {
@@ -83,6 +85,8 @@ public class ConnectorServiceImpl extend
public List<ConnIdObjectClassTO> getSupportedObjectClasses(final Long connInstanceId,
final ConnInstanceTO connInstanceTO) {
+ connInstanceTO.setId(connInstanceId);
+
List<String> objectClasses = controller.getSupportedObjectClasses(connInstanceTO);
List<ConnIdObjectClassTO> result = new ArrayList<ConnIdObjectClassTO>(objectClasses.size());
for (String objectClass : objectClasses) {
@@ -108,6 +112,7 @@ public class ConnectorServiceImpl extend
@Override
public void update(final Long connInstanceId, final ConnInstanceTO connInstanceTO) {
+ connInstanceTO.setId(connInstanceId);
controller.update(connInstanceTO);
}
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=1605386&r1=1605385&r2=1605386&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 Wed Jun 25 13:22:17 2014
@@ -99,9 +99,7 @@ public class LoggerServiceImpl extends A
case AUDIT:
try {
controller.enableAudit(AuditLoggerName.fromLoggerName(name));
- } catch (IllegalArgumentException e) {
- throw new BadRequestException(e);
- } catch (ParseException e) {
+ } catch (Exception e) {
throw new BadRequestException(e);
}
break;
Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java
URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java?rev=1605386&r1=1605385&r2=1605386&view=diff
==============================================================================
--- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java (original)
+++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java Wed Jun 25 13:22:17 2014
@@ -57,6 +57,7 @@ public class NotificationServiceImpl ext
@Override
public void update(final Long notificationId, final NotificationTO notificationTO) {
+ notificationTO.setId(notificationId);
controller.update(notificationTO);
}