You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2013/10/30 12:26:22 UTC
svn commit: r1537047 [1/5] - in /syncope/trunk:
client/src/main/java/org/apache/syncope/client/rest/
common/src/main/java/org/apache/syncope/common/
common/src/main/java/org/apache/syncope/common/mod/
common/src/main/java/org/apache/syncope/common/serv...
Author: ilgrosso
Date: Wed Oct 30 11:26:19 2013
New Revision: 1537047
URL: http://svn.apache.org/r1537047
Log:
[SYNCOPE-425] Discussed changes and RESTful best practices applied
Added:
syncope/trunk/common/src/main/java/org/apache/syncope/common/AbstractWrappable.java (with props)
syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java (with props)
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ResourceNameTO.java (with props)
syncope/trunk/common/src/main/java/org/apache/syncope/common/types/RESTHeaders.java (with props)
syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ResourceAssociationActionType.java (with props)
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/status/
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/status/AbstractStatusBeanProvider.java (with props)
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/status/ConnObjectWrapper.java (with props)
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/status/Status.java (with props)
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/status/StatusBean.java
- copied, changed from r1536599, syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/StatusBean.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/status/StatusUtils.java
- copied, changed from r1536599, syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/StatusUtils.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractStatusModalPage.java
- copied, changed from r1536599, syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractStatusModlaPage.java
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModalPage.html
- copied, changed from r1536599, syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModlaPage.html
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModalPage.properties
- copied unchanged from r1536599, syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModlaPage.properties
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModalPage_it.properties
- copied unchanged from r1536599, syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModlaPage_it.properties
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModalPage_pt_BR.properties
- copied unchanged from r1536599, syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModlaPage_pt_BR.properties
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/AbstractResourceAssociator.java (with props)
Removed:
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationRequestTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationTargetsTO.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/StatusBean.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/StatusUtils.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/AbstractStatusModlaPage.java
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModlaPage.html
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModlaPage.properties
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModlaPage_it.properties
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/AbstractStatusModlaPage_pt_BR.properties
Modified:
syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientExceptionMapper.java
syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientFactoryBean.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/EntitlementService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/BulkAssociationAction.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/CorrelationRuleClassTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/EntitlementTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/JobClassTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/MailTemplateTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/PropagationActionClassTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/SyncActionClassTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/UserTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ValidatorTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ClientExceptionType.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java
syncope/trunk/common/src/test/java/org/apache/syncope/common/JSONTest.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/SyncopeSession.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/AttributableDataProvider.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/commons/HttpResourceStream.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/EditUserModalPage.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/Login.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ProvisioningModalPage.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ResultStatusModalPage.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/StatusModalPage.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/MembershipsPanel.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/ResourcesPanel.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/RolePanel.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/StatusPanel.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/panels/UserSearchResultPanel.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/AuthRestClient.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ConnectorRestClient.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/NotificationRestClient.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ResourceRestClient.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/RoleRestClient.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/SchemaRestClient.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/TaskRestClient.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRequestRestClient.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/UserRestClient.java
syncope/trunk/console/src/main/resources/org/apache/syncope/console/SyncopeApplication.properties
syncope/trunk/console/src/main/resources/org/apache/syncope/console/SyncopeApplication_it.properties
syncope/trunk/console/src/main/resources/org/apache/syncope/console/SyncopeApplication_pt_BR.properties
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/ApprovalModalPage.html
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/BulkActionModalPage.html
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/RoleSummaryPanel.html
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/RoleTabPanel.html
syncope/trunk/console/src/main/resources/org/apache/syncope/console/pages/panels/StatusPanel.html
syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationByResource.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/impl/PropagationManager.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnectorController.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/EntitlementController.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/RoleController.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/TaskController.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserController.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserRequestController.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/data/UserDataBinder.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/AbstractServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConfigurationServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConnectorServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/EntitlementServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/NotificationServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ReportServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ResourceServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/RoleServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/SchemaServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/TaskServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserRequestServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserWorkflowServiceImpl.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AbstractTest.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/AuthenticationTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConfigurationTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ConnInstanceTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ReportTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ResourceTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/RoleTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/SchemaTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/TaskTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserRequestTestITCase.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/UserTestITCase.java
Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientExceptionMapper.java
URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientExceptionMapper.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientExceptionMapper.java (original)
+++ syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientExceptionMapper.java Wed Oct 30 11:26:19 2013
@@ -28,8 +28,8 @@ import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import javax.xml.ws.WebServiceException;
import org.apache.cxf.jaxrs.client.ResponseExceptionMapper;
-import org.apache.syncope.common.SyncopeConstants;
import org.apache.syncope.common.types.ClientExceptionType;
+import org.apache.syncope.common.types.RESTHeaders;
import org.apache.syncope.common.validation.SyncopeClientCompositeException;
import org.apache.syncope.common.validation.SyncopeClientException;
import org.slf4j.Logger;
@@ -75,9 +75,9 @@ public class RestClientExceptionMapper i
}
private SyncopeClientCompositeException checkSyncopeClientCompositeException(final Response response) {
- List<Object> exTypesInHeaders = response.getHeaders().get(SyncopeConstants.REST_EXCEPTION_TYPE_HEADER);
+ List<Object> exTypesInHeaders = response.getHeaders().get(RESTHeaders.EXCEPTION_TYPE.toString());
if (exTypesInHeaders == null) {
- LOG.debug("No " + SyncopeConstants.REST_EXCEPTION_TYPE_HEADER + " provided");
+ LOG.debug("No " + RESTHeaders.EXCEPTION_TYPE + " provided");
return null;
}
@@ -90,8 +90,7 @@ public class RestClientExceptionMapper i
try {
exceptionType = ClientExceptionType.fromHeaderValue(exTypeAsString);
} catch (IllegalArgumentException e) {
- LOG.error("Unexpected value of " + SyncopeConstants.REST_EXCEPTION_TYPE_HEADER + ": "
- + exTypeAsString, e);
+ LOG.error("Unexpected value of " + RESTHeaders.EXCEPTION_TYPE + ": " + exTypeAsString, e);
}
if (exceptionType != null) {
handledExceptions.add(exTypeAsString);
Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientFactoryBean.java
URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientFactoryBean.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientFactoryBean.java (original)
+++ syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientFactoryBean.java Wed Oct 30 11:26:19 2013
@@ -25,12 +25,6 @@ import org.apache.cxf.jaxrs.client.WebCl
public class RestClientFactoryBean extends JAXRSClientFactoryBean {
- private String contentType;
-
- public RestClientFactoryBean() {
- super();
- }
-
public <T> T createServiceInstance(final Class<T> serviceClass, final MediaType mediaType) {
return createServiceInstance(serviceClass, mediaType, null, null);
}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/AbstractWrappable.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/AbstractWrappable.java?rev=1537047&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/AbstractWrappable.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/AbstractWrappable.java Wed Oct 30 11:26:19 2013
@@ -0,0 +1,50 @@
+/*
+ * 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;
+
+public abstract class AbstractWrappable extends AbstractBaseBean {
+
+ private static final long serialVersionUID = 1712808704911635170L;
+
+ private String name;
+
+ public static <T extends AbstractWrappable> T getInstance(final Class<T> reference, final String name) {
+ try {
+ T instance = reference.newInstance();
+ instance.setName(name);
+ return instance;
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Could not instantiate " + reference.getName(), e);
+ }
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(final String name) {
+ this.name = name;
+ }
+}
Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/AbstractWrappable.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/AbstractWrappable.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/AbstractWrappable.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeConstants.java Wed Oct 30 11:26:19 2013
@@ -38,24 +38,6 @@ public class SyncopeConstants {
public static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd'T'HH:mm:ssZ";
- /**
- * HTTP header key for object ID assigned to an object after its creation;
- * HTTP Response after PUT operation should contain this key with resource id as its value.
- */
- public static final String REST_RESOURCE_ID_HEADER = "org.apache.syncope.resource.id";
-
- /**
- * HTTP header key for exception type.
- */
- public static final String REST_EXCEPTION_TYPE_HEADER = "Syncope.ExceptionType";
-
- /**
- * This constant is not defined in javax.ws.rs.core.HttpHeaders.
- *
- * @see javax.ws.rs.core.HttpHeaders
- */
- public static final String CONTENT_DISPOSITION_HEADER = "Content-Disposition";
-
public static final String DEFAULT_ENCODING = "UTF-8";
public static final String ROOT_LOGGER = "ROOT";
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java?rev=1537047&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java Wed Oct 30 11:26:19 2013
@@ -0,0 +1,102 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.List;
+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;
+ }
+
+ public List<String> getResourceNames() {
+ return resourceNames;
+ }
+
+}
Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/StatusMod.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/UserMod.java Wed Oct 30 11:26:19 2013
@@ -26,7 +26,6 @@ import javax.xml.bind.annotation.XmlElem
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.to.PropagationRequestTO;
@XmlRootElement(name = "userMod")
@XmlType
@@ -42,7 +41,7 @@ public class UserMod extends AbstractAtt
private final Set<Long> membershipsToRemove;
- private PropagationRequestTO pwdPropRequest;
+ private StatusMod pwdPropRequest;
public UserMod() {
super();
@@ -81,11 +80,11 @@ public class UserMod extends AbstractAtt
return membershipsToRemove;
}
- public PropagationRequestTO getPwdPropRequest() {
+ public StatusMod getPwdPropRequest() {
return pwdPropRequest;
}
- public void setPwdPropRequest(final PropagationRequestTO pwdPropRequest) {
+ public void setPwdPropRequest(final StatusMod pwdPropRequest) {
this.pwdPropRequest = pwdPropRequest;
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java Wed Oct 30 11:26:19 2013
@@ -19,26 +19,30 @@
package org.apache.syncope.common.services;
import java.util.List;
-import java.util.Set;
+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.syncope.common.to.ConfigurationTO;
import org.apache.syncope.common.to.MailTemplateTO;
import org.apache.syncope.common.to.ValidatorTO;
@Path("configurations")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface ConfigurationService {
/**
* Creates a new configuration element.
*
* @param configurationTO Configuration to be stored.
- * @return Response containing URI location for created resource.
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created configuration
*/
@POST
Response create(ConfigurationTO configurationTO);
@@ -62,14 +66,14 @@ public interface ConfigurationService {
*/
@GET
@Path("mailTemplates")
- Set<MailTemplateTO> getMailTemplates();
+ List<MailTemplateTO> getMailTemplates();
/**
* @return Returns a list of known validator names.
*/
@GET
@Path("validators")
- Set<ValidatorTO> getValidators();
+ List<ValidatorTO> getValidators();
/**
* @return Returns a list of all configuration elements.
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java Wed Oct 30 11:26:19 2013
@@ -19,6 +19,7 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
@@ -26,7 +27,9 @@ 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.syncope.common.to.BulkAction;
import org.apache.syncope.common.to.BulkActionRes;
@@ -37,13 +40,15 @@ import org.apache.syncope.common.to.Sche
import org.apache.syncope.common.types.ConnConfProperty;
@Path("connectors")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface ConnectorService {
/**
* Create a new connector instance.
*
* @param connInstanceTO connector instance to be created
- * @return response containing URI location for created resource
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created connector instance
*/
@POST
Response create(ConnInstanceTO connInstanceTO);
@@ -144,5 +149,5 @@ public interface ConnectorService {
@POST
@Path("bulk")
- BulkActionRes bulkAction(BulkAction bulkAction);
+ BulkActionRes bulk(BulkAction bulkAction);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/EntitlementService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/EntitlementService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/EntitlementService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/EntitlementService.java Wed Oct 30 11:26:19 2013
@@ -18,26 +18,31 @@
*/
package org.apache.syncope.common.services;
-import java.util.Set;
+import java.util.List;
+import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
import org.apache.syncope.common.to.EntitlementTO;
@Path("entitlements")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface EntitlementService {
/**
* @return Returns a collection of all known entitlements.
*/
@GET
- Set<EntitlementTO> getAllEntitlements();
+ List<EntitlementTO> getAllEntitlements();
/**
* @return Returns a collection of entitlements assigned to user making this request (Service Call).
*/
@GET
@Path("own")
- Set<EntitlementTO> getMyEntitlements();
+ List<EntitlementTO> getOwnEntitlements();
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java Wed Oct 30 11:26:19 2013
@@ -19,17 +19,22 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
import org.apache.syncope.common.to.LoggerTO;
import org.apache.syncope.common.types.LoggerType;
@Path("logger/{type}")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface LoggerService {
/**
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java Wed Oct 30 11:26:19 2013
@@ -19,22 +19,27 @@
package org.apache.syncope.common.services;
import java.util.List;
+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.syncope.common.to.NotificationTO;
@Path("notifications")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface NotificationService {
/**
* @param notificationTO Creates a new notification.
- * @return Response containing URI location for created resource.
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created notification
*/
@POST
Response create(NotificationTO notificationTO);
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java Wed Oct 30 11:26:19 2013
@@ -19,25 +19,30 @@
package org.apache.syncope.common.services;
import java.util.List;
-import java.util.Set;
+import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
+import javax.ws.rs.MatrixParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.syncope.common.to.CorrelationRuleClassTO;
import org.apache.syncope.common.to.AbstractPolicyTO;
import org.apache.syncope.common.types.PolicyType;
@Path("policies")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface PolicyService {
/**
* @param policyTO Policy to be created (needs to match type)
* @param <T> response type (extending PolicyTO)
- * @return Response containing URI location for created resource
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created policy
*/
@POST
<T extends AbstractPolicyTO> Response create(T policyTO);
@@ -56,8 +61,7 @@ public interface PolicyService {
* @return List of policies with matching type
*/
@GET
- @Path("{type}/list")
- <T extends AbstractPolicyTO> List<T> list(@PathParam("type") PolicyType type);
+ <T extends AbstractPolicyTO> List<T> list(@MatrixParam("type") PolicyType type);
/**
* @param policyId ID of requested policy
@@ -74,8 +78,8 @@ public interface PolicyService {
* @return Global Policy for matching type
*/
@GET
- @Path("{type}/0")
- <T extends AbstractPolicyTO> T readGlobal(@PathParam("type") PolicyType type);
+ @Path("global")
+ <T extends AbstractPolicyTO> T readGlobal(@MatrixParam("type") PolicyType type);
/**
* @param policyId ID of policy to be updated
@@ -87,10 +91,9 @@ public interface PolicyService {
<T extends AbstractPolicyTO> void update(@PathParam("policyId") Long policyId, T policyTO);
/**
- * @param type PolicyType (just SYNC is supported).
* @return correlation rules java classes
*/
@GET
@Path("syncCorrelationRuleClasses")
- Set<CorrelationRuleClassTO> getSyncCorrelationRuleClasses();
+ List<CorrelationRuleClassTO> getSyncCorrelationRuleClasses();
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java Wed Oct 30 11:26:19 2013
@@ -20,6 +20,7 @@ package org.apache.syncope.common.servic
import org.apache.syncope.common.types.ReportletConfClasses;
import java.util.List;
+import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
@@ -27,25 +28,22 @@ 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.syncope.common.to.ReportExecTO;
import org.apache.syncope.common.to.ReportTO;
import org.apache.syncope.common.types.ReportExecExportFormat;
@Path("reports")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface ReportService {
/**
- * @return Returns number of existing reports
- */
- @GET
- @Path("count")
- int count();
-
- /**
* @param reportTO Report to be created
- * @return Response containing URI location for created resource
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created report
*/
@POST
Response create(ReportTO reportTO);
@@ -96,6 +94,13 @@ public interface ReportService {
List<ReportTO> list();
/**
+ * @return Returns number of existing reports
+ */
+ @GET
+ @Path("count")
+ int count();
+
+ /**
* @param page selected page in relation to size
* @param size Number of items per page
* @return Returns a list of reports according to pagination
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java Wed Oct 30 11:26:19 2013
@@ -19,7 +19,7 @@
package org.apache.syncope.common.services;
import java.util.List;
-import java.util.Set;
+import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.MatrixParam;
@@ -27,6 +27,8 @@ 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.syncope.common.to.BulkAction;
import org.apache.syncope.common.to.BulkActionRes;
@@ -37,6 +39,8 @@ import org.apache.syncope.common.to.Reso
import org.apache.syncope.common.types.AttributableType;
@Path("resources")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface ResourceService {
/**
@@ -49,7 +53,7 @@ public interface ResourceService {
/**
* @param resourceTO Resource to be created
- * @return Response containing URI location for created resource
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created report
*/
@POST
Response create(ResourceTO resourceTO);
@@ -77,7 +81,7 @@ public interface ResourceService {
*/
@GET
@Path("propagationActionsClasses")
- Set<PropagationActionClassTO> getPropagationActionsClasses();
+ List<PropagationActionClassTO> getPropagationActionsClasses();
/**
* @return Returns list of all Resources
@@ -110,15 +114,10 @@ public interface ResourceService {
@POST
@Path("bulk")
- BulkActionRes bulkAction(BulkAction bulkAction);
+ BulkActionRes bulk(BulkAction bulkAction);
- @PUT
- @Path("{resourceName}/users")
- BulkActionRes usersBulkAssociationAction(
- @PathParam("resourceName") String resourceName, BulkAssociationAction bulkAction);
-
- @PUT
- @Path("{resourceName}/roles")
- BulkActionRes rolesBulkAssociationAction(
- @PathParam("resourceName") String resourceName, BulkAssociationAction bulkAction);
+ @POST
+ @Path("{resourceName}/bulkAssociation/{type}")
+ BulkActionRes bulkAssociation(@PathParam("resourceName") String resourceName,
+ BulkAssociationAction bulkAssociationAction, @PathParam("type") AttributableType type);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java Wed Oct 30 11:26:19 2013
@@ -19,21 +19,27 @@
package org.apache.syncope.common.services;
import java.util.List;
+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.syncope.common.search.NodeCond;
import org.apache.syncope.common.mod.RoleMod;
-import org.apache.syncope.common.to.PropagationTargetsTO;
+import org.apache.syncope.common.to.ResourceNameTO;
import org.apache.syncope.common.to.RoleTO;
+import org.apache.syncope.common.types.ResourceAssociationActionType;
@Path("roles")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface RoleService {
/**
@@ -53,19 +59,20 @@ public interface RoleService {
/**
* @param roleTO Role to be created
- * @return Response containing URI location for created role, as well as the role itself enriched with propagation
- * status information
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created role as well as the role itself
+ * enriched with propagation status information, as <tt>Entity</tt>
*/
@POST
Response create(RoleTO roleTO);
/**
* @param roleId ID of role to be deleted
- * @return Returns deleted role, enriched with propagation status information
+ * @return <tt>Response</tt> object featuring the deleted role enriched with propagation status information,
+ * as <tt>Entity</tt>
*/
@DELETE
@Path("{roleId}")
- RoleTO delete(@PathParam("roleId") Long roleId);
+ Response delete(@PathParam("roleId") Long roleId);
/**
* @return Returns list of all knwon roles
@@ -100,7 +107,7 @@ public interface RoleService {
/**
* @param searchCondition Filter condition for role list
* @return Returns list of roles with matching filter conditions
- * @throws InvalidSearchConditionException
+ * @throws InvalidSearchConditionException if given search condition is not valid
*/
@POST
@Path("search")
@@ -111,7 +118,7 @@ public interface RoleService {
* @param page Page of roles in relation to size parameter
* @param size Number of roles to be displayed per page
* @return Returns paginated list of roles with matching filter conditions
- * @throws InvalidSearchConditionException
+ * @throws InvalidSearchConditionException if given search condition is not valid
*/
@POST
@Path("search")
@@ -121,7 +128,7 @@ public interface RoleService {
/**
* @param searchCondition Filter condition for role list
* @return Returns number of roles matching provided filter conditions
- * @throws InvalidSearchConditionException
+ * @throws InvalidSearchConditionException if given search condition is not valid
*/
@POST
@Path("search/count")
@@ -136,47 +143,29 @@ public interface RoleService {
*/
@GET
@Path("{roleId}/own")
- RoleTO selfRead(@PathParam("roleId") Long roleId);
+ RoleTO readSelf(@PathParam("roleId") Long roleId);
/**
* @param roleId ID of role to be updated
* @param roleMod Role object containing list of changes to be applied for selected role
- * @return Returns updated role, merged from existing role and provided roleMod
+ * @return <tt>Response</tt> object featuring the updated role enriched with propagation status information,
+ * as <tt>Entity</tt>
*/
@POST
@Path("{roleId}")
- RoleTO update(@PathParam("roleId") Long roleId, RoleMod roleMod);
+ Response update(@PathParam("roleId") Long roleId, RoleMod roleMod);
/**
- * Unlinks role and the given external resources specified by <tt>propagationTargetsTO</tt> parameter.
+ * Executes resource-related operations on given role.
*
* @param roleId role id.
- * @param propagationTargetsTO resource names.
- * @return updated role.
+ * @param type resource association action type
+ * @param resourceNames external resources to be used for propagation-related operations
+ * @return <tt>Response</tt> object featuring the updated role enriched with propagation status information,
+ * as <tt>Entity</tt>
*/
@POST
- @Path("{roleId}/unlink")
- RoleTO unlink(@PathParam("roleId") Long roleId, PropagationTargetsTO propagationTargetsTO);
-
- /**
- * Unassigns resources to the given role (performs unlink + de-provision).
- *
- * @param roleId role id.
- * @param propagationTargetsTO resources to be unassigned.
- * @return updated role.
- */
- @POST
- @Path("{roleId}/unassign")
- RoleTO unassign(@PathParam("roleId") Long roleId, PropagationTargetsTO propagationTargetsTO);
-
- /**
- * De-provision role from the given resources without unlinking.
- *
- * @param roleId role id of the role to be de-provisioned.
- * @param propagationTargetsTO resource names.
- * @return updated role.
- */
- @POST
- @Path("{roleId}/deprovision")
- RoleTO deprovision(@PathParam("roleId") Long roleId, PropagationTargetsTO propagationTargetsTO);
-}
\ No newline at end of file
+ @Path("{roleId}/associate/{type}")
+ Response associate(@PathParam("roleId") Long roleId, @PathParam("type") ResourceAssociationActionType type,
+ List<ResourceNameTO> resourceNames);
+}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java Wed Oct 30 11:26:19 2013
@@ -19,25 +19,31 @@
package org.apache.syncope.common.services;
import java.util.List;
+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.syncope.common.to.AbstractSchemaTO;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.SchemaType;
@Path("schemas/{kind}/{type}")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface SchemaService {
/**
+ * @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 Response containing URI location for created resource.
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created schema
*/
@POST
<T extends AbstractSchemaTO> Response create(@PathParam("kind") AttributableType attrType,
@@ -45,6 +51,7 @@ public interface SchemaService {
/**
* @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
@@ -53,6 +60,7 @@ public interface SchemaService {
@PathParam("name") String schemaName);
/**
+ * @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
@@ -62,6 +70,7 @@ public interface SchemaService {
@PathParam("kind") AttributableType attrType, @PathParam("type") SchemaType schemaType);
/**
+ * @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
@@ -73,6 +82,7 @@ public interface SchemaService {
@PathParam("type") SchemaType schemaType, @PathParam("name") String schemaName);
/**
+ * @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
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java Wed Oct 30 11:26:19 2013
@@ -19,16 +19,19 @@
package org.apache.syncope.common.services;
import java.util.List;
-import java.util.Set;
+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.syncope.common.to.BulkAction;
import org.apache.syncope.common.to.BulkActionRes;
@@ -42,6 +45,8 @@ import org.apache.syncope.common.to.Sche
import org.apache.syncope.common.types.TaskType;
@Path("tasks")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface TaskService {
/**
@@ -49,13 +54,13 @@ public interface TaskService {
* @return Returns number of tasks with matching type
*/
@GET
- @Path("{type}/count")
- int count(@PathParam("type") TaskType taskType);
+ @Path("count")
+ int count(@MatrixParam("type") TaskType taskType);
/**
* @param taskTO Task to be created
* @param <T> type of taskTO
- * @return Response containing URI location for created resource
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created task
*/
@POST
<T extends SchedTaskTO> Response create(T taskTO);
@@ -88,14 +93,14 @@ public interface TaskService {
*/
@GET
@Path("jobClasses")
- Set<JobClassTO> getJobClasses();
+ List<JobClassTO> getJobClasses();
/**
* @return Returns list of SyncActionClasses
*/
@GET
@Path("syncActionsClasses")
- Set<SyncActionClassTO> getSyncActionsClasses();
+ List<SyncActionClassTO> getSyncActionsClasses();
/**
* @param taskType Type of tasks to be listed
@@ -103,8 +108,7 @@ public interface TaskService {
* @return Returns list of tasks with matching type
*/
@GET
- @Path("{type}/list")
- <T extends AbstractTaskTO> List<T> list(@PathParam("type") TaskType taskType);
+ <T extends AbstractTaskTO> List<T> list(@MatrixParam("type") TaskType taskType);
/**
* @param taskType Type of tasks to be listed
@@ -114,8 +118,7 @@ public interface TaskService {
* @return Returns paginated list of task with matching type
*/
@GET
- @Path("{type}/list")
- <T extends AbstractTaskTO> List<T> list(@PathParam("type") TaskType taskType,
+ <T extends AbstractTaskTO> List<T> list(@MatrixParam("type") TaskType taskType,
@QueryParam("page") int page, @QueryParam("size") @DefaultValue("25") int size);
/**
@@ -153,5 +156,5 @@ public interface TaskService {
@POST
@Path("bulk")
- BulkActionRes bulkAction(BulkAction bulkAction);
+ BulkActionRes bulk(BulkAction bulkAction);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java Wed Oct 30 11:26:19 2013
@@ -19,45 +19,39 @@
package org.apache.syncope.common.services;
import java.util.List;
+import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
+import javax.ws.rs.MatrixParam;
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.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.syncope.common.mod.UserMod;
import org.apache.syncope.common.to.UserRequestTO;
import org.apache.syncope.common.to.UserTO;
-@Path("requests/user")
+@Path("userrequests")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface UserRequestService {
- public static final String SYNCOPE_CREATE_ALLOWED = "Syncope-Create-Allowed";
-
/**
- * This method is similar to {@link #isCreateAllowed()}, but follows RESTful best practices.
- *
- * @return Response contains special syncope HTTP header (SYNCOPE_CREATE_ALLOWED), indicating if user is allowed to
+ * @return Response contains special syncope HTTP header indicating if user is allowed to
* make a create UserRequest
+ * @see org.apache.syncope.common.SyncopeConstants.REST_USER_REQUEST_CREATE_ALLOWED
*/
@OPTIONS
Response getOptions();
/**
- * This method is similar to {@link #getOptions()}, but without following RESTful best practices.
- *
- * @return Returns true, if user is allowed to make user create requests
- */
- @GET
- @Path("create/allowed")
- boolean isCreateAllowed();
-
- /**
* @param userRequestTO Request for user to be created
- * @return Response containing URI location for created resource
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created user request
*/
@POST
Response create(UserRequestTO userRequestTO);
@@ -66,15 +60,14 @@ public interface UserRequestService {
* @return Returns list of all UserRequests.
*/
@GET
- @Path("executed")
List<UserRequestTO> list();
/**
+ * @param username user name
* @return Returns list of all UserRequests of the given user.
*/
@GET
- @Path("filter/{username}")
- List<UserRequestTO> listByUsername(@PathParam("username") String username);
+ List<UserRequestTO> listByUsername(@MatrixParam("username") String username);
/**
* @param requestId ID of UserRequest to be read
@@ -96,14 +89,14 @@ public interface UserRequestService {
UserRequestTO claim(@PathParam("requestId") Long requestId);
@POST
- @Path("create/execute/{requestId}")
+ @Path("execute/create/{requestId}")
UserTO executeCreate(@PathParam("requestId") Long requestId, UserTO reviewed);
@POST
- @Path("update/execute/{requestId}")
+ @Path("execute/update/{requestId}")
UserTO executeUpdate(@PathParam("requestId") Long requestId, UserMod changes);
- @DELETE
- @Path("delete/execute/{requestId}")
+ @POST
+ @Path("execute/delete/{requestId}")
UserTO executeDelete(@PathParam("requestId") Long requestId);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java Wed Oct 30 11:26:19 2013
@@ -23,8 +23,8 @@ 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.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
@@ -34,19 +34,28 @@ 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.StatusMod;
import org.apache.syncope.common.mod.UserMod;
import org.apache.syncope.common.search.NodeCond;
import org.apache.syncope.common.to.BulkAction;
import org.apache.syncope.common.to.BulkActionRes;
-import org.apache.syncope.common.to.PropagationRequestTO;
-import org.apache.syncope.common.to.PropagationTargetsTO;
+import org.apache.syncope.common.to.ResourceNameTO;
import org.apache.syncope.common.to.UserTO;
+import org.apache.syncope.common.types.ResourceAssociationActionType;
@Path("users")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface UserService {
+ @OPTIONS
+ @Path("{userId}/username")
+ Response getUsername(@PathParam("userId") Long userId);
+
+ @OPTIONS
+ @Path("{username}/userId")
+ Response getUserId(@PathParam("username") String username);
+
/**
* Reads the user matching the provided userId.
*
@@ -62,31 +71,17 @@ public interface UserService {
UserTO read(@Description("id of user to be read") @PathParam("userId") Long userId);
/**
- * Returns a list of all existing users.
- *
- * @return A list of all existing users.
- */
- @GET
- @Descriptions({
- @Description(target = DocTarget.METHOD, value = "Returns a list of all existing users"),
- @Description(target = DocTarget.RETURN, value = "A list of all existing users")
- })
- List<UserTO> list();
-
- /**
- * Returns a paged list of all existing users.
+ * Reads data about the authenticated user.
*
- * @param page result page number
- * @param size number of entries per page
- * @return A list of all existing users matching page/size conditions.
+ * @return Data about the authenticated user
*/
@GET
+ @Path("self")
@Descriptions({
- @Description(target = DocTarget.METHOD, value = "Returns a paged list of all existing users"),
- @Description(target = DocTarget.RETURN, value = "A list of all existing users matching page/size conditions")
+ @Description(target = DocTarget.METHOD, value = "Reads data about the authenticated user"),
+ @Description(target = DocTarget.RETURN, value = "Data about the authenticated user")
})
- List<UserTO> list(@Description("result page number") @QueryParam("page") int page,
- @Description("number of entries per page") @QueryParam("size") @DefaultValue("25") int size);
+ UserTO readSelf();
/**
* Returns the number of existing users.
@@ -102,30 +97,49 @@ public interface UserService {
int count();
/**
- * Reads the user matching the provided username.
+ * Returns a list of all existing users.
*
- * @param username username of user to be read
- * @return User matching the provided username
+ * @return A list of all existing users.
*/
@GET
@Descriptions({
- @Description(target = DocTarget.METHOD, value = "Reads the user matching the provided username"),
- @Description(target = DocTarget.RETURN, value = "User matching the provided username")
+ @Description(target = DocTarget.METHOD, value = "Returns a list of all existing users"),
+ @Description(target = DocTarget.RETURN, value = "A list of all existing users")
})
- UserTO read(@Description("username of user to be read") @QueryParam("username") String username);
+ List<UserTO> list();
/**
- * Reads data about the authenticated user.
+ * Returns a paged list of all existing users.
*
- * @return Data about the authenticated user
+ * @param page result page number
+ * @param size number of entries per page
+ * @return A list of all existing users matching page/size conditions.
*/
@GET
- @Path("self")
@Descriptions({
- @Description(target = DocTarget.METHOD, value = "Reads the user matching the provided username"),
- @Description(target = DocTarget.RETURN, value = "Data about the authenticated user")
+ @Description(target = DocTarget.METHOD, value = "Returns a paged list of all existing users"),
+ @Description(target = DocTarget.RETURN, value = "A list of all existing users matching page/size conditions")
})
- UserTO readSelf();
+ List<UserTO> list(@Description("result page number") @QueryParam("page") int page,
+ @Description("number of entries per page") @QueryParam("size") @DefaultValue("25") int size);
+
+ /**
+ * Returns the number of users matching the provided search condition.
+ *
+ * @param searchCondition search condition
+ * @return Number of users matching the provided search condition
+ * @throws InvalidSearchConditionException if provided search condition is not valid
+ */
+ @POST
+ @Path("search/count")
+ @Descriptions({
+ @Description(target = DocTarget.METHOD,
+ value = "Returns the number of users matching the provided search condition"),
+ @Description(target = DocTarget.RETURN,
+ value = "Number of users matching the provided search condition")
+ })
+ int searchCount(@Description("search condition") NodeCond searchCondition)
+ throws InvalidSearchConditionException;
/**
* Returns the list of users matching the given search condition.
@@ -167,28 +181,11 @@ public interface UserService {
throws InvalidSearchConditionException;
/**
- * Returns the number of users matching the provided search condition.
- *
- * @param searchCondition search condition
- * @return Number of users matching the provided search condition
- * @throws InvalidSearchConditionException if provided search condition is not valid
- */
- @POST
- @Path("search/count")
- @Descriptions({
- @Description(target = DocTarget.METHOD,
- value = "Returns the number of users matching the provided search condition"),
- @Description(target = DocTarget.RETURN,
- value = "Number of users matching the provided search condition")
- })
- int searchCount(@Description("search condition") NodeCond searchCondition)
- throws InvalidSearchConditionException;
-
- /**
* Creates a new user.
*
* @param userTO user to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created user
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created user as well as the user itself
+ * enriched with propagation status information, as <tt>Entity</tt>
*/
@POST
@Descriptions({
@@ -205,310 +202,86 @@ public interface UserService {
*
* @param userId id of user to be updated
* @param userMod modification to be applied to user matching the provided userId
- * @return Updated user.
+ * @return <tt>Response</tt> object featuring the updated user enriched with propagation status information,
+ * as <tt>Entity</tt>
*/
@POST
@Path("{userId}")
@Descriptions({
@Description(target = DocTarget.METHOD, value = "Updates user matching the provided userId"),
- @Description(target = DocTarget.RETURN, value = "Updated user")
+ @Description(target = DocTarget.RETURN, value = "<tt>Response</tt> object featuring the updated user enriched "
+ + "with propagation status information, as <tt>Entity</tt>")
})
- UserTO update(@Description("id of user to be updated") @PathParam("userId") Long userId,
+ Response update(@Description("id of user to be updated") @PathParam("userId") Long userId,
@Description("modification to be applied to user matching the provided userId") UserMod userMod);
/**
- * Deletes user matching provided userId.
- *
- * @param userId id of user to be deleted
- * @return Deleted user
- */
- @DELETE
- @Path("{userId}")
- @Descriptions({
- @Description(target = DocTarget.METHOD, value = "Deletes user matching provided userId"),
- @Description(target = DocTarget.RETURN, value = "Deleted user")
- })
- UserTO delete(@Description("id of user to be deleted") @PathParam("userId") Long userId);
-
- /**
- * Executes the provided bulk action.
- *
- * @param bulkAction list of <username, action> pairs
- * @return Bulk action result.
- */
- @POST
- @Path("bulk")
- @Descriptions({
- @Description(target = DocTarget.METHOD, value = "Executes the provided bulk action"),
- @Description(target = DocTarget.RETURN, value = "Bulk action result")
- })
- BulkActionRes bulkAction(@Description("list of <username, action> pairs") BulkAction bulkAction);
-
- /**
- * Activates user matching provided userId if provided token is valid.
- *
- * @param userId id of user to be activated
- * @param token validity token
- * @return Activated user
- */
- @POST
- @Path("{userId}/status/activate")
- @Descriptions({
- @Description(target = DocTarget.METHOD,
- value = "Activates user matching provided userId if provided token is valid"),
- @Description(target = DocTarget.RETURN, value = "Activated user")
- })
- UserTO activate(@Description("id of user to be activated") @PathParam("userId") Long userId,
- @Description("validity token") @QueryParam("token") String token);
-
- /**
- * Activates user matching provided userId if provided token is valid and propagates this update
- * only to resources contained in the propagation request.
- *
- * @param userId id of user to be activated
- * @param token validity token
- * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
- * @return Activated user
- */
- @POST
- @Path("{userId}/status/activate/propagation")
- @Descriptions({
- @Description(target = DocTarget.METHOD,
- value = "Activates user matching provided userId if provided token is valid and propagates "
- + "this update only to resources contained in the propagation request."),
- @Description(target = DocTarget.RETURN, value = "Activated user")
- })
- UserTO activate(@Description("id of user to be activated") @PathParam("userId") Long userId,
- @Description("validity token") @QueryParam("token") String token,
- @Description("propagation request on internal storage or on 0+ external resources"
- ) PropagationRequestTO propagationRequestTO);
-
- /**
- * Activates user matching provided username if provided token is valid.
- *
- * @param username username of user to be activated
- * @param token validity token
- * @return Activated user
- */
- @POST
- @Path("activateByUsername/{username}")
- @Descriptions({
- @Description(target = DocTarget.METHOD,
- value = "Activates user matching provided username if provided token is valid"),
- @Description(target = DocTarget.RETURN, value = "Activated user")
- })
- UserTO activateByUsername(@Description("username of user to be activated") @PathParam("username") String username,
- @Description("validity token") @QueryParam("token") String token);
-
- /**
- * Activates user matching provided username if provided token is valid and propagates this update
- * only to resources contained in the propagation request.
- *
- * @param username username of user to be activated
- * @param token validity token
- * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
- * @return Activated user
- */
- @POST
- @Path("activateByUsername/{username}/propagation")
- @Descriptions({
- @Description(target = DocTarget.METHOD,
- value = "Activates user matching provided username if provided token is valid and propagates "
- + "this update only to resources contained in the propagation request."),
- @Description(target = DocTarget.RETURN, value = "Activated user")
- })
- UserTO activateByUsername(@Description("username of user to be activated") @PathParam("username") String username,
- @Description("validity token") @QueryParam("token") String token,
- @Description("propagation request on internal storage or on 0+ external resources"
- ) PropagationRequestTO propagationRequestTO);
-
- /**
- * Suspends user matching provided userId.
- *
- * @param userId id of user to be suspended
- * @return Suspended user
- */
- @POST
- @Path("{userId}/status/suspend")
- @Descriptions({
- @Description(target = DocTarget.METHOD, value = "Suspends user matching provided userId"),
- @Description(target = DocTarget.RETURN, value = "Suspended user")
- })
- UserTO suspend(@Description("id of user to be suspended") @PathParam("userId") Long userId);
-
- /**
- * Suspend user matching provided userId and propagates this update only to resources contained in the
- * propagation request.
- *
- * @param userId id of user to be activated
- * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
- * @return Suspended user
- */
- @POST
- @Path("{userId}/status/suspend/propagation")
- @Descriptions({
- @Description(target = DocTarget.METHOD, value = "Suspend user matching provided userId and propagates this "
- + "update only to resources contained in the propagation request"),
- @Description(target = DocTarget.RETURN, value = "Suspended user")
- })
- UserTO suspend(@Description("id of user to be suspended") @PathParam("userId") Long userId,
- @Description("propagation request on internal storage or on 0+ external resources"
- ) PropagationRequestTO propagationRequestTO);
-
- /**
- * Suspends user matching provided username.
+ * Performs a status update on user matching provided userId.
*
- * @param username username of user to be suspended
- * @return Suspended user
+ * @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,
+ * as <tt>Entity</tt>
*/
@POST
- @Path("suspendByUsername/{username}")
+ @Path("{userId}/status")
@Descriptions({
- @Description(target = DocTarget.METHOD, value = "Suspends user matching provided username"),
- @Description(target = DocTarget.RETURN, value = "Suspended user")
+ @Description(target = DocTarget.METHOD, value = "Performs a status update on user matching provided userId"),
+ @Description(target = DocTarget.RETURN, value = "<tt>Response</tt> object featuring the updated user enriched "
+ + "with propagation status information, as <tt>Entity</tt>")
})
- UserTO suspendByUsername(@Description("username of user to be suspended") @PathParam("username") String username);
+ Response status(@Description("id of user to be subjected to status update") @PathParam("userId") Long userId,
+ @Description("status update details") StatusMod statusMod);
/**
- * Suspend user matching provided username and propagates this update only to resources contained in the
- * propagation request.
- *
- * @param username username of user to be activated
- * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
- * @return Suspended user
- */
- @POST
- @Path("suspendByUsername/{username}/propagation")
- @Descriptions({
- @Description(target = DocTarget.METHOD, value = "Suspend user matching provided username and propagates this "
- + "update only to resources contained in the propagation request"),
- @Description(target = DocTarget.RETURN, value = "Suspended user")
- })
- UserTO suspendByUsername(@Description("username of user to be suspended") @PathParam("username") String username,
- @Description("propagation request on internal storage or on 0+ external resources"
- ) PropagationRequestTO propagationRequestTO);
-
- /**
- * Reactivates user matching provided userId.
- *
- * @param userId id of user to be reactivated
- * @return Reactivated user
- */
- @POST
- @Path("{userId}/status/reactivate")
- @Descriptions({
- @Description(target = DocTarget.METHOD, value = "Reactivates user matching provided userId"),
- @Description(target = DocTarget.RETURN, value = "Reactivated user")
- })
- UserTO reactivate(@Description("id of user to be reactivated") @PathParam("userId") Long userId);
-
- /**
- * Reactivates user matching provided userId and propagates this update only to resources contained in the
- * propagation request.
- *
- * @param userId id of user to be activated
- * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
- * @return Reactivated user
- */
- @POST
- @Path("{userId}/status/reactivate/propagation")
- @Descriptions({
- @Description(target = DocTarget.METHOD,
- value = "Reactivates user matching provided userId and propagates this update only to resources "
- + "contained in the propagation request"),
- @Description(target = DocTarget.RETURN, value = "Reactivated user")
- })
- UserTO reactivate(@Description("id of user to be reactivated") @PathParam("userId") Long userId,
- @Description("propagation request on internal storage or on 0+ external resources"
- ) PropagationRequestTO propagationRequestTO);
-
- /**
- * Reactivates user matching provided username.
+ * Deletes user matching provided userId.
*
- * @param username username of user to be reactivated
- * @return Reactivated user
+ * @param userId id of user to be deleted
+ * @return <tt>Response</tt> object featuring the deleted user enriched with propagation status information,
+ * as <tt>Entity</tt>
*/
- @POST
- @Path("reactivateByUsername/{username}")
+ @DELETE
+ @Path("{userId}")
@Descriptions({
- @Description(target = DocTarget.METHOD, value = "Reactivates user matching provided username"),
- @Description(target = DocTarget.RETURN, value = "Reactivated user")
+ @Description(target = DocTarget.METHOD, value = "Deletes user matching provided userId"),
+ @Description(target = DocTarget.RETURN, value = "<tt>Response</tt> object featuring the deleted user enriched "
+ + "with propagation status information, as <tt>Entity</tt>")
})
- UserTO reactivateByUsername(
- @Description("username of user to be reactivated") @PathParam("username") String username);
+ Response delete(@Description("id of user to be deleted") @PathParam("userId") Long userId);
/**
- * Reactivates user matching provided username and propagates this update only to resources contained in the
- * propagation request.
+ * Executes resource-related operations on given user.
*
- * @param username username of user to be activated
- * @param propagationRequestTO propagation request on internal storage or on 0+ external resources
- * @return Reactivated user
+ * @param userId user id.
+ * @param type resource association action type
+ * @param resourceNames external resources to be used for propagation-related operations
+ * @return <tt>Response</tt> object featuring the updated user enriched with propagation status information,
+ * as <tt>Entity</tt>
*/
@POST
- @Path("reactivateByUsername/{username}/propagation")
+ @Path("{userId}/associate/{type}")
@Descriptions({
- @Description(target = DocTarget.METHOD,
- value = "Reactivates user matching provided username and propagates this update only to resources "
- + "contained in the propagation request"),
- @Description(target = DocTarget.RETURN, value = "Reactivated user")
+ @Description(target = DocTarget.METHOD, value = "Executes resource-related operations on given user"),
+ @Description(target = DocTarget.RETURN, value = "<tt>Response</tt> object featuring the updated user enriched "
+ + "with propagation status information, as <tt>Entity</tt>")
})
- UserTO reactivateByUsername(
- @Description("username of user to be reactivated") @PathParam("username") String username,
- @Description("propagation request on internal storage or on 0+ external resources"
- ) PropagationRequestTO propagationRequestTO);
-
- /**
- * Unlinks user from the given external resources.
- *
- * @param userId id of user to be unlinked
- * @param propagationTargetsTO external resources to be used for propagation-related operations
- * @return Updated user
- */
- @PUT
- @Path("{userId}/unlink")
- @Descriptions({
- @Description(target = DocTarget.METHOD, value = "Unlinks user from the given external resources"),
- @Description(target = DocTarget.RETURN, value = "Updated user")
- })
- UserTO unlink(@Description("id of user to be unlinked") @PathParam("userId") Long userId,
+ Response associate(@Description("user id") @PathParam("userId") Long userId,
+ @Description("resource association action type") @PathParam("type") ResourceAssociationActionType type,
@Description("external resources to be used for propagation-related operations"
- ) PropagationTargetsTO propagationTargetsTO);
+ ) List<ResourceNameTO> resourceNames);
/**
- * De-provision user from the given external resources without unlinking.
- *
- * @param userId id of user to be de-provisioned
- * @param propagationTargetsTO external resources to be used for propagation-related operations
- * @return Updated user
- */
- @PUT
- @Path("{userId}/deprovision")
- @Descriptions({
- @Description(target = DocTarget.METHOD,
- value = "De-provision user from the given external resources without unlinking"),
- @Description(target = DocTarget.RETURN, value = "Updated user")
- })
- UserTO deprovision(@Description("id of user to be de-provisioned") @PathParam("userId") Long userId,
- @Description("De-provision user from the given external resources without unlinking"
- ) PropagationTargetsTO propagationTargetsTO);
-
- /**
- * Unassigns (unlink + de-provision) user from the given external resources.
+ * Executes the provided bulk action.
*
- * @param userId id of user to be unassigned
- * @param propagationTargetsTO external resources to be used for propagation-related operations
- * @return Updated user
+ * @param bulkAction list of <username, action> pairs
+ * @return Bulk action result.
*/
- @PUT
- @Path("{userId}/unassign")
+ @POST
+ @Path("bulk")
@Descriptions({
- @Description(target = DocTarget.METHOD,
- value = "Unassigns (unlink + de-provision) user from the given external resources"),
- @Description(target = DocTarget.RETURN, value = "Updated user")
+ @Description(target = DocTarget.METHOD, value = "Executes the provided bulk action"),
+ @Description(target = DocTarget.RETURN, value = "Bulk action result")
})
- UserTO unassign(@Description("id of user to be unassigned") @PathParam("userId") Long userId,
- @Description("De-provision user from the given external resources without unlinking"
- ) PropagationTargetsTO propagationTargetsTO);
+ BulkActionRes bulk(@Description("list of <username, action> pairs") BulkAction bulkAction);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserWorkflowService.java Wed Oct 30 11:26:19 2013
@@ -19,16 +19,21 @@
package org.apache.syncope.common.services;
import java.util.List;
+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;
@Path("userworkflow")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface UserWorkflowService {
@POST
@@ -53,5 +58,5 @@ public interface UserWorkflowService {
@POST
@Path("tasks/{taskId}/execute")
- UserTO executeWorkflow(@PathParam("taskId") String taskId, UserTO userTO);
+ UserTO executeTask(@PathParam("taskId") String taskId, UserTO userTO);
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java?rev=1537047&r1=1537046&r2=1537047&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java Wed Oct 30 11:26:19 2013
@@ -18,16 +18,21 @@
*/
package org.apache.syncope.common.services;
+import javax.ws.rs.Consumes;
import org.apache.syncope.common.types.WorkflowTasks;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
import org.apache.syncope.common.to.WorkflowDefinitionTO;
import org.apache.syncope.common.types.AttributableType;
@Path("workflows/{kind}")
+@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface WorkflowService {
/**