View Javadoc

1   /**
2    * Copyright 2011 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.mobility.configparams.service;
17  
18  import java.util.Collection;
19  import java.util.List;
20  
21  import org.kuali.mobility.configparams.entity.ConfigParam;
22  
23  /**
24   * Interface for a contract for interacting with configuration parameters
25   * @author Kuali Mobility Team (mobility.dev@kuali.org)
26   */
27  public interface ConfigParamService {
28  
29  	/**
30  	 * @param configParam the ConfigParam to save
31  	 * @return the id of the saved ConfigParam
32  	 */
33  	public Long saveConfigParam(ConfigParam configParam);
34  
35  	/**
36  	 * @return all configuration parameters
37  	 */
38  	public List<ConfigParam> findAllConfigParam();
39  
40  	/**
41  	 * @param id the id of the ConfigParam to retrieve
42  	 * @return the ConfigParam matching the id
43  	 */
44  	public ConfigParam findConfigParamById(Long id);
45  
46  	/**
47       * @param name the name of the ConfigParam to retrieve
48       * @return the ConfigParam matching the name
49       */
50  	public ConfigParam findConfigParamByName(String name);
51  
52  	/**
53       * @param id the id of the ConfigParam to delete
54       */
55  	public void deleteConfigParamById(Long id);
56  
57  	/**
58  	 * @param name the name of the ConfigParam
59  	 * @return the value of the matched ConfigParam
60  	 */
61      public String findValueByName(String name);
62  
63      /**
64       * Convert a collection of ConfigParam objects to JSON notation
65       * @param collection the colleciton of ConfigParam objects to convert
66       * @return the JSON string representing the collection
67       */
68      public String toJson(Collection<ConfigParam> collection);
69      
70      /**
71       * Parse a JSON string into a ConfigParam object
72       * @param json
73       * @return the parsed ConfigParam
74       */
75      public ConfigParam fromJsonToEntity(String json);
76      
77      /**
78       * Parse a JSON string into a ConfigParam collection
79       * @param json
80       * @return the parsed ConfigParam collection
81       */
82      public Collection<ConfigParam> fromJsonToCollection(String json);
83  
84  }