Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (C) 2013 Stefan Niederhauser ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package guru.nidi.atlassian.remote.jira;
import com.atlassian.jira.rpc.soap.beans.*;
import guru.nidi.atlassian.remote.jira.rest.IssueLink;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.rmi.RemoteException;
import java.util.*;
/**
*
*/
public class JiraTasks {
private final static Logger LOG = LoggerFactory.getLogger(JiraTasks.class);
private static final int MAX_ISSUES = 1000;
private static final Comparator ISSUE_BY_TYPE_COMPARATOR = new Comparator() {
public int compare(RemoteIssue o1, RemoteIssue o2) {
return o1.getType().compareTo(o2.getType());
}
};
private static final String CUSTOMFIELD = "customfield_";
private static final RemoteResolution UNRESOLVED = new RemoteResolution(null, "Unresolved", "The issue is not resolved yet.", null);
private final JiraService service;
private Map fieldNames;
private Map issueTypeById, issueTypeByName;
private Map statusById, statusByName;
private Map priorityById;
private Map resolutionById;
public JiraTasks(JiraService service) {
this.service = service;
}
public JiraService getService() {
return service;
}
public RemoteIssueType issueTypeById(String id) throws java.rmi.RemoteException {
if (issueTypeById == null) {
issueTypeById = new HashMap();
RemoteIssueType[] issueTypes = service.getIssueTypes();
for (RemoteIssueType type : issueTypes) {
issueTypeById.put(type.getId(), type);
}
RemoteIssueType[] issueSubTypes = service.getSubTaskIssueTypes();
for (RemoteIssueType type : issueSubTypes) {
issueTypeById.put(type.getId(), type);
}
}
return id == null ? null : issueTypeById.get(id);
}
public RemoteIssueType issueTypeByName(String name) throws java.rmi.RemoteException {
if (issueTypeByName == null) {
issueTypeByName = new HashMap();
RemoteIssueType[] issueTypes = service.getIssueTypes();
for (RemoteIssueType type : issueTypes) {
issueTypeByName.put(type.getName().toLowerCase(), type);
}
RemoteIssueType[] issueSubTypes = service.getSubTaskIssueTypes();
for (RemoteIssueType type : issueSubTypes) {
issueTypeByName.put(type.getName().toLowerCase(), type);
}
}
return name == null ? null : issueTypeByName.get(name.toLowerCase());
}
public String fieldNameById(String fieldId) {
if (fieldNames == null) {
fieldNames = new HashMap();
List