View Javadoc

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 from the server complete information about selected priority
78  	 *
79  	 * @param uri URI for the priority resource
80  	 * @return complete information about the selected priority
81  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
82  	 */
83  	Promise<Priority> getPriority(URI uri);
84  
85  	/**
86  	 * Retrieves from the server complete list of available priorities
87  	 *
88  	 * @return complete information about the selected priority
89  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
90  	 * @since com.atlassian.jira.rest.client.api 1.0, server 5.0
91  	 */
92  	Promise<Iterable<Priority>> getPriorities();
93  
94  	/**
95  	 * Retrieves from the server complete information about selected resolution
96  	 *
97  	 * @param uri URI for the resolution resource
98  	 * @return complete information about the selected resolution
99  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
100 	 */
101 	Promise<Resolution> getResolution(URI uri);
102 
103 	/**
104 	 * Retrieves from the server complete information about selected resolution
105 	 *
106 	 * @return complete information about the selected resolution
107 	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
108 	 * @since com.atlassian.jira.rest.client.api 1.0, server 5.0
109 	 */
110 	Promise<Iterable<Resolution>> getResolutions();
111 
112 	/**
113 	 * Retrieves information about this JIRA instance
114 	 *
115 	 * @return information about this JIRA instance
116 	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
117 	 */
118 	Promise<ServerInfo> getServerInfo();
119 
120 	/**
121 	 * Retrieves information about JIRA custom and system fields.
122 	 *
123 	 * @return information about JIRA custom and system fields.
124 	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
125 	 */
126 	Promise<Iterable<Field>> getFields();
127 }