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