01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.core.service;
17:
18: import java.util.List;
19:
20: import org.kuali.core.document.MaintenanceDocument;
21: import org.kuali.core.document.MaintenanceLock;
22:
23: /**
24: * This interface defines methods that a Maintenance Document Service must provide.
25: *
26: *
27: */
28: public interface MaintenanceDocumentService {
29:
30: /**
31: *
32: * This method attempts to find any other active documents that are pending on the same maintenance record.
33: *
34: * If any are pending and locked, thereby blocking this document, then the docHeaderId/documentNumber of the blocking
35: * locked document is returned.
36: *
37: * Otherwise, if nothing is blocking, then null is returned.
38: *
39: * @param document - document to test
40: * @return A String representing the docHeaderId of any blocking document, or null if none are blocking
41: *
42: */
43: public String getLockingDocumentId(MaintenanceDocument document);
44:
45: /**
46: * Retrieves maintenance documents locked by the given bo class name, then materializes the pending changes to objects of the
47: * given class.
48: *
49: * @param businessObjectClass
50: * @return
51: */
52: public List getPendingObjects(Class businessObjectClass);
53:
54: /**
55: * This method is here to call the same-named method in the Dao, since the service has access to the Dao, but the caller doesn't.
56: *
57: * This method deletes the locks for the given document number. It is called when the document is final,
58: * thus it can be unlocked, or when the locks need to be regenerated (thus they get cleared first).
59: *
60: * @param documentNumber - document number whose locks should be deleted
61: */
62: public void deleteLocks(String documentNumber);
63:
64: /**
65: * This method is here to call the same-named method in the Dao, since the service has access to the Dao, but the caller doesn't.
66: *
67: * This method stores the given list of maintenance locks. Typically these will all be for the same document.
68: *
69: * @param maintenanceLocks - the list of maintenance locks to be stored
70: */
71: public void storeLocks(List<MaintenanceLock> maintenanceLocks);
72:
73: }
|