syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/7] syncope git commit: [SYNCOPE-620] common-rest-api
Date Mon, 12 Jan 2015 17:41:05 GMT
[SYNCOPE-620] common-rest-api


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/65adad7d
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/65adad7d
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/65adad7d

Branch: refs/heads/2_0_X
Commit: 65adad7dc8e3e29516da8e596aea1d66039a29a6
Parents: 7fea577
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Mon Jan 12 17:47:29 2015 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Mon Jan 12 17:47:29 2015 +0100

----------------------------------------------------------------------
 syncope620/common/lib/pom.xml                   |  11 +
 .../common/lib/to/ConnIdObjectClassTO.java      |  72 +++++
 .../types/ResourceAssociationActionType.java    |  39 +++
 .../types/ResourceDeassociationActionType.java  |  39 +++
 .../org/apache/syncope/common/lib/JSONTest.java |  63 ++++
 syncope620/common/pom.xml                       |   1 +
 syncope620/common/rest-api/pom.xml              |  65 ++++
 .../common/rest/api/ConfigurationService.java   | 112 +++++++
 .../common/rest/api/ConnectorService.java       | 201 ++++++++++++
 .../common/rest/api/EntitlementService.java     |  53 +++
 .../syncope/common/rest/api/JAXRSService.java   |  39 +++
 .../syncope/common/rest/api/LoggerService.java  |  98 ++++++
 .../common/rest/api/NotificationService.java    |  97 ++++++
 .../syncope/common/rest/api/PolicyService.java  | 128 ++++++++
 .../syncope/common/rest/api/RESTHeaders.java    | 115 +++++++
 .../syncope/common/rest/api/ReportService.java  | 195 +++++++++++
 .../common/rest/api/ResourceService.java        | 184 +++++++++++
 .../syncope/common/rest/api/RoleService.java    | 313 ++++++++++++++++++
 .../syncope/common/rest/api/SchemaService.java  | 119 +++++++
 .../rest/api/SecurityQuestionService.java       | 110 +++++++
 .../syncope/common/rest/api/TaskService.java    | 245 ++++++++++++++
 .../common/rest/api/UserSelfService.java        | 145 +++++++++
 .../syncope/common/rest/api/UserService.java    | 321 +++++++++++++++++++
 .../common/rest/api/UserWorkflowService.java    | 108 +++++++
 .../common/rest/api/WorkflowService.java        |  89 +++++
 25 files changed, 2962 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/lib/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/pom.xml b/syncope620/common/lib/pom.xml
index ad51d98..e171dad 100644
--- a/syncope620/common/lib/pom.xml
+++ b/syncope620/common/lib/pom.xml
@@ -62,5 +62,16 @@ under the License.
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-api</artifactId>
     </dependency>
+    
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java
new file mode 100644
index 0000000..fd4d0b7
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClassTO.java
@@ -0,0 +1,72 @@
+/*
+ * 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.common.lib.to;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+/**
+ * Mimic ConnId's ObjectClass information.
+ */
+@XmlRootElement(name = "connIdObjectClass")
+@XmlType
+public class ConnIdObjectClassTO extends AbstractBaseBean {
+
+    private static final long serialVersionUID = 5802458031138859994L;
+
+    @XmlEnum
+    public enum DefaultType {
+
+        ACCOUNT("__ACCOUNT__"),
+        GROUP("__GROUP__");
+
+        private String specialName;
+
+        private DefaultType(final String specialName) {
+            this.specialName = specialName;
+        }
+
+        public String getSpecialName() {
+            return specialName;
+        }
+    }
+
+    public static ConnIdObjectClassTO ACCOUNT = new ConnIdObjectClassTO(DefaultType.ACCOUNT.getSpecialName());
+
+    public static ConnIdObjectClassTO GROUP = new ConnIdObjectClassTO(DefaultType.GROUP.getSpecialName());
+
+    private String type;
+
+    public ConnIdObjectClassTO() {
+    }
+
+    public ConnIdObjectClassTO(final String type) {
+        this.type = type;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(final String type) {
+        this.type = type;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceAssociationActionType.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceAssociationActionType.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceAssociationActionType.java
new file mode 100644
index 0000000..7693ca3
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceAssociationActionType.java
@@ -0,0 +1,39 @@
+/*
+ * 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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum ResourceAssociationActionType {
+
+    /**
+     * Add association between user/role on Syncope and external resource(s) without any propagation.
+     */
+    LINK,
+    /**
+     * Add user/role into external resource(s).
+     */
+    PROVISION,
+    /**
+     * Assign (link + provision) external resource(s) with user/role.
+     */
+    ASSIGN
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceDeassociationActionType.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceDeassociationActionType.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceDeassociationActionType.java
new file mode 100644
index 0000000..c88f453
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceDeassociationActionType.java
@@ -0,0 +1,39 @@
+/*
+ * 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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum ResourceDeassociationActionType {
+
+    /**
+     * Remove association between user/role on Syncope and external resource(s) without any propagation.
+     */
+    UNLINK,
+    /**
+     * Remove user/role from external resource(s).
+     */
+    DEPROVISION,
+    /**
+     * Unassign (unlink + de-provision) external resource(s) from user/role.
+     */
+    UNASSIGN
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java b/syncope620/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
new file mode 100644
index 0000000..008c226
--- /dev/null
+++ b/syncope620/common/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java
@@ -0,0 +1,63 @@
+/*
+ * 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.common.lib;
+
+import static org.junit.Assert.assertEquals;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.io.StringWriter;
+import org.apache.syncope.common.lib.report.UserReportletConf;
+import org.apache.syncope.common.lib.to.ReportTO;
+import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
+import org.junit.Test;
+
+public class JSONTest {
+
+    @Test
+    public void map() throws IOException {
+        WorkflowFormPropertyTO prop = new WorkflowFormPropertyTO();
+        prop.getEnumValues().put("key1", "value1");
+        prop.getEnumValues().put("key2", "value2");
+
+        ObjectMapper mapper = new ObjectMapper();
+
+        StringWriter writer = new StringWriter();
+        mapper.writeValue(writer, prop);
+
+        WorkflowFormPropertyTO unserializedProp = mapper.readValue(writer.toString(), WorkflowFormPropertyTO.class);
+        assertEquals(prop, unserializedProp);
+    }
+
+    @Test
+    public void reportletConfImplementations() throws IOException {
+        ReportTO report = new ReportTO();
+        report.setName("testReportForCreate");
+        report.getReportletConfs().add(new UserReportletConf("first"));
+        report.getReportletConfs().add(new UserReportletConf("second"));
+
+        ObjectMapper mapper = new ObjectMapper();
+
+        StringWriter writer = new StringWriter();
+        mapper.writeValue(writer, report);
+
+        ReportTO actual = mapper.readValue(writer.toString(), ReportTO.class);
+        assertEquals(report, actual);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/common/pom.xml b/syncope620/common/pom.xml
index 0045a54..a137eb5 100644
--- a/syncope620/common/pom.xml
+++ b/syncope620/common/pom.xml
@@ -35,6 +35,7 @@ under the License.
 
   <modules>
     <module>lib</module>
+    <module>rest-api</module>
   </modules>
 
 </project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/pom.xml b/syncope620/common/rest-api/pom.xml
new file mode 100644
index 0000000..432aa9e
--- /dev/null
+++ b/syncope620/common/rest-api/pom.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.syncope</groupId>
+    <artifactId>syncope-common</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+
+  <name>Apache Syncope Common REST API</name>
+  <description>Apache Syncope Common REST API</description>
+  <groupId>org.apache.syncope.common</groupId>
+  <artifactId>syncope-common-rest-api</artifactId>
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>javax.validation</groupId>
+      <artifactId>validation-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.ws.rs</groupId>
+      <artifactId>javax.ws.rs-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-rs-extension-search</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-rs-service-description</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.syncope.common</groupId>
+      <artifactId>syncope-common-lib</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ConfigurationService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ConfigurationService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ConfigurationService.java
new file mode 100644
index 0000000..c76a5c6
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ConfigurationService.java
@@ -0,0 +1,112 @@
+/*
+ * 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.common.rest.api;
+
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConfTO;
+import org.apache.syncope.common.lib.wrap.MailTemplate;
+import org.apache.syncope.common.lib.wrap.Validator;
+
+/**
+ * REST operations for configuration.
+ */
+@Path("configurations")
+public interface ConfigurationService extends JAXRSService {
+
+    /**
+     * Exports internal storage content as downloadable XML file.
+     *
+     * @return internal storage content as downloadable XML file
+     */
+    @GET
+    @Path("stream")
+    Response export();
+
+    /**
+     * Returns a list of known mail-template names.
+     *
+     * @return a list of known mail-template names
+     */
+    @GET
+    @Path("mailTemplates")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<MailTemplate> getMailTemplates();
+
+    /**
+     * Returns a list of known validator names.
+     *
+     * @return a list of known validator names
+     */
+    @GET
+    @Path("validators")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<Validator> getValidators();
+
+    /**
+     * Returns all configuration parameters.
+     *
+     * @return all configuration parameters
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    ConfTO list();
+
+    /**
+     * Returns configuration parameter with matching key.
+     *
+     * @param key identifier of configuration to be read
+     * @return configuration parameter with matching key
+     */
+    @GET
+    @Path("{key}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    AttrTO read(@NotNull @PathParam("key") String key);
+
+    /**
+     * Creates / updates the configuration parameter with the given key.
+     *
+     * @param key parameter key
+     * @param value parameter value
+     */
+    @PUT
+    @Path("{key}")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    void set(@NotNull @PathParam("key") String key, @NotNull AttrTO value);
+
+    /**
+     * Deletes the configuration parameter with matching key.
+     *
+     * @param key configuration parameter key
+     */
+    @DELETE
+    @Path("{key}")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    void delete(@NotNull @PathParam("key") String key);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ConnectorService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ConnectorService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ConnectorService.java
new file mode 100644
index 0000000..793a2cf
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ConnectorService.java
@@ -0,0 +1,201 @@
+/*
+ * 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.common.rest.api;
+
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+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.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.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.ConnBundleTO;
+import org.apache.syncope.common.lib.to.ConnIdObjectClassTO;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+
+/**
+ * REST operations for connector bundles and instances.
+ */
+@Path("connectors")
+public interface ConnectorService extends JAXRSService {
+
+    /**
+     * Returns available connector bundles with property keys in selected language.
+     *
+     * @param lang language to select property keys; default language is English
+     * @return available connector bundles with property keys in selected language
+     */
+    @GET
+    @Path("bundles")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<ConnBundleTO> getBundles(@QueryParam("lang") String lang);
+
+    /**
+     * Returns configuration for given connector instance.
+     *
+     * @param connInstanceId connector instance id to read configuration from
+     * @return configuration for given connector instance
+     */
+    @GET
+    @Path("{connInstanceId}/configuration")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<ConnConfProperty> getConfigurationProperties(@NotNull @PathParam("connInstanceId") Long connInstanceId);
+
+    /**
+     * Returns schema names for connector bundle matching the given connector instance id.
+     *
+     * @param connInstanceId connector instance id to be used for schema lookup
+     * @param connInstanceTO connector instance object to provide special configuration properties
+     * @param includeSpecial if set to true, special schema names (like '__PASSWORD__') will be included;
+     * default is false
+     * @return schema names for connector bundle matching the given connector instance id
+     */
+    @POST
+    @Path("{connInstanceId}/schemaNames")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<PlainSchemaTO> getSchemaNames(@NotNull @PathParam("connInstanceId") Long connInstanceId,
+            @NotNull ConnInstanceTO connInstanceTO,
+            @QueryParam("includeSpecial") @DefaultValue("false") boolean includeSpecial);
+
+    /**
+     * Returns supported object classes for connector bundle matching the given connector instance id.
+     *
+     * @param connInstanceId connector instance id to be used for schema lookup
+     * @param connInstanceTO connector instance object to provide special configuration properties
+     * @return supported object classes for connector bundle matching the given connector instance id
+     */
+    @POST
+    @Path("{connInstanceId}/supportedObjectClasses")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<ConnIdObjectClassTO> getSupportedObjectClasses(
+            @NotNull @PathParam("connInstanceId") Long connInstanceId,
+            @NotNull ConnInstanceTO connInstanceTO);
+
+    /**
+     * Returns connector instance with matching id.
+     *
+     * @param connInstanceId connector instance id to be read
+     * @return connector instance with matching id
+     */
+    @GET
+    @Path("{connInstanceId}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    ConnInstanceTO read(@NotNull @PathParam("connInstanceId") Long connInstanceId);
+
+    /**
+     * Returns connector instance for matching resource.
+     *
+     * @param resourceName resource name to be used for connector lookup
+     * @return connector instance for matching resource
+     */
+    @GET
+    @Path("byResource/{resourceName}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    ConnInstanceTO readByResource(@NotNull @PathParam("resourceName") String resourceName);
+
+    /**
+     * Returns a list of all connector instances with property keys in the matching language.
+     *
+     * @param lang language to select property keys, null for default (English).
+     * An ISO 639 alpha-2 or alpha-3 language code, or a language subtag up to 8 characters in length.
+     * @return list of all connector instances with property keys in the matching language
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<ConnInstanceTO> list(@QueryParam("lang") String lang);
+
+    /**
+     * Creates a new connector instance.
+     *
+     * @param connInstanceTO connector instance to be created
+     * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created connector instance
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE,
+                value = "Featuring <tt>Location</tt> header of created connector instance")
+    })
+    @POST
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    Response create(@NotNull ConnInstanceTO connInstanceTO);
+
+    /**
+     * Updates the connector instance matching the provided id.
+     *
+     * @param connInstanceId connector instance id to be updated
+     * @param connInstanceTO connector instance to be stored
+     */
+    @PUT
+    @Path("{connInstanceId}")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    void update(@NotNull @PathParam("connInstanceId") Long connInstanceId, @NotNull ConnInstanceTO connInstanceTO);
+
+    /**
+     * Deletes the connector instance matching the provided id.
+     *
+     * @param connInstanceId connector instance id to be deleted
+     */
+    @DELETE
+    @Path("{connInstanceId}")
+    void delete(@NotNull @PathParam("connInstanceId") Long connInstanceId);
+
+    /**
+     * @param connInstanceTO connector instance to be used for connection check
+     * @return true if connection could be established
+     */
+    @POST
+    @Path("check")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    boolean check(@NotNull ConnInstanceTO connInstanceTO);
+
+    /**
+     * Reload all connector bundles and instances.
+     */
+    @POST
+    @Path("reload")
+    void reload();
+
+    /**
+     * Executes the provided bulk action.
+     *
+     * @param bulkAction list of connector instance ids against which the bulk action will be performed.
+     * @return Bulk action result
+     */
+    @POST
+    @Path("bulk")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    BulkActionResult bulk(@NotNull BulkAction bulkAction);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/EntitlementService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/EntitlementService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/EntitlementService.java
new file mode 100644
index 0000000..220980a
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/EntitlementService.java
@@ -0,0 +1,53 @@
+/*
+ * 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.common.rest.api;
+
+import java.util.List;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.common.lib.wrap.EntitlementTO;
+
+/**
+ * REST operations for entitlements.
+ */
+@Path("entitlements")
+public interface EntitlementService extends JAXRSService {
+
+    /**
+     * Returns a list of all known entitlements.
+     *
+     * @return list of all known entitlements
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<EntitlementTO> getAllEntitlements();
+
+    /**
+     * Returns a list of entitlements assigned to user making the current request.
+     *
+     * @return list of entitlements assigned to user making the current request
+     */
+    @GET
+    @Path("own")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<EntitlementTO> getOwnEntitlements();
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/JAXRSService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/JAXRSService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/JAXRSService.java
new file mode 100644
index 0000000..4170584
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/JAXRSService.java
@@ -0,0 +1,39 @@
+/*
+ * 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.common.rest.api;
+
+public interface JAXRSService {
+
+    final String PARAM_FIQL = "fiql";
+
+    final String PARAM_PAGE = "page";
+
+    final String DEFAULT_PARAM_PAGE = "1";
+
+    final int DEFAULT_PARAM_PAGE_VALUE = Integer.valueOf(DEFAULT_PARAM_PAGE);
+
+    final String PARAM_SIZE = "size";
+
+    final String DEFAULT_PARAM_SIZE = "25";
+
+    final int DEFAULT_PARAM_SIZE_VALUE = Integer.valueOf(DEFAULT_PARAM_SIZE);
+
+    final String PARAM_ORDERBY = "orderby";
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/LoggerService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/LoggerService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/LoggerService.java
new file mode 100644
index 0000000..cfe3a32
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/LoggerService.java
@@ -0,0 +1,98 @@
+/*
+ * 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.common.rest.api;
+
+import java.util.List;
+import javax.validation.constraints.NotNull;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import org.apache.syncope.common.lib.to.EventCategoryTO;
+import org.apache.syncope.common.lib.to.LoggerTO;
+import org.apache.syncope.common.lib.types.LoggerType;
+
+/**
+ * REST operations for logging and auditing.
+ */
+@Path("logger")
+public interface LoggerService extends JAXRSService {
+
+    /**
+     * Returns a list of all managed events in audit.
+     *
+     * @return list of all managed events in audit
+     */
+    @GET
+    @Path("events")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<EventCategoryTO> events();
+
+    /**
+     * Returns logger with matching type and name.
+     *
+     * @param type LoggerType to be selected.
+     * @param name Logger name to be read
+     * @return logger with matching type and name
+     */
+    @GET
+    @Path("{type}/{name}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    LoggerTO read(@NotNull @PathParam("type") LoggerType type, @NotNull @PathParam("name") final String name);
+
+    /**
+     * Returns a list of loggers with matching type.
+     *
+     * @param type LoggerType to be selected
+     * @return list of loggers with matching type
+     */
+    @GET
+    @Path("{type}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<LoggerTO> list(@NotNull @PathParam("type") LoggerType type);
+
+    /**
+     * Creates or updates (if existing) the logger with matching name.
+     *
+     * @param type LoggerType to be selected
+     * @param name Logger name to be updated
+     * @param logger Logger to be created or updated
+     */
+    @PUT
+    @Path("{type}/{name}")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    void update(@NotNull @PathParam("type") LoggerType type, @NotNull @PathParam("name") String name,
+            @NotNull LoggerTO logger);
+
+    /**
+     * Deletes the logger with matching name.
+     *
+     * @param type LoggerType to be selected
+     * @param name Logger name to be deleted
+     */
+    @DELETE
+    @Path("{type}/{name}")
+    void delete(@NotNull @PathParam("type") LoggerType type, @NotNull @PathParam("name") String name);
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/NotificationService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/NotificationService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/NotificationService.java
new file mode 100644
index 0000000..348f25b
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/NotificationService.java
@@ -0,0 +1,97 @@
+/*
+ * 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.common.rest.api;
+
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+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.core.MediaType;
+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.lib.to.NotificationTO;
+
+/**
+ * REST operations for notifications.
+ */
+@Path("notifications")
+public interface NotificationService extends JAXRSService {
+
+    /**
+     * Returns notification with matching id.
+     *
+     * @param notificationId id of notification to be read
+     * @return notification with matching id
+     */
+    @GET
+    @Path("{notificationId}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    NotificationTO read(@NotNull @PathParam("notificationId") Long notificationId);
+
+    /**
+     * Returns a list of all notifications.
+     *
+     * @return list of all notifications.
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<NotificationTO> list();
+
+    /**
+     * Creates a new notification.
+     *
+     * @param notificationTO Creates a new notification.
+     * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created notification
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE,
+                value = "Featuring <tt>Location</tt> header of created notification")
+    })
+    @POST
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    Response create(@NotNull NotificationTO notificationTO);
+
+    /**
+     * Updates the notification matching the given id.
+     *
+     * @param notificationId id of notification to be updated
+     * @param notificationTO notification to be stored
+     */
+    @PUT
+    @Path("{notificationId}")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    void update(@NotNull @PathParam("notificationId") Long notificationId, @NotNull NotificationTO notificationTO);
+
+    /**
+     * Deletes the notification matching the given id.
+     *
+     * @param notificationId id for notification to be deleted
+     */
+    @DELETE
+    @Path("{notificationId}")
+    void delete(@NotNull @PathParam("notificationId") Long notificationId);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/PolicyService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/PolicyService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/PolicyService.java
new file mode 100644
index 0000000..18cfe29
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/PolicyService.java
@@ -0,0 +1,128 @@
+/*
+ * 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.common.rest.api;
+
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.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.lib.to.AbstractPolicyTO;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.common.lib.wrap.CorrelationRuleClass;
+
+/**
+ * REST operations for policies.
+ */
+@Path("policies")
+public interface PolicyService extends JAXRSService {
+
+    /**
+     * Returns a list of classes to be used as correlation rules.
+     *
+     * @return list of classes to be used as correlation rules
+     */
+    @GET
+    @Path("syncCorrelationRuleClasses")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<CorrelationRuleClass> getSyncCorrelationRuleClasses();
+
+    /**
+     * Returns the policy matching the given id.
+     *
+     * @param policyId id of requested policy
+     * @param <T> response type (extending PolicyTO)
+     * @return policy with matching id
+     */
+    @GET
+    @Path("{policyId}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    <T extends AbstractPolicyTO> T read(@NotNull @PathParam("policyId") Long policyId);
+
+    /**
+     * Returns the global policy for the given type.
+     *
+     * @param type PolicyType to read global policy from
+     * @param <T> response type (extending PolicyTO)
+     * @return global policy for matching type
+     */
+    @GET
+    @Path("global")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    <T extends AbstractPolicyTO> T readGlobal(@NotNull @MatrixParam("type") PolicyType type);
+
+    /**
+     * Returns a list of policies of the matching type.
+     *
+     * @param type Type selector for requested policies
+     * @param <T> response type (extending PolicyTO)
+     * @return list of policies with matching type
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    <T extends AbstractPolicyTO> List<T> list(@NotNull @MatrixParam("type") PolicyType type);
+
+    /**
+     * Create a new policy.
+     *
+     * @param policyTO Policy to be created (needs to match type)
+     * @param <T> response type (extending PolicyTO)
+     * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created policy
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE, value = "Featuring <tt>Location</tt> header of created policy")
+    })
+    @POST
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    <T extends AbstractPolicyTO> Response create(@NotNull T policyTO);
+
+    /**
+     * Updates policy matching the given id.
+     *
+     * @param policyId id of policy to be updated
+     * @param policyTO Policy to replace existing policy
+     * @param <T> response type (extending PolicyTO)
+     */
+    @PUT
+    @Path("{policyId}")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    <T extends AbstractPolicyTO> void update(@NotNull @PathParam("policyId") Long policyId, @NotNull T policyTO);
+
+    /**
+     * Delete policy matching the given id.
+     *
+     * @param policyId id of policy to be deleted
+     * @param <T> response type (extending PolicyTO)
+     */
+    @DELETE
+    @Path("{policyId}")
+    <T extends AbstractPolicyTO> void delete(@NotNull @PathParam("policyId") Long policyId);
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java
new file mode 100644
index 0000000..715270b
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java
@@ -0,0 +1,115 @@
+/*
+ * 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.common.rest.api;
+
+/**
+ * Custom HTTP headers in use with REST services.
+ */
+public final class RESTHeaders {
+
+    /**
+     * UserId option key.
+     */
+    public static final String USER_ID = "Syncope.UserId";
+
+    /**
+     * Username option key.
+     */
+    public static final String USERNAME = "Syncope.Username";
+
+    /**
+     * Option key stating if user request create is allowed or not.
+     */
+    public static final String SELFREG_ALLOWED = "Syncope.SelfRegistration.Allowed";
+
+    /**
+     * Option key stating if password reset is allowed or not.
+     */
+    public static final String PWDRESET_ALLOWED = "Syncope.PasswordReset.Allowed";
+
+    /**
+     * Option key stating if password reset requires security question or not.
+     */
+    public static final String PWDRESET_NEEDS_SECURITYQUESTIONS = "Syncope.PasswordReset.SecurityQuestions";
+
+    /**
+     * Option key stating if Activiti workflow adapter is in use for users.
+     */
+    public static final String ACTIVITI_USER_ENABLED = "Syncope.Activiti.User.Enabled";
+
+    /**
+     * Option key stating if Activiti workflow adapter is in use for roles.
+     */
+    public static final String ACTIVITI_ROLE_ENABLED = "Syncope.Activiti.Role.Enabled";
+    
+     /**
+     * Option key stating if Camel is the current provisioning manager engine.
+     */
+    public static final String CAMEL_USER_PROVISIONING_MANAGER ="Syncope.Provisioning.Camel.User.Enabled";
+    
+    /**
+     * Option key stating if Camel is the current provisioning manager engine.
+     */
+    public static final String CAMEL_ROLE_PROVISIONING_MANAGER ="Syncope.Provisioning.Camel.Role.Enabled";
+
+
+    /**
+     * HTTP header key for object ID assigned to an object after its creation.
+     */
+    public static final String RESOURCE_ID = "Syncope.Id";
+
+    /**
+     * Declares the type of exception being raised.
+     *
+     * @see ClientExceptionType
+     */
+    public static final String ERROR_CODE = "X-Application-Error-Code";
+
+    /**
+     * Declares additional information for the exception being raised.
+     */
+    public static final String ERROR_INFO = "X-Application-Error-Info";
+
+    /**
+     * Mediatype for PNG images, not defined in <tt>javax.ws.rs.core.MediaType</tt>.
+     *
+     * @see javax.ws.rs.core.MediaType
+     */
+    public static final String MEDIATYPE_IMAGE_PNG = "image/png";
+
+    /**
+     * Allows the client to specify a preference for the result to be returned from the server.
+     * <a href="http://msdn.microsoft.com/en-us/library/hh537533.aspx">More information</a>.
+     *
+     * @see Preference
+     */
+    public static final String PREFER = "Prefer";
+
+    /**
+     * Allowd the server to inform the client about the fact that a specified preference was applied.
+     * <a href="http://msdn.microsoft.com/en-us/library/hh554623.aspx">More information</a>.
+     *
+     * @see Preference
+     */
+    public static final String PREFERENCE_APPLIED = "Preference-Applied";
+
+    private RESTHeaders() {
+        // Empty constructor for static utility class.
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ReportService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ReportService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ReportService.java
new file mode 100644
index 0000000..4911af7
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ReportService.java
@@ -0,0 +1,195 @@
+/*
+ * 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.common.rest.api;
+
+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;
+import javax.ws.rs.GET;
+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.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.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.ReportExecTO;
+import org.apache.syncope.common.lib.to.ReportTO;
+import org.apache.syncope.common.lib.types.ReportExecExportFormat;
+import org.apache.syncope.common.lib.wrap.ReportletConfClass;
+
+/**
+ * REST operations for reports.
+ */
+@Path("reports")
+public interface ReportService extends JAXRSService {
+
+    /**
+     * Returns a list of available classes for reportlet configuration.
+     *
+     * @return list of available classes for reportlet configuration
+     */
+    @GET
+    @Path("reportletConfClasses")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<ReportletConfClass> getReportletConfClasses();
+
+    /**
+     * Returns report with matching id.
+     *
+     * @param reportId id of report to be read
+     * @return report with matching id
+     */
+    @GET
+    @Path("{reportId}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    ReportTO read(@NotNull @PathParam("reportId") Long reportId);
+
+    /**
+     * Returns report execution with matching id.
+     *
+     * @param executionId report execution id to be selected
+     * @return report execution with matching id
+     */
+    @GET
+    @Path("executions/{executionId}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    ReportExecTO readExecution(@NotNull @PathParam("executionId") Long executionId);
+
+    /**
+     * Returns a paged list of all existing reports.
+     *
+     * @return paged list of all existing reports
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<ReportTO> list();
+
+    /**
+     * Returns a paged list of all existing reports.
+     *
+     * @param orderBy list of ordering clauses, separated by comma
+     * @return paged list of all existing reports
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<ReportTO> list(@QueryParam(PARAM_ORDERBY) String orderBy);
+
+    /**
+     * Returns a paged list of all existing reports matching page/size conditions.
+     *
+     * @param page selected page in relation to size
+     * @param size number of entries per page
+     * @return paged list of existing reports matching page/size conditions
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<ReportTO> list(
+            @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.
+     *
+     * @param page selected page in relation to size
+     * @param size number of entries per page
+     * @param orderBy list of ordering clauses, separated by comma
+     * @return paged list of existing reports matching page/size conditions
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<ReportTO> list(
+            @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);
+
+    /**
+     * Creates a new report.
+     *
+     * @param reportTO report to be created
+     * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created report
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE, value = "Featuring <tt>Location</tt> header of created report")
+    })
+    @POST
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    Response create(@NotNull ReportTO reportTO);
+
+    /**
+     * Updates report with matching id.
+     *
+     * @param reportId id for report to be updated
+     * @param reportTO report to be stored
+     */
+    @PUT
+    @Path("{reportId}")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    void update(@NotNull @PathParam("reportId") Long reportId, ReportTO reportTO);
+
+    /**
+     * Deletes report with matching id.
+     *
+     * @param reportId Deletes report with matching id
+     */
+    @DELETE
+    @Path("{reportId}")
+    void delete(@NotNull @PathParam("reportId") Long reportId);
+
+    /**
+     * Deletes report execution with matching id.
+     *
+     * @param executionId id of execution report to be deleted
+     */
+    @DELETE
+    @Path("executions/{executionId}")
+    void deleteExecution(@NotNull @PathParam("executionId") Long executionId);
+
+    /**
+     * Executes the report with matching id.
+     *
+     * @param reportId id of report to be executed
+     * @return report execution result
+     */
+    @POST
+    @Path("{reportId}/execute")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    ReportExecTO execute(@NotNull @PathParam("reportId") Long reportId);
+
+    /**
+     * Exports the report execution with matching id in the requested format.
+     *
+     * @param executionId id of execution report to be selected
+     * @param fmt file-format selection
+     * @return a stream for content download
+     */
+    @GET
+    @Path("executions/{executionId}/stream")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    Response exportExecutionResult(@NotNull @PathParam("executionId") Long executionId,
+            @QueryParam("format") ReportExecExportFormat fmt);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ResourceService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ResourceService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ResourceService.java
new file mode 100644
index 0000000..6ddd3af
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/ResourceService.java
@@ -0,0 +1,184 @@
+/*
+ * 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.common.rest.api;
+
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import org.apache.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.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.ConnObjectTO;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.common.lib.wrap.PropagationActionClass;
+import org.apache.syncope.common.lib.wrap.SubjectId;
+
+/**
+ * REST operations for external resources.
+ */
+@Path("resources")
+public interface ResourceService extends JAXRSService {
+
+    /**
+     * Returns connector object from the external resource, for the given type and id.
+     *
+     * @param resourceName Name of resource to read connector object from
+     * @param type user / role
+     * @param id user id / role id
+     * @return connector object from the external resource, for the given type and id
+     */
+    @GET
+    @Path("{resourceName}/{type}/{id}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    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.
+     *
+     * @return list of classes that can be used to customize the propagation process
+     */
+    @GET
+    @Path("propagationActionsClasses")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<PropagationActionClass> getPropagationActionsClasses();
+
+    /**
+     * Returns the resource with matching name.
+     *
+     * @param resourceName Name of resource to be read
+     * @return resource with matching name
+     */
+    @GET
+    @Path("{resourceName}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    ResourceTO read(@NotNull @PathParam("resourceName") String resourceName);
+
+    /**
+     * Returns a list of all resources.
+     *
+     * @return list of all resources
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<ResourceTO> list();
+
+    /**
+     * Returns a list of resources using matching connector instance id.
+     *
+     * @param connInstanceId Connector id to filter for resources
+     * @return resources using matching connector instance id
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<ResourceTO> list(@NotNull @MatrixParam("connectorId") Long connInstanceId);
+
+    /**
+     * Creates a new resource.
+     *
+     * @param resourceTO Resource to be created
+     * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created resource
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE,
+                value = "Featuring <tt>Location</tt> header of created resource")
+    })
+    @POST
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    Response create(@NotNull ResourceTO resourceTO);
+
+    /**
+     * Updates the resource matching the given name.
+     *
+     * @param resourceName name of resource to be updated
+     * @param resourceTO resource to be stored
+     */
+    @PUT
+    @Path("{resourceName}")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    void update(@NotNull @PathParam("resourceName") String resourceName, @NotNull ResourceTO resourceTO);
+
+    /**
+     * Deletes the resource matching the given name.
+     *
+     * @param resourceName name of resource to be deleted
+     */
+    @DELETE
+    @Path("{resourceName}")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    void delete(@NotNull @PathParam("resourceName") String resourceName);
+
+    /**
+     * Checks wether the connection to resource could be established.
+     *
+     * @param resourceTO resource to be checked
+     * @return true if connection to resource could be established
+     */
+    @POST
+    @Path("check")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    boolean check(@NotNull ResourceTO resourceTO);
+
+    /**
+     * De-associate users or roles (depending on the provided subject type) from the given resource.
+     *
+     * @param resourceName name of resource
+     * @param subjectType subject type (user or role)
+     * @param type resource de-association action type
+     * @param subjectIds users or roles against which the bulk action will be performed
+     * @return <tt>Response</tt> object featuring {@link BulkActionResult} as <tt>Entity</tt>
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE,
+                value = "Featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>")
+    })
+    @POST
+    @Path("{resourceName}/bulkDeassociation/{subjType}/{type}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    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.
+     *
+     * @param bulkAction list of resource names against which the bulk action will be performed
+     * @return Bulk action result
+     */
+    @POST
+    @Path("bulk")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    BulkActionResult bulk(@NotNull BulkAction bulkAction);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RoleService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RoleService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RoleService.java
new file mode 100644
index 0000000..6692648
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/RoleService.java
@@ -0,0 +1,313 @@
+/*
+ * 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.common.rest.api;
+
+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;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+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.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.lib.mod.RoleMod;
+import org.apache.syncope.common.lib.to.BulkAction;
+import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.PagedResult;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.types.ResourceAssociationActionType;
+import org.apache.syncope.common.lib.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.lib.wrap.ResourceName;
+
+/**
+ * REST operations for roles.
+ */
+@Path("roles")
+public interface RoleService extends JAXRSService {
+
+    /**
+     * Returns children roles of given role.
+     *
+     * @param roleId id of role to get children from
+     * @return children roles of given role
+     */
+    @GET
+    @Path("{roleId}/children")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    List<RoleTO> children(@NotNull @PathParam("roleId") Long roleId);
+
+    /**
+     * Returns parent role of the given role (or null if no parent exists).
+     *
+     * @param roleId id of role to get parent role from
+     * @return parent role of the given role (or null if no parent exists)
+     */
+    @GET
+    @Path("{roleId}/parent")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    RoleTO parent(@NotNull @PathParam("roleId") Long roleId);
+
+    /**
+     * Reads the role matching the provided roleId.
+     *
+     * @param roleId id of role to be read
+     * @return role with matching id
+     */
+    @GET
+    @Path("{roleId}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    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
+     * can read his own roles.
+     *
+     * @param roleId id of role to be read
+     * @return role with matching id
+     */
+    @Descriptions({
+        @Description(target = DocTarget.METHOD,
+                value = "This method is similar to <tt>read()</tt>, but uses different authentication handling to "
+                + "ensure that a user can read his own roles.")
+    })
+    @GET
+    @Path("{roleId}/own")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    RoleTO readSelf(@NotNull @PathParam("roleId") Long roleId);
+
+    /**
+     * Returns a paged list of existing roles.
+     *
+     * @return paged list of all existing roles
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<RoleTO> list();
+
+    /**
+     * Returns a paged list of existing roles.
+     *
+     * @param orderBy list of ordering clauses, separated by comma
+     * @return paged list of all existing roles
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<RoleTO> list(@QueryParam(PARAM_ORDERBY) String orderBy);
+
+    /**
+     * Returns a paged list of existing roles matching page/size conditions.
+     *
+     * @param page result page number
+     * @param size number of entries per page
+     * @return paged list of existing roles matching page/size conditions
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<RoleTO> list(
+            @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.
+     *
+     * @param page result page number
+     * @param size number of entries per page
+     * @param orderBy list of ordering clauses, separated by comma
+     * @return paged list of existing roles matching page/size conditions
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<RoleTO> list(
+            @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);
+
+    /**
+     * Returns a paged list of roles matching the provided FIQL search condition.
+     *
+     * @param fiql FIQL search expression
+     * @return paged list of roles matching the provided FIQL search condition
+     */
+    @GET
+    @Path("search")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<RoleTO> search(@NotNull @QueryParam(PARAM_FIQL) String fiql);
+
+    /**
+     * Returns a paged list of roles matching the provided FIQL search condition.
+     *
+     * @param fiql FIQL search expression
+     * @param orderBy list of ordering clauses, separated by comma
+     * @return paged list of roles matching the provided FIQL search condition
+     */
+    @GET
+    @Path("search")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    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.
+     *
+     * @param fiql FIQL search expression
+     * @param page result page number
+     * @param size number of entries per page
+     * @return paged list of roles matching the provided FIQL search condition
+     */
+    @GET
+    @Path("search")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<RoleTO> search(@QueryParam(PARAM_FIQL) String fiql,
+            @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.
+     *
+     * @param fiql FIQL search expression
+     * @param page result page number
+     * @param size number of entries per page
+     * @param orderBy list of ordering clauses, separated by comma
+     * @return paged list of roles matching the provided FIQL search condition
+     */
+    @GET
+    @Path("search")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    PagedResult<RoleTO> search(@QueryParam(PARAM_FIQL) String fiql,
+            @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);
+
+    /**
+     * Creates a new role.
+     *
+     * @param roleTO role to be created
+     * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created role as well as the role itself
+     * enriched with propagation status information - {@link RoleTO} as <tt>Entity</tt>
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE,
+                value = "Featuring <tt>Location</tt> header of created role as well as the "
+                + "role itself enriched with propagation status information - <tt>RoleTO</tt> as <tt>Entity</tt>")
+    })
+    @POST
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    Response create(@NotNull RoleTO roleTO);
+
+    /**
+     * Updates role matching the provided roleId.
+     *
+     * @param roleId id of role to be updated
+     * @param roleMod modification to be applied to role matching the provided roleId
+     * @return <tt>Response</tt> object featuring the updated role enriched with propagation status information
+     * - {@link RoleTO} as <tt>Entity</tt>
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE,
+                value = "Featuring the updated role enriched with propagation status information - "
+                + "<tt>RoleTO</tt> as <tt>Entity</tt>")
+    })
+    @POST
+    @Path("{roleId}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    Response update(@NotNull @PathParam("roleId") Long roleId, @NotNull RoleMod roleMod);
+
+    /**
+     * Deletes role matching provided roleId.
+     *
+     * @param roleId id of role to be deleted
+     * @return <tt>Response</tt> object featuring the deleted role enriched with propagation status information
+     * - {@link RoleTO} as <tt>Entity</tt>
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE,
+                value = "Featuring the deleted role enriched with propagation status information - "
+                + "<tt>RoleTO</tt> as <tt>Entity</tt>")
+    })
+    @DELETE
+    @Path("{roleId}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    Response delete(@NotNull @PathParam("roleId") Long roleId);
+
+    /**
+     * Executes resource-related operations on given role.
+     *
+     * @param roleId role id.
+     * @param type resource association action type
+     * @param resourceNames external resources to be used for propagation-related operations
+     * @return <tt>Response</tt> object featuring
+     * {@link org.apache.syncope.common.reqres.BulkActionResult} as <tt>Entity</tt>
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE,
+                value = "Featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>")
+    })
+    @POST
+    @Path("{roleId}/deassociate/{type}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    Response bulkDeassociation(@NotNull @PathParam("roleId") Long roleId,
+            @NotNull @PathParam("type") ResourceDeassociationActionType type,
+            @NotNull List<ResourceName> resourceNames);
+
+    /**
+     * Executes resource-related operations on given role.
+     *
+     * @param roleId role id.
+     * @param type resource association action type
+     * @param resourceNames external resources to be used for propagation-related operations
+     * @return <tt>Response</tt> object featuring {@link org.apache.syncope.common.reqres.BulkActionResult}
+     * as <tt>Entity</tt>
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE,
+                value = "Featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>")
+    })
+    @POST
+    @Path("{roleId}/associate/{type}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    Response bulkAssociation(@NotNull @PathParam("roleId") Long roleId,
+            @NotNull @PathParam("type") ResourceAssociationActionType type,
+            @NotNull List<ResourceName> resourceNames);
+
+    /**
+     * Executes the provided bulk action.
+     *
+     * @param bulkAction list of role ids against which the bulk action will be performed.
+     * @return Bulk action result
+     */
+    @POST
+    @Path("bulk")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    BulkActionResult bulk(@NotNull BulkAction bulkAction);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/65adad7d/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/SchemaService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/SchemaService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/SchemaService.java
new file mode 100644
index 0000000..84ac9d6
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/SchemaService.java
@@ -0,0 +1,119 @@
+/*
+ * 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.common.rest.api;
+
+import java.util.List;
+import javax.validation.constraints.NotNull;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+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.core.MediaType;
+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.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.SchemaType;
+
+/**
+ * REST operations for attribute schemas.
+ */
+@Path("schemas/{kind}/{type}")
+public interface SchemaService extends JAXRSService {
+
+    /**
+     * Returns schema matching the given kind, type and name.
+     *
+     * @param <T> actual SchemaTO
+     * @param attrType kind for schemas to be read
+     * @param schemaType type for schemas to be read
+     * @param schemaName name of schema to be read
+     * @return schema matching the given kind, type and name
+     */
+    @GET
+    @Path("{name}")
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    <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.
+     *
+     * @param <T> actual SchemaTO
+     * @param attrType kind for schemas to be listed
+     * @param schemaType type for schemas to be listed
+     * @return list of schemas with matching kind and type
+     */
+    @GET
+    @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    <T extends AbstractSchemaTO> List<T> list(
+            @NotNull @PathParam("kind") AttributableType attrType, @NotNull @PathParam("type") SchemaType schemaType);
+
+    /**
+     * Creates a new schema.
+     *
+     * @param <T> actual SchemaTO
+     * @param attrType kind for schema to be created
+     * @param schemaType type for schema to be created
+     * @param schemaTO schema to be created
+     * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created schema
+     */
+    @Descriptions({
+        @Description(target = DocTarget.RESPONSE, value = "Featuring <tt>Location</tt> header of created schema")
+    })
+    @POST
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    <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.
+     *
+     * @param <T> actual SchemaTO
+     * @param attrType kind for schemas to be updated
+     * @param schemaType type for schemas to be updated
+     * @param schemaName name of schema to be updated
+     * @param schemaTO updated schema to be stored
+     */
+    @PUT
+    @Path("{name}")
+    @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+    <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.
+     *
+     * @param attrType kind for schema to be deleted
+     * @param schemaType type for schema to be deleted
+     * @param schemaName name of schema to be deleted
+     */
+    @DELETE
+    @Path("{name}")
+    void delete(@NotNull @PathParam("kind") AttributableType attrType,
+            @NotNull @PathParam("type") SchemaType schemaType,
+            @NotNull @PathParam("name") String schemaName);
+}


Mime
View raw message