1
1
/*
2
- * Copyright (C) 2007-2010 TopCoder Inc., All Rights Reserved.
2
+ * Copyright (C) 2007-2016 TopCoder Inc., All Rights Reserved.
3
3
*/
4
4
package com .cronos .onlinereview .services .uploads ;
5
5
6
6
import com .topcoder .management .phase .PhaseManagementException ;
7
7
import com .topcoder .management .resource .Resource ;
8
8
9
+ import java .util .Set ;
10
+
9
11
10
12
/**
11
13
* <p>
27
29
* Thread safety: the implementations must be thread safe.
28
30
* </p>
29
31
*
32
+ * <p>
33
+ * Version 1.1.2 (Provide Way To Pre_register members When Launching Challenge)
34
+ * <ol>
35
+ * <li>Added {@link #removeAllSubmitters(long, String)} method</li>
36
+ * </ol>
37
+ * </p>
38
+ * <p>
39
+ * Version 1.1.3 (TOPCODER DIRECT - IMPROVEMENT FOR PRE-REGISTER MEMBERS WHEN LAUNCHING CHALLENGES):
40
+ * <ol>
41
+ * <li>Added {@link #removeSubmitters(long, Set, String)} method</li>
42
+ * </ol>
43
+ * </p>
30
44
* @author fabrizyo, saarixx, cyberjag, TCSDEVELOPER
31
- * @version 1.1.1
45
+ * @version 1.1.3
32
46
* @since 1.0
33
47
*/
34
48
public interface UploadServices {
@@ -37,7 +51,7 @@ public interface UploadServices {
37
51
* <p>
38
52
* Adds a new submission for an user in a particular project.
39
53
* </p>
40
- *
54
+ * <p/>
41
55
* <p>
42
56
* If the project allows multiple submissions for users, it will add the new submission and return. If multiple
43
57
* submission are not allowed for the project firstly, it will add the new submission, secondly mark previous
@@ -47,9 +61,7 @@ public interface UploadServices {
47
61
* @param projectId the project's id
48
62
* @param userId the user's id
49
63
* @param filename the file name to use
50
- *
51
64
* @return the id of the new submission
52
- *
53
65
* @throws InvalidProjectException if the project does not exist
54
66
* @throws InvalidProjectPhaseException if neither Submission or Screening phase are opened
55
67
* @throws InvalidUserException if the user does not exist or has not the submitter role
@@ -69,9 +81,7 @@ public interface UploadServices {
69
81
* @param projectId the project's id
70
82
* @param userId the user's id
71
83
* @param filename the file name to use
72
- *
73
84
* @return the id of the created final fix submission.
74
- *
75
85
* @throws InvalidProjectException if the project does not exist
76
86
* @throws InvalidProjectPhaseException if Final Fix phase is not opened
77
87
* @throws InvalidUserException if the user does not exist or she/he is not winner submitter
@@ -91,9 +101,7 @@ public interface UploadServices {
91
101
* @param projectId the project's id
92
102
* @param userId the user's id
93
103
* @param filename the file name to use
94
- *
95
104
* @return the id of the created test cases submission
96
- *
97
105
* @throws InvalidProjectException if the project does not exist
98
106
* @throws InvalidProjectPhaseException if Review phase is not opened
99
107
* @throws InvalidUserException if the user does not exist or has not the reviewer role
@@ -110,9 +118,7 @@ public interface UploadServices {
110
118
* @param projectId the project's id
111
119
* @param userId the user's id.
112
120
* @param filename the file name to use.
113
- *
114
121
* @return the id of the new submission.
115
- *
116
122
* @throws InvalidProjectException if the project doesn't exist.
117
123
* @throws InvalidProjectPhaseException if Specification Submission phase is not opened.
118
124
* @throws InvalidUserException if the user doesn't exist or hasn't the Specification Submitter role.
@@ -131,26 +137,22 @@ public interface UploadServices {
131
137
* @param submissionId the submission's id
132
138
* @param submissionStatusId the submission status id
133
139
* @param operator the operator which execute the operation
134
- *
135
- * @throws InvalidSubmissionException if the submission does not exist
136
- * @throws InvalidSubmissionStatusException
137
- * if the submission status does not exist
138
- * @throws PersistenceException if some error occurs in persistence layer
139
- * @throws IllegalArgumentException if any id is < 0 or if operator is null or trim to empty
140
+ * @throws InvalidSubmissionException if the submission does not exist
141
+ * @throws InvalidSubmissionStatusException if the submission status does not exist
142
+ * @throws PersistenceException if some error occurs in persistence layer
143
+ * @throws IllegalArgumentException if any id is < 0 or if operator is null or trim to empty
140
144
* @since 1.0
141
145
*/
142
146
void setSubmissionStatus (long submissionId , long submissionStatusId , String operator )
143
- throws InvalidSubmissionException , InvalidSubmissionStatusException , PersistenceException ;
147
+ throws InvalidSubmissionException , InvalidSubmissionStatusException , PersistenceException ;
144
148
145
149
146
150
/**
147
151
* Adds the given user as a new submitter to the given project id.
148
152
*
149
153
* @param projectId the project to which the user needs to be added
150
154
* @param userId the user to be added
151
- *
152
155
* @return the added resource id
153
- *
154
156
* @throws InvalidProjectException if the project id is unknown
155
157
* @throws InvalidUserException if the user id is unknown
156
158
* @throws InvalidProjectPhaseException if the phase of the project is not Registration.
@@ -171,7 +173,7 @@ long addSubmitter(long projectId, long userId) throws InvalidProjectException,
171
173
* @throws InvalidUserException if the user id is unknown
172
174
* @throws InvalidProjectPhaseException if the phase of the project is not Registration.
173
175
* @throws UploadServicesException if any error occurs from UploadServices
174
- * @throws PhaseManagementException if an unexpected error occurs.
176
+ * @throws PhaseManagementException if an unexpected error occurs.
175
177
* @throws IllegalArgumentException if any id is < 0
176
178
* @since 1.1.1
177
179
*/
@@ -187,9 +189,35 @@ long addSubmitter(long projectId, long userId) throws InvalidProjectException,
187
189
* @throws InvalidUserException if the user id is unknown
188
190
* @throws InvalidProjectPhaseException if the phase of the project is not Registration.
189
191
* @throws UploadServicesException if any error occurs from UploadServices
190
- * @throws PhaseManagementException if an unexpected error occurs.
192
+ * @throws PhaseManagementException if an unexpected error occurs.
191
193
* @throws IllegalArgumentException if any id is < 0
192
194
* @since 1.1.1
193
195
*/
194
196
Resource addPrimaryScreener (long projectId , long userId ) throws UploadServicesException , PhaseManagementException ;
195
- }
197
+
198
+ /**
199
+ * Remove all submitters for a given project
200
+ *
201
+ * @param projectId the project id
202
+ * @param operator user whos added
203
+ * @return
204
+ * @throws InvalidProjectException
205
+ * @throws UploadServicesException
206
+ * @throws InvalidUserException
207
+ * @throws InvalidProjectPhaseException
208
+ * @since 1.1.2
209
+ */
210
+ Set <Long > removeAllSubmitters (long projectId , String operator ) throws UploadServicesException ;
211
+
212
+ /**
213
+ * Remove submitters from given project
214
+ *
215
+ * @param projectId the project id
216
+ * @param users set of user id
217
+ * @param operator user who is added it
218
+ * @return
219
+ * @throws UploadServicesException
220
+ * @since 1.1.3
221
+ */
222
+ Set <Long > removeSubmitters (long projectId , Set <Long > users , String operator )throws UploadServicesException ;
223
+ }
0 commit comments