http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java ---------------------------------------------------------------------- diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java new file mode 100644 index 0000000..3046a5d --- /dev/null +++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java @@ -0,0 +1,127 @@ +/* + * 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 javax.validation.constraints.NotNull; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.DefaultValue; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.apache.cxf.jaxrs.model.wadl.Description; +import org.apache.cxf.jaxrs.model.wadl.Descriptions; +import org.apache.cxf.jaxrs.model.wadl.DocTarget; +import org.apache.syncope.common.lib.mod.UserMod; +import org.apache.syncope.common.lib.to.UserTO; + +/** + * REST operations for user self-management. + */ +@Path("users/self") +public interface UserSelfService extends JAXRSService { + + /** + * 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 userKey id of user to be updated + * @param userMod modification to be applied to user matching the provided userKey + * @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("{userKey}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response update(@NotNull @PathParam("userKey") Long userKey, @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/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java ---------------------------------------------------------------------- diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java new file mode 100644 index 0000000..ea1d197 --- /dev/null +++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java @@ -0,0 +1,321 @@ +/* + * 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.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 key. + * + * @param userKey user key + * @return <tt>Response</tt> object featuring HTTP header with username matching the given userKey + */ + @Descriptions({ + @Description(target = DocTarget.RESPONSE, + value = "Featuring HTTP header with username matching the given userKey") + }) + @OPTIONS + @Path("{userKey}/username") + Response getUsername(@NotNull @PathParam("userKey") Long userKey); + + /** + * Gives the user key for the provided username. + * + * @param username username + * @return <tt>Response</tt> object featuring HTTP header with userKey matching the given username + */ + @Descriptions({ + @Description(target = DocTarget.RESPONSE, + value = "Featuring HTTP header with userKey matching the given username") + }) + @OPTIONS + @Path("{username}/userKey") + Response getUserId(@NotNull @PathParam("username") String username); + + /** + * Reads the user matching the provided userKey. + * + * @param userKey id of user to be read + * @return User matching the provided userKey + */ + @GET + @Path("{userKey}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + UserTO read(@NotNull @PathParam("userKey") Long userKey); + + /** + * 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 userKey. + * + * @param userKey id of user to be updated + * @param userMod modification to be applied to user matching the provided userKey + * @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("{userKey}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response update(@NotNull @PathParam("userKey") Long userKey, @NotNull UserMod userMod); + + /** + * Performs a status update on user matching provided userKey. + * + * @param userKey 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("{userKey}/status") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response status(@NotNull @PathParam("userKey") Long userKey, @NotNull StatusMod statusMod); + + /** + * Deletes user matching provided userKey. + * + * @param userKey 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("{userKey}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response delete(@NotNull @PathParam("userKey") Long userKey); + + /** + * Executes resource-related operations on given user. + * + * @param userKey user key + * @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("{userKey}/bulkDeassociation/{type}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response bulkDeassociation(@NotNull @PathParam("userKey") Long userKey, + @NotNull @PathParam("type") ResourceDeassociationActionType type, + @NotNull List<ResourceName> resourceNames); + + /** + * Executes resource-related operations on given user. + * + * @param userKey user key. + * @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("{userKey}/bulkAssociation/{type}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + Response bulkAssociation(@NotNull @PathParam("userKey") Long userKey, + @NotNull @PathParam("type") ResourceAssociationActionType type, + @NotNull ResourceAssociationMod associationMod); + + /** + * Executes the provided bulk action. + * + * @param bulkAction list of user keys 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/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java ---------------------------------------------------------------------- diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java new file mode 100644 index 0000000..256317d --- /dev/null +++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowService.java @@ -0,0 +1,108 @@ +/* + * 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.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 key. + * + * @param userKey user key + * @param name form name + * @return list of all available workflow forms with matching name, fir the given user key. + */ + @GET + @Path("forms/{userKey}/{name}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + List<WorkflowFormTO> getFormsByName( + @NotNull @PathParam("userKey") final Long userKey, @NotNull @PathParam("name") final String name); + + /** + * Returns a list of available forms for the given user key. + * + * @param userKey user key + * @return list of available forms for the given user key + */ + @GET + @Path("forms/{userKey}") + @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) + WorkflowFormTO getFormForUser(@NotNull @PathParam("userKey") Long userKey); + + /** + * 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/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java ---------------------------------------------------------------------- diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java new file mode 100644 index 0000000..92aa86b --- /dev/null +++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/WorkflowService.java @@ -0,0 +1,70 @@ +/* + * 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 javax.validation.constraints.NotNull; +import javax.ws.rs.Consumes; +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.types.SubjectType; +import org.apache.syncope.common.rest.api.RESTHeaders; + +/** + * REST operations for workflow definition management. + */ +@Path("workflows/{kind}") +public interface WorkflowService extends JAXRSService { + + /** + * 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/AbstractBaseBean.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/AbstractBaseBean.java b/common/src/main/java/org/apache/syncope/common/AbstractBaseBean.java deleted file mode 100644 index 1c870a1..0000000 --- a/common/src/main/java/org/apache/syncope/common/AbstractBaseBean.java +++ /dev/null @@ -1,54 +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; - -import java.io.Serializable; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.syncope.common.to.AbstractTaskTO; -import org.apache.syncope.common.to.ReportTO; -import org.apache.syncope.common.to.RoleTO; -import org.apache.syncope.common.to.UserTO; - -@XmlType -// Reporting here only classes used via PagedResult -@XmlSeeAlso({ AbstractTaskTO.class, ReportTO.class, RoleTO.class, UserTO.class }) -public abstract class AbstractBaseBean implements Serializable { - - private static final long serialVersionUID = 3119542005279892164L; - - @Override - public boolean equals(final Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); - } - - @Override - public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); - } - - @Override - public String toString() { - return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/SyncopeClientCompositeException.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/SyncopeClientCompositeException.java b/common/src/main/java/org/apache/syncope/common/SyncopeClientCompositeException.java deleted file mode 100644 index 70f1bee..0000000 --- a/common/src/main/java/org/apache/syncope/common/SyncopeClientCompositeException.java +++ /dev/null @@ -1,96 +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; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import org.apache.syncope.common.types.ClientExceptionType; - -public class SyncopeClientCompositeException extends SyncopeClientException { - - private static final long serialVersionUID = 7882118041134372129L; - - private final Set<SyncopeClientException> exceptions = new HashSet<SyncopeClientException>(); - - protected SyncopeClientCompositeException() { - super(ClientExceptionType.Composite); - } - - public boolean hasExceptions() { - return !exceptions.isEmpty(); - } - - public boolean hasException(final ClientExceptionType exceptionType) { - return getException(exceptionType) != null; - } - - public SyncopeClientException getException(final ClientExceptionType exceptionType) { - boolean found = false; - SyncopeClientException syncopeClientException = null; - for (Iterator<SyncopeClientException> itor = exceptions.iterator(); itor.hasNext() && !found;) { - syncopeClientException = itor.next(); - if (syncopeClientException.getType().equals(exceptionType)) { - found = true; - } - } - - return found - ? syncopeClientException - : null; - } - - public Set<SyncopeClientException> getExceptions() { - return exceptions; - } - - public boolean addException(final SyncopeClientException exception) { - if (exception.getType() == null) { - throw new IllegalArgumentException(exception + " does not have the right " - + ClientExceptionType.class.getName() + " set"); - } - - return exceptions.add(exception); - } - - @Override - public String getMessage() { - StringBuilder message = new StringBuilder(); - - message.append("{"); - Iterator<SyncopeClientException> iter = getExceptions().iterator(); - while (iter.hasNext()) { - SyncopeClientException e = iter.next(); - message.append("["); - message.append(e.getMessage()); - message.append("]"); - if (iter.hasNext()) { - message.append(", "); - } - } - message.append("}"); - - return message.toString(); - } - - @Override - public String getLocalizedMessage() { - return getMessage(); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/SyncopeClientException.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/SyncopeClientException.java b/common/src/main/java/org/apache/syncope/common/SyncopeClientException.java deleted file mode 100644 index a003af7..0000000 --- a/common/src/main/java/org/apache/syncope/common/SyncopeClientException.java +++ /dev/null @@ -1,97 +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; - -import java.util.ArrayList; -import java.util.List; -import org.apache.syncope.common.types.ClientExceptionType; - -public class SyncopeClientException extends RuntimeException { - - private static final long serialVersionUID = 3380920886511913475L; - - private ClientExceptionType type; - - private final List<String> elements = new ArrayList<String>(); - - public static SyncopeClientException build(final ClientExceptionType type) { - if (type == ClientExceptionType.Composite) { - throw new IllegalArgumentException("Composite exceptions must be obtained via buildComposite()"); - } - return new SyncopeClientException(type); - } - - public static SyncopeClientCompositeException buildComposite() { - return new SyncopeClientCompositeException(); - } - - protected SyncopeClientException(final ClientExceptionType type) { - super(); - setType(type); - } - - public boolean isComposite() { - return getType() == ClientExceptionType.Composite; - } - - public SyncopeClientCompositeException asComposite() { - if (!isComposite()) { - throw new IllegalArgumentException("This is not a composite exception"); - } - - return (SyncopeClientCompositeException) this; - } - - public ClientExceptionType getType() { - return type; - } - - public final void setType(final ClientExceptionType type) { - this.type = type; - } - - public List<String> getElements() { - return elements; - } - - public boolean isEmpty() { - return elements.isEmpty(); - } - - public int size() { - return elements.size(); - } - - @Override - public String getMessage() { - StringBuilder message = new StringBuilder(); - - message.append(getType()); - message.append(" "); - message.append(getElements()); - - return message.toString(); - } - - @Override - public String getLocalizedMessage() { - return getMessage(); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java b/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java deleted file mode 100644 index c729cdd..0000000 --- a/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java +++ /dev/null @@ -1,52 +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; - -import java.util.regex.Pattern; - -public class SyncopeConstants { - - public static final String NAMESPACE = "http://syncope.apache.org/2.0"; - - public static final String UNAUTHENTICATED = "unauthenticated"; - - public static final String ANONYMOUS_ENTITLEMENT = "anonymous"; - - public static final String ENUM_VALUES_SEPARATOR = ";"; - - public static final String[] DATE_PATTERNS = { - "yyyy-MM-dd'T'HH:mm:ssZ", - "EEE, dd MMM yyyy HH:mm:ss z", - "yyyy-MM-dd'T'HH:mm:ssz", - "yyyy-MM-dd HH:mm:ss", - "yyyy-MM-dd HH:mm:ss.S", // explicitly added to import date into MySql repository - "yyyy-MM-dd" }; - - public static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd'T'HH:mm:ssZ"; - - public static final String DEFAULT_ENCODING = "UTF-8"; - - public static final String ROOT_LOGGER = "ROOT"; - - public static final Pattern EMAIL_PATTERN = Pattern.compile( - "^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*" - + "@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$", - Pattern.CASE_INSENSITIVE); - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/annotation/ClassList.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/annotation/ClassList.java b/common/src/main/java/org/apache/syncope/common/annotation/ClassList.java deleted file mode 100644 index 5681695..0000000 --- a/common/src/main/java/org/apache/syncope/common/annotation/ClassList.java +++ /dev/null @@ -1,26 +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.annotation; - -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -@Retention(RUNTIME) -public @interface ClassList { -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/annotation/FormAttributeField.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/annotation/FormAttributeField.java b/common/src/main/java/org/apache/syncope/common/annotation/FormAttributeField.java deleted file mode 100644 index cca70a1..0000000 --- a/common/src/main/java/org/apache/syncope/common/annotation/FormAttributeField.java +++ /dev/null @@ -1,37 +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.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.apache.syncope.common.types.IntMappingType; - -@Target({ ElementType.FIELD }) -@Retention(RetentionPolicy.RUNTIME) -public @interface FormAttributeField { - - boolean userSearch() default false; - - boolean roleSearch() default false; - - IntMappingType schema() default IntMappingType.UserSchema; -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/annotation/SchemaList.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/annotation/SchemaList.java b/common/src/main/java/org/apache/syncope/common/annotation/SchemaList.java deleted file mode 100644 index ad98ae5..0000000 --- a/common/src/main/java/org/apache/syncope/common/annotation/SchemaList.java +++ /dev/null @@ -1,28 +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.annotation; - -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -@Retention(RUNTIME) -public @interface SchemaList { - - boolean extended() default false; -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java b/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java deleted file mode 100644 index 15dca15..0000000 --- a/common/src/main/java/org/apache/syncope/common/mod/AbstractAttributableMod.java +++ /dev/null @@ -1,113 +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.mod; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashSet; -import java.util.Set; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlType; - -import org.apache.syncope.common.AbstractBaseBean; - -/** - * Abstract base class for objects that can have attributes removed, added or updated. - * - * Attributes can be regular attributes, derived attributes, virtual attributes and resources. - */ -@XmlType -public abstract class AbstractAttributableMod extends AbstractBaseBean { - - private static final long serialVersionUID = 3241118574016303198L; - - protected long id; - - protected final Set<AttributeMod> attrsToUpdate = new HashSet<AttributeMod>(); - - protected final Set<String> attrsToRemove = new HashSet<String>(); - - protected final Set<String> derAttrsToAdd = new HashSet<String>(); - - protected final Set<String> derAttrsToRemove = new HashSet<String>(); - - protected final Set<AttributeMod> virAttrsToUpdate = new HashSet<AttributeMod>(); - - protected final Set<String> virAttrsToRemove = new HashSet<String>(); - - public long getId() { - return id; - } - - public void setId(final long id) { - this.id = id; - } - - @XmlElementWrapper(name = "attributesToRemove") - @XmlElement(name = "attribute") - @JsonProperty("attributesToRemove") - public Set<String> getAttrsToRemove() { - return attrsToRemove; - } - - @XmlElementWrapper(name = "attributesToUpdate") - @XmlElement(name = "attributeMod") - @JsonProperty("attributesToUpdate") - public Set<AttributeMod> getAttrsToUpdate() { - return attrsToUpdate; - } - - @XmlElementWrapper(name = "derAttrsToAdd") - @XmlElement(name = "attribute") - @JsonProperty("derAttrsToAdd") - public Set<String> getDerAttrsToAdd() { - return derAttrsToAdd; - } - - @XmlElementWrapper(name = "derAttrsToRemove") - @XmlElement(name = "attribute") - @JsonProperty("derAttrsToRemove") - public Set<String> getDerAttrsToRemove() { - return derAttrsToRemove; - } - - @XmlElementWrapper(name = "virAttrsToRemove") - @XmlElement(name = "attribute") - @JsonProperty("virAttrsToRemove") - public Set<String> getVirAttrsToRemove() { - return virAttrsToRemove; - } - - @XmlElementWrapper(name = "virAttrsToUpdate") - @XmlElement(name = "attribute") - @JsonProperty("virAttrsToUpdate") - public Set<AttributeMod> getVirAttrsToUpdate() { - return virAttrsToUpdate; - } - - /** - * @return true is all backing Sets are empty. - */ - public boolean isEmpty() { - return attrsToUpdate.isEmpty() && attrsToRemove.isEmpty() - && derAttrsToAdd.isEmpty() && derAttrsToRemove.isEmpty() - && virAttrsToUpdate.isEmpty() && virAttrsToRemove.isEmpty(); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/mod/AbstractSubjectMod.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/mod/AbstractSubjectMod.java b/common/src/main/java/org/apache/syncope/common/mod/AbstractSubjectMod.java deleted file mode 100644 index 82def2f..0000000 --- a/common/src/main/java/org/apache/syncope/common/mod/AbstractSubjectMod.java +++ /dev/null @@ -1,56 +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.mod; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashSet; -import java.util.Set; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlType; - -@XmlType -public abstract class AbstractSubjectMod extends AbstractAttributableMod { - - private static final long serialVersionUID = -6404459635536484024L; - - protected final Set<String> resourcesToAdd = new HashSet<String>(); - - protected final Set<String> resourcesToRemove = new HashSet<String>(); - - @XmlElementWrapper(name = "resourcesToAdd") - @XmlElement(name = "resource") - @JsonProperty("resourcesToAdd") - public Set<String> getResourcesToAdd() { - return resourcesToAdd; - } - - @XmlElementWrapper(name = "resourcesToRemove") - @XmlElement(name = "resource") - @JsonProperty("resourcesToRemove") - public Set<String> getResourcesToRemove() { - return resourcesToRemove; - } - - @Override - public boolean isEmpty() { - return super.isEmpty() && resourcesToAdd.isEmpty() && resourcesToRemove.isEmpty(); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/mod/AttributeMod.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/mod/AttributeMod.java b/common/src/main/java/org/apache/syncope/common/mod/AttributeMod.java deleted file mode 100644 index 38f6f8b..0000000 --- a/common/src/main/java/org/apache/syncope/common/mod/AttributeMod.java +++ /dev/null @@ -1,78 +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.mod; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -import org.apache.syncope.common.AbstractBaseBean; - -@XmlRootElement -@XmlType -public class AttributeMod extends AbstractBaseBean { - - private static final long serialVersionUID = -913573979137431406L; - - private String schema; - - private List<String> valuesToBeAdded; - - private List<String> valuesToBeRemoved; - - public AttributeMod() { - super(); - - valuesToBeAdded = new ArrayList<String>(); - valuesToBeRemoved = new ArrayList<String>(); - } - - public String getSchema() { - return schema; - } - - public void setSchema(String schema) { - this.schema = schema; - } - - @XmlElementWrapper(name = "valuesToBeAdded") - @XmlElement(name = "value") - @JsonProperty("valuesToBeAdded") - public List<String> getValuesToBeAdded() { - return valuesToBeAdded; - } - - @XmlElementWrapper(name = "valuesToBeRemoved") - @XmlElement(name = "value") - @JsonProperty("valuesToBeRemoved") - public List<String> getValuesToBeRemoved() { - return valuesToBeRemoved; - } - - @JsonIgnore - public boolean isEmpty() { - return valuesToBeAdded.isEmpty() && valuesToBeRemoved.isEmpty(); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/mod/MembershipMod.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/mod/MembershipMod.java b/common/src/main/java/org/apache/syncope/common/mod/MembershipMod.java deleted file mode 100644 index 8fa83bc..0000000 --- a/common/src/main/java/org/apache/syncope/common/mod/MembershipMod.java +++ /dev/null @@ -1,46 +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.mod; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -@XmlRootElement -@XmlType -public class MembershipMod extends AbstractAttributableMod { - - private static final long serialVersionUID = 2511869129977331525L; - - private long role; - - public long getRole() { - return role; - } - - public void setRole(long role) { - this.role = role; - } - - @JsonIgnore - @Override - public boolean isEmpty() { - return super.isEmpty() && role == 0; - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/mod/ReferenceMod.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/mod/ReferenceMod.java b/common/src/main/java/org/apache/syncope/common/mod/ReferenceMod.java deleted file mode 100644 index 5be3289..0000000 --- a/common/src/main/java/org/apache/syncope/common/mod/ReferenceMod.java +++ /dev/null @@ -1,54 +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.mod; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -import org.apache.syncope.common.AbstractBaseBean; - -/** - * This class is used to specify the willing to modify an external reference id. Use 'null' ReferenceMod to keep the - * current reference id; use a ReferenceMod with a null id to try to reset the reference id; use a ReferenceMod with a - * not null id to specify a new reference id. - */ -@XmlRootElement(name = "referenceMod") -@XmlType -public class ReferenceMod extends AbstractBaseBean { - - private static final long serialVersionUID = -4188817853738067677L; - - private Long id; - - public ReferenceMod() { - this.id = null; - } - - public ReferenceMod(final Long id) { - this.id = id; - } - - public Long getId() { - return id; - } - - public void setId(final Long id) { - this.id = id; - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/mod/ResourceAssociationMod.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/mod/ResourceAssociationMod.java b/common/src/main/java/org/apache/syncope/common/mod/ResourceAssociationMod.java deleted file mode 100644 index 1a5335f..0000000 --- a/common/src/main/java/org/apache/syncope/common/mod/ResourceAssociationMod.java +++ /dev/null @@ -1,81 +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.mod; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -import org.apache.syncope.common.AbstractBaseBean; -import org.apache.syncope.common.wrap.ResourceName; - -/** - * This class is used to specify the willing to create associations between user and external references. - * Password can be provided if required by an assign or provisioning operation. - * - * @see org.apache.syncope.common.types.ResourceAssociationActionType - */ -@XmlRootElement(name = "resourceAssociationMod") -@XmlType -public class ResourceAssociationMod extends AbstractBaseBean { - - private static final long serialVersionUID = -4188817853738067678L; - - /** - * Target external resources. - */ - private final List<ResourceName> targetResources = new ArrayList<ResourceName>(); - - /** - * Indicate the willing to change password on target external resources. - */ - private boolean changePwd; - - /** - * Indicate the new password to be provisioned on target external resources. - */ - private String password; - - @XmlElementWrapper(name = "resources") - @XmlElement(name = "resource") - @JsonProperty("resources") - public List<ResourceName> getTargetResources() { - return targetResources; - } - - public boolean isChangePwd() { - return changePwd; - } - - public void setChangePwd(boolean changePwd) { - this.changePwd = changePwd; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/mod/RoleMod.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/mod/RoleMod.java b/common/src/main/java/org/apache/syncope/common/mod/RoleMod.java deleted file mode 100644 index cb24391..0000000 --- a/common/src/main/java/org/apache/syncope/common/mod/RoleMod.java +++ /dev/null @@ -1,301 +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.mod; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -@XmlRootElement(name = "roleMod") -@XmlType -public class RoleMod extends AbstractSubjectMod { - - private static final long serialVersionUID = 7455805264680210747L; - - private String name; - - private ReferenceMod userOwner; - - private ReferenceMod roleOwner; - - private Boolean inheritOwner; - - private Boolean inheritTemplates; - - private Boolean inheritAttrs; - - private Boolean inheritDerAttrs; - - private Boolean inheritVirAttrs; - - private Boolean inheritAccountPolicy; - - private Boolean inheritPasswordPolicy; - - private boolean modEntitlements; - - private List<String> entitlements = new ArrayList<String>(); - - private boolean modRAttrTemplates; - - private List<String> rAttrTemplates = new ArrayList<String>(); - - private boolean modRDerAttrTemplates; - - private List<String> rDerAttrTemplates = new ArrayList<String>(); - - private boolean modRVirAttrTemplates; - - private List<String> rVirAttrTemplates = new ArrayList<String>(); - - private boolean modMAttrTemplates; - - private List<String> mAttrTemplates = new ArrayList<String>(); - - private boolean modMDerAttrTemplates; - - private List<String> mDerAttrTemplates = new ArrayList<String>(); - - private boolean modMVirAttrTemplates; - - private List<String> mVirAttrTemplates = new ArrayList<String>(); - - private ReferenceMod passwordPolicy; - - private ReferenceMod accountPolicy; - - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } - - public ReferenceMod getUserOwner() { - return userOwner; - } - - public void setUserOwner(ReferenceMod userOwner) { - this.userOwner = userOwner; - } - - public ReferenceMod getRoleOwner() { - return roleOwner; - } - - public void setRoleOwner(ReferenceMod roleOwner) { - this.roleOwner = roleOwner; - } - - public Boolean getInheritOwner() { - return inheritOwner; - } - - public void setInheritOwner(Boolean inheritOwner) { - this.inheritOwner = inheritOwner; - } - - public Boolean getInheritTemplates() { - return inheritTemplates; - } - - public void setInheritTemplates(final Boolean inheritTemplates) { - this.inheritTemplates = inheritTemplates; - } - - public Boolean getInheritAttrs() { - return inheritAttrs; - } - - public void setInheritAttributes(final Boolean inheritAttrs) { - this.inheritAttrs = inheritAttrs; - } - - public Boolean getInheritDerAttrs() { - return inheritDerAttrs; - } - - public void setInheritDerAttrs(final Boolean inheritDerAttrs) { - this.inheritDerAttrs = inheritDerAttrs; - } - - public Boolean getInheritVirAttrs() { - return inheritVirAttrs; - } - - public void setInheritVirAttrs(final Boolean inheritVirAttrs) { - this.inheritVirAttrs = inheritVirAttrs; - } - - public boolean isModEntitlements() { - return modEntitlements; - } - - public void setModEntitlements(final boolean modEntitlements) { - this.modEntitlements = modEntitlements; - } - - @XmlElementWrapper(name = "entitlements") - @XmlElement(name = "entitlement") - @JsonProperty("entitlements") - public List<String> getEntitlements() { - return entitlements; - } - - public boolean isModRAttrTemplates() { - return modRAttrTemplates; - } - - public void setModRAttrTemplates(final boolean modRAttrTemplates) { - this.modRAttrTemplates = modRAttrTemplates; - } - - @XmlElementWrapper(name = "rAttrTemplates") - @XmlElement(name = "rAttrTemplate") - @JsonProperty("rAttrTemplates") - public List<String> getRAttrTemplates() { - return rAttrTemplates; - } - - public boolean isModRDerAttrTemplates() { - return modRDerAttrTemplates; - } - - public void setModRDerAttrTemplates(final boolean modRDerAttrTemplates) { - this.modRDerAttrTemplates = modRDerAttrTemplates; - } - - @XmlElementWrapper(name = "rDerAttrTemplates") - @XmlElement(name = "rDerAttrTemplate") - @JsonProperty("rDerAttrTemplates") - public List<String> getRDerAttrTemplates() { - return rDerAttrTemplates; - } - - public boolean isModRVirAttrTemplates() { - return modRVirAttrTemplates; - } - - public void setModRVirAttrTemplates(final boolean modRVirAttrTemplates) { - this.modRVirAttrTemplates = modRVirAttrTemplates; - } - - @XmlElementWrapper(name = "rVirAttrTemplates") - @XmlElement(name = "rVirAttrTemplate") - @JsonProperty("rVirAttrTemplates") - public List<String> getRVirAttrTemplates() { - return rVirAttrTemplates; - } - - public boolean isModMAttrTemplates() { - return modMAttrTemplates; - } - - public void setModMAttrTemplates(final boolean modMAttrTemplates) { - this.modMAttrTemplates = modMAttrTemplates; - } - - @XmlElementWrapper(name = "mAttrTemplates") - @XmlElement(name = "mAttrTemplate") - @JsonProperty("mAttrTemplates") - public List<String> getMAttrTemplates() { - return mAttrTemplates; - } - - public boolean isModMDerAttrTemplates() { - return modMDerAttrTemplates; - } - - public void setModMDerAttrTemplates(final boolean modMDerAttrTemplates) { - this.modMDerAttrTemplates = modMDerAttrTemplates; - } - - @XmlElementWrapper(name = "mDerAttrTemplates") - @XmlElement(name = "mDerAttrTemplate") - @JsonProperty("mDerAttrTemplates") - public List<String> getMDerAttrTemplates() { - return mDerAttrTemplates; - } - - public boolean isModMVirAttrTemplates() { - return modMVirAttrTemplates; - } - - public void setModMVirAttrTemplates(final boolean modMVirAttrTemplates) { - this.modMVirAttrTemplates = modMVirAttrTemplates; - } - - @XmlElementWrapper(name = "mVirAttrTemplates") - @XmlElement(name = "mVirAttrTemplate") - @JsonProperty("mVirAttrTemplates") - public List<String> getMVirAttrTemplates() { - return mVirAttrTemplates; - } - - public ReferenceMod getPasswordPolicy() { - return passwordPolicy; - } - - public void setPasswordPolicy(final ReferenceMod passwordPolicy) { - this.passwordPolicy = passwordPolicy; - } - - public Boolean getInheritPasswordPolicy() { - return inheritPasswordPolicy; - } - - public void setInheritPasswordPolicy(final Boolean inheritPasswordPolicy) { - this.inheritPasswordPolicy = inheritPasswordPolicy; - } - - public ReferenceMod getAccountPolicy() { - return accountPolicy; - } - - public void setAccountPolicy(final ReferenceMod accountPolicy) { - this.accountPolicy = accountPolicy; - } - - public Boolean getInheritAccountPolicy() { - return inheritAccountPolicy; - } - - public void setInheritAccountPolicy(final Boolean inheritAccountPolicy) { - this.inheritAccountPolicy = inheritAccountPolicy; - } - - @JsonIgnore - @Override - public boolean isEmpty() { - return super.isEmpty() && name == null && userOwner == null && roleOwner == null - && inheritTemplates == null && inheritOwner == null - && inheritAccountPolicy == null && inheritPasswordPolicy == null - && inheritAttrs == null && inheritDerAttrs == null && inheritVirAttrs == null - && accountPolicy == null && passwordPolicy == null && entitlements.isEmpty() - && rAttrTemplates.isEmpty() && rDerAttrTemplates.isEmpty() && rVirAttrTemplates.isEmpty() - && mAttrTemplates.isEmpty() && mDerAttrTemplates.isEmpty() && mVirAttrTemplates.isEmpty(); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java b/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java deleted file mode 100644 index c4ae577..0000000 --- a/common/src/main/java/org/apache/syncope/common/mod/StatusMod.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.mod; - -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.apache.syncope.common.AbstractBaseBean; - -@XmlRootElement(name = "statusMod") -@XmlType -public class StatusMod extends AbstractBaseBean { - - private static final long serialVersionUID = 3230910033784302656L; - - @XmlEnum - @XmlType(name = "statusModType") - public enum ModType { - - ACTIVATE, - SUSPEND, - REACTIVATE; - - } - - /** - * Id of user to for which status update is requested. - */ - private long id; - - private ModType type; - - /** - * Update token (if required). - */ - private String token; - - /** - * Whether update should be performed on internal storage. - */ - private boolean onSyncope = true; - - /** - * External resources for which update is needed to be propagated. - */ - private final List<String> resourceNames = new ArrayList<String>(); - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public ModType getType() { - return type; - } - - public void setType(final ModType type) { - this.type = type; - } - - public String getToken() { - return token; - } - - public void setToken(final String token) { - this.token = token; - } - - public boolean isOnSyncope() { - return onSyncope; - } - - public void setOnSyncope(final boolean onSyncope) { - this.onSyncope = onSyncope; - } - - @XmlElementWrapper(name = "resources") - @XmlElement(name = "resource") - @JsonProperty("resources") - public List<String> getResourceNames() { - return resourceNames; - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/mod/UserMod.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/mod/UserMod.java b/common/src/main/java/org/apache/syncope/common/mod/UserMod.java deleted file mode 100644 index d4e39f2..0000000 --- a/common/src/main/java/org/apache/syncope/common/mod/UserMod.java +++ /dev/null @@ -1,123 +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.mod; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashSet; -import java.util.Set; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -@XmlRootElement(name = "userMod") -@XmlType -public class UserMod extends AbstractSubjectMod { - - private static final long serialVersionUID = 3081848906558106204L; - - private String password; - - private String username; - - private final Set<MembershipMod> membershipsToAdd; - - private final Set<Long> membershipsToRemove; - - private StatusMod pwdPropRequest; - - private Long securityQuestion; - - private String securityAnswer; - - public UserMod() { - super(); - - membershipsToAdd = new HashSet<MembershipMod>(); - membershipsToRemove = new HashSet<Long>(); - } - - public String getUsername() { - return username; - } - - public void setUsername(final String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(final String password) { - this.password = password; - } - - @XmlElementWrapper(name = "membershipsToAdd") - @XmlElement(name = "membership") - @JsonProperty("membershipsToAdd") - public Set<MembershipMod> getMembershipsToAdd() { - return membershipsToAdd; - } - - @XmlElementWrapper(name = "membershipsToRemove") - @XmlElement(name = "membership") - @JsonProperty("membershipsToRemove") - public Set<Long> getMembershipsToRemove() { - return membershipsToRemove; - } - - public StatusMod getPwdPropRequest() { - return pwdPropRequest; - } - - public void setPwdPropRequest(final StatusMod pwdPropRequest) { - this.pwdPropRequest = pwdPropRequest; - } - - public Long getSecurityQuestion() { - return securityQuestion; - } - - public void setSecurityQuestion(final Long securityQuestion) { - this.securityQuestion = securityQuestion; - } - - public String getSecurityAnswer() { - return securityAnswer; - } - - public void setSecurityAnswer(final String securityAnswer) { - this.securityAnswer = securityAnswer; - } - - @JsonIgnore - @Override - public boolean isEmpty() { - return super.isEmpty() - && password == null - && username == null - && membershipsToAdd.isEmpty() - && membershipsToRemove.isEmpty() - && pwdPropRequest == null - && securityQuestion == null - && securityAnswer == null; - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/mod/package-info.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/mod/package-info.java b/common/src/main/java/org/apache/syncope/common/mod/package-info.java deleted file mode 100644 index 2669ff1..0000000 --- a/common/src/main/java/org/apache/syncope/common/mod/package-info.java +++ /dev/null @@ -1,23 +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. - */ -@XmlSchema(namespace = SyncopeConstants.NAMESPACE) -package org.apache.syncope.common.mod; - -import javax.xml.bind.annotation.XmlSchema; -import org.apache.syncope.common.SyncopeConstants; http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/package-info.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/package-info.java b/common/src/main/java/org/apache/syncope/common/package-info.java deleted file mode 100644 index 17fb64b..0000000 --- a/common/src/main/java/org/apache/syncope/common/package-info.java +++ /dev/null @@ -1,22 +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. - */ -@XmlSchema(namespace = SyncopeConstants.NAMESPACE) -package org.apache.syncope.common; - -import javax.xml.bind.annotation.XmlSchema; http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/report/AbstractReportletConf.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/report/AbstractReportletConf.java b/common/src/main/java/org/apache/syncope/common/report/AbstractReportletConf.java deleted file mode 100644 index 6563c71..0000000 --- a/common/src/main/java/org/apache/syncope/common/report/AbstractReportletConf.java +++ /dev/null @@ -1,51 +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.report; - -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; - -import org.apache.syncope.common.AbstractBaseBean; - -@XmlType -@XmlSeeAlso({ StaticReportletConf.class, UserReportletConf.class, RoleReportletConf.class }) -public abstract class AbstractReportletConf extends AbstractBaseBean implements ReportletConf { - - private static final long serialVersionUID = -6130008602014516608L; - - private String name; - - public AbstractReportletConf() { - this(""); - setName(getClass().getName()); - } - - public AbstractReportletConf(final String name) { - this.name = name; - } - - @Override - public final String getName() { - return name; - } - - public final void setName(final String name) { - this.name = name; - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/2d194636/common/src/main/java/org/apache/syncope/common/report/ReportletConf.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/syncope/common/report/ReportletConf.java b/common/src/main/java/org/apache/syncope/common/report/ReportletConf.java deleted file mode 100644 index 970ae87..0000000 --- a/common/src/main/java/org/apache/syncope/common/report/ReportletConf.java +++ /dev/null @@ -1,32 +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.report; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class") -public interface ReportletConf { - - /** - * Give name of related reportlet instance. - * - * @return name of this reportlet instance - */ - String getName(); -}
