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 types
47       * @param progressMonitor progress monitor
48       * @return list of available issue types for this JIRA instance
49  	 * @throws RestClientException in case of problems (if linking is disabled on the server, connectivity, malformed messages, etc.)
50       * @since server 4.3, client 0.5
51       */
52      Iterable<IssuelinksType> getIssueLinkTypes(ProgressMonitor progressMonitor);
53  
54  	/**
55  	 * Retrieves complete information about selected status
56  	 * @param uri URI to this status resource (one can get it e.g. from <code>self</code> attribute
57  	 * of <code>status</code> field of an issue)
58  	 * @param progressMonitor progress monitor
59  	 * @return complete information about the selected status
60  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
61  	 */
62  	Status getStatus(URI uri, ProgressMonitor progressMonitor);
63  
64  	/**
65  	 * Retrieves from the server complete information about selected priority
66  	 * @param uri URI for the priority resource
67  	 * @param progressMonitor progress monitor
68  	 * @return complete information about the selected priority
69  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
70  	 */
71  	Priority getPriority(URI uri, ProgressMonitor progressMonitor);
72  
73  	/**
74  	 * Retrieves from the server complete information about selected resolution
75  	 * @param uri URI for the resolution resource
76  	 * @param progressMonitor progress monitor
77  	 * @return complete information about the selected resolution
78  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
79  	 */
80  	Resolution getResolution(URI uri, ProgressMonitor progressMonitor);
81  
82  	/**
83  	 * Retrieves information about this JIRA instance
84  	 * @param progressMonitor progress monitor
85  	 * @return information about this JIRA instance
86  	 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
87  	 */
88  	ServerInfo getServerInfo(ProgressMonitor progressMonitor);
89  }