1 /**
2 * Copyright 2005-2014 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.krad.messages;
17
18 import java.util.Collection;
19
20 /**
21 * API for message providers
22 *
23 * <p>
24 * A message provider fronts an external repository and provides messages from that repository
25 * to the application. The provider must support the following message retrieval methods and be registered
26 * with the {@link MessageService} implementation
27 * </p>
28 *
29 * @author Kuali Rice Team (rice.collab@kuali.org)
30 */
31 public interface MessageProvider {
32
33 /**
34 * Gets the {@link Message} object that has the given namespace, component, key, and locale
35 *
36 * @param namespace namespace code the message belongs to
37 * @param component component code the namespace is associated with
38 * @param key key that identifies the message within the namespace and component
39 * @param locale locale code for the message to return
40 * @return Message matching message object, or null if a message was not found
41 */
42 public Message getMessage(String namespace, String component, String key, String locale);
43
44 /**
45 * Gets all message objects for the given namespace, component, and locale
46 *
47 * @param namespace namespace code the message belongs to
48 * @param component component code the namespace is associated with
49 * @param locale locale code for the message to return
50 * @return Collection<Message> collection of messages that match, or empty collection if no messages
51 * are found
52 */
53 public Collection<Message> getAllMessagesForComponent(String namespace, String component, String locale);
54 }