Index rebuild is done synchronously. Added some logging messages for monitoring
[pithos] / src / gr / ebs / gss / server / ejb / ExternalAPI.java
1 /*
2  * Copyright 2007, 2008, 2009, 2010 Electronic Business Systems Ltd.
3  *
4  * This file is part of GSS.
5  *
6  * GSS is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * GSS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with GSS.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 package gr.ebs.gss.server.ejb;
20
21 import gr.ebs.gss.client.exceptions.DuplicateNameException;
22 import gr.ebs.gss.client.exceptions.GSSIOException;
23 import gr.ebs.gss.client.exceptions.InsufficientPermissionsException;
24 import gr.ebs.gss.client.exceptions.InvitationUsedException;
25 import gr.ebs.gss.client.exceptions.ObjectNotFoundException;
26 import gr.ebs.gss.client.exceptions.QuotaExceededException;
27 import gr.ebs.gss.server.domain.FileUploadStatus;
28 import gr.ebs.gss.server.domain.Invitation;
29 import gr.ebs.gss.server.domain.Nonce;
30 import gr.ebs.gss.server.domain.User;
31 import gr.ebs.gss.server.domain.UserClass;
32 import gr.ebs.gss.server.domain.dto.FileBodyDTO;
33 import gr.ebs.gss.server.domain.dto.FileHeaderDTO;
34 import gr.ebs.gss.server.domain.dto.FolderDTO;
35 import gr.ebs.gss.server.domain.dto.GroupDTO;
36 import gr.ebs.gss.server.domain.dto.PermissionDTO;
37 import gr.ebs.gss.server.domain.dto.StatsDTO;
38 import gr.ebs.gss.server.domain.dto.UserDTO;
39
40 import java.io.File;
41 import java.io.IOException;
42 import java.io.InputStream;
43 import java.net.MalformedURLException;
44 import java.util.Date;
45 import java.util.List;
46 import java.util.Set;
47
48 import javax.ejb.Local;
49 import javax.ejb.TransactionAttribute;
50 import javax.ejb.TransactionAttributeType;
51
52 import org.apache.commons.configuration.Configuration;
53 import org.apache.solr.client.solrj.SolrServerException;
54 import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer;
55
56 /**
57  * The External API for GSS clients.
58  *
59  * @author past
60  */
61 @Local
62 public interface ExternalAPI {
63
64         /**
65          * Retrieves the root folder for the specified user. The caller must ensure
66          * that the userId exists.
67          *
68          * @param userId
69          * @return Folder
70          * @throws ObjectNotFoundException if no Folder or user was found
71          */
72         public FolderDTO getRootFolder(Long userId) throws ObjectNotFoundException;
73
74         /**
75          * Retrieve the folder with the specified ID.
76          *
77          * @param userId the ID of the current user
78          * @param folderId the ID of the folder to retrieve
79          * @return the folder found
80          * @throws ObjectNotFoundException if the folder or the user was not found
81          * @throws InsufficientPermissionsException if ther user does not have read permissions for folder
82          */
83         public FolderDTO getFolder(Long userId, Long folderId) throws ObjectNotFoundException,
84                         InsufficientPermissionsException;
85
86         /**
87          * Returns the user with the specified ID.
88          *
89          * @param userId The ID of the User to be found
90          * @return The User object
91          * @throws ObjectNotFoundException if the user cannot be found
92          */
93         public User getUser(Long userId) throws ObjectNotFoundException;
94
95         /**
96          * Returns the user with the specified ID.
97          *
98          * @param userId The ID of the User to be found
99          * @return The User object
100          * @throws ObjectNotFoundException if the user cannot be found
101          */
102         public UserDTO getUserDTO(Long userId) throws ObjectNotFoundException;
103
104         /**
105          * Returns the group with the specified ID.
106          *
107          * @param groupId The ID of the Group to be found
108          * @return The Group object
109          * @throws ObjectNotFoundException if the group cannot be found
110          */
111         public GroupDTO getGroup(Long groupId) throws ObjectNotFoundException;
112
113         /**
114          * Returns the group with the specified name that belongs to the
115          * specified user.
116          *
117          * @param userId the ID of the user
118          * @param name the name of the group
119          * @return The Group object
120          * @throws ObjectNotFoundException if the group cannot be found
121          */
122         public GroupDTO getGroup(Long userId, String name) throws ObjectNotFoundException;
123
124         /**
125          * Retrieve the list of groups for a particular user.
126          *
127          * @param userId the ID of the User
128          * @return a List of Groups that belong to the specified User
129          * @throws ObjectNotFoundException if the user was not found
130          */
131         public List<GroupDTO> getGroups(Long userId) throws ObjectNotFoundException;
132
133         /**
134          * Returns a list of files contained in the folder specified by its id.
135          *
136          * @param userId the ID of the User
137          * @param folderId the ID of the folder containing the files
138          * @param ignoreDeleted
139          * @return the list of file header objects
140          * @throws ObjectNotFoundException if the user or the folder cannot be found
141          * @throws InsufficientPermissionsException
142          */
143         public List<FileHeaderDTO> getFiles(Long userId, Long folderId, boolean ignoreDeleted) throws ObjectNotFoundException,
144                         InsufficientPermissionsException;
145
146         /**
147          * Returns a list of users for the specified group
148          *
149          * @param userId the ID of the User
150          * @param groupId the ID of the requested group
151          * @return List<UserDTO>
152          * @throws ObjectNotFoundException if the user or group was not found, with
153          *             the exception message mentioning the precise problem
154          */
155         public List<UserDTO> getUsers(Long userId, Long groupId) throws ObjectNotFoundException;
156
157         /**
158          * Returns a list of users matching the specified username
159          *
160          * @param username the username of the User
161          * @return List<UserDTO>
162          */
163         public List<UserDTO> getUsersByUserNameLike(String username);
164
165         /**
166          * Creates a new folder with the specified owner, parent folder and name.
167          * New folder has the same permissions as its parent
168          *
169          * @param userId
170          * @param parentId
171          * @param name
172          * @return the new folder
173          * @throws DuplicateNameException if the specified name already exists in
174          *             the parent folder, as either a folder or file
175          * @throws ObjectNotFoundException if the user or parent folder was not
176          *             found, with the exception message mentioning the precise
177          *             problem
178          * @throws InsufficientPermissionsException
179          */
180         public FolderDTO createFolder(Long userId, Long parentId, String name) throws DuplicateNameException,
181                         ObjectNotFoundException, InsufficientPermissionsException;
182
183         /**
184          * Deletes the specified folder, if the specified user has the appropriate
185          * permission.
186          *
187          * @param userId the ID of the current user
188          * @param folderId the ID of the folder to delete
189          * @throws InsufficientPermissionsException if the user does not have the
190          *             appropriate privileges
191          * @throws ObjectNotFoundException if the user or folder was not found, with
192          *             the exception message mentioning the precise problem
193          */
194         public void deleteFolder(Long userId, Long folderId)
195                         throws InsufficientPermissionsException, ObjectNotFoundException;
196
197         /**
198          * Retrieve the subfolders of the specified folder.
199          *
200          * @param userId the ID of the current user
201          * @param folderId the ID of the folder to retrieve
202          * @return the list of subfolders found
203          * @throws ObjectNotFoundException if the folder or user was not found
204          * @throws InsufficientPermissionsException
205          */
206         public List<FolderDTO> getSubfolders(Long userId, Long folderId)
207                         throws ObjectNotFoundException, InsufficientPermissionsException;
208
209         /**
210          * Retrieve the folder with the specified ID with subfolders.
211          *
212          * @param userId the ID of the current user
213          * @param folderId the ID of the folder to retrieve
214          * @return the folder found
215          * @throws ObjectNotFoundException if the folder or the user was not found
216          * @throws InsufficientPermissionsException if ther user does not have read permissions for folder
217          */
218         public FolderDTO getFolderWithSubfolders(Long userId, Long folderId)
219                         throws ObjectNotFoundException, InsufficientPermissionsException;
220
221         /**
222          * Retrieve the folder with the specified ID with subfolders.
223          *
224          * @param userId the ID of the current user
225          * @param callingUserId the ID of the user requesting this operation
226          * @param folderId the ID of the folder to retrieve
227          * @return the folder found
228          * @throws ObjectNotFoundException if the folder or the user was not found
229          * @throws InsufficientPermissionsException if ther user does not have read permissions for folder
230          */
231         public FolderDTO getFolderWithSubfolders(Long userId, Long callingUserId, Long folderId)
232                         throws ObjectNotFoundException, InsufficientPermissionsException;
233         /**
234          * Retrieve the subfolders of the specified folder that are shared to others.
235          *
236          * @param userId the ID of the current user
237          * @param folderId the ID of the folder to retrieve
238          * @return the list of subfolders found
239          * @throws ObjectNotFoundException if the folder or user was not found
240          */
241         public List<FolderDTO> getSharedSubfolders(Long userId, Long folderId) throws ObjectNotFoundException;
242
243         /**
244          * Retrieve the subfolders of the specified folder that are shared to others.
245          *
246          * @param userId the ID of the current user
247          * @param callingUserId the id of the user requesting this operation
248          * @param folderId the ID of the folder to retrieve
249          * @return the list of subfolders found
250          * @throws ObjectNotFoundException if the folder or user was not found
251          */
252         public List<FolderDTO> getSharedSubfolders(Long userId, Long callingUserId, Long folderId) throws ObjectNotFoundException;
253         /**
254          * Modifies the specified folder if the specified user has the appropriate
255          * permission.
256          *
257          * @param userId the ID of the current user
258          * @param folderId the ID of the folder to retrieve
259          * @param folderName
260          * @param readForAll
261          * @param permissions
262          * @return the updated folder
263          * @throws InsufficientPermissionsException if the user does not have the
264          *             appropriate privileges
265          * @throws ObjectNotFoundException if the user or folder was not found, with
266          *             the exception message mentioning the precise problem
267          * @throws DuplicateNameException if the specified name already exists in
268          *             the parent folder, as either a folder or file
269          */
270         public FolderDTO updateFolder(Long userId, Long folderId, String folderName,
271                                 Boolean readForAll,
272                                 Set<PermissionDTO> permissions)
273                         throws InsufficientPermissionsException, ObjectNotFoundException, DuplicateNameException;
274
275         /**
276          * Adds a user to the specified group
277          *
278          * @param userId the ID of the current user
279          * @param groupId the id of the new group
280          * @param userToAddId the id of the user to add
281          * @throws DuplicateNameException if the user already exists in group
282          * @throws ObjectNotFoundException if the user or group was not found, with
283          *             the exception message mentioning the precise problem
284          * @throws InsufficientPermissionsException
285          */
286         public void addUserToGroup(Long userId, Long groupId, Long userToAddId)
287                         throws ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException;
288
289         /**
290          * Creates a new group with the specified owner and name.
291          *
292          * @param userId the ID of the current user
293          * @param name the name of the new group
294          * @throws DuplicateNameException if the new group name already exists
295          * @throws ObjectNotFoundException if the user or group was not found, with
296          *             the exception message mentioning the precise problem
297          */
298         public void createGroup(Long userId, String name) throws ObjectNotFoundException, DuplicateNameException;
299
300         /**
301          * Deletes the specified group in the specified user's namespace.
302          *
303          * @param userId the ID of the current user
304          * @param groupId the ID of the group to delete
305          * @throws ObjectNotFoundException if the user or group was not found, with
306          *             the exception message mentioning the precise problem
307          * @throws InsufficientPermissionsException
308          */
309         public void deleteGroup(Long userId, Long groupId) throws ObjectNotFoundException, InsufficientPermissionsException;
310
311         /**
312          * Creates a new file with the specified owner, parent folder and name. The
313          * new file has the same permissions as its parent folder. The file contents
314          * are read from the input stream to a new File object.
315          *
316          * @param userId the ID of the current user
317          * @param folderId the ID of the parent folder
318          * @param name the name of the new file
319          * @param mimeType the MIME type of the file
320          * @param stream the input stream with the file contents
321          * @return The FileHeaderDTO created
322          * @throws DuplicateNameException if the specified name already exists in
323          *             the parent folder, as either a folder or file
324          * @throws ObjectNotFoundException if the user or parent folder was not
325          *             found, with the exception message mentioning the precise
326          *             problem
327          * @throws GSSIOException if there was an error while storing the file contents
328          * @throws InsufficientPermissionsException
329          * @throws QuotaExceededException
330          */
331         public FileHeaderDTO createFile(Long userId, Long folderId, String name, String mimeType,
332                                 InputStream stream) throws DuplicateNameException, ObjectNotFoundException,
333                                 GSSIOException, InsufficientPermissionsException, QuotaExceededException;
334
335         /**
336          * Deletes the specified file, provided the specified user has
337          * the necessary permissions.
338          *
339          * @param userId the ID of the current user
340          * @param fileId the ID of the file to delete
341          * @throws ObjectNotFoundException if the user or file was not found, with
342          *             the exception message mentioning the precise problem
343          * @throws InsufficientPermissionsException if the user does not have the
344          *             appropriate privileges
345          */
346         public void deleteFile(Long userId, Long fileId) throws ObjectNotFoundException, InsufficientPermissionsException;
347
348         /**
349          * Deletes the specified file in the specified user's namespace.
350          *
351          * @param userId the ID of the current user
352          * @param fileIds the IDs of the files to delete
353          * @throws ObjectNotFoundException if the user or file was not found, with
354          *             the exception message mentioning the precise problem
355          * @throws InsufficientPermissionsException if the user does not have the
356          *             appropriate privileges
357          */
358         public void deleteFiles(Long userId, List<Long> fileIds)
359                         throws ObjectNotFoundException, InsufficientPermissionsException;
360
361         /**
362          * Creates a new tag for the specified user and file.
363          *
364          * @param userId the creator of the tag
365          * @param fileHeaderId the file that is tagged
366          * @param tag the tag
367          * @throws ObjectNotFoundException if the user or the file was not found
368          */
369         public void createTag(Long userId, Long fileHeaderId, String tag) throws ObjectNotFoundException;
370
371         /**
372          * Returns all tags defined by the specified user
373          *
374          * @param userId
375          * @return Set<String>
376          * @throws ObjectNotFoundException if the user was null
377          */
378         public Set<String> getUserTags(final Long userId) throws ObjectNotFoundException;
379
380         /**
381          * Updates the attributes of the specified file.
382          *
383          * @param userId
384          * @param fileId
385          * @param name
386          * @param tagSet a String that contains tags separated by comma
387          * @param modificationDate the modification date
388          * @param versioned the new value of the versioned flag
389          * @param readForAll
390          * @param permissions
391          * @throws DuplicateNameException
392          * @throws ObjectNotFoundException
393          * @throws InsufficientPermissionsException
394          */
395         public void updateFile(Long userId, Long fileId, String name, String tagSet,
396                         Date modificationDate, Boolean versioned, Boolean readForAll,
397                         Set<PermissionDTO> permissions)
398                         throws DuplicateNameException, ObjectNotFoundException, InsufficientPermissionsException;
399
400         /**
401          * Retrieve the contents of the current body for the file
402          * with the specified FileHeader ID. The file contents
403          * are provided as an InputStream from which the caller can
404          * retrieve the raw bytes.
405          *
406          * @param userId the ID of the current user
407          * @param fileId the ID of the file to retrieve
408          * @return an InputStream from the current file body contents
409          * @throws ObjectNotFoundException if the file or the user was not found
410          * @throws InsufficientPermissionsException  if the user does not have the
411          *             appropriate privileges
412          */
413         public InputStream getFileContents(Long userId, Long fileId)
414                         throws ObjectNotFoundException, InsufficientPermissionsException;
415
416         /**
417          * Retrieve the contents of the  body identified by bodyId for the file
418          * with the specified FileHeader ID. The file contents
419          * are provided as an InputStream from which the caller can
420          * retrieve the raw bytes.
421          *
422          * @param userId the ID of the current user
423          * @param fileId the ID of the file to retrieve
424          * @param bodyId the body ID
425          * @return an InputStream from the current file body contents
426          * @throws ObjectNotFoundException if the file or the user was not found
427          * @throws InsufficientPermissionsException  if the user does not have the
428          *             appropriate privileges
429          */
430         public InputStream getFileContents(Long userId, Long fileId, Long bodyId)
431                         throws ObjectNotFoundException, InsufficientPermissionsException;
432
433         /**
434          * Retrieve the file with the specified ID.
435          *
436          * @param userId the ID of the current user
437          * @param fileId the ID of the file to retrieve
438          * @return the file found
439          * @throws ObjectNotFoundException if the file or the user was not found, with
440          *                      the exception message mentioning the precise problem
441          * @throws InsufficientPermissionsException
442          */
443         public FileHeaderDTO getFile(Long userId, Long fileId) throws ObjectNotFoundException,
444                         InsufficientPermissionsException;
445
446         /**
447          * Retrieve the filebody with the specified ID.
448          *
449          * @param userId the ID of the current user
450          * @param fileId the ID of the file to retrieve
451          * @param bodyId the ID of the body
452          * @return the file found
453          * @throws ObjectNotFoundException if the file or the user was not found, with
454          *                      the exception message mentioning the precise problem
455          * @throws InsufficientPermissionsException
456          */
457         public FileBodyDTO getFileBody(Long userId, Long fileId, Long bodyId)
458                         throws ObjectNotFoundException, InsufficientPermissionsException;
459
460         /**
461          * Get the resource (file or folder) at the specified path in
462          * the specified user's namespace. The returned object will be of type
463          * FileHeaderDTO or FolderDTO.<p><strong>Note:</strong> this method does not
464          * receive the current user as a parameter, therefore it is unable to perform
465          * the necessary permission checks and should <strong>NOT</strong> be directly
466          * exposed to remote clients. It is the caller's responsibility to verify that
467          * the calling user has the required privileges for performing any subsequent
468          * action on the resource through one of the other ExternalAPI methods.
469          *
470          * @param ownerId the ID of the user owning the namespace
471          * @param path the absolute path in the user's namespace
472          * @param ignoreDeleted if true, resources that have been moved to the trash
473          *                      will be ignored
474          * @throws ObjectNotFoundException if the user or resource was not found, with
475          *                      the exception message mentioning the precise problem
476          * @return the resource found
477          */
478         public Object getResourceAtPath(Long ownerId, String path, boolean ignoreDeleted)
479                         throws ObjectNotFoundException;
480
481         /**
482          * Copy the provided file to the specified destination.
483          *
484          * @param userId the ID of the current user
485          * @param fileId the IF of the provided file
486          * @param dest the path of the new resource
487          * @throws ObjectNotFoundException if the user, file or destination was not
488          *                      found, with     the exception message mentioning the precise problem
489          * @throws DuplicateNameException if the specified name already exists in
490          *          the destination folder, as either a folder or file
491          * @throws GSSIOException if there was an error while accessing the file contents
492          * @throws InsufficientPermissionsException
493          * @throws QuotaExceededException
494          */
495         public void copyFile(Long userId, Long fileId, String dest) throws ObjectNotFoundException,
496                         DuplicateNameException, GSSIOException, InsufficientPermissionsException, QuotaExceededException;
497
498         /**
499          * Copy the provided file to the specified destination.
500          *
501          * @param userId the ID of the current user
502          * @param ownerId the ID of the owner of the destination namespace
503          * @param fileId the IF of the provided file
504          * @param dest the path of the new resource
505          * @throws ObjectNotFoundException if the user, file or destination was not
506          *                      found, with     the exception message mentioning the precise problem
507          * @throws DuplicateNameException if the specified name already exists in
508          *          the destination folder, as either a folder or file
509          * @throws GSSIOException if there was an error while accessing the file contents
510          * @throws InsufficientPermissionsException
511          * @throws QuotaExceededException
512          */
513         public void copyFileToPath(Long userId, Long ownerId, Long fileId, String dest) throws ObjectNotFoundException,
514                         DuplicateNameException, GSSIOException, InsufficientPermissionsException, QuotaExceededException;
515
516         /**
517          * Copy the provided file to the specified destination.
518          *
519          * @param userId the ID of the current user
520          * @param fileIds the IDs of the provided files
521          * @param destId the ID of the destination folder
522          * @throws ObjectNotFoundException if the user, file or destination was not
523          *                      found, with     the exception message mentioning the precise problem
524          * @throws GSSIOException if there was an error while accessing the file contents
525          * @throws DuplicateNameException if the specified name already exists in
526          *          the destination folder, as either a folder or file
527          * @throws InsufficientPermissionsException
528          * @throws QuotaExceededException
529          */
530         public void copyFiles(Long userId, List<Long> fileIds, Long destId)
531                         throws ObjectNotFoundException, DuplicateNameException, GSSIOException,
532                         InsufficientPermissionsException, QuotaExceededException;
533
534         /**
535          * Copy the provided file to the specified destination.
536          *
537          * @param userId the ID of the current user
538          * @param fileId the IF of the provided file
539          * @param destId the ID of the destination folder
540          * @param destName the name of the new file
541          * @throws ObjectNotFoundException if the user, file or destination was not
542          *                      found, with     the exception message mentioning the precise problem
543          * @throws GSSIOException if there was an error while accessing the file contents
544          * @throws DuplicateNameException if the specified name already exists in
545          *          the destination folder, as either a folder or file
546          * @throws InsufficientPermissionsException
547          * @throws QuotaExceededException
548          */
549         public void copyFile(Long userId, Long fileId, Long destId, String destName)
550                         throws ObjectNotFoundException, DuplicateNameException, GSSIOException,
551                         InsufficientPermissionsException, QuotaExceededException;
552
553         /**
554          * Copy the provided folder to the specified destination.
555          *
556          * @param userId the ID of the current user
557          * @param folderId the IF of the provided folder
558          * @param dest the path of the new folder
559          * @throws ObjectNotFoundException if the user, folder or destination was not
560          *                      found, with     the exception message mentioning the precise problem
561          * @throws DuplicateNameException if the specified name already exists in
562          *          the destination folder, as either a folder or file
563          * @throws InsufficientPermissionsException InsufficientPermissionsException if the user does not have the
564          *          appropriate privileges
565          */
566         public void copyFolder(Long userId, Long folderId, String dest) throws ObjectNotFoundException,
567                         DuplicateNameException, InsufficientPermissionsException;
568
569         /**
570          * Copy the provided folder to the specified destination.
571          *
572          * @param userId the ID of the current user
573          * @param folderId the IF of the provided folder
574          * @param destId the ID of the destination folder
575          * @param destName the name of the new folder
576          * @throws ObjectNotFoundException if the user, folder or destination was not
577          *                      found, with     the exception message mentioning the precise problem
578          * @throws DuplicateNameException if the specified name already exists in
579          *          the destination folder, as either a folder or file
580          * @throws InsufficientPermissionsException InsufficientPermissionsException
581          *                      if the user does not have the appropriate privileges
582          */
583         public void copyFolder(Long userId, Long folderId, Long destId, String destName)
584                         throws ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException;
585
586         /**
587          * Copy the provided folder and all its subfolders and files to the specified destination.
588          *
589          * @param userId the ID of the current user
590          * @param ownerId the ID of the owner of the destination namespace
591          * @param folderId the IF of the provided folder
592          * @param dest the path of the new folder
593          * @throws ObjectNotFoundException if the user, folder or destination was not
594          *                      found, with     the exception message mentioning the precise problem
595          * @throws DuplicateNameException if the specified name already exists in
596          *          the destination folder, as either a folder or file
597          * @throws InsufficientPermissionsException InsufficientPermissionsException if the user does not have the
598          *          appropriate privileges
599          * @throws QuotaExceededException if the user quota limit would be exceeded
600          * @throws GSSIOException if there was an error while accessing the file contents
601          */
602         public void copyFolderStructureToPath(Long userId, Long ownerId, Long folderId, String dest) throws ObjectNotFoundException,
603                         DuplicateNameException, InsufficientPermissionsException, GSSIOException, QuotaExceededException;
604
605         /**
606          * Copy the provided folder and all its subfolders and files to the specified destination.
607          *
608          * @param userId the ID of the current user
609          * @param folderId the IF of the provided folder
610          * @param destId the ID of the destination folder
611          * @param destName the name of the new folder
612          * @throws ObjectNotFoundException if the user, folder or destination was not
613          *                      found, with     the exception message mentioning the precise problem
614          * @throws DuplicateNameException if the specified name already exists in
615          *          the destination folder, as either a folder or file
616          * @throws InsufficientPermissionsException InsufficientPermissionsException
617          *                      if the user does not have the appropriate privileges
618          * @throws GSSIOException if there was an error while accessing the file contents
619          * @throws QuotaExceededException if the user quota limit would be exceeded
620          */
621         public void copyFolderStructure(Long userId, Long folderId, Long destId, String destName)
622                         throws ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException,
623                         GSSIOException, QuotaExceededException;
624
625         /**
626          * Marks  the specified file as deleted in the specified user's namespace.
627          *
628          * @param userId the ID of the current user
629          * @param fileId the ID of the file to delete
630          * @throws ObjectNotFoundException if the user or file was not found, with
631          *             the exception message mentioning the precise problem
632          * @throws InsufficientPermissionsException if the user does not have the
633          *             appropriate privileges
634          */
635         public void moveFileToTrash(Long userId, Long fileId) throws ObjectNotFoundException,
636                         InsufficientPermissionsException;
637
638         /**
639          * Marks  the specified deleted file as undeleted in the specified user's namespace.
640          *
641          * @param userId the ID of the current user
642          * @param fileId the ID of the file to undelete
643          * @throws ObjectNotFoundException if the user or file was not found, with
644          *             the exception message mentioning the precise problem
645          * @throws InsufficientPermissionsException if the user does not have the
646          *             appropriate privileges
647          *
648          */
649         public void removeFileFromTrash(Long userId, Long fileId) throws ObjectNotFoundException, InsufficientPermissionsException;
650
651         /**
652          * Marks  the specified files as deleted in the specified user's namespace.
653          *
654          * @param userId the ID of the current user
655          * @param fileIds the IDs of the file to delete
656          * @throws ObjectNotFoundException if the user or file was not found, with
657          *             the exception message mentioning the precise problem
658          * @throws InsufficientPermissionsException if the user does not have the
659          *             appropriate privileges
660          */
661         public void moveFilesToTrash(Long userId, List<Long> fileIds)
662                         throws ObjectNotFoundException, InsufficientPermissionsException;
663
664         /**
665          * Marks  the specified deleted files as undeleted in the specified user's namespace.
666          *
667          * @param userId the ID of the current user
668          * @param fileIds the IDs of the file to undelete
669          * @throws ObjectNotFoundException if the user or file was not found, with
670          *             the exception message mentioning the precise problem
671          * @throws InsufficientPermissionsException if the user does not have the
672          *             appropriate privileges
673          */
674         public void removeFilesFromTrash(Long userId, List<Long> fileIds) throws ObjectNotFoundException, InsufficientPermissionsException;
675
676         /**
677          * Marks  the specified folder as deleted in the specified user's namespace.
678          *
679          * @param userId the ID of the current user
680          * @param folderId the ID of the folder to delete
681          * @throws ObjectNotFoundException if the user or file was not found, with
682          *             the exception message mentioning the precise problem
683          * @throws InsufficientPermissionsException if the user does not have the
684          *             appropriate privileges
685          */
686         public void moveFolderToTrash(Long userId, Long folderId)
687                         throws ObjectNotFoundException, InsufficientPermissionsException;
688
689         /**
690          * Marks  the specified deleted folder as undeleted in the specified user's namespace.
691          *
692          * @param userId the ID of the current user
693          * @param folderId the ID of the folder to undelete
694          * @throws ObjectNotFoundException if the user or file was not found, with
695          *             the exception message mentioning the precise problem
696          * @throws InsufficientPermissionsException if the user does not have the
697          *          appropriate privileges
698          *
699          */
700         public void removeFolderFromTrash(Long userId, Long folderId) throws ObjectNotFoundException, InsufficientPermissionsException;
701
702         /**
703          * Move the provided folder and all its subfolders and files to the specified destination.
704          *
705          * @param userId the ID of the current user
706          * @param folderId the IF of the provided folder
707          * @param destId the ID of the destination folder
708          * @param destName the name of the new folder
709          * @throws ObjectNotFoundException if the user, folder or destination was not
710          *                      found, with     the exception message mentioning the precise problem
711          * @throws DuplicateNameException if the specified name already exists in
712          *          the destination folder, as either a folder or file
713          * @throws InsufficientPermissionsException if the user does not have the
714          *          appropriate privileges
715          * @throws GSSIOException
716          * @throws QuotaExceededException
717          */
718         public void moveFolder(Long userId, Long folderId, Long destId, String destName)
719                         throws ObjectNotFoundException, DuplicateNameException, InsufficientPermissionsException,
720                         GSSIOException, QuotaExceededException;
721
722         /**
723          * Move the provided folder and all its subfolders and files to the specified destination.
724          *
725          * @param userId the ID of the current user
726          * @param ownerId the owner of the destination namespace
727          * @param folderId the IF of the provided folder
728          * @param dest the path of the new folder
729          * @throws ObjectNotFoundException if the user, folder or destination was not
730          *                      found, with     the exception message mentioning the precise problem
731          * @throws DuplicateNameException if the specified name already exists in
732          *          the destination folder, as either a folder or file
733          * @throws InsufficientPermissionsException InsufficientPermissionsException if the user does not have the
734          *          appropriate privileges
735          * @throws GSSIOException
736          * @throws QuotaExceededException
737          */
738         public void moveFolderToPath(Long userId, Long ownerId, Long folderId, String dest) throws ObjectNotFoundException,
739                         DuplicateNameException, InsufficientPermissionsException, GSSIOException, QuotaExceededException;
740
741         /**
742          * Move the provided file to the specified destination.
743          *
744          * @param userId the ID of the current user
745          * @param fileId the IF of the provided file
746          * @param destId the ID of the destination folder
747          * @param destName the name of the new file
748          * @throws InsufficientPermissionsException
749          * @throws ObjectNotFoundException if the user, file or destination was not
750          *                      found, with     the exception message mentioning the precise problem
751          * @throws GSSIOException if there was an error while accessing the file contents
752          * @throws DuplicateNameException if the specified name already exists in
753          *          the destination folder, as either a folder or file
754          * @throws QuotaExceededException
755          */
756         public void moveFile(Long userId, Long fileId, Long destId, String destName)
757                         throws InsufficientPermissionsException, ObjectNotFoundException,
758                         DuplicateNameException, GSSIOException, QuotaExceededException;
759
760         /**
761          * Move the provided file to the specified destination.
762          *
763          * @param userId the ID of the current user
764          * @param ownerId the owner of the destination namespace
765          * @param fileId the IF of the provided file
766          * @param dest the path of the new file
767          * @throws InsufficientPermissionsException
768          * @throws ObjectNotFoundException if the user, file or destination was not
769          *                      found, with     the exception message mentioning the precise problem
770          * @throws GSSIOException if there was an error while accessing the file contents
771          * @throws DuplicateNameException if the specified name already exists in
772          *          the destination folder, as either a folder or file
773          * @throws QuotaExceededException
774          */
775         public void moveFileToPath(Long userId, Long ownerId, Long fileId, String dest) throws ObjectNotFoundException, InsufficientPermissionsException, DuplicateNameException, GSSIOException, QuotaExceededException;
776
777         /**
778          * move the provided file to the specified destination.
779          *
780          * @param userId the ID of the current user
781          * @param fileIds the IDs of the provided files
782          * @param destId the ID of the destination folder
783          * @throws InsufficientPermissionsException
784          * @throws ObjectNotFoundException if the user, file or destination was not
785          *                      found, with     the exception message mentioning the precise problem
786          * @throws GSSIOException if there was an error while accessing the file contents
787          * @throws DuplicateNameException if the specified name already exists in
788          *          the destination folder, as either a folder or file
789          * @throws QuotaExceededException
790          */
791         public void moveFiles(Long userId, List<Long> fileIds, Long destId)
792                         throws InsufficientPermissionsException, ObjectNotFoundException,
793                         DuplicateNameException, GSSIOException, QuotaExceededException;
794
795         /**
796          * Returns a list of All deleted files of a user.
797          *
798          * @param userId the ID of the User
799          *       * @return the list of deleted file header objects
800          * @throws ObjectNotFoundException if the user cannot be found
801          */
802         public List<FileHeaderDTO> getDeletedFiles(Long userId) throws ObjectNotFoundException;
803
804         /**
805          * Returns a list of All deleted root folders of a user.
806          *
807          * @param userId the ID of the User
808          *       * @return the list of deleted file header objects
809          * @throws ObjectNotFoundException if the user cannot be found
810          */
811         public List<FolderDTO> getDeletedRootFolders(Long userId) throws ObjectNotFoundException;
812
813         /**
814          * Empty Trash by deleting all marked as deleted files and folders
815          * @param userId
816          * @throws ObjectNotFoundException if something goes wrong in the delete process
817          * @throws InsufficientPermissionsException if something goes wrong in the delete process
818          */
819         public void emptyTrash(Long userId) throws ObjectNotFoundException, InsufficientPermissionsException;
820
821         /**
822          * Restores All Trashed Items by undeleting all marked as deleted files and folders
823          * @param userId
824          * @throws ObjectNotFoundException if something goes wrong in the delete process
825          * @throws InsufficientPermissionsException
826          */
827         public void restoreTrash(Long userId) throws ObjectNotFoundException, InsufficientPermissionsException;
828
829         /**
830          * Search the system for a user with the specified username.
831          * If no such user is found, the method returns null.
832          *
833          * @param username the username to search for
834          * @return the User object with the specified username
835          */
836         public User findUser(String username);
837
838         /**
839          * Create a new user with the specified name, username and e-mail address.
840          *
841          * @param username the username of the new user
842          * @param name the name of the new user
843          * @param mail the e-mail of the new user
844          * @param idp the IdP of the new user
845          * @param idpid the IdP identifier of the new user
846          * @return the newly-created User object
847          * @throws DuplicateNameException if a user with the same username already exists
848          * @throws ObjectNotFoundException if no username was provided
849          */
850         public User createUser(String username, String name, String mail, String idp, String idpid)
851                         throws DuplicateNameException, ObjectNotFoundException;
852
853         /**
854          * Updates the authentication token for the specified user.
855          *
856          * @param userId the ID of the user whose token should be updated
857          * @return the updated user
858          * @throws ObjectNotFoundException if the user could not be found
859          */
860         public User updateUserToken(Long userId) throws ObjectNotFoundException;
861
862         /**
863          * Updates the policy acceptance flag for the specified user.
864          *
865          * @param userId the ID of the user whose flag should be updated
866          * @param isAccepted the new value of the flag
867          * @return the updated user
868          * @throws ObjectNotFoundException if the user could not be found
869          */
870         public User updateUserPolicyAcceptance(Long userId, boolean isAccepted) throws ObjectNotFoundException;
871
872         /**
873          * Invalidates the authentication token for the specified user.
874          *
875          * @param userId the ID of the user whose token should be updated
876          * @throws ObjectNotFoundException if the user could not be found
877          */
878         public void invalidateUserToken(Long userId) throws ObjectNotFoundException;
879
880         /**
881          * Retrieve folder user and group permissions
882          *
883          * @param userId the ID of the user whose token should be updated
884          * @param folderId the ID of the folder
885          * @return the Set of permissions from requested folder
886          * @throws ObjectNotFoundException if the user or folder could not be found
887          * @throws InsufficientPermissionsException
888          */
889         public Set<PermissionDTO> getFolderPermissions(Long userId, Long folderId)
890                         throws ObjectNotFoundException, InsufficientPermissionsException;
891
892         /**
893          * Retrieve file user and group permissions
894          *
895          * @param userId the ID of the user whose token should be updated
896          * @param fileId the ID of the folder
897          * @return the Set of permissions from requested folder
898          * @throws ObjectNotFoundException if the user or folder could not be found
899          * @throws InsufficientPermissionsException
900          */
901         public Set<PermissionDTO> getFilePermissions(Long userId, Long fileId)
902                         throws ObjectNotFoundException, InsufficientPermissionsException;
903
904         /**
905          * Returns a list of all shared root folders of a user.
906          *
907          * @param userId the ID of the User
908          * @return the list of shared root folders
909          * @throws ObjectNotFoundException if the user cannot be found
910          */
911         public List<FolderDTO> getSharedRootFolders(Long userId) throws ObjectNotFoundException;
912
913         /**
914          * Returns a list of all shared files of a user that are not
915          * inside other shared folders.
916          *
917          * @param userId the ID of the User
918          * @return the list of shared files
919          * @throws ObjectNotFoundException if the user cannot be found
920          */
921         public List<FileHeaderDTO> getSharedFilesNotInSharedFolders(Long userId) throws ObjectNotFoundException;
922
923         /**
924          * Returns a list of all shared files of a user.
925          *
926          * @param userId the ID of the User
927          * @return the list of shared files
928          * @throws ObjectNotFoundException if the user cannot be found
929          */
930         public List<FileHeaderDTO> getSharedFiles(Long userId) throws ObjectNotFoundException;
931
932         /**
933          * Returns a list of all shared folders of a user.
934          *
935          * @param userId the ID of the User
936          * @return the list of shared folders
937          * @throws ObjectNotFoundException if the user cannot be found
938          */
939         public List<FolderDTO> getSharedFolders(Long userId) throws ObjectNotFoundException;
940
941         /**
942          * Returns a list of all shared root folders of a user that calling
943          * user has at least read permissions.
944          *
945          * @param ownerId the ID of the User
946          * @return the list of shared root folders
947          * @param callingUserId
948          *
949          * @throws ObjectNotFoundException if the user cannot be found
950          */
951         public List<FolderDTO> getSharedRootFolders(Long ownerId, Long callingUserId)
952                         throws ObjectNotFoundException;
953
954         /**
955          * Returns a list of all shared  files of a user that calling user has
956          * at least read permissions..
957          *
958          * @param ownerId the ID of the User
959          * @return the list of shared files
960          * @param callingUserId
961          * @throws ObjectNotFoundException if the user cannot be found
962          */
963         public List<FileHeaderDTO> getSharedFiles(Long ownerId, Long callingUserId)
964                         throws ObjectNotFoundException;
965
966         /**
967          * Remove a user member from a group
968          *
969          * @param userId the ID of the User owning the group
970          * @param groupId the ID of the requested group
971          * @param memberId the ID of the member to be removed
972          *
973          * @throws ObjectNotFoundException if the user or group was not found, with
974          *             the exception message mentioning the precise problem
975          * @throws InsufficientPermissionsException
976          */
977         public void removeMemberFromGroup(Long userId, Long groupId, Long memberId)
978                         throws ObjectNotFoundException, InsufficientPermissionsException;
979
980         /**
981          * Retrieves the list of users sharing files to user identified by user id
982          * @param userId
983          * @return the List of users sharing files to user
984          * @throws ObjectNotFoundException
985          */
986         public List<UserDTO> getUsersSharingFoldersForUser(Long userId) throws ObjectNotFoundException;
987
988         /**
989          * Search Files
990          *
991          * @param userId
992          * @param query
993          * @return list of files that match query
994          * @throws ObjectNotFoundException if no user or query was specified
995          */
996         public List<FileHeaderDTO> searchFiles(Long userId, String query) throws ObjectNotFoundException;
997
998         /**
999          * Creates a nonce for the specified user.
1000          *
1001          * @param userId the ID of the user
1002          * @return the new nonce
1003          * @throws ObjectNotFoundException if the user could not be found
1004          */
1005         public Nonce createNonce(Long userId) throws ObjectNotFoundException;
1006
1007         /**
1008          * Find the nonce object for the specified encoded nonce, that should be
1009          * associated with the specified user.
1010          *
1011          * @param nonce the issued nonce in Base64 encoding
1012          * @param userId the ID of the user for whom this nonce should have been issued
1013          * @return the retrieved nonce object
1014          * @throws ObjectNotFoundException if the nonce or user were not found
1015          */
1016         public Nonce getNonce(String nonce, Long userId) throws ObjectNotFoundException;
1017
1018         /**
1019          * Remove the specified nonce from the persistent store.
1020          *
1021          * @param id the ID of the nonce
1022          * @throws ObjectNotFoundException if the specified nonce could not be found
1023          */
1024         public void removeNonce(Long id) throws ObjectNotFoundException;
1025
1026         /**
1027          * Activate the supplied nonce for the specified user.
1028          *
1029          * @param userId the ID of the user
1030          * @param nonce the nonce to activate
1031          * @param nonceExpiryDate the expiry date of the nonce
1032          * @throws ObjectNotFoundException
1033          */
1034         public void activateUserNonce(Long userId, String nonce, Date nonceExpiryDate) throws ObjectNotFoundException;
1035
1036         /**
1037          * Retrieves user statistics.
1038          *
1039          * @param userId the ID of the user
1040          * @return the statistics
1041          * @throws ObjectNotFoundException
1042          *
1043          */
1044         public StatsDTO getUserStatistics(Long userId) throws ObjectNotFoundException;
1045
1046         /**
1047          * Retrieves file versions
1048          *
1049          * @param userId the ID of the user
1050          * @param fileId the ID of the file
1051          * @return the list of filebodies
1052          * @throws ObjectNotFoundException
1053          * @throws InsufficientPermissionsException
1054          *
1055          */
1056         public List<FileBodyDTO> getVersions(Long userId, Long fileId)
1057                         throws ObjectNotFoundException, InsufficientPermissionsException;
1058
1059         /**
1060          * Restore the file contents to the specified version.
1061          *
1062          * @param userId the ID of the user
1063          * @param fileId the ID of the file
1064          * @param version the version number of the desired file contents
1065          * @throws ObjectNotFoundException if the user or file was not
1066          *                      found, with     the exception message mentioning the precise problem
1067          * @throws InsufficientPermissionsException if the user does not have the
1068          *          appropriate privileges
1069          * @throws QuotaExceededException if the user quota limit would be exceeded
1070          * @throws GSSIOException if there was an error while accessing the file contents
1071          */
1072         public void restoreVersion(Long userId, Long fileId, int version)
1073                         throws ObjectNotFoundException, InsufficientPermissionsException,  GSSIOException, QuotaExceededException;
1074
1075         /**
1076          * Remove file version identified by bodyId
1077          *
1078          * @param userId the ID of the user
1079          * @param fileId the ID of the file
1080          * @param bodyId the ID of the body
1081          *
1082          * @throws ObjectNotFoundException
1083          * @throws InsufficientPermissionsException
1084          *
1085          */
1086         public void removeVersion(Long userId, Long fileId, Long bodyId)
1087                         throws ObjectNotFoundException, InsufficientPermissionsException;
1088
1089         /**
1090          * Removes all old file versions for specified file keeping only the current revision
1091          *
1092          * @param userId the ID of the user
1093          * @param fileId the ID of the file
1094          *
1095          * @throws ObjectNotFoundException
1096          * @throws InsufficientPermissionsException
1097          *
1098          */
1099         public void removeOldVersions(Long userId, Long fileId)
1100                         throws ObjectNotFoundException, InsufficientPermissionsException;
1101
1102         /**
1103          * It is used by the Solr mbean to rebuild the index.
1104          */
1105         public String rebuildSolrIndex();
1106
1107         /**
1108          * It is used by the Solr mbean to refresh the index. It does not delete anything just re-add everything in the index
1109          */
1110         public String refreshSolrIndex();
1111         
1112         /**
1113          * Creates a new file with the specified owner, parent folder and name. The
1114          * new file has the same permissions as its parent folder. The file contents
1115          * are already uploaded outside of externalAPI and the uploaded file is used as a parameter.
1116          *
1117          * @param userId the ID of the current user
1118          * @param folderId the ID of the parent folder
1119          * @param name the name of the new file
1120          * @param mimeType the MIME type of the file
1121          * @param fileSize the uploaded file size
1122          * @param filePath the uploaded file full path
1123          * @return The FileHeaderDTO created
1124          * @throws DuplicateNameException if the specified name already exists in
1125          *             the parent folder, as either a folder or file
1126          * @throws ObjectNotFoundException if the user or parent folder was not
1127          *             found, with the exception message mentioning the precise
1128          *             problem
1129          * @throws GSSIOException if there was an error while storing the file contents
1130          * @throws InsufficientPermissionsException
1131          * @throws QuotaExceededException
1132          */
1133         public FileHeaderDTO createFile(Long userId, Long folderId, String name, String mimeType, long fileSize, String filePath)
1134                         throws DuplicateNameException, ObjectNotFoundException, GSSIOException,
1135                         InsufficientPermissionsException, QuotaExceededException;
1136
1137         /**
1138          * Create a new FileBody with the supplied uploaded file as contents and make it the current body
1139          * of the file.
1140          *
1141          * @param userId the ID of the current user
1142          * @param fileId the ID of the file header object
1143          * @param mimeType the content type of the file
1144          * @param fileSize the uploaded file size
1145          * @param filePath the uploaded file full path
1146          * @return The FileHeaderDTO updated
1147          * @throws ObjectNotFoundException if the user or file was not found, with
1148          *                      the exception message mentioning the precise problem
1149          * @throws GSSIOException when an IO exception occurs
1150          * @throws InsufficientPermissionsException
1151          * @throws QuotaExceededException
1152          */
1153         public FileHeaderDTO updateFileContents(Long userId, Long fileId, String mimeType,
1154                                 long fileSize, String filePath) throws ObjectNotFoundException, GSSIOException,
1155                                 InsufficientPermissionsException, QuotaExceededException;
1156
1157         /**
1158          * Create a file based on inputstream without using transaction.
1159          *
1160          * @param stream
1161          * @param userId
1162          * @return the file
1163          * @throws IOException
1164          * @throws ObjectNotFoundException
1165          */
1166         @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
1167         public File uploadFile(InputStream stream, Long userId)
1168                         throws IOException, ObjectNotFoundException;
1169
1170         public void createFileUploadProgress(Long userId, String filename,
1171                                 Long bytesTransfered, Long fileSize) throws ObjectNotFoundException;
1172
1173         public FileUploadStatus getFileUploadStatus(Long userId, String fileName);
1174
1175         public void removeFileUploadProgress(Long userId, String filename)
1176                         throws ObjectNotFoundException;
1177
1178         /**
1179          * Fetch the file body with the specified version number.
1180          *
1181          * @param userId the ID of the current user
1182          * @param fileId the ID of the file header
1183          * @param version the version number
1184          * @return the file body
1185          * @throws ObjectNotFoundException if the user file or version
1186          *                      were not found
1187          * @throws InsufficientPermissionsException if the user does not
1188          *                      have enough privileges for reading this file
1189          */
1190         public FileBodyDTO getFileVersion(Long userId, Long fileId, int version) throws ObjectNotFoundException, InsufficientPermissionsException;
1191
1192         /**
1193          * Search the system for a user with the specified email address.
1194          * If no such user is found, the method returns null.
1195          */
1196         public User findUserByEmail(String email);
1197
1198         /**
1199          * Update the user with the values from the supplied object.
1200          */
1201         public void updateUser(User user);
1202
1203         /**
1204          * Update accounting information for given user.
1205          *
1206          * @param user The user to update
1207          * @param date Date of transaction
1208          * @param bandwidthDiff Bandwidth used; positive for addition,
1209          * negative for subtraction (e.g. to rollback)
1210          */
1211         public void updateAccounting(User user, Date date, long bandwidthDiff);
1212
1213         /**
1214          * Check if the user with the specified ID has permission to read the
1215          * folder with the supplied ID.
1216          */
1217         public boolean canReadFolder(Long userId, Long folderId) throws ObjectNotFoundException;
1218
1219         /**
1220          * Reset WebDAV password for given user.
1221          *
1222          * @param userId
1223          * @return the new password
1224          * @throws ObjectNotFoundException
1225          */
1226         public String resetWebDAVPassword(Long userId) throws ObjectNotFoundException;
1227
1228         /**
1229          * Find the invite for the specified invitation code.
1230          *
1231          * @param code the invitation code
1232          * @return the Invitation or null if not found
1233          */
1234         public Invitation findInvite(String code);
1235
1236         /**
1237          * Create a new user in the connected IdP.
1238          *
1239          * @param username the username of the new user
1240          * @param firstname the first name of the new user
1241          * @param lastname the last name of the new user
1242          * @param email the e-mail of the new user
1243          * @param password the password of the new user
1244          */
1245         public void createLdapUser(String username, String firstname, String lastname, String email, String password);
1246
1247         /**
1248          * Retrieves the available user classes.
1249          */
1250         public List<UserClass> getUserClasses();
1251
1252         /**
1253          * Upgrades the user class to the default "coupon bearer" class and marks
1254          * the provided coupon as used.
1255          *
1256          * @param username the username of the user
1257          * @param code the coupon code
1258          * @return the new user class
1259          * @throws InvitationUsedException when trying to reuse an already used invitation
1260          * @throws ObjectNotFoundException if the user was not found
1261          */
1262         public UserClass upgradeUserClass(String username, String code)
1263                         throws ObjectNotFoundException, InvitationUsedException;
1264
1265         /**
1266          * Retrieve the user class for coupon-bearing users.
1267          */
1268         public UserClass getCouponUserClass();
1269
1270         /**
1271          * Delete the actual file in the specified file system path.
1272          */
1273         public void deleteActualFile(String path);
1274
1275         /**
1276          * Posts the file specified by id to solr indexing server
1277          *
1278      * @param solr
1279          * @param id
1280          */
1281         public void postFileToSolr(CommonsHttpSolrServer solr, Long id);
1282 }