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 2015/01/12 18:41:09 UTC
[6/7] syncope git commit: [SYNCOPE-620] server-rest-cxf
http://git-wip-us.apache.org/repos/asf/syncope/blob/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/TaskService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/TaskService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/TaskService.java
deleted file mode 100644
index 7ca24e5..0000000
--- a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/TaskService.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * 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.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.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.AbstractTaskTO;
-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.ReportExecTO;
-import org.apache.syncope.common.lib.to.SchedTaskTO;
-import org.apache.syncope.common.lib.to.TaskExecTO;
-import org.apache.syncope.common.lib.types.TaskType;
-import org.apache.syncope.common.lib.wrap.JobClass;
-import org.apache.syncope.common.lib.wrap.PushActionClass;
-import org.apache.syncope.common.lib.wrap.SyncActionClass;
-
-/**
- * REST operations for tasks.
- */
-@Path("tasks")
-public interface TaskService extends JAXRSService {
-
- /**
- * Returns a list of classes to be used for jobs.
- *
- * @return list of classes to be used for jobs
- */
- @GET
- @Path("jobClasses")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<JobClass> getJobClasses();
-
- /**
- * Returns a list of classes to be used as synchronization actions.
- *
- * @return list of classes to be used as synchronization actions
- */
- @GET
- @Path("syncActionsClasses")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<SyncActionClass> getSyncActionsClasses();
-
- /**
- * Returns a list of classes to be used as push actions.
- *
- * @return list of classes to be used as push actions
- */
- @GET
- @Path("pushActionsClasses")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<PushActionClass> getPushActionsClasses();
-
- /**
- * Returns the task matching the given id.
- *
- * @param taskId id of task to be read
- * @param <T> type of taskTO
- * @return task with matching id
- */
- @GET
- @Path("{taskId}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractTaskTO> T read(@NotNull @PathParam("taskId") Long taskId);
-
- /**
- * Returns the task execution with the given id.
- *
- * @param executionId id of task execution to be read
- * @return task execution with matching Id
- */
- @GET
- @Path("executions/{executionId}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- TaskExecTO readExecution(@NotNull @PathParam("executionId") Long executionId);
-
- /**
- * Returns a list of tasks with matching type.
- *
- * @param taskType type of tasks to be listed
- * @param <T> type of taskTO
- * @return list of tasks with matching type
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractTaskTO> PagedResult<T> list(@NotNull @MatrixParam("type") TaskType taskType);
-
- /**
- * Returns a list of tasks with matching type.
- *
- * @param taskType type of tasks to be listed
- * @param orderBy list of ordering clauses, separated by comma
- * @param <T> type of taskTO
- * @return list of tasks with matching type
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractTaskTO> PagedResult<T> list(@NotNull @MatrixParam("type") TaskType taskType,
- @QueryParam(PARAM_ORDERBY) String orderBy);
-
- /**
- * Returns a paged list of existing tasks matching type and page/size conditions.
- *
- * @param taskType type of tasks to be listed
- * @param page page number of tasks in relation to page size
- * @param size number of tasks listed per page
- * @param orderBy list of ordering clauses, separated by comma
- * @param <T> type of taskTO
- * @return paged list of existing tasks matching type and page/size conditions
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <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);
-
- /**
- * Returns a paged list of existing tasks matching type and page/size conditions.
- *
- * @param taskType type of tasks to be listed
- * @param page page number of tasks in relation to page size
- * @param size number of tasks listed per page
- * @param <T> type of taskTO
- * @return paged list of existing tasks matching type and page/size conditions
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends AbstractTaskTO> PagedResult<T> list(@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);
-
- /**
- * Creates a new task.
- *
- * @param taskTO task to be created
- * @param <T> type of taskTO
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created task
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE, value = "Featuring <tt>Location</tt> header of created task")
- })
- @POST
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- <T extends SchedTaskTO> Response create(@NotNull T taskTO);
-
- /**
- * Updates the task matching the provided id.
- *
- * @param taskId id of task to be updated
- * @param taskTO updated task to be stored
- */
- @PUT
- @Path("{taskId}")
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void update(@NotNull @PathParam("taskId") Long taskId, @NotNull AbstractTaskTO taskTO);
-
- /**
- * Deletes the task matching the provided id.
- *
- * @param taskId id of task to be deleted
- */
- @DELETE
- @Path("{taskId}")
- void delete(@NotNull @PathParam("taskId") Long taskId);
-
- /**
- * Deletes the task execution matching the provided id.
- *
- * @param executionId id of task execution to be deleted
- */
- @DELETE
- @Path("executions/{executionId}")
- void deleteExecution(@NotNull @PathParam("executionId") Long executionId);
-
- /**
- * Executes the task matching the given id.
- *
- * @param taskId id of task to be executed
- * @param dryRun if true, task will only be simulated
- * @return execution report for the task matching the given id
- */
- @POST
- @Path("{taskId}/execute")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- 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 reportExec execution being reported
- */
- @POST
- @Path("executions/{executionId}/report")
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void report(@NotNull @PathParam("executionId") Long executionId, @NotNull ReportExecTO reportExec);
-
- /**
- * Executes the provided bulk action.
- *
- * @param bulkAction list of task 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/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserSelfService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserSelfService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserSelfService.java
deleted file mode 100644
index bfb9561..0000000
--- a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserSelfService.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 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 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.OPTIONS;
-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.UserMod;
-import org.apache.syncope.common.lib.to.UserTO;
-
-/**
- * REST operations for user self-management.
- */
-@Path("users/self")
-public interface UserSelfService extends JAXRSService {
-
- /**
- * Checks whether self-registration is allowed.
- *
- * @return <tt>Response</tt> contains special Syncope HTTP header indicating if user self registration and / or
- * password reset is allowed
- * @see org.apache.syncope.common.types.RESTHeaders#SELFREG_ALLOWED
- * @see org.apache.syncope.common.types.RESTHeaders#PWDRESET_ALLOWED
- * @see org.apache.syncope.common.types.RESTHeaders#PWDRESET_NEEDS_SECURITYQUESTIONS
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Contains special Syncope HTTP header indicating if user self registration "
- + "and / or password reset is allowed")
- })
- @OPTIONS
- Response getOptions();
-
- /**
- * Returns the user making the service call.
- *
- * @return calling user data
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- UserTO read();
-
- /**
- * Self-registration for new user.
- *
- * @param userTO user to be created
- * @param storePassword whether password shall be stored internally
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of self-registered user as well as the user
- * itself - {@link UserTO} as <tt>Entity</tt>
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Featuring <tt>Location</tt> header of self-registered user as well "
- + "as the user itself - {@link UserTO} as <tt>Entity</tt>")
- })
- @POST
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response create(@NotNull UserTO userTO,
- @DefaultValue("true") @QueryParam("storePassword") boolean storePassword);
-
- /**
- * Self-updates user.
- *
- * @param userId id of user to be updated
- * @param userMod modification to be applied to user matching the provided userId
- * @return <tt>Response</tt> object featuring the updated user - {@link UserTO} as <tt>Entity</tt>
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Featuring the updated user - <tt>UserTO</tt> as <tt>Entity</tt>")
- })
- @POST
- @Path("{userId}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response update(@NotNull @PathParam("userId") Long userId, @NotNull UserMod userMod);
-
- /**
- * Self-deletes user.
- *
- * @return <tt>Response</tt> object featuring the deleted user - {@link UserTO} as <tt>Entity</tt>
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Featuring the deleted user - <tt>UserTO</tt> as <tt>Entity</tt>")
- })
- @DELETE
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response delete();
-
- /**
- * Provides answer for the security question configured for user matching the given username, if any.
- * If provided anwser matches the one stored for that user, a password reset token is internally generated,
- * otherwise an error is returned.
- *
- * @param username username for which the security answer is provided
- * @param securityAnswer actual answer text
- */
- @POST
- @Path("requestPasswordReset")
- void requestPasswordReset(@NotNull @QueryParam("username") String username, String securityAnswer);
-
- /**
- * Reset the password value for the user matching the provided token, if available and still valid.
- * If the token actually matches one of users, and if it is still valid at the time of submission, the matching
- * user's password value is set as provided. The new password value will need anyway to comply with all relevant
- * password policies.
- *
- * @param token password reset token
- * @param password new password to be set
- */
- @POST
- @Path("confirmPasswordReset")
- void confirmPasswordReset(@NotNull @QueryParam("token") String token, String password);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserService.java
deleted file mode 100644
index 5e62795..0000000
--- a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserService.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * 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.OPTIONS;
-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.ResourceAssociationMod;
-import org.apache.syncope.common.lib.mod.StatusMod;
-import org.apache.syncope.common.lib.mod.UserMod;
-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.UserTO;
-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 users.
- */
-@Path("users")
-public interface UserService extends JAXRSService {
-
- /**
- * Gives the username for the provided user id.
- *
- * @param userId user id
- * @return <tt>Response</tt> object featuring HTTP header with username matching the given userId
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Featuring HTTP header with username matching the given userId")
- })
- @OPTIONS
- @Path("{userId}/username")
- Response getUsername(@NotNull @PathParam("userId") Long userId);
-
- /**
- * Gives the user id for the provided username.
- *
- * @param username username
- * @return <tt>Response</tt> object featuring HTTP header with userId matching the given username
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Featuring HTTP header with userId matching the given username")
- })
- @OPTIONS
- @Path("{username}/userId")
- Response getUserId(@NotNull @PathParam("username") String username);
-
- /**
- * Reads the user matching the provided userId.
- *
- * @param userId id of user to be read
- * @return User matching the provided userId
- */
- @GET
- @Path("{userId}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- UserTO read(@NotNull @PathParam("userId") Long userId);
-
- /**
- * Returns a paged list of existing users.
- *
- * @return paged list of all existing users
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<UserTO> list();
-
- /**
- * Returns a paged list of existing users.
- *
- * @param orderBy list of ordering clauses, separated by comma
- * @return paged list of all existing users
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<UserTO> list(@QueryParam(PARAM_ORDERBY) String orderBy);
-
- /**
- * Returns a paged list of existing users matching page/size conditions.
- *
- * @param page result page number
- * @param size number of entries per page
- * @return paged list of existing users matching page/size conditions
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<UserTO> 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 users 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 users matching page/size conditions
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<UserTO> 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 users matching the provided FIQL search condition.
- *
- * @param fiql FIQL search expression
- * @return paged list of users matching the provided FIQL search condition
- */
- @GET
- @Path("search")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<UserTO> search(@NotNull @QueryParam(PARAM_FIQL) String fiql);
-
- /**
- * Returns a paged list of users matching the provided FIQL search condition.
- *
- * @param fiql FIQL search expression
- * @param orderBy list of ordering clauses, separated by comma
- * @return paged list of users matching the provided FIQL search condition
- */
- @GET
- @Path("search")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- 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.
- *
- * @param fiql FIQL search expression
- * @param page result page number
- * @param size number of entries per page
- * @return paged list of users matching the provided FIQL search condition
- */
- @GET
- @Path("search")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<UserTO> 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 users 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 users matching the provided FIQL search condition
- */
- @GET
- @Path("search")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PagedResult<UserTO> 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 user.
- *
- * @param userTO user to be created
- * @param storePassword whether password shall be stored internally
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created user as well as the user itself
- * enriched with propagation status information - {@link UserTO} as <tt>Entity</tt>
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Featuring <tt>Location</tt> header of created user as well as the "
- + "user itself enriched with propagation status information - <tt>UserTO</tt> as <tt>Entity</tt>")
- })
- @POST
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response create(@NotNull UserTO userTO,
- @DefaultValue("true") @QueryParam("storePassword") boolean storePassword);
-
- /**
- * Updates user matching the provided userId.
- *
- * @param userId id of user to be updated
- * @param userMod modification to be applied to user matching the provided userId
- * @return <tt>Response</tt> object featuring the updated user enriched with propagation status information
- * - {@link UserTO} as <tt>Entity</tt>
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Featuring the updated user enriched with propagation status information - "
- + "<tt>UserTO</tt> as <tt>Entity</tt>")
- })
- @POST
- @Path("{userId}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response update(@NotNull @PathParam("userId") Long userId, @NotNull UserMod userMod);
-
- /**
- * Performs a status update on user matching provided userId.
- *
- * @param userId id of user to be subjected to status update
- * @param statusMod status update details
- * @return <tt>Response</tt> object featuring the updated user enriched with propagation status information
- * - {@link UserTO} as <tt>Entity</tt>
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Featuring the updated user enriched with propagation status information - "
- + "<tt>UserTO</tt> as <tt>Entity</tt>")
- })
- @POST
- @Path("{userId}/status")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response status(@NotNull @PathParam("userId") Long userId, @NotNull StatusMod statusMod);
-
- /**
- * Deletes user matching provided userId.
- *
- * @param userId id of user to be deleted
- * @return <tt>Response</tt> object featuring the deleted user enriched with propagation status information
- * - {@link UserTO} as <tt>Entity</tt>
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Featuring the deleted user enriched with propagation status information - "
- + "<tt>UserTO</tt> as <tt>Entity</tt>")
- })
- @DELETE
- @Path("{userId}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response delete(@NotNull @PathParam("userId") Long userId);
-
- /**
- * Executes resource-related operations on given user.
- *
- * @param userId user id
- * @param type resource de-association action type
- * @param resourceNames external resources to be used for propagation-related operations
- * @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("{userId}/bulkDeassociation/{type}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response bulkDeassociation(@NotNull @PathParam("userId") Long userId,
- @NotNull @PathParam("type") ResourceDeassociationActionType type,
- @NotNull List<ResourceName> resourceNames);
-
- /**
- * Executes resource-related operations on given user.
- *
- * @param userId user id.
- * @param type resource association action type
- * @param associationMod external resources to be used for propagation-related operations
- * @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("{userId}/bulkAssociation/{type}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response bulkAssociation(@NotNull @PathParam("userId") Long userId,
- @NotNull @PathParam("type") ResourceAssociationActionType type,
- @NotNull ResourceAssociationMod associationMod);
-
- /**
- * Executes the provided bulk action.
- *
- * @param bulkAction list of user 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/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserWorkflowService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserWorkflowService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserWorkflowService.java
deleted file mode 100644
index 0dab6c2..0000000
--- a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/UserWorkflowService.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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.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.core.MediaType;
-import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.lib.to.WorkflowFormTO;
-
-/**
- * REST operations related to user workflow.
- */
-@Path("userworkflow")
-public interface UserWorkflowService extends JAXRSService {
-
- /**
- * Returns a list of all available workflow forms.
- *
- * @return list of all available workflow forms
- */
- @GET
- @Path("forms")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<WorkflowFormTO> getForms();
-
- /**
- * Returns a list of all available workflow forms with matching name, for the given user id.
- *
- * @param userId user id
- * @param name form name
- * @return list of all available workflow forms with matching name, fir the given user id.
- */
- @GET
- @Path("forms/{userId}/{name}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- 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.
- *
- * @param userId user id
- * @return list of available forms for the given user id
- */
- @GET
- @Path("forms/{userId}")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- WorkflowFormTO getFormForUser(@NotNull @PathParam("userId") Long userId);
-
- /**
- * Claims the form for the given task id.
- *
- * @param taskId workflow task id
- * @return the workflow form for the given task id
- */
- @POST
- @Path("forms/{taskId}/claim")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- WorkflowFormTO claimForm(@NotNull @PathParam("taskId") String taskId);
-
- /**
- * Submits a workflow form.
- *
- * @param form workflow form.
- * @return updated user
- */
- @POST
- @Path("forms")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- UserTO submitForm(@NotNull WorkflowFormTO form);
-
- /**
- * Executes workflow task for matching id.
- *
- * @param taskId workflow task id
- * @param userTO argument to be passed to workflow task
- * @return updated user
- */
- @POST
- @Path("tasks/{taskId}/execute")
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- UserTO executeTask(@NotNull @PathParam("taskId") String taskId, @NotNull UserTO userTO);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/WorkflowService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/WorkflowService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/WorkflowService.java
deleted file mode 100644
index 786d234..0000000
--- a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/WorkflowService.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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 javax.validation.constraints.NotNull;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.OPTIONS;
-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.types.SubjectType;
-
-/**
- * REST operations for workflow definition management.
- */
-@Path("workflows/{kind}")
-public interface WorkflowService extends JAXRSService {
-
- /**
- * Checks whether Activiti is enabled (for users or roles).
- *
- * @param kind user or role
- * @return <tt>Response</tt> contains special syncope HTTP header indicating if Activiti is enabled for
- * users / roles
- * @see org.apache.syncope.common.types.RESTHeaders#ACTIVITI_USER_ENABLED
- * @see org.apache.syncope.common.types.RESTHeaders#ACTIVITI_ROLE_ENABLED
- */
- @Descriptions({
- @Description(target = DocTarget.RESPONSE,
- value = "Contains special syncope HTTP header indicating if Activiti is enabled for users / roles")
- })
- @OPTIONS
- Response getOptions(@NotNull @PathParam("kind") SubjectType kind);
-
- /**
- * Exports workflow definition for matching kind.
- *
- * @param kind user or role
- * @return workflow definition for matching kind
- */
- @GET
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response exportDefinition(@NotNull @PathParam("kind") SubjectType kind);
-
- /**
- * Exports workflow diagram representation.
- *
- * @param kind user or role
- * @return workflow diagram representation
- */
- @GET
- @Path("diagram.png")
- @Produces({ RESTHeaders.MEDIATYPE_IMAGE_PNG })
- Response exportDiagram(@NotNull @PathParam("kind") SubjectType kind);
-
- /**
- * Imports workflow definition for matching kind.
- *
- * @param kind user or role
- * @param definition workflow definition for matching kind
- */
- @PUT
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void importDefinition(@NotNull @PathParam("kind") SubjectType kind, @NotNull String definition);
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConfigurationService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConfigurationService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConfigurationService.java
new file mode 100644
index 0000000..d886b91
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/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.service;
+
+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/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java
new file mode 100644
index 0000000..91d982e
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/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.service;
+
+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 connInstanceKey connector instance id to read configuration from
+ * @return configuration for given connector instance
+ */
+ @GET
+ @Path("{connInstanceKey}/configuration")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ List<ConnConfProperty> getConfigurationProperties(@NotNull @PathParam("connInstanceKey") Long connInstanceKey);
+
+ /**
+ * Returns schema names for connector bundle matching the given connector instance id.
+ *
+ * @param connInstanceKey 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("{connInstanceKey}/schemaNames")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ List<PlainSchemaTO> getSchemaNames(@NotNull @PathParam("connInstanceKey") Long connInstanceKey,
+ @NotNull ConnInstanceTO connInstanceTO,
+ @QueryParam("includeSpecial") @DefaultValue("false") boolean includeSpecial);
+
+ /**
+ * Returns supported object classes for connector bundle matching the given connector instance id.
+ *
+ * @param connInstanceKey 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("{connInstanceKey}/supportedObjectClasses")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ List<ConnIdObjectClassTO> getSupportedObjectClasses(
+ @NotNull @PathParam("connInstanceKey") Long connInstanceKey,
+ @NotNull ConnInstanceTO connInstanceTO);
+
+ /**
+ * Returns connector instance with matching id.
+ *
+ * @param connInstanceKey connector instance id to be read
+ * @return connector instance with matching id
+ */
+ @GET
+ @Path("{connInstanceKey}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ ConnInstanceTO read(@NotNull @PathParam("connInstanceKey") Long connInstanceKey);
+
+ /**
+ * 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 connInstanceKey connector instance id to be updated
+ * @param connInstanceTO connector instance to be stored
+ */
+ @PUT
+ @Path("{connInstanceKey}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ void update(@NotNull @PathParam("connInstanceKey") Long connInstanceKey, @NotNull ConnInstanceTO connInstanceTO);
+
+ /**
+ * Deletes the connector instance matching the provided id.
+ *
+ * @param connInstanceKey connector instance id to be deleted
+ */
+ @DELETE
+ @Path("{connInstanceKey}")
+ void delete(@NotNull @PathParam("connInstanceKey") Long connInstanceKey);
+
+ /**
+ * @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/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/EntitlementService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/EntitlementService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/EntitlementService.java
new file mode 100644
index 0000000..44ad900
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/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.service;
+
+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/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java
new file mode 100644
index 0000000..7108b49
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/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.service;
+
+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/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/LoggerService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/LoggerService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/LoggerService.java
new file mode 100644
index 0000000..6ab40e7
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/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.service;
+
+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/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
new file mode 100644
index 0000000..a210014
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/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.service;
+
+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 notificationKey key of notification to be read
+ * @return notification with matching key
+ */
+ @GET
+ @Path("{notificationKey}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ NotificationTO read(@NotNull @PathParam("notificationKey") Long notificationKey);
+
+ /**
+ * 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 key.
+ *
+ * @param notificationKey key of notification to be updated
+ * @param notificationTO notification to be stored
+ */
+ @PUT
+ @Path("{notificationKey}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ void update(@NotNull @PathParam("notificationKey") Long notificationKey, @NotNull NotificationTO notificationTO);
+
+ /**
+ * Deletes the notification matching the given key.
+ *
+ * @param notificationKey key for notification to be deleted
+ */
+ @DELETE
+ @Path("{notificationKey}")
+ void delete(@NotNull @PathParam("notificationKey") Long notificationKey);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
new file mode 100644
index 0000000..6050d9c
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/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.service;
+
+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 key.
+ *
+ * @param policyKey key of requested policy
+ * @param <T> response type (extending PolicyTO)
+ * @return policy with matching id
+ */
+ @GET
+ @Path("{policyKey}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ <T extends AbstractPolicyTO> T read(@NotNull @PathParam("policyKey") Long policyKey);
+
+ /**
+ * 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 key.
+ *
+ * @param policyKey key of policy to be updated
+ * @param policyTO Policy to replace existing policy
+ * @param <T> response type (extending PolicyTO)
+ */
+ @PUT
+ @Path("{policyKey}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ <T extends AbstractPolicyTO> void update(@NotNull @PathParam("policyKey") Long policyKey, @NotNull T policyTO);
+
+ /**
+ * Delete policy matching the given key.
+ *
+ * @param policyKey key of policy to be deleted
+ * @param <T> response type (extending PolicyTO)
+ */
+ @DELETE
+ @Path("{policyKey}")
+ <T extends AbstractPolicyTO> void delete(@NotNull @PathParam("policyKey") Long policyKey);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
new file mode 100644
index 0000000..b8f2826
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/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.service;
+
+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 key.
+ *
+ * @param reportKey key of report to be read
+ * @return report with matching key
+ */
+ @GET
+ @Path("{reportKey}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ ReportTO read(@NotNull @PathParam("reportKey") Long reportKey);
+
+ /**
+ * Returns report execution with matching key.
+ *
+ * @param executionId report execution id to be selected
+ * @return report execution with matching key
+ */
+ @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 key.
+ *
+ * @param reportKey id for report to be updated
+ * @param reportTO report to be stored
+ */
+ @PUT
+ @Path("{reportKey}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ void update(@NotNull @PathParam("reportKey") Long reportKey, ReportTO reportTO);
+
+ /**
+ * Deletes report with matching key.
+ *
+ * @param reportKey Deletes report with matching key
+ */
+ @DELETE
+ @Path("{reportKey}")
+ void delete(@NotNull @PathParam("reportKey") Long reportKey);
+
+ /**
+ * Deletes report execution with matching key.
+ *
+ * @param executionId key of execution report to be deleted
+ */
+ @DELETE
+ @Path("executions/{executionId}")
+ void deleteExecution(@NotNull @PathParam("executionId") Long executionId);
+
+ /**
+ * Executes the report with matching key.
+ *
+ * @param reportKey key of report to be executed
+ * @return report execution result
+ */
+ @POST
+ @Path("{reportKey}/execute")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ ReportExecTO execute(@NotNull @PathParam("reportKey") Long reportKey);
+
+ /**
+ * Exports the report execution with matching key in the requested format.
+ *
+ * @param executionId key 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/8b4e52d7/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
----------------------------------------------------------------------
diff --git a/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java
new file mode 100644
index 0000000..9b62de3
--- /dev/null
+++ b/syncope620/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/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.service;
+
+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 key.
+ *
+ * @param resourceKey Name of resource to read connector object from
+ * @param type user / role
+ * @param key user key / role key
+ * @return connector object from the external resource, for the given type and key
+ */
+ @GET
+ @Path("{resourceKey}/{type}/{id}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ ConnObjectTO getConnectorObject(@NotNull @PathParam("resourceKey") String resourceKey,
+ @NotNull @PathParam("type") SubjectType type, @NotNull @PathParam("key") Long key);
+
+ /**
+ * 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 resourceKey Name of resource to be read
+ * @return resource with matching name
+ */
+ @GET
+ @Path("{resourceKey}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ ResourceTO read(@NotNull @PathParam("resourceKey") String resourceKey);
+
+ /**
+ * 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 resourceKey name of resource to be updated
+ * @param resourceTO resource to be stored
+ */
+ @PUT
+ @Path("{resourceKey}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ void update(@NotNull @PathParam("resourceKey") String resourceKey, @NotNull ResourceTO resourceTO);
+
+ /**
+ * Deletes the resource matching the given name.
+ *
+ * @param resourceKey name of resource to be deleted
+ */
+ @DELETE
+ @Path("{resourceKey}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ void delete(@NotNull @PathParam("resourceKey") String resourceKey);
+
+ /**
+ * 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 resourceKey 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("{resourceKey}/bulkDeassociation/{subjType}/{type}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ BulkActionResult bulkDeassociation(@NotNull @PathParam("resourceKey") String resourceKey,
+ @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);
+}