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;
18  
19  import com.atlassian.jira.rest.client.domain.IssueType;
20  import com.atlassian.jira.rest.client.domain.IssuelinksType;
21  import com.atlassian.jira.rest.client.domain.Priority;
22  import com.atlassian.jira.rest.client.domain.Resolution;
23  import com.atlassian.jira.rest.client.domain.ServerInfo;
24  import com.atlassian.jira.rest.client.domain.Status;
25  
26  import java.net.URI;
27  
28  /**
29   * Serves information about JIRA metadata like server information, issue types defined, stati, priorities and resolutions.
30   * This data constitutes a data dictionary which then JIRA issues base on.
31   *
32   * @since v0.1
33   */
34  public interface MetadataRestClient {
35  	/**
36  	 * Retrieves from the server complete information about selected issue type
37  	 * @param uri URI to issue type resource (one can get it e.g. from <code>self</code> attribute
38  	 * of issueType field of an issue).
39  	 * @param progressMonitor progress monitor
40  	 * @return complete information about issue type resource
41  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
42  	 */
43  	IssueType getIssueType(URI uri, ProgressMonitor progressMonitor);
44  
45  	/**
46  	 * Retrieves from the server complete list of available issue type
47  	 * @param progressMonitor progress monitor
48  	 * @return complete information about issue type resource
49  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
50  	 * @since client 1.0, server 5.0
51  	 */
52  	Iterable<IssueType> getIssueTypes(ProgressMonitor progressMonitor);
53  
54      /**
55       * Retrieves from the server complete list of available issue types
56       * @param progressMonitor progress monitor
57       * @return list of available issue types for this JIRA instance
58  	 * @throws RestClientException in case of problems (if linking is disabled on the server, connectivity, malformed messages, etc.)
59       * @since server 4.3, client 0.5
60       */
61      Iterable<IssuelinksType> getIssueLinkTypes(ProgressMonitor progressMonitor);
62  
63  	/**
64  	 * Retrieves complete information about selected status
65  	 * @param uri URI to this status resource (one can get it e.g. from <code>self</code> attribute
66  	 * of <code>status</code> field of an issue)
67  	 * @param progressMonitor progress monitor
68  	 * @return complete information about the selected status
69  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
70  	 */
71  	Status getStatus(URI uri, ProgressMonitor progressMonitor);
72  
73  	/**
74  	 * Retrieves from the server complete information about selected priority
75  	 * @param uri URI for the priority resource
76  	 * @param progressMonitor progress monitor
77  	 * @return complete information about the selected priority
78  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
79  	 */
80  	Priority getPriority(URI uri, ProgressMonitor progressMonitor);
81  
82  	/**
83  	 * Retrieves from the server complete list of available priorities
84  	 * @param progressMonitor progress monitor
85  	 * @return complete information about the selected priority
86  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
87  	 * @since client 1.0, server 5.0
88  	 */
89  	Iterable<Priority> getPriorities(ProgressMonitor progressMonitor);
90  
91  	/**
92  	 * Retrieves from the server complete information about selected resolution
93  	 * @param uri URI for the resolution resource
94  	 * @param progressMonitor progress monitor
95  	 * @return complete information about the selected resolution
96  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
97  	 */
98  	Resolution getResolution(URI uri, ProgressMonitor progressMonitor);
99  
100 	/**
101 	 * Retrieves from the server complete information about selected resolution
102 	 * @param progressMonitor progress monitor
103 	 * @return complete information about the selected resolution
104 	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
105 	 * @since client 1.0, server 5.0
106 	 */
107 	Iterable<Resolution> getResolutions(ProgressMonitor progressMonitor);
108 
109 	/**
110 	 * Retrieves information about this JIRA instance
111 	 * @param progressMonitor progress monitor
112 	 * @return information about this JIRA instance
113 	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
114 	 */
115 	ServerInfo getServerInfo(ProgressMonitor progressMonitor);
116 }