KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cowsultants > itracker > ejb > client > interfaces > IssueHandler


1 /*
2  * This software was designed and created by Jason Carroll.
3  * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4  * The author can be reached at jcarroll@cowsultants.com
5  * ITracker website: http://www.cowsultants.com
6  * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it only under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  */

18
19 package cowsultants.itracker.ejb.client.interfaces;
20
21 import java.util.*;
22 import javax.ejb.EJBLocalObject JavaDoc;
23
24 import cowsultants.itracker.ejb.client.models.*;
25
26 public interface IssueHandler extends EJBLocalObject JavaDoc {
27     public static final String JavaDoc JNDI_NAME = "ejb/IssueHandler";
28
29     public IssueModel getIssue(Integer JavaDoc issueId);
30     public IssueModel[] getAllIssues();
31     public int getNumberIssues();
32     /**
33       * Returns an array of issues that are currently at the given status.
34       * @param status the status to search for
35       * @return an array of issues with the given status
36       */

37     public IssueModel[] getIssuesWithStatus(int status);
38     /**
39       * Returns an array of issues that are currently at the given status or a status
40       * less than the given status.
41       * @param status the status to search for
42       * @return an array of issues with the given status or lower
43       */

44     public IssueModel[] getIssuesWithStatusLessThan(int status);
45     /**
46       * Returns an array of issues that are currently at the given severity.
47       * @param severity the severity to search for
48       * @return an array of issues with the given severity
49       */

50     public IssueModel[] getIssuesWithSeverity(int severity);
51     public IssueModel[] getIssuesByProjectId(Integer JavaDoc projectId);
52     public IssueModel[] getIssuesByProjectId(Integer JavaDoc projectId, int status);
53     public IssueModel[] getIssuesCreatedByUser(Integer JavaDoc userId);
54     public IssueModel[] getIssuesCreatedByUser(Integer JavaDoc userId, boolean availableProjectsOnly);
55     public IssueModel[] getIssuesOwnedByUser(Integer JavaDoc userId);
56     public IssueModel[] getIssuesOwnedByUser(Integer JavaDoc userId, boolean availableProjectsOnly);
57     public IssueModel[] getIssuesWatchedByUser(Integer JavaDoc userId);
58     public IssueModel[] getIssuesWatchedByUser(Integer JavaDoc userId, boolean availableProjectsOnly);
59     public IssueModel[] getUnassignedIssues();
60     public IssueModel[] getUnassignedIssues(boolean availableProjectsOnly);
61     /**
62       * Creates a new issue in a project.
63       * @param model an IssueModel representing the new issue information
64       * @param projectId the projectId the issue belongs to
65       * @param userId the id of registered creator of the new issue
66       * @param createdById the id of the actual creator of the issue. This would normally be the same as the userId.
67       * @return an IssueModel containing the newly created issue, or null if the create failed
68       */

69     public IssueModel createIssue(IssueModel model, Integer JavaDoc projectId, Integer JavaDoc userId, Integer JavaDoc createdById);
70     public IssueModel updateIssue(IssueModel model, Integer JavaDoc userId);
71     /**
72       * Moves an issues from its current project to a new project.
73       * @param issue an IssueModel of the issue to move
74       * @param projectId the id of the target project
75       * @param userId the id of the user that is moving the issue
76       * @return an IssueModel of the issue after it has been moved
77       */

78     public IssueModel moveIssue(IssueModel model, Integer JavaDoc projectId, Integer JavaDoc userId);
79     public boolean deleteIssue(IssueModel model);
80
81     public boolean assignIssue(Integer JavaDoc issueId, Integer JavaDoc userId);
82     public boolean assignIssue(Integer JavaDoc issueId, Integer JavaDoc userId, Integer JavaDoc assignedByUserId);
83     public boolean setIssueFields(Integer JavaDoc issueId, IssueFieldModel[] fields);
84     public boolean setIssueComponents(Integer JavaDoc issueId, HashSet componentIds, Integer JavaDoc userId);
85     public boolean setIssueVersions(Integer JavaDoc issueId, HashSet versionIds, Integer JavaDoc userId);
86     public boolean addIssueHistory(IssueHistoryModel model);
87     public boolean addIssueActivity(IssueActivityModel model);
88     public void updateIssueActivityNotification(Integer JavaDoc issueId, boolean notificationSent);
89     public boolean addIssueAttachment(IssueAttachmentModel model, byte[] data);
90     /**
91       * Updates the binary data of the attachment stored in the database.
92       * @param attachmentId the id of the attachment to update
93       * @param data a byte arrray of the binary data for the attachment
94       * @return true if the update was successful
95       */

96     public boolean setIssueAttachmentData(Integer JavaDoc attachmentId, byte[] data);
97     /**
98       * Updates the binary data of the attachment stored in the database. Used mainly
99       * to take an existing attachment stored on the filesystem and move it into
100       * the database.
101       * @param fileName the filename listed in the database for the localtion of the attachment.
102                         This is the name that was previously used to store the data on the
103                         filesystem, not the original filename of the attachment.
104       * @param data a byte arrray of the binary data for the attachment
105       * @return true if the update was successful
106       */

107     public boolean setIssueAttachmentData(String JavaDoc fileName, byte[] data);
108     public boolean addIssueNotification(NotificationModel model);
109     public boolean removeIssueAttachment(Integer JavaDoc attachmentId);
110
111     public Integer JavaDoc removeIssueHistoryEntry(Integer JavaDoc entryId, Integer JavaDoc userId);
112
113     public ProjectModel getIssueProject(Integer JavaDoc issueId);
114     public ComponentModel[] getIssueComponents(Integer JavaDoc issueId);
115     public HashSet getIssueComponentIds(Integer JavaDoc issueId);
116     public VersionModel[] getIssueVersions(Integer JavaDoc issueId);
117     public HashSet getIssueVersionIds(Integer JavaDoc issueId);
118     public UserModel getIssueCreator(Integer JavaDoc issueId);
119     public UserModel getIssueOwner(Integer JavaDoc issueId);
120
121     public IssueActivityModel[] getIssueActivity(Integer JavaDoc issueId);
122     public IssueActivityModel[] getIssueActivity(Integer JavaDoc issueId, boolean notificationSent);
123     public IssueAttachmentModel[] getAllIssueAttachments();
124     public long[] getAllIssueAttachmentsSizeAndCount();
125     public IssueAttachmentModel getIssueAttachment(Integer JavaDoc attachmentId);
126     /**
127       * Returns the bianry data for an attachment.
128       * @param attachmentId the id of the attachment to obtain the data for
129       * @return a byte array containing the attachment data
130       */

131     public byte[] getIssueAttachmentData(Integer JavaDoc attachmentId);
132     public IssueAttachmentModel[] getIssueAttachments(Integer JavaDoc issueId);
133     public int getIssueAttachmentCount(Integer JavaDoc issueId);
134     /**
135       * Returns the latest issue history entry for a particular issue.
136       * @param issueId the id of the issue to return the history entry for.
137       * @return the latest IssueHistoryModel, or null if no entries could be found
138       */

139     public IssueHistoryModel getLastIssueHistory(Integer JavaDoc issueId);
140     public IssueHistoryModel[] getIssueHistory(Integer JavaDoc issueId);
141
142     /**
143       * Retrieves the primary issue notifications. Primary notifications
144       * are defined as the issue owner (or creator if not assigned), and any project owners.
145       * This should encompass the list of people that should be notified so that action
146       * can be taken on an issue that needs immediate attention.
147       * @param issueId the id of the issue to find notifications for
148       * @returns an array of NotificationModels
149       */

150     public NotificationModel[] getPrimaryIssueNotifications(Integer JavaDoc issueId);
151     /**
152       * Retrieves all notifications for an issue where the notification's user is also active.
153       * @param issueId the id of the issue to find notifications for
154       * @returns an array of NotificationModels
155       */

156     public NotificationModel[] getIssueNotifications(Integer JavaDoc issueId);
157     /**
158       * Retrieves an array of issue notifications. The notifications by default
159       * is the creator and owner of the issue, all project admins for the issue's project,
160       * and anyone else that has a notfication on file.
161       * @param issueId the id of the issue to find notifications for
162       * @param pimaryOnly only include the primary notifications
163       * @param activeOnly only include the notification if the user is currently active (not locked or deleted)
164       * @returns an array of NotificationModels
165       * @see IssueHandlerBean#getPrimaryIssueNotifications
166       */

167     public NotificationModel[] getIssueNotifications(Integer JavaDoc issueId, boolean primaryOnly, boolean activeOnly);
168     public boolean hasIssueNotification(Integer JavaDoc issueId, Integer JavaDoc userId);
169     public void sendNotification(Integer JavaDoc issueId, int type, String JavaDoc baseURL);
170     public void sendNotification(Integer JavaDoc issueId, int type, String JavaDoc baseURL, HashSet addresses, Integer JavaDoc lastModifiedDays);
171
172     public int getOpenIssueCountByProjectId(Integer JavaDoc projectId);
173     public int getResolvedIssueCountByProjectId(Integer JavaDoc projectId);
174     public int getTotalIssueCountByProjectId(Integer JavaDoc projectId);
175     public Date getLatestIssueDateByProjectId(Integer JavaDoc projectId);
176
177     public boolean canViewIssue(Integer JavaDoc issueId, UserModel user);
178     public boolean canViewIssue(IssueModel issue, UserModel user);
179 }
Popular Tags