Coverage Report - org.kuali.rice.krms.impl.repository.AgendaBoService
 
Classes in this File Line Coverage Branch Coverage Complexity
AgendaBoService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2006-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  
 
 17  
 package org.kuali.rice.krms.impl.repository;
 18  
 
 19  
 import java.util.Set;
 20  
 
 21  
 import org.kuali.rice.krms.api.repository.agenda.AgendaDefinition;
 22  
 import org.kuali.rice.krms.api.repository.agenda.AgendaItem;
 23  
 
 24  
 /**
 25  
  * This is the interface for accessing KRMS repository Agenda related
 26  
  * business objects. 
 27  
  * 
 28  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 29  
  *
 30  
  */
 31  
 public interface AgendaBoService {
 32  
 
 33  
     /**
 34  
      * This will create a {@link AgendaDefinition} exactly like the parameter passed in.
 35  
      *
 36  
      * @param agenda  The Agenda to create
 37  
      * @throws IllegalArgumentException if the Agenda is null
 38  
      * @throws IllegalStateException if the Agenda already exists in the system
 39  
      */
 40  
         public AgendaDefinition createAgenda(AgendaDefinition agenda);
 41  
         
 42  
     /**
 43  
      * This will update an existing {@link AgendaDefinition}.
 44  
      *
 45  
      * @param agenda  The Agenda to update
 46  
      * @throws IllegalArgumentException if the Agenda is null
 47  
      * @throws IllegalStateException if the Agenda does not exists in the system
 48  
      */        
 49  
         public void updateAgenda(AgendaDefinition agenda);
 50  
         
 51  
     /**
 52  
      * Retrieves an Agenda from the repository based on the given agenda id.
 53  
      *
 54  
      * @param agendaId the id of the Agenda to retrieve
 55  
      * @return an {@link AgendaDefinition} identified by the given agendaId.  
 56  
      * A null reference is returned if an invalid or non-existent id is supplied.
 57  
      */
 58  
         public AgendaDefinition getAgendaByAgendaId(String agendaId);
 59  
         
 60  
     /**
 61  
      * Retrieves an Agenda from the repository based on the provided agenda name
 62  
      * and namespace.
 63  
      *
 64  
      * @param name the name of the Agenda to retrieve.
 65  
      * @param namespace the namespace that the agenda is under.
 66  
      * @return an {@link AgendaDefinition} identified by the given name and namespace.  
 67  
      * A null reference is returned if an invalid or non-existent name and
 68  
      * namespace combination is supplied.
 69  
      */
 70  
         public AgendaDefinition getAgendaByNameAndNamespace(String name, String namespace);
 71  
         
 72  
     /**
 73  
      * Retrieves a set of Agendas associated with a context.
 74  
      *
 75  
      * @param contextId the id of the context
 76  
      * @return a set of {@link AgendaDefinition} associated with the given context.  
 77  
      * A null reference is returned if an invalid or contextId is supplied.
 78  
      */
 79  
         public Set<AgendaDefinition> getAgendasByContextId(String contextId);
 80  
         
 81  
     /**
 82  
      * This will create an {@link AgendaItem} in the repository exactly like
 83  
      * the parameter passed in.
 84  
      *
 85  
      * @param agendaItem  The AgendaItem to create
 86  
      * @throws IllegalArgumentException if the AgendaItem is null
 87  
      * @throws IllegalStateException if the AgendaItem already exists in the system
 88  
      */
 89  
         public AgendaItem createAgendaItem(AgendaItem agendaItem);
 90  
         
 91  
     /**
 92  
      * This will update an existing {@link AgendaItem}.
 93  
      *
 94  
      * @param agendaItem  The AgendaItem to update
 95  
      * @throws IllegalArgumentException if the AgendaItem is null
 96  
      * @throws IllegalStateException if the AgendaItem does not exists in the system
 97  
      */        
 98  
         public void updateAgendaItem(AgendaItem agendaItem);
 99  
         
 100  
     /**
 101  
      * This will create an {@link AgendaItem} in the repository exactly like
 102  
      * the parameter passed in.  The AgendaItem will be linked to an existing
 103  
      * AgendaItem in the relationship provided. Linking the AgendaItems effectively
 104  
      * builds a tree of AgendaItems that may be traversed by the engine.
 105  
      *
 106  
      * @param agendaItem  The AgendaItem to create
 107  
      * @param parentId  The id of the existing AgendaItem to be linked with the
 108  
      *  newly created AgendaItem 
 109  
      * @param position. A boolean used to specify the relationship between the
 110  
      *  linked AgendaItems.
 111  
      *  <p> If the position parameter is true, the new AgendaItem is linked as the next 
 112  
      *  AgendaItem to be evaluated if the parent AgendaItem evaluates to TRUE.
 113  
      *  <p> If the position parameter is false, the new AgendaItem is linked as the next 
 114  
      *  AgendaItem to be evaluated if the parent AgendaItem evaluates to FALSE.
 115  
      *  <p> If the position parameter is null,  the new AgendaItem is linked as the next 
 116  
      *  AgendaItem to be evaluated after any true or false branches of the tree have
 117  
      *  been traversed.
 118  
      * @throws IllegalArgumentException if the AgendaItem is null
 119  
      * @throws IllegalStateException if the parent AgendaItem does not already exists in the system
 120  
      */
 121  
         public void addAgendaItem(AgendaItem agendaItem, String parentId, Boolean position);
 122  
         
 123  
     /**
 124  
      * Retrieves an AgendaItem from the repository based on the given agenda id.
 125  
      *
 126  
      * @param id the id of the AgendaItem to retrieve
 127  
      * @return an {@link AgendaItem} identified by the given id.  
 128  
      * A null reference is returned if an invalid or non-existent id is supplied.
 129  
      */
 130  
         public AgendaItem getAgendaItemById(String id);
 131  
 
 132  
         /**
 133  
         * Converts a mutable bo to it's immutable counterpart
 134  
         * @param bo the mutable business object
 135  
         * @return the immutable object
 136  
         */
 137  
         public AgendaDefinition to(AgendaBo bo);
 138  
 
 139  
    /**
 140  
         * Converts a immutable object to it's mutable bo counterpart
 141  
         * @param im immutable object
 142  
         * @return the mutable bo
 143  
         */
 144  
         public AgendaBo from(AgendaDefinition im);
 145  
 }