1 /*
2 * Copyright (C) 2010 Atlassian
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package com.atlassian.jira.rest.client.api;
18
19 import com.atlassian.jira.rest.client.api.domain.Field;
20 import com.atlassian.jira.rest.client.api.domain.IssueType;
21 import com.atlassian.jira.rest.client.api.domain.IssuelinksType;
22 import com.atlassian.jira.rest.client.api.domain.Priority;
23 import com.atlassian.jira.rest.client.api.domain.Resolution;
24 import com.atlassian.jira.rest.client.api.domain.ServerInfo;
25 import com.atlassian.jira.rest.client.api.domain.Status;
26 import com.atlassian.util.concurrent.Promise;
27
28 import java.net.URI;
29
30 /**
31 * Serves information about JIRA metadata like server information, issue types defined, stati, priorities and resolutions.
32 * This data constitutes a data dictionary which then JIRA issues base on.
33 *
34 * @since v2.0
35 */
36 public interface MetadataRestClient {
37
38 /**
39 * Retrieves from the server complete information about selected issue type
40 *
41 * @param uri URI to issue type resource (one can get it e.g. from <code>self</code> attribute
42 * of issueType field of an issue).
43 * @return complete information about issue type resource
44 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
45 */
46 Promise<IssueType> getIssueType(URI uri);
47
48 /**
49 * Retrieves from the server complete list of available issue type
50 *
51 * @return complete information about issue type resource
52 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
53 * @since com.atlassian.jira.rest.client.api 1.0, server 5.0
54 */
55 Promise<Iterable<IssueType>> getIssueTypes();
56
57 /**
58 * Retrieves from the server complete list of available issue types
59 *
60 * @return list of available issue types for this JIRA instance
61 * @throws RestClientException in case of problems (if linking is disabled on the server, connectivity, malformed messages, etc.)
62 * @since server 4.3, com.atlassian.jira.rest.client.api 0.5
63 */
64 Promise<Iterable<IssuelinksType>> getIssueLinkTypes();
65
66 /**
67 * Retrieves complete information about selected status
68 *
69 * @param uri URI to this status resource (one can get it e.g. from <code>self</code> attribute
70 * of <code>status</code> field of an issue)
71 * @return complete information about the selected status
72 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
73 */
74 Promise<Status> getStatus(URI uri);
75
76 /**
77 * Retrieves lists of available statuses with complete information about them
78 *
79 * @return Lists of complete information about available statuses
80 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
81 */
82 Promise<Iterable<Status>> getStatuses();
83
84 /**
85 * Retrieves from the server complete information about selected priority
86 *
87 * @param uri URI for the priority resource
88 * @return complete information about the selected priority
89 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
90 */
91 Promise<Priority> getPriority(URI uri);
92
93 /**
94 * Retrieves from the server complete list of available priorities
95 *
96 * @return complete information about the selected priority
97 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
98 * @since com.atlassian.jira.rest.client.api 1.0, server 5.0
99 */
100 Promise<Iterable<Priority>> getPriorities();
101
102 /**
103 * Retrieves from the server complete information about selected resolution
104 *
105 * @param uri URI for the resolution resource
106 * @return complete information about the selected resolution
107 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
108 */
109 Promise<Resolution> getResolution(URI uri);
110
111 /**
112 * Retrieves from the server complete information about selected resolution
113 *
114 * @return complete information about the selected resolution
115 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
116 * @since com.atlassian.jira.rest.client.api 1.0, server 5.0
117 */
118 Promise<Iterable<Resolution>> getResolutions();
119
120 /**
121 * Retrieves information about this JIRA instance
122 *
123 * @return information about this JIRA instance
124 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
125 */
126 Promise<ServerInfo> getServerInfo();
127
128 /**
129 * Retrieves information about JIRA custom and system fields.
130 *
131 * @return information about JIRA custom and system fields.
132 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
133 */
134 Promise<Iterable<Field>> getFields();
135 }