View Javadoc

1   /**
2    * Copyright 2005-2011 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  
19  import org.kuali.rice.krms.api.repository.context.ContextDefinition;
20  
21  /**
22   * This is the interface for accessing KRMS repository Context related bos 
23   * 
24   * @author Kuali Rice Team (rice.collab@kuali.org)
25   *
26   */
27  public interface ContextBoService {
28  
29      /**
30       * This will create a {@link ContextDefinition} exactly like the parameter passed in.
31       *
32       * @param context  The Context to create
33       * @throws IllegalArgumentException if the context is null
34       * @throws IllegalStateException if the context already exists in the system
35       */
36  	public ContextDefinition createContext(ContextDefinition context);
37  
38      /**
39       * This will update an existing {@link ContextDefinition}.
40       *
41       * @param context  The Context to update
42       * @throws IllegalArgumentException if the Context is null
43       * @throws IllegalStateException if the Context does not exists in the system
44       */	
45  	public void updateContext(ContextDefinition context);
46  	
47  //	public void createContextAttribute(ContextAttribute contextAttribute);
48  //	public void updateContextAttribute(ContextAttribute contextAttribute);
49  	
50      /**
51       * Retrieves an Context from the repository based on the given context id.
52       *
53       * @param contextId the id of the Context to retrieve
54       * @return an {@link ContextDefinition} identified by the given contextId.  
55       * A null reference is returned if an invalid or non-existent id is supplied.
56       * @throws IllegalArgumentException if the contextId is null or blank.
57       */
58  	public ContextDefinition getContextByContextId( String contextId );
59  	
60      /**
61       * Retrieves an Context from the repository based on the provided context name
62       * and namespace.
63       *
64       * @param name the name of the Context to retrieve.
65       * @param namespace the namespace that the context is under.
66       * @return an {@link ContextDefinition} identified by the given name and namespace.  
67       * A null reference is returned if an invalid or non-existent name and
68       * namespace combination is supplied.
69       * @throws IllegalArgumentException if the either the name or the namespace
70       * is null or blank.
71       */
72  	public ContextDefinition getContextByNameAndNamespace( String name, String namespace );
73  
74  	/**
75  	* Converts a mutable bo to it's immutable counterpart
76  	* @param bo the mutable business object
77  	* @return the immutable object
78  	*/
79  //	public ContextDefinition to( ContextBo bo);
80  
81     /**
82  	* Converts a immutable object to it's mutable bo counterpart
83  	* @param im immutable object
84  	* @return the mutable bo
85  	*/
86  //	public ContextBo from( ContextDefinition im );
87  }