001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.krms.impl.repository; 017 018import org.kuali.rice.krms.api.repository.language.NaturalLanguageUsage; 019import java.util.List; 020 021/** 022 * This is the interface for accessing repository {@link NaturalLanguageUsageBo} related business objects. 023 * 024 * @author Kuali Rice Team (rice.collab@kuali.org) 025 * 026 */ 027public interface NaturalLanguageUsageBoService { 028 029 030 /** 031 * This will create a {@link NaturalLanguageUsage} exactly like the parameter passed in. 032 * 033 * @param naturalLanguageUsage The NaturalLanguageUsage to create. 034 * @throws IllegalArgumentException if the NaturalLanguageUsage is null. 035 * @throws IllegalStateException if the NaturalLanguageUsage already exists in the system. 036 * @return a {@link NaturalLanguageUsage} exactly like the parameter passed in. 037 * 038 */ 039 public NaturalLanguageUsage createNaturalLanguageUsage(NaturalLanguageUsage naturalLanguageUsage); 040 041 /** 042 * Retrieves a NaturalLanguageUsage from the repository based on the given id. 043 * 044 * @param naturalLanguageUsageId to retrieve. 045 * @return a {@link NaturalLanguageUsage} identified by the given id. 046 * A null reference is returned if an invalid or non-existent id is supplied. 047 * 048 */ 049 public NaturalLanguageUsage getNaturalLanguageUsage(String naturalLanguageUsageId); 050 051 /** 052 * Retrieves a NaturalLanguageUsage from the repository based on the given namespace and name. 053 * 054 * @param namespace of the NaturalLanguageUsage to retrieve. 055 * @param name of the NaturalLanguageUsage to retrieve. 056 * @return a {@link NaturalLanguageUsage} identified by the given namespace and name. 057 * A null reference is returned if the repository does not contain a NaturalLanguageUsage with the given namespace 058 * and name. 059 * 060 */ 061 public NaturalLanguageUsage getNaturalLanguageUsageByName(String namespace, String name); 062 063 /** 064 * This will update an existing {@link NaturalLanguageUsage}. 065 * 066 * @param naturalLanguageUsage The NaturalLanguageUsage to update. 067 * @throws IllegalArgumentException if the NaturalLanguageUsage is null. 068 * @throws IllegalStateException if the NaturalLanguageUsage does not exists in the system. 069 * 070 */ 071 public NaturalLanguageUsage updateNaturalLanguageUsage(NaturalLanguageUsage naturalLanguageUsage); 072 073 /** 074 * Delete the {@link NaturalLanguageUsage} with the given id. 075 * 076 * @param naturalLanguageUsageId to delete. 077 * @throws IllegalArgumentException if the NaturalLanguageUsage is null. 078 * @throws IllegalStateException if the NaturalLanguageUsage does not exists in the system 079 * 080 */ 081 public void deleteNaturalLanguageUsage(String naturalLanguageUsageId); 082 083 public List<NaturalLanguageUsage> findNaturalLanguageUsagesByName(String name); 084 085 public List<NaturalLanguageUsage> findNaturalLanguageUsagesByDescription(String description); 086 087 public List<NaturalLanguageUsage> findNaturalLanguageUsagesByNamespace(String namespace); 088 089 /** 090 * Converts a mutable {@link NaturalLanguageUsageBo} to its immutable counterpart, {@link NaturalLanguageUsage}. 091 * @param naturalLanguageUsageBo the mutable business object. 092 * @return a {@link NaturalLanguageUsage} the immutable object. 093 * 094 */ 095 public NaturalLanguageUsage to(NaturalLanguageUsageBo naturalLanguageUsageBo); 096 097 /** 098 * Converts a immutable {@link NaturalLanguageUsage} to its mutable {@link NaturalLanguageUsageBo} counterpart. 099 * @param naturalLanguageUsage the immutable object. 100 * @return a {@link NaturalLanguageUsageBo} the mutable NaturalLanguageUsageBo. 101 * 102 */ 103 public NaturalLanguageUsageBo from(NaturalLanguageUsage naturalLanguageUsage); 104 105}