Project

General

Profile

Download (3.39 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2009 EDIT European Distributed Institute of Taxonomy
3
 * http://www.e-taxonomy.eu
4
 *
5
 * The contents of this file are subject to the Mozilla Public License Version
6
 * 1.1 See LICENSE.TXT at the top of this package for the full license terms.
7
 */
8

    
9
package eu.etaxonomy.cdm.remote.controller;
10

    
11
import io.swagger.annotations.Api;
12

    
13
import org.springframework.beans.factory.annotation.Autowired;
14
import org.springframework.stereotype.Controller;
15
import org.springframework.web.bind.annotation.RequestMapping;
16

    
17
import eu.etaxonomy.cdm.api.service.IAgentService;
18
import eu.etaxonomy.cdm.api.service.pager.Pager;
19
import eu.etaxonomy.cdm.database.UpdatableRoutingDataSource;
20
import eu.etaxonomy.cdm.model.agent.AgentBase;
21

    
22
/**
23
 * The AgentListController class is a Spring MVC Controller.
24
 * <p>
25
 * The syntax of the mapped service URIs contains the the {datasource-name} path element.
26
 * The available {datasource-name}s are defined in a configuration file which
27
 * is loaded by the {@link UpdatableRoutingDataSource}. If the
28
 * UpdatableRoutingDataSource is not being used in the actual application
29
 * context any arbitrary {datasource-name} may be used.
30
 * <p>
31
 * Methods mapped at type level, inherited from super classes ({@link BaseController}):
32
 * <blockquote>
33
 * URI: <b>&#x002F;{datasource-name}&#x002F;agent&#x002F;</b>
34
 *
35
 * Depending on the URI parameters used this service returns
36
 * either a {@link Pager} on or a List of the {@link AgentBase} entities
37
 * identified by the <code>{agent-uuid}</code>.
38
 * The returned AgentBase instances are initialized by
39
 * the following strategy: {@link #DEFAULT_INIT_STRATEGY}
40
 * <p>
41
 * <b>URI Parameters to return a {@link Pager}:</b>
42
 * <ul>
43
 * <li><b>pageNumber</b>
44
 *            the number of the page to be returned, the first page has the
45
 *            pageNumber = 1 - <i>optional parameter</i>
46
 * <li><b>pageSize</b>
47
 *            the maximum number of entities returned per page (can be null
48
 *            to return all entities in a single page) - <i>optional
49
 *            parameter</i>
50
 * <li><b>type</b>
51
 *           Further restricts the type of entities to be returned.
52
 *           If null the base type <code>&lt;T&gt;</code> is being used. - <i>optional parameter</i>
53
 * </ul>
54
 * <p>
55
 * <b>URI Parameters to return a {@link List}:</b>
56
 * <ul>
57
 * <li><b>start</b>
58
 *            The offset index from the start of the list. The first entity
59
 *            has the index = 0 - <b><i>required parameter</i></b>
60
 *            The start parameter is used to distinguish between the List and Pager variants!
61
 * <li><b>limit</b>
62
 *           The maximum number of entities returned. - <i>optional parameter</i>
63
 * <li><b>type</b>
64
 *           Further restricts the type of entities to be returned.
65
 *           If null the base type <code>&lt;T&gt;</code> is being used. - <i>optional parameter</i>
66
 * </ul>
67
 * </blockquote>
68
 *
69
 * @author a.kohlbecker
70
 * @since 24.03.2009
71
 */
72
@Controller
73
@Api(value = "agent")
74
@RequestMapping(value = {"/agent"})
75
public class AgentListController extends AbstractIdentifiableListController<AgentBase, IAgentService> {
76

    
77
    /* (non-Javadoc)
78
     * @see eu.etaxonomy.cdm.remote.controller.BaseListController#setService(eu.etaxonomy.cdm.api.service.IService)
79
     */
80
    @Override
81
    @Autowired
82
    public void setService(IAgentService service) {
83
        this.service = service;
84
    }
85
}
(6-6/76)