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