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.Priority;
21 import com.atlassian.jira.rest.client.domain.Resolution;
22 import com.atlassian.jira.rest.client.domain.ServerInfo;
23 import com.atlassian.jira.rest.client.domain.Status;
24
25 import java.net.URI;
26
27 /**
28 * Serves information about JIRA metadata like server information, issue types defined, stati, priorities and resolutions.
29 * This data constitutes a data dictionary which then JIRA issues base on.
30 *
31 * @since v0.1
32 */
33 public interface MetadataRestClient {
34 /**
35 * Retrieves from the server complete information about selected issue type
36 * @param uri URI to issue type resource (one can get it e.g. from <code>self</code> attribute
37 * of issueType field of an issue).
38 * @param progressMonitor progress monitor
39 * @return complete information about issue type resource
40 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
41 */
42 IssueType getIssueType(URI uri, ProgressMonitor progressMonitor);
43
44 /**
45 * Retrieves complete information about selected status
46 * @param uri URI to this status resource (one can get it e.g. from <code>self</code> attribute
47 * of <code>status</code> field of an issue)
48 * @param progressMonitor progress monitor
49 * @return complete information about the selected status
50 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
51 */
52 Status getStatus(URI uri, ProgressMonitor progressMonitor);
53
54 /**
55 * Retrieves from the server complete information about selected priority
56 * @param uri URI for the priority resource
57 * @param progressMonitor progress monitor
58 * @return complete information about the selected priority
59 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
60 */
61 Priority getPriority(URI uri, ProgressMonitor progressMonitor);
62
63 /**
64 * Retrieves from the server complete information about selected resolution
65 * @param uri URI for the resolution resource
66 * @param progressMonitor progress monitor
67 * @return complete information about the selected resolution
68 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
69 */
70 Resolution getResolution(URI uri, ProgressMonitor progressMonitor);
71
72 /**
73 * Retrieves information about this JIRA instance
74 * @param progressMonitor progress monitor
75 * @return information about this JIRA instance
76 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
77 */
78 ServerInfo getServerInfo(ProgressMonitor progressMonitor);
79 }