001 /** 002 * Copyright 2005-2013 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 */ 016 package org.kuali.rice.krms.impl.repository; 017 018 import org.kuali.rice.krms.api.repository.function.FunctionDefinition; 019 import org.kuali.rice.krms.api.repository.function.FunctionRepositoryService; 020 021 /** 022 * This is the interface for accessing KRMS repository Function related bos 023 * 024 * @author Kuali Rice Team (rice.collab@kuali.org) 025 * 026 */ 027 028 public interface FunctionBoService extends FunctionRepositoryService { 029 030 /** 031 * This will create a {@link FunctionDefinition} exactly like the function passed in. 032 * 033 * @param function The Function to create 034 * @throws IllegalArgumentException if the function is null 035 * @throws IllegalStateException if the function already exists in the system 036 */ 037 public FunctionDefinition createFunction(FunctionDefinition function); 038 039 /** 040 * This will update an existing {@link FunctionDefinition}. 041 * 042 * @param function The Function to update 043 * @throws IllegalArgumentException if the function is null 044 * @throws IllegalStateException if the function does not exist in the system 045 */ 046 public void updateFunction(FunctionDefinition function); 047 048 /** 049 * Retrieves a Function from the repository based on the given function id. 050 * 051 * @param functionId the id of the Function to retrieve 052 * @return a {@link FunctionDefinition} identified by the given functionId. 053 * A null reference is returned if an invalid or non-existent functionId is supplied. 054 */ 055 public FunctionDefinition getFunctionById(String functionId); 056 057 /** 058 * Retrieves a Function from the repository based on the provided function name 059 * and namespace. 060 * 061 * @param name the name of the Function to retrieve. 062 * @param namespace the namespace that the Function is under. 063 * @return a {@link FunctionDefinition} identified by the given name and namespace. 064 * A null reference is returned if an invalid or non-existent function name and 065 * namespace combination is supplied. 066 */ 067 public FunctionDefinition getFunctionByNameAndNamespace(String name, String namespace); 068 069 }