1 /** 2 * Copyright 2005-2016 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.krms.impl.repository; 17 18 import org.kuali.rice.krms.api.repository.language.NaturalLanguageUsage; 19 import java.util.List; 20 21 /** 22 * This is the interface for accessing repository {@link NaturalLanguageUsageBo} related business objects. 23 * 24 * @author Kuali Rice Team (rice.collab@kuali.org) 25 * 26 */ 27 public interface NaturalLanguageUsageBoService { 28 29 30 /** 31 * This will create a {@link NaturalLanguageUsage} exactly like the parameter passed in. 32 * 33 * @param naturalLanguageUsage The NaturalLanguageUsage to create. 34 * @throws IllegalArgumentException if the NaturalLanguageUsage is null. 35 * @throws IllegalStateException if the NaturalLanguageUsage already exists in the system. 36 * @return a {@link NaturalLanguageUsage} exactly like the parameter passed in. 37 * 38 */ 39 public NaturalLanguageUsage createNaturalLanguageUsage(NaturalLanguageUsage naturalLanguageUsage); 40 41 /** 42 * Retrieves a NaturalLanguageUsage from the repository based on the given id. 43 * 44 * @param naturalLanguageUsageId to retrieve. 45 * @return a {@link NaturalLanguageUsage} identified by the given id. 46 * A null reference is returned if an invalid or non-existent id is supplied. 47 * 48 */ 49 public NaturalLanguageUsage getNaturalLanguageUsage(String naturalLanguageUsageId); 50 51 /** 52 * Retrieves a NaturalLanguageUsage from the repository based on the given namespace and name. 53 * 54 * @param namespace of the NaturalLanguageUsage to retrieve. 55 * @param name of the NaturalLanguageUsage to retrieve. 56 * @return a {@link NaturalLanguageUsage} identified by the given namespace and name. 57 * A null reference is returned if the repository does not contain a NaturalLanguageUsage with the given namespace 58 * and name. 59 * 60 */ 61 public NaturalLanguageUsage getNaturalLanguageUsageByName(String namespace, String name); 62 63 /** 64 * This will update an existing {@link NaturalLanguageUsage}. 65 * 66 * @param naturalLanguageUsage The NaturalLanguageUsage to update. 67 * @throws IllegalArgumentException if the NaturalLanguageUsage is null. 68 * @throws IllegalStateException if the NaturalLanguageUsage does not exists in the system. 69 * 70 */ 71 public void updateNaturalLanguageUsage(NaturalLanguageUsage naturalLanguageUsage); 72 73 /** 74 * Delete the {@link NaturalLanguageUsage} with the given id. 75 * 76 * @param naturalLanguageUsageId to delete. 77 * @throws IllegalArgumentException if the NaturalLanguageUsage is null. 78 * @throws IllegalStateException if the NaturalLanguageUsage does not exists in the system 79 * 80 */ 81 public void deleteNaturalLanguageUsage(String naturalLanguageUsageId); 82 83 public List<NaturalLanguageUsage> findNaturalLanguageUsagesByName(String name); 84 85 public List<NaturalLanguageUsage> findNaturalLanguageUsagesByDescription(String description); 86 87 public List<NaturalLanguageUsage> findNaturalLanguageUsagesByNamespace(String namespace); 88 89 /** 90 * Converts a mutable {@link NaturalLanguageUsageBo} to its immutable counterpart, {@link NaturalLanguageUsage}. 91 * @param naturalLanguageUsageBo the mutable business object. 92 * @return a {@link NaturalLanguageUsage} the immutable object. 93 * 94 */ 95 public NaturalLanguageUsage to(NaturalLanguageUsageBo naturalLanguageUsageBo); 96 97 /** 98 * Converts a immutable {@link NaturalLanguageUsage} to its mutable {@link NaturalLanguageUsageBo} counterpart. 99 * @param naturalLanguageUsage the immutable object. 100 * @return a {@link NaturalLanguageUsageBo} the mutable NaturalLanguageUsageBo. 101 * 102 */ 103 public NaturalLanguageUsageBo from(NaturalLanguageUsage naturalLanguageUsage); 104 105 }