• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Issue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.taskadapter.redmineapi.bean.Issue的典型用法代码示例。如果您正苦于以下问题:Java Issue类的具体用法?Java Issue怎么用?Java Issue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Issue类属于com.taskadapter.redmineapi.bean包,在下文中一共展示了Issue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createNewIssue

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
private void createNewIssue(ILoggingEvent event, String hash) throws RedmineException {
    Issue issue = IssueFactory.create(projectId, title + " - " + dateFormat.format(new Date(event.getTimeStamp())));

    String description = transformDescription(event);

    if (gitSupport) {
        String gitNavigation = showGitNavigation(event);

        issue.setDescription(gitNavigation + description);
    } else {
        issue.setDescription(description);
    }

    issue = issueManager.createIssue(issue);

    maps.put(hash, issue.getId());
}
 
开发者ID:kewang,项目名称:logback-redmine-appender,代码行数:18,代码来源:RedmineAppender.java


示例2: addWatcherToIssue

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
public void addWatcherToIssue(int watcherId, int issueId) throws RedmineException {
	logger.debug("adding watcher " + watcherId + " to issue " + issueId + "...");
	URI uri = getURIConfigurator().getChildObjectsURI(Issue.class, Integer.toString(issueId), Watcher.class);
	HttpPost httpPost = new HttpPost(uri);
	final StringWriter writer = new StringWriter();
	final JSONWriter jsonWriter = new JSONWriter(writer);
	try {
		jsonWriter.object().key("user_id").value(watcherId).endObject();
	} catch (JSONException e) {
		throw new RedmineInternalError("Unexpected exception", e);
	}
	String body = writer.toString();
	setEntity(httpPost, body);
	String response = send(httpPost);
	logger.debug(response);
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:17,代码来源:Transport.java


示例3: getIssuesByProject

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
@Override
	public Iterable<Issue> getIssuesByProject(Project project) throws RedmineException
	{
		List<Issue> issues = manager.getIssueManager().getIssues(project.getIdentifier(),null,Include.journals);
		
//		List<Issue> issuesWithJournals = new ArrayList<Issue>();
//		
//		for(Issue i : issues)
//		{
//			Issue issueWithJournals = manager.getIssueManager().getIssueById(i.getId(), Include.journals);
//			issuesWithJournals.add(issueWithJournals);
//		}
//		
//		return issuesWithJournals;
		
		return issues;
	}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:18,代码来源:RedmineClient.java


示例4: getTaskData

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
@Override
public TaskData getTaskData(TaskRepository repository, String taskIdOrKey, IProgressMonitor monitor)
		throws CoreException
{

	try
	{
		IRedmineClient client = getClientManager().getClient(repository);
		
		Issue issue = client.getIssueById(Integer.parseInt(taskIdOrKey));
		
		
		return taskDataHandler.createTaskDataFromIssue(repository, issue, client.getCachedRepositoryConfiguration());
		
	}
	catch (RedmineException e)
	{
		throw new CoreException(new RepositoryStatus(Status.ERROR, RedmineCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_NETWORK, "Error performing query.",e));
	}
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:21,代码来源:RedmineRepositoryConnector.java


示例5: postContent

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
@Override
public void postContent(TaskRepository repository, ITask task, AbstractTaskAttachmentSource source, String comment,
		TaskAttribute attachmentAttribute, IProgressMonitor monitor) throws CoreException
{
	Integer issueId = Integer.parseInt(task.getTaskId());
	
	TaskAttachmentMapper attachment = TaskAttachmentMapper.createFrom(attachmentAttribute);
	
	
	try
	{
		IRedmineClient client = redmineRepositoryConnector.getClientManager().getClient(repository);

		Issue issue = client.getIssueById(issueId);
		
		client.uploadAttachment(issue, source.getName(),source.getDescription(), source.getContentType(), source.createInputStream(monitor));
	}
	catch (Exception e)
	{
		throw new CoreException(new RepositoryStatus(Status.ERROR, RedmineCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_NETWORK, "Error downloading attachment.",e));
	}		
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:23,代码来源:RedmineTaskAttachmentHandler.java


示例6: addMissingInformationsToIssueFromCachedConfiguration

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
private void addMissingInformationsToIssueFromCachedConfiguration(Issue issue,
		CachedRepositoryConfiguration configuration)
{
	//Data transfer object members of issue are not populated with all the info,
	//we should hit the server to retrieve missing fields but instead we hit our
	//local cache.
	issue.setProject(configuration.getProjectById(issue.getProject().getId()));
	issue.setAssignee(configuration.getUserById(issue.getAssignee().getId()));
	issue.setAuthor(configuration.getUserById(issue.getAuthor().getId()));
	
	for(Journal j : issue.getJournals())
	{
		j.setUser(configuration.getUserById(j.getUser().getId()));
	}
	
	for(Attachment a : issue.getAttachments())
	{
		a.setAuthor(configuration.getUserById(a.getAuthor().getId()));
	}
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:21,代码来源:RedmineTaskDataHandler.java


示例7: resolve

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
@Override
public ExecutionDecision resolve(Redmine annotation) {
    Validate.notNull(redmineManager, "Redmine manager must be specified.");
    Validate.notNull(redmineGovernorStrategy, "Governor strategy must be specified. Have you already called setGovernorStrategy()?");

    final String redmineIssueKey = annotation.value();

    if (redmineIssueKey == null || redmineIssueKey.length() == 0) {
        return ExecutionDecision.execute();
    }

    final Issue redmineIssue = getIssue(redmineIssueKey);

    // when there is some error while we are getting the issue, we execute that test
    if (redmineIssue == null) {
        logger.warning(String.format("Redmine Issue %s couldn't be retrieved from configured repository.", redmineIssueKey));
        return ExecutionDecision.execute();
    }

    return redmineGovernorStrategy.annotation(annotation).issue(redmineIssue).resolve();
}
 
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:22,代码来源:RedmineGovernorClient.java


示例8: close

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
@Override
public void close(String issueId) {
    Validate.notNull(redmineManager, "Redmine manager must be specified.");

    try {
        final Issue issue = getIssue(issueId);
        if (!IssueStatus.isClosed(issue.getStatusId())) {
            if (redmineGovernorConfiguration.getCloseOrder() != null && redmineGovernorConfiguration.getCloseOrder().length() > 0) {
                resolveIntermediateIssueTransitions(issue, redmineGovernorConfiguration.getCloseOrder());
            }
            issue.setStatusId(IssueStatus.CLOSED.getStatusCode());
            issue.setNotes(getClosingMessage());
            redmineManager.getIssueManager().update(issue);
            final boolean stillNotClosed = !IssueStatus.isClosed(getIssue(issueId).getStatusId());
            if (stillNotClosed) {
                printAvailableStatus();
                throw new RuntimeException("Arquillian governor redmine could not close issue. "
                        + "The status transition is probably invalid. Use property 'closeOrder' in arquillian.xml and provide a valid status transition for this issue.");
            }
        }
    } catch (Exception e) {
        logger.warning(String.format("An exception has occurred while closing the issue %s. Exception: %s", issueId, e.getMessage()));
    }
}
 
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:25,代码来源:RedmineGovernorClient.java


示例9: resolveIntermediateIssueTransitions

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
private void resolveIntermediateIssueTransitions(Issue issue, String closeOrder) {
    final String[] statusId = closeOrder.split(",");

    int i = 0;
    while (i < statusId.length) {
        try {
            final Integer intermediateStatus = Integer.parseInt(statusId[i].trim());
            if (!IssueStatus.isClosed(intermediateStatus)) {
                issue.setStatusId(intermediateStatus);
                redmineManager.getIssueManager().update(issue);
            }
        } catch (Exception e) {
            Logger.getLogger(getClass().getName()).log(Level.WARNING, String.format("Could not update issue %s with status id %d", issue.getId(), statusId[i]), e);
        }
        i++;
    }
}
 
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:18,代码来源:RedmineGovernorClient.java


示例10: open

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
public void open(String issueId, Throwable cause) {
    Validate.notNull(redmineManager, "Redmine manager must be specified.");

    try {
        final Issue issue = getIssue(issueId);
        if (IssueStatus.isClosed(issue.getStatusId())) {
            issue.setStatusId(IssueStatus.NEW.getStatusCode());
            final StringBuilder openingMessage = new StringBuilder(getOpeningMessage() + "\n");
            openingMessage.append(getCauseAsString(cause));
            issue.setNotes(openingMessage.toString());
            redmineManager.getIssueManager().update(issue);
            final boolean stillClosed = IssueStatus.isClosed(getIssue(issueId).getStatusId());
            if (stillClosed) {
                throw new RuntimeException("Arquillian governor redmine could not open issue " + issueId
                        + ". Please check if provided user has privileges for re opening issues.");
            }
        }

    } catch (Exception e) {
        logger.warning(String.format("An exception has occurred while closing the issue %s. Exception: %s", issueId, e.getMessage()));
    }
}
 
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:23,代码来源:RedmineGovernorClient.java


示例11: addComment

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
/**
 * @see com.googlesource.gerrit.plugins.hooks.its.ItsFacade#addComment(java.lang.String,
 *      java.lang.String)
 */
@Override
public void addComment(final String issueId, final String comment)
    throws IOException {

  if (comment == null || comment.trim().isEmpty()) {
    return;
  }

  execute(new Callable<String>() {
    @Override
    public String call() throws Exception {
      Issue issue = new Issue();
      issue.setId(convertIssueId(issueId));
      issue.setNotes(comment);

      try {
        redmineManager.update(issue);
      } catch (RedmineException e) {
        LOGGER.error("Error in add comment: {}", e.getMessage(), e);
        throw new IOException(e.getMessage(), e);
      }
      return issueId;
    }
  });
}
 
开发者ID:cyrilix,项目名称:its-redmine,代码行数:30,代码来源:RedmineItsFacade.java


示例12: doPerformAction

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
private void doPerformAction(final String issueKey, final String actionName)
    throws IOException, RedmineException {

  Integer statusId = getStatusId(actionName);

  if (statusId != null) {
    LOGGER.debug("Executing action " + actionName + " on issue " + issueKey);
    Issue issue = new Issue();
    issue.setId(valueOf(issueKey));
    issue.setStatusId(statusId);
    redmineManager.update(issue);
  } else {
    LOGGER.error("Action " + actionName
        + " not found within available actions");
    throw new InvalidTransitionException("Action " + actionName
        + " not executable on issue " + issueKey);
  }
}
 
开发者ID:cyrilix,项目名称:its-redmine,代码行数:19,代码来源:RedmineItsFacade.java


示例13: addWatcherToIssue

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
public void addWatcherToIssue(int watcherId, int issueId) throws RedMineException {
	Log.d(DEBUG_TAG, "adding watcher " + watcherId + " to issue " + issueId + "...");
	URI uri = getURIConfigurator().getChildObjectsURI(Issue.class, Integer.toString(issueId), Watcher.class);
	HttpPost httpPost = new HttpPost(uri);
	final JSONStringer jsonWriter = new JSONStringer();
	try {
		jsonWriter.object().key("user_id").value(watcherId).endObject();
	} catch (JSONException e) {
		throw new RedmineInternalError("Unexpected exception", e);
	}
	String body = jsonWriter.toString();
	setEntity(httpPost, body);
	String response = getCommunicator().sendRequest(httpPost);
	Log.d(DEBUG_TAG, response);
	return;
}
 
开发者ID:noveogroup,项目名称:android-snitch,代码行数:17,代码来源:Transport.java


示例14: postNewIssue

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
public Observable<Issue> postNewIssue(final Project project, final User assignee, final String statusName,
                                      final String title, final String message,
                                      final String pictureFilename, final String logsFilename) {
    final Issue issue = new Issue();
    issue.setProject(project);
    issue.setSubject(title);
    issue.setDescription(message);

    if (assignee != null) {
        issue.setAssignee(assignee);
    }

    if (statusName != null) {
        issue.setStatusName(statusName);
    }

    return createIssue(project, issue, pictureFilename, logsFilename);
}
 
开发者ID:noveogroup,项目名称:android-snitch,代码行数:19,代码来源:RedMineControllerWrapper.java


示例15: createIssue

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
private Observable<Issue> createIssue(final Project project, final Issue issue, final String pictureFilename, final String logsFilename) {
    return updateObservable(new Observable.OnSubscribe<Issue>() {
        @Override
        public void call(Subscriber<? super Issue> subscriber) {
            try {
                uploadAttachments(pictureFilename, issue, logsFilename);

                subscriber.onNext(redmineManager.createIssue(String.valueOf(project.getId()), issue));
                subscriber.onCompleted();
            } catch (Exception e) {
                logger.trace(e.getMessage(), e);
                subscriber.onError(e);
            }
        }
    });
}
 
开发者ID:noveogroup,项目名称:android-snitch,代码行数:17,代码来源:RedMineControllerWrapper.java


示例16: getIssuesBySummary

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
/**
 * There could be several issues with the same summary, so the method returns List.
 *
 * @return empty list if not issues with this summary field exist, never NULL
 * @throws RedmineAuthenticationException invalid or no API access key is used with the server, which
 *                                 requires authorization. Check the constructor arguments.
 * @throws NotFoundException
 * @throws RedmineException
 */
public List<Issue> getIssuesBySummary(String projectKey, String summaryField) throws RedmineException {
    if ((projectKey != null) && (projectKey.length() > 0)) {
        return transport.getObjectsList(Issue.class,
                new BasicNameValuePair("subject", summaryField),
                new BasicNameValuePair("project_id", projectKey));
    } else {
        return transport.getObjectsList(Issue.class,
                new BasicNameValuePair("subject", summaryField));
    }
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:20,代码来源:IssueManager.java


示例17: getIssues

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
/**
 * @param projectKey ignored if NULL
 * @param queryId    id of the saved query in Redmine. the query must be accessible to the user
 *                   represented by the API access key (if the Redmine project requires authorization).
 *                   This parameter is <strong>optional</strong>, NULL can be provided to get all available issues.
 * @return list of Issue objects
 * @throws RedmineAuthenticationException invalid or no API access key is used with the server, which
 *                                 requires authorization. Check the constructor arguments.
 * @throws RedmineException
 * @see Issue
 */
public List<Issue> getIssues(String projectKey, Integer queryId, Include... include) throws RedmineException {
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    if (queryId != null) {
        params.add(new BasicNameValuePair("query_id", String.valueOf(queryId)));
    }

    if ((projectKey != null) && (projectKey.length() > 0)) {
        params.add(new BasicNameValuePair("project_id", projectKey));
    }
    String includeStr = Joiner.join(",", include);
    params.add(new BasicNameValuePair("include", includeStr));

    return transport.getObjectsList(Issue.class, params);
}
 
开发者ID:andrea-rockt,项目名称:mylyn-redmine-connector,代码行数:26,代码来源:IssueManager.java


示例18: getIssue

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
private Issue getIssue(String issueId) {
    try {
        if (issueId == null || !isNumeric(issueId)) {
            throw new IllegalArgumentException("Issue id is invalid.");
        }
        return redmineManager.getIssueManager().getIssueById(new Integer(issueId), Include.journals);
    } catch (Exception e) {
        logger.warning(String.format("An exception has occured while getting the issue %s. Exception: %s", issueId, e.getMessage()));
        return null;
    }
}
 
开发者ID:arquillian,项目名称:arquillian-governor,代码行数:12,代码来源:RedmineGovernorClient.java


示例19: testAddRelatedLink

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
/**
 * Test of method
 * {@link RedmineItsFacade#addRelatedLink(String, java.net.URL, String)}
 */
@Test
public void testAddRelatedLink() {
  try {
    LOGGER.info("------ testAddRelatedLink -------");

    IMocksControl control = EasyMock.createStrictControl();
    RedmineManager redmineManager = control.createMock(RedmineManager.class);
    Issue expectedIssue = new Issue();
    expectedIssue.setId(42);
    expectedIssue
        .setNotes("Related URL: \"description\":http://myredmine.org");

    RedmineItsFacade instance = new RedmineItsFacade(redmineManager);
    control.reset();
    redmineManager.update(expectedIssue);
    expectLastCall();
    control.replay();

    instance.addRelatedLink("42", new URL("http://myredmine.org"),
        "description");
    control.verify();

  } catch (Exception e) {
    LOGGER.error("Unexpected error: " + e.getMessage(), e);
    fail("Unexpected error: " + e.getMessage());
  }
}
 
开发者ID:cyrilix,项目名称:its-redmine,代码行数:32,代码来源:RedmineItsFacadeTest.java


示例20: getIssuesBySummary

import com.taskadapter.redmineapi.bean.Issue; //导入依赖的package包/类
/**
   * There could be several issues with the same summary, so the method returns List.
   *
   * @return empty list if not issues with this summary field exist, never NULL
   * @throws RedMineAuthenticationException invalid or no API access key is used with the server, which
   *                                 requires authorization. Check the constructor arguments.
   * @throws NotFoundException
   * @throws RedMineException
   */
  public List<Issue> getIssuesBySummary(String projectKey, String summaryField) throws RedMineException {
      if ((projectKey != null) && (projectKey.length() > 0)) {
	return transport.getObjectsList(Issue.class,
			new BasicNameValuePair("subject", summaryField),
			new BasicNameValuePair("project_id", projectKey));
} else {
	return transport.getObjectsList(Issue.class,
			new BasicNameValuePair("subject", summaryField));
      }
  }
 
开发者ID:noveogroup,项目名称:android-snitch,代码行数:20,代码来源:RedmineManager.java



注:本文中的com.taskadapter.redmineapi.bean.Issue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RESTMapper类代码示例发布时间:2022-05-22
下一篇:
Java RequestException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap