| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| PopulationRule |
|
| 1.0;1 |
| 1 | /** | |
| 2 | * Copyright 2011 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 2.0 (the | |
| 5 | * "License"); you may not use this file except in compliance with the | |
| 6 | * License. You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.osedu.org/licenses/ECL-2.0 | |
| 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 | |
| 13 | * implied. See the License for the specific language governing | |
| 14 | * permissions and limitations under the License. | |
| 15 | */ | |
| 16 | package org.kuali.student.r2.core.population.infc; | |
| 17 | ||
| 18 | import java.util.List; | |
| 19 | ||
| 20 | import org.kuali.student.r2.common.infc.IdEntity; | |
| 21 | import org.kuali.rice.core.api.criteria.QueryByCriteria; | |
| 22 | ||
| 23 | /** | |
| 24 | * Information about a Population Rule to set up a Population. Each | |
| 25 | * "rule" defined in this interface adds to the population. | |
| 26 | * | |
| 27 | * The Population Rule Type determines the "operator" of how these | |
| 28 | * elements are combined. | |
| 29 | * | |
| 30 | * @author tom | |
| 31 | * @since Thu Nov 21 14:22:34 EDT 2011 | |
| 32 | */ | |
| 33 | public interface PopulationRule | |
| 34 | extends IdEntity { | |
| 35 | ||
| 36 | /** | |
| 37 | * The search criteria to be used in building this | |
| 38 | * population. | |
| 39 | * | |
| 40 | * *** NOT IMPLEMENTED ***** | |
| 41 | * TODO: Figure out how this can be persisted | |
| 42 | * | |
| 43 | * @name Search Criteria | |
| 44 | * @required when the rule type indicates the population is based on a search criteria | |
| 45 | */ | |
| 46 | public QueryByCriteria getSearchCriteria(); | |
| 47 | ||
| 48 | /** | |
| 49 | * Agenda Ids to be used in building this population. | |
| 50 | * | |
| 51 | * @name Agenda Ids | |
| 52 | * @required when the rule type indicates this is based on a KRMS rule | |
| 53 | */ | |
| 54 | public List<String> getAgendaIds(); | |
| 55 | ||
| 56 | /** | |
| 57 | * A list of Group Ids to be used in building this population. | |
| 58 | * | |
| 59 | * @name Group Ids | |
| 60 | * @required when the rule type indicates this is based on a group | |
| 61 | */ | |
| 62 | public List<String> getGroupIds(); | |
| 63 | ||
| 64 | /** | |
| 65 | * A list of Person Ids to be used in building this population. | |
| 66 | * | |
| 67 | * Note: this does not hold the list of members unless people can be manually | |
| 68 | * added or removed from the population. | |
| 69 | * | |
| 70 | * @name Person Ids | |
| 71 | * @required when rule type indicates students can be explicitly added/removed | |
| 72 | * from the population. | |
| 73 | */ | |
| 74 | public List<String> getPersonIds(); | |
| 75 | ||
| 76 | /** | |
| 77 | * A list of Population Ids to be used in building this | |
| 78 | * population. | |
| 79 | * | |
| 80 | * The operation is determined by the PopuationRule | |
| 81 | * Type. | |
| 82 | * | |
| 83 | * @name Child Population Ids | |
| 84 | * @required if the rule type indicates this population is created as a union or intersection or minus | |
| 85 | * other existing populations. | |
| 86 | */ | |
| 87 | public List<String> getChildPopulationIds(); | |
| 88 | ||
| 89 | /** | |
| 90 | * The Population Id to be used as the reference population from which | |
| 91 | * the child populations are removed in the minus operation. | |
| 92 | * | |
| 93 | * This is used only in the minus operation to help calculate "all others | |
| 94 | * not caught but the any of the above" use case. | |
| 95 | * | |
| 96 | * @name Reference Population Id | |
| 97 | * @required if the rule type is a Minus type | |
| 98 | */ | |
| 99 | public String getReferencePopulationId(); | |
| 100 | ||
| 101 | /** | |
| 102 | * Gets the valid sort order keys that can be used to sort the | |
| 103 | * members of the Population. | |
| 104 | * | |
| 105 | * The valid sort order keys correspond | |
| 106 | * to the underlying rule sorting capabilities. | |
| 107 | * | |
| 108 | * This may return an empty list indicating the population does not support | |
| 109 | * any particular ordering. | |
| 110 | * | |
| 111 | * @name Sort Order Type Keys | |
| 112 | */ | |
| 113 | public List<String> getSortOrderTypeKeys(); | |
| 114 | ||
| 115 | /** | |
| 116 | * Tests to see if the Population may vary by time. | |
| 117 | * | |
| 118 | * If true then the response to isMemberAtXXXX getMembersAtXXXX methods should | |
| 119 | * be used to assess membership because it is highly likely the population | |
| 120 | * would return a different result depending on the time parameter that is supplied. | |
| 121 | * | |
| 122 | * An example of populations that vary by time include freshman, sophomore, | |
| 123 | * junior, senior, etc... because the answer varies greatly depending on the | |
| 124 | * term in question. | |
| 125 | * | |
| 126 | * Some examples of populations that are not expected to vary with time are | |
| 127 | * males or students with IDs ending in an odd number or US citizens. | |
| 128 | * | |
| 129 | * Note: Saying that a population does not vary with time does not mean that | |
| 130 | * the population does not change over time. Rather it means that | |
| 131 | * calls isMember and isMemberAtXXX methods or getMembers and getMembersAtXXX | |
| 132 | * should normally return the same answer if invoked simultaneously. | |
| 133 | * | |
| 134 | * @name Varies By Time | |
| 135 | */ | |
| 136 | public Boolean getVariesByTime(); | |
| 137 | ||
| 138 | /** | |
| 139 | * Tests to see if this Population supports the getting of an explicit list | |
| 140 | * of the members in this population. | |
| 141 | * | |
| 142 | * Not all populations need to support this method and only support | |
| 143 | * the isMember method which tests. | |
| 144 | * | |
| 145 | * If false then calls to the getMembersXXX family for this population | |
| 146 | * should throw an OperationFailedException exception. | |
| 147 | * | |
| 148 | * @name Supports Get Members | |
| 149 | */ | |
| 150 | public Boolean getSupportsGetMembers(); | |
| 151 | } |