Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
SessionDocumentService |
|
| 1.0;1 |
1 | /** | |
2 | * Copyright 2005-2011 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.krad.service; | |
17 | ||
18 | import java.sql.Timestamp; | |
19 | ||
20 | import org.kuali.rice.kew.api.WorkflowDocument; | |
21 | import org.kuali.rice.krad.UserSession; | |
22 | import org.kuali.rice.krad.web.form.DocumentFormBase; | |
23 | ||
24 | /** | |
25 | * Service API for persisting <code>Document</code> form content and | |
26 | * retrieving back | |
27 | * | |
28 | * <p> | |
29 | * Used as an extension to session support. If a session times out, the doucment contents | |
30 | * can be retrieved from the persistence storage and work resumed | |
31 | * </p> | |
32 | * | |
33 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
34 | */ | |
35 | public interface SessionDocumentService { | |
36 | ||
37 | /** | |
38 | * Retrieves a document from the user session for the given document id | |
39 | */ | |
40 | public WorkflowDocument getDocumentFromSession(UserSession userSession, String docId); | |
41 | ||
42 | /** | |
43 | * This method places a document into the user session. | |
44 | */ | |
45 | public void addDocumentToUserSession(UserSession userSession, WorkflowDocument document); | |
46 | ||
47 | /** | |
48 | * Delete DocumentFormBase from session and database. | |
49 | * | |
50 | * @param documentNumber | |
51 | * @param docFormKey | |
52 | * @param userSession | |
53 | * @throws | |
54 | */ | |
55 | public void purgeDocumentForm(String documentNumber, String docFormKey, UserSession userSession, String ipAddress); | |
56 | ||
57 | /** | |
58 | * Delete KualiDocumentFormBase from session and database. | |
59 | * | |
60 | * @param documentNumber | |
61 | * @throws | |
62 | */ | |
63 | public void purgeAllSessionDocuments(Timestamp expirationDate); | |
64 | ||
65 | /** | |
66 | * This method stores a UifFormBase into session and database | |
67 | * | |
68 | * @param form | |
69 | * @param userSession | |
70 | * @param ipAddress | |
71 | */ | |
72 | public void setDocumentForm(DocumentFormBase form, UserSession userSession, String ipAddress); | |
73 | ||
74 | /** | |
75 | * Returns DocumentFormBase object from the db | |
76 | * | |
77 | * @param documentNumber | |
78 | * @param docFormKey | |
79 | * @param userSession | |
80 | * @param ipAddress | |
81 | * @return | |
82 | */ | |
83 | public DocumentFormBase getDocumentForm(String documentNumber, String docFormKey, UserSession userSession, | |
84 | String ipAddress); | |
85 | } |