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 2014/01/03 14:43:24 UTC
svn commit: r1555086 [1/3] - in /syncope/trunk: ./ common/
common/src/main/java/org/apache/syncope/common/mod/
common/src/main/java/org/apache/syncope/common/reqres/
common/src/main/java/org/apache/syncope/common/services/
common/src/main/java/org/apac...
Author: ilgrosso
Date: Fri Jan 3 13:43:23 2014
New Revision: 1555086
URL: http://svn.apache.org/r1555086
Log:
[SYNCOPE-151] Completing all javadocs according to latest modifications in CXF-5353
Added:
syncope/trunk/common/src/main/java/org/apache/syncope/common/reqres/package-info.java (with props)
syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ResourceDeassociationActionType.java
- copied, changed from r1555020, syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ResourceDeAssociationActionType.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/SubjectId.java (with props)
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/package-info.java (with props)
syncope/trunk/core/src/test/resources/restTestEnv.xml (with props)
Removed:
syncope/trunk/common/src/main/java/org/apache/syncope/common/reqres/BulkAssociationAction.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/types/ResourceDeAssociationActionType.java
Modified:
syncope/trunk/common/pom.xml
syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/ResourceAssociationMod.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/JAXRSService.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/UserSelfService.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/util/CollectionWrapper.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/AbstractWrappable.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/CorrelationRuleClass.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/EntitlementTO.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/JobClass.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/MailTemplate.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/PropagationActionClass.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/ReportletConfClass.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/ResourceName.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/SyncActionClass.java
syncope/trunk/common/src/main/java/org/apache/syncope/common/wrap/Validator.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/ProvisioningModalPage.java
syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/ReportRestClient.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/UserRestClient.java
syncope/trunk/core/pom.xml
syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/UserWorkflowController.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/UserServiceImpl.java
syncope/trunk/core/src/main/java/org/apache/syncope/core/services/UserWorkflowServiceImpl.java
syncope/trunk/core/src/main/resources/restContext.xml
syncope/trunk/core/src/main/resources/wadl2html/schema.xsl
syncope/trunk/core/src/test/java/org/apache/syncope/core/notification/NotificationTest.java
syncope/trunk/core/src/test/java/org/apache/syncope/core/persistence/dao/AbstractDAOTest.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/UserTestITCase.java
syncope/trunk/pom.xml
Modified: syncope/trunk/common/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/common/pom.xml?rev=1555086&r1=1555085&r2=1555086&view=diff
==============================================================================
--- syncope/trunk/common/pom.xml (original)
+++ syncope/trunk/common/pom.xml Fri Jan 3 13:43:23 2014
@@ -88,6 +88,19 @@ under the License.
<build>
<plugins>
+ <!-- Generating javadoc JAR artifact for usage with CXF's WADL generator -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/ResourceAssociationMod.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/ResourceAssociationMod.java?rev=1555086&r1=1555085&r2=1555086&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/ResourceAssociationMod.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/mod/ResourceAssociationMod.java Fri Jan 3 13:43:23 2014
@@ -18,8 +18,11 @@
*/
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;
@@ -41,7 +44,7 @@ public class ResourceAssociationMod exte
/**
* Target external resources.
*/
- private List<ResourceName> targetResources;
+ private final List<ResourceName> targetResources = new ArrayList<ResourceName>();
/**
* Indicate the willing to change password on target external resources.
@@ -53,12 +56,9 @@ public class ResourceAssociationMod exte
*/
private String password;
- public ResourceAssociationMod() {
- targetResources = new ArrayList<ResourceName>();
- changePwd = false;
- password = null;
- }
-
+ @XmlElementWrapper(name = "resources")
+ @XmlElement(name = "resource")
+ @JsonProperty("resources")
public List<ResourceName> getTargetResources() {
return targetResources;
}
Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/reqres/package-info.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/reqres/package-info.java?rev=1555086&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/reqres/package-info.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/reqres/package-info.java Fri Jan 3 13:43:23 2014
@@ -0,0 +1,23 @@
+/*
+ * 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.reqres;
+
+import javax.xml.bind.annotation.XmlSchema;
+import org.apache.syncope.common.SyncopeConstants;
Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/reqres/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/reqres/package-info.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: syncope/trunk/common/src/main/java/org/apache/syncope/common/reqres/package-info.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
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=1555086&r1=1555085&r2=1555086&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 Fri Jan 3 13:43:23 2014
@@ -29,25 +29,22 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.model.wadl.Description;
+import org.apache.cxf.jaxrs.model.wadl.Descriptions;
+import org.apache.cxf.jaxrs.model.wadl.DocTarget;
import org.apache.syncope.common.to.ConfigurationTO;
import org.apache.syncope.common.wrap.MailTemplate;
import org.apache.syncope.common.wrap.Validator;
+/**
+ * REST operations for configuration.
+ */
@Path("configurations")
public interface ConfigurationService extends JAXRSService {
/**
- * Creates a new configuration element.
+ * Exports internal storage content as downloadable XML file.
*
- * @param configurationTO Configuration to be stored.
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created configuration
- */
- @POST
- @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- Response create(ConfigurationTO configurationTO);
-
- /**
* @return internal storage content as downloadable XML file
*/
@GET
@@ -55,15 +52,9 @@ public interface ConfigurationService ex
Response export();
/**
- * @param key Deletes configuration with matching key.
- */
- @DELETE
- @Path("{key}")
- @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- void delete(@PathParam("key") String key);
-
- /**
- * @return Returns a list of known mail-template names.
+ * Returns a list of known mail-template names.
+ *
+ * @return a list of known mail-template names
*/
@GET
@Path("mailTemplates")
@@ -71,7 +62,9 @@ public interface ConfigurationService ex
List<MailTemplate> getMailTemplates();
/**
- * @return Returns a list of known validator names.
+ * Returns a list of known validator names.
+ *
+ * @return a list of known validator names
*/
@GET
@Path("validators")
@@ -79,27 +72,58 @@ public interface ConfigurationService ex
List<Validator> getValidators();
/**
- * @return list of all configuration elements.
+ * Returns configuration parameter with matching key.
+ *
+ * @param key identifier of configuration to be read
+ * @return configuration parameter with matching key
*/
@GET
+ @Path("{key}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<ConfigurationTO> list();
+ ConfigurationTO read(@PathParam("key") String key);
/**
- * @param key Identifier of configuration to be read.
- * @return configuration element with matching key.
+ * Returns list of all configuration parameters.
+ *
+ * @return list of all configuration parameters
*/
@GET
- @Path("{key}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
- ConfigurationTO read(@PathParam("key") String key);
+ List<ConfigurationTO> list();
+
+ /**
+ * Creates a new configuration parameter.
+ *
+ * @param configurationTO Configuration to be stored.
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created configuration
+ */
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>Location</tt> header of created configuration")
+ })
+ @POST
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ Response create(ConfigurationTO configurationTO);
/**
- * @param key Overwrites configuration element with matching key.
- * @param configurationTO New configuration
+ * Updates configuration parameter for the given key.
+ *
+ * @param key configuration parameter key
+ * @param configurationTO new configuration
*/
@PUT
@Path("{key}")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
void update(@PathParam("key") String key, ConfigurationTO configurationTO);
+
+ /**
+ * Deletes configuration with matching key.
+ *
+ * @param key configuration parameter key
+ */
+ @DELETE
+ @Path("{key}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ void delete(@PathParam("key") String key);
}
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=1555086&r1=1555085&r2=1555086&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 Fri Jan 3 13:43:23 2014
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.common.services;
-import org.apache.syncope.common.reqres.BulkAction;
-import org.apache.syncope.common.reqres.BulkActionResult;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -33,50 +31,49 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.model.wadl.Description;
+import org.apache.cxf.jaxrs.model.wadl.Descriptions;
+import org.apache.cxf.jaxrs.model.wadl.DocTarget;
+
+import org.apache.syncope.common.reqres.BulkAction;
+import org.apache.syncope.common.reqres.BulkActionResult;
import org.apache.syncope.common.to.ConnBundleTO;
import org.apache.syncope.common.to.ConnIdObjectClassTO;
import org.apache.syncope.common.to.ConnInstanceTO;
import org.apache.syncope.common.to.SchemaTO;
import org.apache.syncope.common.types.ConnConfProperty;
+/**
+ * REST operations for connector bundles and instances.
+ */
@Path("connectors")
-@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface ConnectorService extends JAXRSService {
/**
- * Create a new connector instance.
+ * Returns available connector bundles with property keys in selected language.
*
- * @param connInstanceTO connector instance to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created connector instance
- */
- @POST
- Response create(ConnInstanceTO connInstanceTO);
-
- /**
- * @param connInstanceId connector instance id to be deleted
- */
- @DELETE
- @Path("{connInstanceId}")
- void delete(@PathParam("connInstanceId") Long connInstanceId);
-
- /**
* @param lang language to select property keys; default language is English
* @return available connector bundles with property keys in selected language
*/
@GET
@Path("bundles")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<ConnBundleTO> getBundles(@QueryParam("lang") String lang);
/**
+ * Returns configuration for given connector instance.
+ *
* @param connInstanceId connector instance id to read configuration from
- * @return configuration for selected connector instance
+ * @return configuration for given connector instance
*/
@GET
@Path("{connInstanceId}/configuration")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<ConnConfProperty> getConfigurationProperties(@PathParam("connInstanceId") Long connInstanceId);
/**
+ * Returns schema names for connector bundle matching the given connector instance id.
+ *
* @param connInstanceId connector instance id to be used for schema lookup
* @param connInstanceTO connector instance object to provide special configuration properties
* @param includeSpecial if set to true, special schema names (like '__PASSWORD__') will be included;
@@ -85,59 +82,100 @@ public interface ConnectorService extend
*/
@POST
@Path("{connInstanceId}/schemaNames")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<SchemaTO> getSchemaNames(@PathParam("connInstanceId") Long connInstanceId, ConnInstanceTO connInstanceTO,
@QueryParam("includeSpecial") @DefaultValue("false") boolean includeSpecial);
/**
+ * Returns supported object classes for connector bundle matching the given connector instance id.
+ *
* @param connInstanceId connector instance id to be used for schema lookup
* @param connInstanceTO connector instance object to provide special configuration properties
* @return supported object classes for connector bundle matching the given connector instance id
*/
@POST
@Path("{connInstanceId}/supportedObjectClasses")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<ConnIdObjectClassTO> getSupportedObjectClasses(@PathParam("connInstanceId") Long connInstanceId,
ConnInstanceTO connInstanceTO);
/**
- * @param lang language to select property keys, null for default (English).
- * An ISO 639 alpha-2 or alpha-3 language code, or a language subtag up to 8 characters in length. See the
- * java.util.Locale class description about valid language values.
- * @return list of all connector instances with property keys in the matching language
- * @see java.util.Locale
- */
- @GET
- List<ConnInstanceTO> list(@QueryParam("lang") String lang);
-
- /**
+ * Returns connector instance with matching id.
+ *
* @param connInstanceId connector instance id to be read
* @return connector instance with matching id
*/
@GET
@Path("{connInstanceId}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
ConnInstanceTO read(@PathParam("connInstanceId") Long connInstanceId);
/**
+ * Returns connector instance for matching resource.
+ *
* @param resourceName resource name to be used for connector lookup
* @return connector instance for matching resource
*/
@GET
@Path("byResource/{resourceName}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
ConnInstanceTO readByResource(@PathParam("resourceName") String resourceName);
/**
+ * @Returns a list of all connector instances with property keys in the matching language.
+ *
+ * @param lang language to select property keys, null for default (English).
+ * An ISO 639 alpha-2 or alpha-3 language code, or a language subtag up to 8 characters in length.
+ * @return list of all connector instances with property keys in the matching language
+ */
+ @GET
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ List<ConnInstanceTO> list(@QueryParam("lang") String lang);
+
+ /**
+ * Creates a new connector instance.
+ *
+ * @param connInstanceTO connector instance to be created
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created connector instance
+ */
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>Location</tt> header of created connector instance")
+ })
+ @POST
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ Response create(ConnInstanceTO connInstanceTO);
+
+ /**
+ * Updates the connector instance matching the provided id.
+ *
* @param connInstanceId connector instance id to be updated
* @param connInstaceTO connector instance to be stored
*/
@PUT
@Path("{connInstanceId}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
void update(@PathParam("connInstanceId") Long connInstanceId, ConnInstanceTO connInstaceTO);
/**
+ * Deletes the connector instance matching the provided id.
+ *
+ * @param connInstanceId connector instance id to be deleted
+ */
+ @DELETE
+ @Path("{connInstanceId}")
+ void delete(@PathParam("connInstanceId") Long connInstanceId);
+
+ /**
* @param connInstaceTO connector instance to be used for connection check
* @return true if connection could be established
*/
@POST
@Path("check")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
boolean check(ConnInstanceTO connInstaceTO);
/**
@@ -147,7 +185,15 @@ public interface ConnectorService extend
@Path("reload")
void reload();
+ /**
+ * Executes the provided bulk action.
+ *
+ * @param bulkAction list of connector instance ids against which the bulk action will be performed.
+ * @return Bulk action result
+ */
@POST
@Path("bulk")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
BulkActionResult bulk(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=1555086&r1=1555085&r2=1555086&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 Fri Jan 3 13:43:23 2014
@@ -19,7 +19,6 @@
package org.apache.syncope.common.services;
import java.util.List;
-import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@@ -28,21 +27,28 @@ import javax.ws.rs.core.MediaType;
import org.apache.syncope.common.wrap.EntitlementTO;
+/**
+ * REST operations for entitlements.
+ */
@Path("entitlements")
-@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface EntitlementService extends JAXRSService {
/**
- * @return Returns a collection of all known entitlements.
+ * Returns a list of all known entitlements.
+ *
+ * @return list of all known entitlements
*/
@GET
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<EntitlementTO> getAllEntitlements();
/**
- * @return Returns a collection of entitlements assigned to user making this request (Service Call).
+ * Returns a list of entitlements assigned to user making the current request.
+ *
+ * @return list of entitlements assigned to user making the current request
*/
@GET
@Path("own")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<EntitlementTO> getOwnEntitlements();
}
Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/JAXRSService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/JAXRSService.java?rev=1555086&r1=1555085&r2=1555086&view=diff
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/JAXRSService.java (original)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/JAXRSService.java Fri Jan 3 13:43:23 2014
@@ -20,20 +20,20 @@ package org.apache.syncope.common.servic
public interface JAXRSService {
- static final String PARAM_FIQL = "fiql";
+ final String PARAM_FIQL = "fiql";
- static final String PARAM_PAGE = "page";
+ final String PARAM_PAGE = "page";
- static final String DEFAULT_PARAM_PAGE = "1";
+ final String DEFAULT_PARAM_PAGE = "1";
- static final int DEFAULT_PARAM_PAGE_VALUE = Integer.valueOf(DEFAULT_PARAM_PAGE);
+ final int DEFAULT_PARAM_PAGE_VALUE = Integer.valueOf(DEFAULT_PARAM_PAGE);
- static final String PARAM_SIZE = "size";
+ final String PARAM_SIZE = "size";
- static final String DEFAULT_PARAM_SIZE = "25";
+ final String DEFAULT_PARAM_SIZE = "25";
- static final int DEFAULT_PARAM_SIZE_VALUE = Integer.valueOf(DEFAULT_PARAM_SIZE);
+ final int DEFAULT_PARAM_SIZE_VALUE = Integer.valueOf(DEFAULT_PARAM_SIZE);
- static final String PARAM_ORDERBY = "orderby";
+ final String PARAM_ORDERBY = "orderby";
}
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=1555086&r1=1555085&r2=1555086&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 Fri Jan 3 13:43:23 2014
@@ -19,8 +19,8 @@
package org.apache.syncope.common.services;
import java.util.List;
-import javax.ws.rs.Consumes;
+import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
@@ -28,51 +28,70 @@ 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.EventCategoryTO;
+import org.apache.syncope.common.to.EventCategoryTO;
import org.apache.syncope.common.to.LoggerTO;
import org.apache.syncope.common.types.LoggerType;
+/**
+ * REST operations for logging and auditing.
+ */
@Path("logger")
-@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface LoggerService extends JAXRSService {
/**
- * @param type LoggerType to be selected.
- * @param name Logger name to be deleted.
+ * Returns a list of all managed events in audit.
+ *
+ * @return list of all managed events in audit
*/
- @DELETE
- @Path("{type}/{name}")
- void delete(@PathParam("type") LoggerType type, @PathParam("name") String name);
+ @GET
+ @Path("events")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ List<EventCategoryTO> events();
/**
+ * Returns logger with matching type and name.
+ *
* @param type LoggerType to be selected.
- * @return List of logger with matching type.
+ * @param name Logger name to be read
+ * @return logger with matching type and name
*/
@GET
- @Path("{type}")
- List<LoggerTO> list(@PathParam("type") LoggerType type);
+ @Path("{type}/{name}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ LoggerTO read(@PathParam("type") LoggerType type, @PathParam("name") final String name);
/**
- * @param type LoggerType to be selected.
- * @param name Logger name to be read.
- * @return Returns logger with matching type and name.
+ * Returns a list of loggers with matching type.
+ *
+ * @param type LoggerType to be selected
+ * @return list of loggers with matching type
*/
@GET
- @Path("{type}/{name}")
- LoggerTO read(@PathParam("type") LoggerType type, @PathParam("name") final String name);
+ @Path("{type}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ List<LoggerTO> list(@PathParam("type") LoggerType type);
/**
- * @param type LoggerType to be selected.
- * @param name Logger name to be updated.
- * @param logger Logger to be created or updated.
+ * Creates or updates (if existing) the logger with matching name.
+ *
+ * @param type LoggerType to be selected
+ * @param name Logger name to be updated
+ * @param logger Logger to be created or updated
*/
@PUT
@Path("{type}/{name}/level")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
void update(@PathParam("type") LoggerType type, @PathParam("name") String name, LoggerTO logger);
- @GET
- @Path("events")
- List<EventCategoryTO> events();
+ /**
+ * Deletes the logger with matching name.
+ *
+ * @param type LoggerType to be selected
+ * @param name Logger name to be deleted
+ */
+ @DELETE
+ @Path("{type}/{name}")
+ void delete(@PathParam("type") LoggerType type, @PathParam("name") String name);
+
}
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=1555086&r1=1555085&r2=1555086&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 Fri Jan 3 13:43:23 2014
@@ -29,48 +29,69 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.model.wadl.Description;
+import org.apache.cxf.jaxrs.model.wadl.Descriptions;
+import org.apache.cxf.jaxrs.model.wadl.DocTarget;
import org.apache.syncope.common.to.NotificationTO;
+/**
+ * REST operations for notifications.
+ */
@Path("notifications")
-@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface NotificationService extends JAXRSService {
/**
- * @param notificationTO Creates a new notification.
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created notification
- */
- @POST
- Response create(NotificationTO notificationTO);
-
- /**
- * @param notificationId ID for notification to be deleted.
+ * Returns notification with matching id.
+ *
+ * @param notificationId id of notification to be read
+ * @return notification with matching id
*/
- @DELETE
+ @GET
@Path("{notificationId}")
- void delete(@PathParam("notificationId") Long notificationId);
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ NotificationTO read(@PathParam("notificationId") Long notificationId);
/**
- * @return Returns list of all notifications.
+ * Returns a list of all notifications.
+ *
+ * @return list of all notifications.
*/
@GET
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<NotificationTO> list();
/**
- * @param notificationId ID of notification to be read.
- * @return Notification with matching id.
+ * Creates a new notification.
+ *
+ * @param notificationTO Creates a new notification.
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created notification
*/
- @GET
- @Path("{notificationId}")
- NotificationTO read(@PathParam("notificationId") Long notificationId);
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>Location</tt> header of created notification")
+ })
+ @POST
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ Response create(NotificationTO notificationTO);
/**
- * @param notificationId ID of notification to be updated.
- * @param notificationTO Notification to be stored.
+ * Updates the notification matching the given id.
+ *
+ * @param notificationId id of notification to be updated
+ * @param notificationTO notification to be stored
*/
@PUT
@Path("{notificationId}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
void update(@PathParam("notificationId") Long notificationId, NotificationTO notificationTO);
+ /**
+ * Deletes the notification matching the given id.
+ *
+ * @param notificationId id for notification to be deleted
+ */
+ @DELETE
+ @Path("{notificationId}")
+ void delete(@PathParam("notificationId") Long notificationId);
}
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=1555086&r1=1555085&r2=1555086&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 Fri Jan 3 13:43:23 2014
@@ -30,70 +30,99 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.model.wadl.Description;
+import org.apache.cxf.jaxrs.model.wadl.Descriptions;
+import org.apache.cxf.jaxrs.model.wadl.DocTarget;
import org.apache.syncope.common.wrap.CorrelationRuleClass;
import org.apache.syncope.common.to.AbstractPolicyTO;
import org.apache.syncope.common.types.PolicyType;
+/**
+ * REST operations for policies.
+ */
@Path("policies")
-@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface PolicyService extends JAXRSService {
/**
- * @param policyTO Policy to be created (needs to match type)
- * @param <T> response type (extending PolicyTO)
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created policy
+ * Returns a list of classes to be used as correlation rules.
+ *
+ * @return list of classes to be used as correlation rules
*/
- @POST
- <T extends AbstractPolicyTO> Response create(T policyTO);
+ @GET
+ @Path("syncCorrelationRuleClasses")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ List<CorrelationRuleClass> getSyncCorrelationRuleClasses();
/**
- * @param policyId Deletes policy with given id
+ * Returns the policy matching the given id.
+ *
+ * @param policyId id of requested policy
* @param <T> response type (extending PolicyTO)
+ * @return policy with matching id
*/
- @DELETE
+ @GET
@Path("{policyId}")
- <T extends AbstractPolicyTO> void delete(@PathParam("policyId") Long policyId);
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ <T extends AbstractPolicyTO> T read(@PathParam("policyId") Long policyId);
/**
- * @param type Type selector for requested policies
+ * Returns the global policy for the given type.
+ *
+ * @param type PolicyType to read global policy from
* @param <T> response type (extending PolicyTO)
- * @return List of policies with matching type
+ * @return global policy for matching type
*/
@GET
- <T extends AbstractPolicyTO> List<T> list(@MatrixParam("type") PolicyType type);
+ @Path("global")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ <T extends AbstractPolicyTO> T readGlobal(@MatrixParam("type") PolicyType type);
/**
- * @param policyId ID of requested policy
+ * Returns a list of policies of the matching type.
+ *
+ * @param type Type selector for requested policies
* @param <T> response type (extending PolicyTO)
- * @return policy with matching id
+ * @return list of policies with matching type
*/
@GET
- @Path("{policyId}")
- <T extends AbstractPolicyTO> T read(@PathParam("policyId") Long policyId);
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ <T extends AbstractPolicyTO> List<T> list(@MatrixParam("type") PolicyType type);
/**
- * @param type PolicyType to read global policy from
+ * Create a new policy.
+ *
+ * @param policyTO Policy to be created (needs to match type)
* @param <T> response type (extending PolicyTO)
- * @return Global Policy for matching type
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created policy
*/
- @GET
- @Path("global")
- <T extends AbstractPolicyTO> T readGlobal(@MatrixParam("type") PolicyType type);
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>Location</tt> header of created policy")
+ })
+ @POST
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ <T extends AbstractPolicyTO> Response create(T policyTO);
/**
- * @param policyId ID of policy to be updated
+ * Updates policy matching the given id.
+ *
+ * @param policyId id of policy to be updated
* @param policyTO Policy to replace existing policy
* @param <T> response type (extending PolicyTO)
*/
@PUT
@Path("{policyId}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
<T extends AbstractPolicyTO> void update(@PathParam("policyId") Long policyId, T policyTO);
/**
- * @return correlation rules java classes
+ * Delete policy matching the given id.
+ *
+ * @param policyId id of policy to be deleted
+ * @param <T> response type (extending PolicyTO)
*/
- @GET
- @Path("syncCorrelationRuleClasses")
- List<CorrelationRuleClass> getSyncCorrelationRuleClasses();
+ @DELETE
+ @Path("{policyId}")
+ <T extends AbstractPolicyTO> void delete(@PathParam("policyId") Long policyId);
+
}
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=1555086&r1=1555085&r2=1555086&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 Fri Jan 3 13:43:23 2014
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.common.services;
-import org.apache.syncope.common.reqres.PagedResult;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -32,116 +31,164 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.model.wadl.Description;
+import org.apache.cxf.jaxrs.model.wadl.Descriptions;
+import org.apache.cxf.jaxrs.model.wadl.DocTarget;
+import org.apache.syncope.common.reqres.PagedResult;
import org.apache.syncope.common.to.ReportExecTO;
import org.apache.syncope.common.to.ReportTO;
import org.apache.syncope.common.types.ReportExecExportFormat;
import org.apache.syncope.common.wrap.ReportletConfClass;
+/**
+ * REST operations for reports.
+ */
@Path("reports")
-@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface ReportService extends JAXRSService {
/**
- * @param reportTO Report to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created report
- */
- @POST
- Response create(ReportTO reportTO);
-
- /**
- * @param reportId Deletes report with matching id
+ * Returns a list of available classes for reportlet configuration.
+ *
+ * @return list of available classes for reportlet configuration
*/
- @DELETE
- @Path("{reportId}")
- void delete(@PathParam("reportId") Long reportId);
-
- /**
- * @param executionId ID of execution report to be deleted
- */
- @DELETE
- @Path("executions/{executionId}")
- void deleteExecution(@PathParam("executionId") Long executionId);
-
- /**
- * @param reportId ID of report to be executed.
- * @return Execution result
- */
- @POST
- @Path("{reportId}/execute")
- ReportExecTO execute(@PathParam("reportId") Long reportId);
+ @GET
+ @Path("reportletConfClasses")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ List<ReportletConfClass> getReportletConfClasses();
/**
- * @param executionId ID of execution report to be selected
- * @param fmt file-format selection
- * @return Returns a stream for content download
+ * Returns report with matching id.
+ *
+ * @param reportId id of report to be read
+ * @return report with matching id
*/
@GET
- @Path("executions/{executionId}/stream")
- Response exportExecutionResult(@PathParam("executionId") Long executionId,
- @QueryParam("format") ReportExecExportFormat fmt);
+ @Path("{reportId}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ ReportTO read(@PathParam("reportId") Long reportId);
/**
- * @return Returns a list of all reportletConfClasses
+ * Returns report execution with matching id.
+ *
+ * @param executionId report execution id to be selected
+ * @return report execution with matching id
*/
@GET
- @Path("reportletConfClasses")
- List<ReportletConfClass> getReportletConfClasses();
+ @Path("executions/{executionId}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ ReportExecTO readExecution(@PathParam("executionId") Long executionId);
/**
- * @return Paged list of all existing reports
+ * Returns a paged list of all existing reports.
+ *
+ * @return paged list of all existing reports
*/
@GET
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<ReportTO> list();
/**
+ * Returns a paged list of all existing reports.
+ *
* @param orderBy list of ordering clauses, separated by comma
- * @return Paged list of all existing reports
+ * @return paged list of all existing reports
*/
@GET
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<ReportTO> list(@QueryParam(PARAM_ORDERBY) String orderBy);
/**
+ * Returns a paged list of all existing reports matching page/size conditions.
+ *
* @param page selected page in relation to size
* @param size number of entries per page
- * @return Paged list of existing reports matching page/size conditions
+ * @return paged list of existing reports matching page/size conditions
*/
@GET
- PagedResult<ReportTO> list(@QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ PagedResult<ReportTO> list(
+ @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
@QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size);
/**
+ * Returns a paged list of all existing reports matching page/size conditions.
+ *
* @param page selected page in relation to size
* @param size number of entries per page
* @param orderBy list of ordering clauses, separated by comma
- * @return Paged list of existing reports matching page/size conditions
+ * @return paged list of existing reports matching page/size conditions
*/
@GET
- PagedResult<ReportTO> list(@QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ PagedResult<ReportTO> list(
+ @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
@QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size,
@QueryParam(PARAM_ORDERBY) String orderBy);
/**
- * @param reportId ID of report to be read
- * @return Report with matching ID
+ * Creates a new report.
+ *
+ * @param reportTO report to be created
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created report
*/
- @GET
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>Location</tt> header of created report")
+ })
+ @POST
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ Response create(ReportTO reportTO);
+
+ /**
+ * Updates report with matching id.
+ *
+ * @param reportId id for report to be updated
+ * @param reportTO report to be stored
+ */
+ @PUT
@Path("{reportId}")
- ReportTO read(@PathParam("reportId") Long reportId);
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ void update(@PathParam("reportId") Long reportId, ReportTO reportTO);
/**
- * @param executionId ID ExecutionReport to be selected
- * @return Returns ExecutionReport with matching id
+ * Deletes report with matching id.
+ *
+ * @param reportId Deletes report with matching id
*/
- @GET
+ @DELETE
+ @Path("{reportId}")
+ void delete(@PathParam("reportId") Long reportId);
+
+ /**
+ * Deletes report execution with matching id.
+ *
+ * @param executionId id of execution report to be deleted
+ */
+ @DELETE
@Path("executions/{executionId}")
- ReportExecTO readExecution(@PathParam("executionId") Long executionId);
+ void deleteExecution(@PathParam("executionId") Long executionId);
/**
- * @param reportId ID for report to be updated
- * @param reportTO Updates report with matching reportId
+ * Executes the report with matching id.
+ *
+ * @param reportId id of report to be executed
+ * @return report execution result
*/
- @PUT
- @Path("{reportId}")
- void update(@PathParam("reportId") Long reportId, ReportTO reportTO);
+ @POST
+ @Path("{reportId}/execute")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ ReportExecTO execute(@PathParam("reportId") Long reportId);
+
+ /**
+ * Exports the report execution with matching id in the requested format.
+ *
+ * @param executionId id of execution report to be selected
+ * @param fmt file-format selection
+ * @return a stream for content download
+ */
+ @GET
+ @Path("executions/{executionId}/stream")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ Response exportExecutionResult(@PathParam("executionId") Long executionId,
+ @QueryParam("format") ReportExecExportFormat fmt);
}
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=1555086&r1=1555085&r2=1555086&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 Fri Jan 3 13:43:23 2014
@@ -18,9 +18,6 @@
*/
package org.apache.syncope.common.services;
-import org.apache.syncope.common.reqres.BulkAssociationAction;
-import org.apache.syncope.common.reqres.BulkAction;
-import org.apache.syncope.common.reqres.BulkActionResult;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -33,39 +30,28 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.model.wadl.Description;
+import org.apache.cxf.jaxrs.model.wadl.Descriptions;
+import org.apache.cxf.jaxrs.model.wadl.DocTarget;
+
+import org.apache.syncope.common.reqres.BulkAction;
+import org.apache.syncope.common.reqres.BulkActionResult;
import org.apache.syncope.common.to.ConnObjectTO;
-import org.apache.syncope.common.wrap.PropagationActionClass;
import org.apache.syncope.common.to.ResourceTO;
import org.apache.syncope.common.types.AttributableType;
+import org.apache.syncope.common.types.ResourceDeassociationActionType;
+import org.apache.syncope.common.wrap.PropagationActionClass;
+import org.apache.syncope.common.wrap.SubjectId;
+/**
+ * REST operations for external resources.
+ */
@Path("resources")
-@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface ResourceService extends JAXRSService {
/**
- * @param resourceTO Resource to be checked
- * @return Returns true, if connection to resource could be established
- */
- @POST
- @Path("check")
- boolean check(ResourceTO resourceTO);
-
- /**
- * @param resourceTO Resource to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created report
- */
- @POST
- Response create(ResourceTO resourceTO);
-
- /**
- * @param resourceName Name of resource to be deleted
- */
- @DELETE
- @Path("{resourceName}")
- void delete(@PathParam("resourceName") String resourceName);
-
- /**
+ * Returns connector object from the external resource, for the given type and id.
+ *
* @param resourceName Name of resource to read connector object from
* @param type user / role
* @param id user id / role id
@@ -73,51 +59,126 @@ public interface ResourceService extends
*/
@GET
@Path("{resourceName}/{type}/{id}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
ConnObjectTO getConnectorObject(@PathParam("resourceName") String resourceName,
@PathParam("type") AttributableType type, @PathParam("id") Long id);
/**
- * @return Returns PropagationActionsClasses
+ * Returns a list of classes that can be used to customize the propagation process.
+ *
+ * @return list of classes that can be used to customize the propagation process
*/
@GET
@Path("propagationActionsClasses")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<PropagationActionClass> getPropagationActionsClasses();
/**
- * @return Returns list of all Resources
+ * Returns the resource with matching name.
+ *
+ * @param resourceName Name of resource to be read
+ * @return resource with matching name
*/
@GET
+ @Path("{resourceName}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ ResourceTO read(@PathParam("resourceName") String resourceName);
+
+ /**
+ * Returns a list of all resources.
+ *
+ * @return list of all resources
+ */
+ @GET
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<ResourceTO> list();
/**
+ * Returns a list of resources using matching connector instance id.
+ *
* @param connInstanceId Connector id to filter for resources
- * @return Returns all resources using matching connector
+ * @return resources using matching connector instance id
*/
@GET
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<ResourceTO> list(@MatrixParam("connectorId") Long connInstanceId);
/**
- * @param resourceName Name of resource to be read
- * @return Resource with matching name
+ * Creates a new resource.
+ *
+ * @param resourceTO Resource to be created
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created resource
*/
- @GET
- @Path("{resourceName}")
- ResourceTO read(@PathParam("resourceName") String resourceName);
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>Location</tt> header of created resource")
+ })
+ @POST
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ Response create(ResourceTO resourceTO);
/**
- * @param resourceName Name of resource to be updated
- * @param resourceTO Resource to be stored
+ * Updates the resource matching the given name.
+ *
+ * @param resourceName name of resource to be updated
+ * @param resourceTO resource to be stored
*/
@PUT
@Path("{resourceName}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
void update(@PathParam("resourceName") String resourceName, ResourceTO resourceTO);
+ /**
+ * Deletes the resource matching the given name.
+ *
+ * @param resourceName name of resource to be deleted
+ */
+ @DELETE
+ @Path("{resourceName}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ void delete(@PathParam("resourceName") String resourceName);
+
+ /**
+ * Checks wether the connection to resource could be established.
+ *
+ * @param resourceTO resource to be checked
+ * @return true if connection to resource could be established
+ */
@POST
- @Path("bulk")
- BulkActionResult bulk(BulkAction bulkAction);
+ @Path("check")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ boolean check(ResourceTO resourceTO);
+ /**
+ * De-associate users or roles (depending on the provided attributable type) from the given resource.
+ *
+ * @param resourceName name of resource
+ * @param attrType attributable type (user or role)
+ * @param type resource de-association action type
+ * @param subjectIds users or roles against which the bulk action will be performed
+ * @return <tt>Response</tt> object featuring {@link BulkActionResult} as <tt>Entity</tt>
+ */
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>")
+ })
@POST
- @Path("{resourceName}/bulkAssociation/{type}")
- BulkActionResult bulkAssociation(@PathParam("resourceName") String resourceName,
- BulkAssociationAction bulkAssociationAction, @PathParam("type") AttributableType type);
+ @Path("{resourceName}/bulkDeassociation/{attrType}/{type}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ BulkActionResult bulkDeassociation(@PathParam("resourceName") String resourceName,
+ @PathParam("attrType") AttributableType attrType,
+ @PathParam("type") ResourceDeassociationActionType type, List<SubjectId> subjectIds);
+
+ /**
+ * Executes the provided bulk action.
+ *
+ * @param bulkAction list of resource names against which the bulk action will be performed
+ * @return Bulk action result
+ */
+ @POST
+ @Path("bulk")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ BulkActionResult bulk(BulkAction bulkAction);
}
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=1555086&r1=1555085&r2=1555086&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 Fri Jan 3 13:43:23 2014
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.common.services;
-import org.apache.syncope.common.reqres.PagedResult;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@@ -31,179 +30,266 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.model.wadl.Description;
+import org.apache.cxf.jaxrs.model.wadl.Descriptions;
+import org.apache.cxf.jaxrs.model.wadl.DocTarget;
+import org.apache.syncope.common.reqres.PagedResult;
import org.apache.syncope.common.mod.RoleMod;
import org.apache.syncope.common.to.RoleTO;
import org.apache.syncope.common.types.ResourceAssociationActionType;
-import org.apache.syncope.common.types.ResourceDeAssociationActionType;
+import org.apache.syncope.common.types.ResourceDeassociationActionType;
import org.apache.syncope.common.wrap.ResourceName;
+/**
+ * REST operations for roles.
+ */
@Path("roles")
-@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface RoleService extends JAXRSService {
/**
- * @param roleId ID of role to get children from
- * @return Returns list of children for selected role
+ * Returns children roles of given role.
+ *
+ * @param roleId id of role to get children from
+ * @return children roles of given role
*/
@GET
@Path("{roleId}/children")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
List<RoleTO> children(@PathParam("roleId") Long roleId);
/**
- * @param roleTO Role to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created role as well as the role itself
- * enriched with propagation status information, as <tt>Entity</tt>
+ * Returns parent role of the given role (or null if no parent exists).
+ *
+ * @param roleId id of role to get parent role from
+ * @return parent role of the given role (or null if no parent exists)
*/
- @POST
- Response create(RoleTO roleTO);
+ @GET
+ @Path("{roleId}/parent")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ RoleTO parent(@PathParam("roleId") Long roleId);
/**
- * @param roleId ID of role to be deleted
- * @return <tt>Response</tt> object featuring the deleted role enriched with propagation status information,
- * as <tt>Entity</tt>
+ * Reads the role matching the provided roleId.
+ *
+ * @param roleId id of role to be read
+ * @return role with matching id
*/
- @DELETE
+ @GET
@Path("{roleId}")
- Response delete(@PathParam("roleId") Long roleId);
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ RoleTO read(@PathParam("roleId") Long roleId);
/**
- * @return Paged list of all existing roles
+ * This method is similar to {@link #read(Long)}, but uses different authentication handling to ensure that a user
+ * can read his own roles.
+ *
+ * @param roleId id of role to be read
+ * @return role with matching id
*/
+ @Descriptions({
+ @Description(target = DocTarget.METHOD,
+ value = "This method is similar to <tt>read()</tt>, but uses different authentication handling to "
+ + "ensure that a user can read his own roles.")
+ })
@GET
+ @Path("{roleId}/own")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ RoleTO readSelf(@PathParam("roleId") Long roleId);
+
+ /**
+ * Returns a paged list of existing roles.
+ *
+ * @return paged list of all existing roles
+ */
+ @GET
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<RoleTO> list();
/**
+ * Returns a paged list of existing roles.
+ *
* @param orderBy list of ordering clauses, separated by comma
- * @return Paged list of all existing roles
+ * @return paged list of all existing roles
*/
@GET
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<RoleTO> list(@QueryParam(PARAM_ORDERBY) String orderBy);
/**
+ * Returns a paged list of existing roles matching page/size conditions.
+ *
* @param page result page number
* @param size number of entries per page
- * @return Paged list of existing roles matching page/size conditions
+ * @return paged list of existing roles matching page/size conditions
*/
@GET
- PagedResult<RoleTO> list(@QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ PagedResult<RoleTO> list(
+ @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
@QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size);
/**
+ * Returns a paged list of existing roles matching page/size conditions.
+ *
* @param page result page number
* @param size number of entries per page
* @param orderBy list of ordering clauses, separated by comma
- * @return Paged list of existing roles matching page/size conditions
+ * @return paged list of existing roles matching page/size conditions
*/
@GET
- PagedResult<RoleTO> list(@QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ PagedResult<RoleTO> list(
+ @QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
@QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size,
@QueryParam(PARAM_ORDERBY) String orderBy);
/**
- * @param roleId Id of role to get parent role from
- * @return Returns parent role or null if no parent exists
- */
- @GET
- @Path("{roleId}/parent")
- RoleTO parent(@PathParam("roleId") Long roleId);
-
- /**
- * @param roleId ID of role to be read
- * @return Returns role with matching id
- */
- @GET
- @Path("{roleId}")
- RoleTO read(@PathParam("roleId") Long roleId);
-
- /**
+ * Returns a paged list of roles matching the provided FIQL search condition.
+ *
* @param fiql FIQL search expression
- * @return Paged list of roles matching the provided FIQL search condition
+ * @return paged list of roles matching the provided FIQL search condition
*/
@GET
@Path("search")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<RoleTO> search(@QueryParam(PARAM_FIQL) String fiql);
/**
+ * Returns a paged list of roles matching the provided FIQL search condition.
+ *
* @param fiql FIQL search expression
* @param orderBy list of ordering clauses, separated by comma
- * @return Paged list of roles matching the provided FIQL search condition
+ * @return paged list of roles matching the provided FIQL search condition
*/
@GET
@Path("search")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<RoleTO> search(@QueryParam(PARAM_FIQL) String fiql, @QueryParam(PARAM_ORDERBY) String orderBy);
/**
+ * Returns a paged list of roles matching the provided FIQL search condition.
+ *
* @param fiql FIQL search expression
* @param page result page number
* @param size number of entries per page
- * @return Paged list of roles matching the provided FIQL search condition
+ * @return paged list of roles matching the provided FIQL search condition
*/
@GET
@Path("search")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<RoleTO> search(@QueryParam(PARAM_FIQL) String fiql,
@QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
@QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size);
/**
+ * Returns a paged list of roles matching the provided FIQL search condition.
+ *
* @param fiql FIQL search expression
* @param page result page number
* @param size number of entries per page
* @param orderBy list of ordering clauses, separated by comma
- * @return Paged list of roles matching the provided FIQL search condition
+ * @return paged list of roles matching the provided FIQL search condition
*/
@GET
@Path("search")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
PagedResult<RoleTO> search(@QueryParam(PARAM_FIQL) String fiql,
@QueryParam(PARAM_PAGE) @DefaultValue(DEFAULT_PARAM_PAGE) int page,
@QueryParam(PARAM_SIZE) @DefaultValue(DEFAULT_PARAM_SIZE) int size,
@QueryParam(PARAM_ORDERBY) String orderBy);
/**
- * This method is similar to {@link #read(Long)}, but uses different authentication handling to ensure that a user
- * can read his own roles.
+ * Creates a new role.
*
- * @param roleId ID of role to be read
- * @return Returns role with matching id
+ * @param roleTO role to be created
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created role as well as the role itself
+ * enriched with propagation status information - {@link RoleTO} as <tt>Entity</tt>
*/
- @GET
- @Path("{roleId}/own")
- RoleTO readSelf(@PathParam("roleId") Long roleId);
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>Location</tt> header of created role as well as the "
+ + "role itself enriched with propagation status information - <tt>RoleTO</tt> as <tt>Entity</tt>")
+ })
+ @POST
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ Response create(RoleTO roleTO);
/**
- * @param roleId ID of role to be updated
- * @param roleMod Role object containing list of changes to be applied for selected role
- * @return <tt>Response</tt> object featuring the updated role enriched with propagation status information,
- * as <tt>Entity</tt>
- */
+ * Updates role matching the provided roleId.
+ *
+ * @param roleId id of role to be updated
+ * @param roleMod modification to be applied to role matching the provided roleId
+ * @return <tt>Response</tt> object featuring the updated role enriched with propagation status information
+ * - {@link RoleTO} as <tt>Entity</tt>
+ */
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring the updated role enriched with propagation status "
+ + "information - <tt>RoleTO</tt> as <tt>Entity</tt>")
+ })
@POST
@Path("{roleId}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
Response update(@PathParam("roleId") Long roleId, RoleMod roleMod);
/**
+ * Deletes role matching provided roleId.
+ *
+ * @param roleId id of role to be deleted
+ * @return <tt>Response</tt> object featuring the deleted role enriched with propagation status information
+ * - {@link RoleTO} as <tt>Entity</tt>
+ */
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring the deleted role enriched with propagation status "
+ + "information - <tt>RoleTO</tt> as <tt>Entity</tt>")
+ })
+ @DELETE
+ @Path("{roleId}")
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ Response delete(@PathParam("roleId") Long roleId);
+
+ /**
* Executes resource-related operations on given role.
*
* @param roleId role id.
* @param type resource association action type
* @param resourceNames external resources to be used for propagation-related operations
- * @return <tt>Response</tt> object featuring the bulk action result
+ * @return <tt>Response</tt> object featuring
+ * {@link org.apache.syncope.common.reqres.BulkActionResult} as <tt>Entity</tt>
*/
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>")
+ })
@POST
@Path("{roleId}/deassociate/{type}")
- Response bulkDeassociation(@PathParam("roleId") Long roleId, @PathParam("type") ResourceDeAssociationActionType type,
- List<ResourceName> resourceNames);
-
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ Response bulkDeassociation(@PathParam("roleId") Long roleId,
+ @PathParam("type") ResourceDeassociationActionType type, List<ResourceName> resourceNames);
+
/**
* Executes resource-related operations on given role.
*
* @param roleId role id.
* @param type resource association action type
* @param resourceNames external resources to be used for propagation-related operations
- * @return <tt>Response</tt> object featuring the bulk action result
+ * @return <tt>Response</tt> object featuring {@link org.apache.syncope.common.reqres.BulkActionResult}
+ * as <tt>Entity</tt>
*/
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>BulkActionResult</tt> as <tt>Entity</tt>")
+ })
@POST
@Path("{roleId}/associate/{type}")
- Response bulkAssociation(@PathParam("roleId") Long roleId, @PathParam("type") ResourceAssociationActionType type,
- List<ResourceName> resourceNames);
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ Response bulkAssociation(@PathParam("roleId") Long roleId,
+ @PathParam("type") ResourceAssociationActionType type, List<ResourceName> 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=1555086&r1=1555085&r2=1555086&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 Fri Jan 3 13:43:23 2014
@@ -29,67 +29,89 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.apache.cxf.jaxrs.model.wadl.Description;
+import org.apache.cxf.jaxrs.model.wadl.Descriptions;
+import org.apache.cxf.jaxrs.model.wadl.DocTarget;
import org.apache.syncope.common.to.AbstractSchemaTO;
import org.apache.syncope.common.types.AttributableType;
import org.apache.syncope.common.types.SchemaType;
+/**
+ * REST operations for attribute schemas.
+ */
@Path("schemas/{kind}/{type}")
-@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public interface SchemaService extends JAXRSService {
/**
+ * Returns schema matching the given kind, type and name.
+ *
* @param <T> actual SchemaTO
- * @param attrType Kind for schema to be created
- * @param schemaType Type for schema to be created
- * @param schemaTO Schema to be created
- * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created schema
- */
- @POST
- <T extends AbstractSchemaTO> Response create(@PathParam("kind") AttributableType attrType,
- @PathParam("type") SchemaType schemaType, T schemaTO);
-
- /**
- * @param attrType Kind for schema to be deleted
- * @param schemaType Type for schema to be deleted
- * @param schemaName Name of schema to be deleted
+ * @param attrType kind for schemas to be read
+ * @param schemaType type for schemas to be read
+ * @param schemaName name of schema to be read
+ * @return schema matching the given kind, type and name
*/
- @DELETE
+ @GET
@Path("{name}")
- void delete(@PathParam("kind") AttributableType attrType, @PathParam("type") SchemaType schemaType,
- @PathParam("name") String schemaName);
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ <T extends AbstractSchemaTO> T read(@PathParam("kind") AttributableType attrType,
+ @PathParam("type") SchemaType schemaType, @PathParam("name") String schemaName);
/**
+ * Returns a list of schemas with matching kind and type.
+ *
* @param <T> actual SchemaTO
- * @param attrType Kind for schemas to be listed
- * @param schemaType Type for schemas to be listed
- * @return List of schemas with matching kind and type
+ * @param attrType kind for schemas to be listed
+ * @param schemaType type for schemas to be listed
+ * @return list of schemas with matching kind and type
*/
@GET
+ @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
<T extends AbstractSchemaTO> List<T> list(
@PathParam("kind") AttributableType attrType, @PathParam("type") SchemaType schemaType);
/**
+ * Creates a new schema.
+ *
* @param <T> actual SchemaTO
- * @param attrType Kind for schemas to be read
- * @param schemaType Type for schemas to be read
- * @param schemaName Name of schema to be read
- * @return Returns schema with matching name, kind and type
+ * @param attrType kind for schema to be created
+ * @param schemaType type for schema to be created
+ * @param schemaTO schema to be created
+ * @return <tt>Response</tt> object featuring <tt>Location</tt> header of created schema
*/
- @GET
- @Path("{name}")
- <T extends AbstractSchemaTO> T read(@PathParam("kind") AttributableType attrType,
- @PathParam("type") SchemaType schemaType, @PathParam("name") String schemaName);
+ @Descriptions({
+ @Description(target = DocTarget.RETURN,
+ value = "<tt>Response</tt> object featuring <tt>Location</tt> header of created schema")
+ })
+ @POST
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ <T extends AbstractSchemaTO> Response create(@PathParam("kind") AttributableType attrType,
+ @PathParam("type") SchemaType schemaType, T schemaTO);
/**
+ * Updates the schema matching the given kind, type and name.
+ *
* @param <T> actual SchemaTO
- * @param attrType Kind for schemas to be updated
- * @param schemaType Type for schemas to be updated
- * @param schemaName Name of schema to be updated
- * @param schemaTO New schema to be stored
+ * @param attrType kind for schemas to be updated
+ * @param schemaType type for schemas to be updated
+ * @param schemaName name of schema to be updated
+ * @param schemaTO updated schema to be stored
*/
@PUT
@Path("{name}")
+ @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
<T extends AbstractSchemaTO> void update(@PathParam("kind") AttributableType attrType,
@PathParam("type") SchemaType schemaType, @PathParam("name") String schemaName, T schemaTO);
+
+ /**
+ * Deletes the schema matching the given kind, type and name.
+ *
+ * @param attrType kind for schema to be deleted
+ * @param schemaType type for schema to be deleted
+ * @param schemaName name of schema to be deleted
+ */
+ @DELETE
+ @Path("{name}")
+ void delete(@PathParam("kind") AttributableType attrType, @PathParam("type") SchemaType schemaType,
+ @PathParam("name") String schemaName);
}