Package net.sf.redmine_mylyn.core.client

Examples of net.sf.redmine_mylyn.core.client.IClient


 
  @Override
  public IClient getClient(TaskRepository repository) throws RedmineStatusException {
   
    synchronized(clientByUrl) {
      IClient client = clientByUrl.get(repository.getUrl());
     
      if(client==null) {
       
        Configuration conf = confByUrl.get(repository.getUrl());
        if(conf==null) {
View Full Code Here


       
        detectedVersionString = null;
       
        RedmineServerVersion detectedVersion = null;
        try {
          IClient client = ClientFactory.createClient(repository);
          detectedVersion = client.checkClientConnection(monitor);
        } catch (RedmineStatusException e) {
          if(e.getCause() instanceof RedmineApiAuthenticationException) {
            throw new CoreException(new Status(IStatus.ERROR, RedmineCorePlugin.PLUGIN_ID, Messages.INVALID_CREDENTIALS));
          }
          throw new CoreException(e.getStatus());
View Full Code Here

  @Override
  public InputStream getContent(TaskRepository repository, ITask task, TaskAttribute attachmentAttribute, IProgressMonitor monitor) throws CoreException {
    TaskAttachmentMapper attachment = TaskAttachmentMapper.createFrom(attachmentAttribute);
    try {
      IClient client;
      client = connector.getClientManager().getClient(repository);
      return client.getAttachmentContent(RedmineUtil.parseIntegerId(attachment.getAttachmentId()), attachment.getFileName(), monitor);
    } catch (RedmineStatusException e) {
      throw new CoreException(e.getStatus());
    }
  }
View Full Code Here

        description = mapper.getDescription();
      }
    }
   
    try {
      IClient client = connector.getClientManager().getClient(repository);
      client.uploadAttachment(RedmineUtil.parseIntegerId(task.getTaskId()), fileName, description, source, comment, monitor);
    } catch (RedmineStatusException e) {
      throw new CoreException(e.getStatus());
    }
  }
View Full Code Here

 
  @Override
  public RepositoryResponse postTaskData(TaskRepository repository, TaskData taskData, Set<TaskAttribute> oldAttributes, IProgressMonitor monitor) throws CoreException {
    String taskId = taskData.getTaskId();
    try {
      IClient client = connector.getClientManager().getClient(repository);
      Configuration cfg = connector.getRepositoryConfiguration(repository);

      if(taskData.isNew() || taskId.isEmpty()) {
        Issue issue = IssueMapper.createIssue(repository, taskData, oldAttributes, cfg);
        taskId += client.createIssue(issue, monitor);
      } else {
        Issue issue = IssueMapper.createIssue(repository, taskData, oldAttributes, cfg);
        TimeEntry timeEntry = IssueMapper.createTimeEntry(repository, taskData, oldAttributes, cfg);
        TaskAttribute commentAttribute = taskData.getRoot().getAttribute(RedmineAttribute.COMMENT.getTaskKey());
        String comment = commentAttribute==null ? null : commentAttribute.getValue();
        client.updateIssue(issue, comment, timeEntry, monitor);
      }
    } catch (RedmineStatusException e) {
      throw new CoreException(e.getStatus());
    }
   
View Full Code Here

  }

  @Override
  public boolean canCreateNewTask(TaskRepository repository) {
    try {
      IClient client = getClientManager().getClient(repository);
      if (client!=null) {
        Configuration conf = client.getConfiguration();
        if (!conf.getProjects().isEmpty() && !conf.getTrackers().isEmpty()) {
          Project project = conf.getProjects().getAll().get(0);
          List<Tracker> trackers = conf.getTrackers().getById(project.getTrackerIds());
          if (trackers.size()>0) {
            return true;
View Full Code Here

    TaskData taskData = null;
   
    try {
      int id = Integer.parseInt(taskId);

      IClient client = getClientManager().getClient(repository);
      Issue issue = client.getIssue(id, monitor);

      if(issue==null) {
        IStatus status = new Status(IStatus.INFO, RedmineCorePlugin.PLUGIN_ID, Messages.ERRMSG_CANT_FIND_ISSUE+taskId);
        throw new CoreException(status);
      }
View Full Code Here

    monitor.beginTask(Messages.PROGRESS_TASK_DOWNLOAD, IProgressMonitor.UNKNOWN);

    TaskData[] taskData = new TaskData[taskIds.size()];
   
    try {
      IClient client = getClientManager().getClient(repository);
      Issue[] issues = client.getIssues(taskIds, monitor);
     
      if(issues!=null) {
        for (int i=issues.length-1; i>=0; i--) {
          taskData[i] = taskDataHandler.createTaskDataFromIssue(repository, issues[i], monitor);
        }
View Full Code Here

  public IStatus performQuery(TaskRepository repository, IRepositoryQuery repositoryQuery, TaskDataCollector collector, ISynchronizationSession session, IProgressMonitor monitor) {
   
    try {
      Query query = Query.fromUrl(repositoryQuery.getUrl(), repository.getCharacterEncoding(), getRepositoryConfiguration(repository));

      IClient client = getClientManager().getClient(repository);
      Issue[] partialIssues = client.query(query, monitor);
     
      for(Issue partialIssue : partialIssues) {
        Date updated = partialIssue.getUpdatedOn();
       
        // UpdatedOn should never be null
View Full Code Here

   
    try {
      Date updatedSince = RedmineUtil.parseDate(repository.getSynchronizationTimeStamp());
      Set<ITask> tasks = session.getTasks();

      IClient client = getClientManager().getClient(repository);
      int[] changedIds = client.getUpdatedIssueIds(tasks, updatedSince, monitor);

      if(changedIds!=null && changedIds.length>0) {
        Arrays.sort(changedIds);
        for(ITask task : tasks) {
          if(Arrays.binarySearch(changedIds, RedmineUtil.parseIntegerId(task.getTaskId()))>=0) {
View Full Code Here

TOP

Related Classes of net.sf.redmine_mylyn.core.client.IClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.