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.typerelation.RelationshipType;
019import org.kuali.rice.krms.api.repository.typerelation.TypeTypeRelation;
020import java.util.List;
021
022/**
023 * This is the interface for accessing repository {@link TypeTypeRelationBo} related business objects.
024 * 
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 * 
027 */
028public interface TypeTypeRelationBoService {
029
030
031    /**
032     * This will create a {@link TypeTypeRelation} exactly like the parameter passed in.
033     * 
034     * @param typeTypeRelation  The TypeTypeRelation to create.
035     * @throws IllegalArgumentException if the TypeTypeRelation is null.
036     * @throws IllegalStateException if the TypeTypeRelation already exists in the system.
037     * @return a {@link TypeTypeRelation} exactly like the parameter passed in.
038     * 
039     */
040    public TypeTypeRelation createTypeTypeRelation(TypeTypeRelation typeTypeRelation);
041
042    /**
043     * Retrieves a TypeTypeRelation from the repository based on the given id.
044     * 
045     * @param typeTypeRelationId to retrieve.
046     * @return a {@link TypeTypeRelation} identified by the given id.  
047     * A null reference is returned if an invalid or non-existent id is supplied.
048     * 
049     */
050    public TypeTypeRelation getTypeTypeRelation(String typeTypeRelationId);
051
052    /**
053     * This will update an existing {@link TypeTypeRelation}.
054     * 
055     * @param typeTypeRelation  The TypeTypeRelation to update.
056     * @throws IllegalArgumentException if the TypeTypeRelation is null.
057     * @throws IllegalStateException if the TypeTypeRelation does not exists in the system.
058     * 
059     */
060    public void updateTypeTypeRelation(TypeTypeRelation typeTypeRelation);
061
062    /**
063     * Delete the {@link TypeTypeRelation} with the given id.
064     * 
065     * @param typeTypeRelationId to delete.
066     * @throws IllegalArgumentException if the TypeTypeRelation is null.
067     * @throws IllegalStateException if the TypeTypeRelation does not exists in the system
068     * 
069     */
070    public void deleteTypeTypeRelation(String typeTypeRelationId);
071
072    public List<TypeTypeRelation> findTypeTypeRelationsByFromType(String fromTypeId);
073
074    public List<TypeTypeRelation> findTypeTypeRelationsByToType(String toTypeId);
075
076    public List<TypeTypeRelation> findTypeTypeRelationsByRelationshipType(RelationshipType relationshipType);
077
078    public List<TypeTypeRelation> findTypeTypeRelationsBySequenceNumber(Integer sequenceNumber);
079
080    /**
081     * Converts a mutable {@link TypeTypeRelationBo} to its immutable counterpart, {@link TypeTypeRelation}.
082     * @param typeTypeRelationBo the mutable business object.
083     * @return a {@link TypeTypeRelation} the immutable object.
084     * 
085     */
086    public TypeTypeRelation to(TypeTypeRelationBo typeTypeRelationBo);
087
088    /**
089     * Converts a immutable {@link TypeTypeRelation} to its mutable {@link TypeTypeRelationBo} counterpart.
090     * @param typeTypeRelation the immutable object.
091     * @return a {@link TypeTypeRelationBo} the mutable TypeTypeRelationBo.
092     * 
093     */
094    public TypeTypeRelationBo from(TypeTypeRelation typeTypeRelation);
095
096}