Coverage Report - org.kuali.rice.kns.service.MaintenanceDocumentService
 
Classes in this File Line Coverage Branch Coverage Complexity
MaintenanceDocumentService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2008 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.kns.service;
 17  
 
 18  
 import java.util.List;
 19  
 
 20  
 import org.kuali.rice.kns.document.MaintenanceDocument;
 21  
 import org.kuali.rice.kns.document.MaintenanceLock;
 22  
 import org.kuali.rice.kns.maintenance.Maintainable;
 23  
 
 24  
 /**
 25  
  * This interface defines methods that a Maintenance Document Service must provide.
 26  
  * 
 27  
  * 
 28  
  */
 29  
 public interface MaintenanceDocumentService {
 30  
 
 31  
     /**
 32  
      * 
 33  
      * This method attempts to find any other active documents that are pending on the same maintenance record.
 34  
      * 
 35  
      * If any are pending and locked, thereby blocking this document, then the docHeaderId/documentNumber of the blocking
 36  
      * locked document is returned.
 37  
      * 
 38  
      * Otherwise, if nothing is blocking, then null is returned.
 39  
      * 
 40  
      * @param document - document to test
 41  
      * @return A String representing the docHeaderId of any blocking document, or null if none are blocking
 42  
      * 
 43  
      */
 44  
     public String getLockingDocumentId(MaintenanceDocument document);
 45  
 
 46  
     /**
 47  
      * This method attempts to find any other active documents that are pending on the same maintenance record.
 48  
      * 
 49  
      * If any are pending and locked, thereby blocking this document, then the docHeaderId/documentNumber of the blocking
 50  
      * locked document is returned.
 51  
      * 
 52  
      * Otherwise, if nothing is blocking, then null is returned.
 53  
      * 
 54  
      * @param maintainable - maintainable representing the document to test
 55  
      * @param documentNumber - the documentNumber/docHeaderId of the document to test
 56  
      * @return A String representing the docHeaderId of any blocking document, or null if none are blocking
 57  
      */
 58  
     public String getLockingDocumentId(Maintainable maintainable, String documentNumber);
 59  
 
 60  
 //    /**
 61  
 //     * Retrieves maintenance documents locked by the given bo class name, then materializes the pending changes to objects of the
 62  
 //     * given class.
 63  
 //     * 
 64  
 //     * @param businessObjectClass
 65  
 //     * @return
 66  
 //     */
 67  
 //    public List getPendingObjects(Class businessObjectClass);
 68  
 
 69  
     /**
 70  
      * 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.
 71  
      * 
 72  
      * This method deletes the locks for the given document number.  It is called when the document is final,
 73  
      * thus it can be unlocked, or when the locks need to be regenerated (thus they get cleared first).
 74  
      * 
 75  
      * @param documentNumber - document number whose locks should be deleted
 76  
      */
 77  
     public void deleteLocks(String documentNumber);
 78  
 
 79  
     /**
 80  
      * 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.
 81  
      * 
 82  
      * This method stores the given list of maintenance locks.  Typically these will all be for the same document.
 83  
      * 
 84  
      * @param maintenanceLocks - the list of maintenance locks to be stored
 85  
      */
 86  
     public void storeLocks(List<MaintenanceLock> maintenanceLocks);
 87  
 
 88  
 }