http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/services/ReportService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/ReportService.java b/common/src/main/java/org/apache/syncope/common/services/ReportService.java deleted file mode 100644 index 4bf9c27..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/ReportService.java +++ /dev/null @@ -1,195 +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.services; - -import java.util.List; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -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.reqres.PagedResult; -import org.apache.syncope.common.to.ReportExecTO; -import org.apache.syncope.common.to.ReportTO; -import org.apache.syncope.common.types.ReportExecExportFormat; -import org.apache.syncope.common.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/2d194636/common/src/main/java/org/apache/syncope/common/services/ResourceService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/ResourceService.java b/common/src/main/java/org/apache/syncope/common/services/ResourceService.java deleted file mode 100644 index dae4622..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/ResourceService.java +++ /dev/null @@ -1,173 +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.services; - -import java.util.List; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -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.reqres.BulkAction; -import org.apache.syncope.common.reqres.BulkActionResult; -import org.apache.syncope.common.to.ConnObjectTO; -import org.apache.syncope.common.to.ResourceTO; -import org.apache.syncope.common.types.ResourceDeassociationActionType; -import org.apache.syncope.common.types.SubjectType; -import org.apache.syncope.common.wrap.PropagationActionClass; -import org.apache.syncope.common.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(); - - /** - * 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/2d194636/common/src/main/java/org/apache/syncope/common/services/RoleService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/RoleService.java b/common/src/main/java/org/apache/syncope/common/services/RoleService.java deleted file mode 100644 index 1f4e45b..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/RoleService.java +++ /dev/null @@ -1,313 +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.services; - -import java.util.List; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -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.reqres.PagedResult; -import org.apache.syncope.common.mod.RoleMod; -import org.apache.syncope.common.reqres.BulkAction; -import org.apache.syncope.common.reqres.BulkActionResult; -import org.apache.syncope.common.to.RoleTO; -import org.apache.syncope.common.types.ResourceAssociationActionType; -import org.apache.syncope.common.types.ResourceDeassociationActionType; -import org.apache.syncope.common.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/2d194636/common/src/main/java/org/apache/syncope/common/services/RouteService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/RouteService.java b/common/src/main/java/org/apache/syncope/common/services/RouteService.java deleted file mode 100644 index 2082fc5..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/RouteService.java +++ /dev/null @@ -1,76 +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.services; - -import java.util.List; -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.syncope.common.to.RouteTO; -import org.apache.syncope.common.types.SubjectType; - -@Path("routes/{subject}") -public interface RouteService extends JAXRSService { - - /** - * Checks whether Camel is choosed as default provisioning engine. - * - * @param subject user or role - * @return <tt>Response</tt> contains special syncope HTTP header indicating if Camel is enabled for - * users / roles provisioning - * @see org.apache.syncope.common.types.RESTHeaders#CAMEL_USER_PROVISIONING_MANAGER - * @see org.apache.syncope.common.types.RESTHeaders#CAMEL_ROLE_PROVISIONING_MANAGER - * - */ - @OPTIONS - Response getOptions(@NotNull @PathParam("subject") SubjectType subject); - - @GET - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - List<RouteTO> getRoutes(@NotNull @PathParam("subject") SubjectType subject); - - @GET - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @Path("{id}") - public RouteTO getRoute(@NotNull @PathParam("subject") SubjectType subject, @PathParam("id") Long Id); - - @GET - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @Path("{id}") - public RouteTO getRoute(@PathParam("id") Long Id); - - @PUT - @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @Path("{id}") - void importRoute(@NotNull @PathParam("subject") SubjectType subject,@PathParam("id") Long id, RouteTO route); - - @PUT - @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @Path("{id}") - void importRoute(@PathParam("id") Long id, RouteTO route); - - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/services/SchemaService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/SchemaService.java b/common/src/main/java/org/apache/syncope/common/services/SchemaService.java deleted file mode 100644 index bbb4c06..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/SchemaService.java +++ /dev/null @@ -1,119 +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.services; - -import java.util.List; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -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.to.AbstractSchemaTO; -import org.apache.syncope.common.types.AttributableType; -import org.apache.syncope.common.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); -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/services/SecurityQuestionService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/SecurityQuestionService.java b/common/src/main/java/org/apache/syncope/common/services/SecurityQuestionService.java deleted file mode 100644 index 09958f2..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/SecurityQuestionService.java +++ /dev/null @@ -1,110 +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.services; - -import java.util.List; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -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.to.SecurityQuestionTO; - -/** - * REST operations for configuration. - */ -@Path("securityQuestions") -public interface SecurityQuestionService extends JAXRSService { - - /** - * Returns a list of all security questions. - * - * @return list of all security questions - */ - @GET - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - List<SecurityQuestionTO> list(); - - /** - * Returns security question with matching id. - * - * @param securityQuestionId security question id to be read - * @return security question with matching id - */ - @GET - @Path("{securityQuestionId}") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - SecurityQuestionTO read(@NotNull @PathParam("securityQuestionId") Long securityQuestionId); - - /** - * Creates a new security question. - * - * @param securityQuestionTO security question to be created - * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created security question - */ - @Descriptions({ - @Description(target = DocTarget.RESPONSE, - value = "Featuring <tt>Location</tt> header of created security question") - }) - @POST - @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - Response create(@NotNull SecurityQuestionTO securityQuestionTO); - - /** - * Updates the security question matching the provided id. - * - * @param securityQuestionId security question id to be updated - * @param securityQuestionTO security question to be stored - */ - @PUT - @Path("{securityQuestionId}") - @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - void update(@NotNull @PathParam("securityQuestionId") Long securityQuestionId, - @NotNull SecurityQuestionTO securityQuestionTO); - - /** - * Deletes the security question matching the provided id. - * - * @param securityQuestionId security question id to be deleted - */ - @DELETE - @Path("{securityQuestionId}") - void delete(@NotNull @PathParam("securityQuestionId") Long securityQuestionId); - - /** - * Ask for security question configured for the user matching the given username, if any. - * - * @param username username for which the security question is requested - * @return security question, if configured for the user matching the given username - */ - @GET - @Path("byUser/{username}") - @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) - SecurityQuestionTO readByUser(@NotNull @PathParam("username") String username); -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/services/TaskService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/TaskService.java b/common/src/main/java/org/apache/syncope/common/services/TaskService.java deleted file mode 100644 index 8efba34..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/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.services; - -import java.util.List; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -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.reqres.PagedResult; -import org.apache.syncope.common.reqres.BulkAction; -import org.apache.syncope.common.reqres.BulkActionResult; -import org.apache.syncope.common.to.ReportExecTO; -import org.apache.syncope.common.to.TaskExecTO; -import org.apache.syncope.common.to.AbstractTaskTO; -import org.apache.syncope.common.to.SchedTaskTO; -import org.apache.syncope.common.types.TaskType; -import org.apache.syncope.common.wrap.JobClass; -import org.apache.syncope.common.wrap.PushActionClass; -import org.apache.syncope.common.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/2d194636/common/src/main/java/org/apache/syncope/common/services/UserSelfService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/UserSelfService.java b/common/src/main/java/org/apache/syncope/common/services/UserSelfService.java deleted file mode 100644 index 4905a33..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/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.services; - -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.mod.UserMod; -import org.apache.syncope.common.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/2d194636/common/src/main/java/org/apache/syncope/common/services/UserService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/UserService.java b/common/src/main/java/org/apache/syncope/common/services/UserService.java deleted file mode 100644 index c720218..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/UserService.java +++ /dev/null @@ -1,322 +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.services; - -import java.util.List; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -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.mod.ResourceAssociationMod; -import org.apache.syncope.common.mod.StatusMod; -import org.apache.syncope.common.mod.UserMod; -import org.apache.syncope.common.wrap.ResourceName; -import org.apache.syncope.common.reqres.PagedResult; -import org.apache.syncope.common.reqres.BulkAction; -import org.apache.syncope.common.reqres.BulkActionResult; -import org.apache.syncope.common.to.UserTO; -import org.apache.syncope.common.types.ResourceAssociationActionType; -import org.apache.syncope.common.types.ResourceDeassociationActionType; - -/** - * 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/2d194636/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java b/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java deleted file mode 100644 index c3f7721..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java +++ /dev/null @@ -1,110 +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.services; - -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.to.UserTO; -import org.apache.syncope.common.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/2d194636/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java b/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java deleted file mode 100644 index f6c55b4..0000000 --- a/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java +++ /dev/null @@ -1,90 +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.services; - -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.types.RESTHeaders; -import org.apache.syncope.common.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/2d194636/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java b/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java deleted file mode 100644 index 232598e..0000000 --- a/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java +++ /dev/null @@ -1,86 +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.to; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlType; - -@XmlType -public abstract class AbstractAttributableTO extends ConnObjectTO { - - private static final long serialVersionUID = 4083884098736820255L; - - private long id; - - private final List<AttributeTO> derAttrs = new ArrayList<AttributeTO>(); - - private final List<AttributeTO> virAttrs = new ArrayList<AttributeTO>(); - - public long getId() { - return id; - } - - public void setId(final long id) { - this.id = id; - } - - @JsonIgnore - public Map<String, AttributeTO> getDerAttrMap() { - Map<String, AttributeTO> result = new HashMap<String, AttributeTO>(derAttrs.size()); - for (AttributeTO attributeTO : derAttrs) { - result.put(attributeTO.getSchema(), attributeTO); - } - result = Collections.unmodifiableMap(result); - - return result; - } - - @JsonIgnore - public Map<String, AttributeTO> getVirAttrMap() { - Map<String, AttributeTO> result = new HashMap<String, AttributeTO>(virAttrs.size()); - for (AttributeTO attributeTO : virAttrs) { - result.put(attributeTO.getSchema(), attributeTO); - } - result = Collections.unmodifiableMap(result); - - return result; - } - - @XmlElementWrapper(name = "derivedAttributes") - @XmlElement(name = "attribute") - @JsonProperty("derivedAttributes") - public List<AttributeTO> getDerAttrs() { - return derAttrs; - } - - @XmlElementWrapper(name = "virtualAttributes") - @XmlElement(name = "attribute") - @JsonProperty("virtualAttributes") - public List<AttributeTO> getVirAttrs() { - return virAttrs; - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java b/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java deleted file mode 100644 index 4745c9b..0000000 --- a/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.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.to; - -import java.util.Date; - -import javax.xml.bind.annotation.XmlType; - -import org.apache.syncope.common.AbstractBaseBean; - -@XmlType -public class AbstractExecTO extends AbstractBaseBean { - - private static final long serialVersionUID = -4621191979198357081L; - - protected long id; - - protected String status; - - protected String message; - - protected Date startDate; - - protected Date endDate; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public Date getStartDate() { - return startDate == null - ? null - : new Date(startDate.getTime()); - } - - public void setStartDate(Date startDate) { - if (startDate != null) { - this.startDate = new Date(startDate.getTime()); - } - } - - public Date getEndDate() { - return endDate == null - ? null - : new Date(endDate.getTime()); - } - - public void setEndDate(Date endDate) { - if (endDate != null) { - this.endDate = new Date(endDate.getTime()); - } - } -}
