001/**
002 * Copyright 2005-2014 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.krad.messages;
017
018import java.util.Collection;
019
020/**
021 * API for message providers
022 *
023 * <p>
024 * A message provider fronts an external repository and provides messages from that repository
025 * to the application. The provider must support the following message retrieval methods and be registered
026 * with the {@link MessageService} implementation
027 * </p>
028 *
029 * @author Kuali Rice Team (rice.collab@kuali.org)
030 */
031public interface MessageProvider {
032
033    /**
034     * Gets the {@link Message} object that has the given namespace, component, key, and locale
035     *
036     * @param namespace namespace code the message belongs to
037     * @param component component code the namespace is associated with
038     * @param key key that identifies the message within the namespace and component
039     * @param locale locale code for the message to return
040     * @return Message matching message object, or null if a message was not found
041     */
042    public Message getMessage(String namespace, String component, String key, String locale);
043
044    /**
045     * Gets all message objects for the given namespace, component, and locale
046     *
047     * @param namespace namespace code the message belongs to
048     * @param component component code the namespace is associated with
049     * @param locale locale code for the message to return
050     * @return Collection<Message> collection of messages that match, or empty collection if no messages
051     *         are found
052     */
053    public Collection<Message> getAllMessagesForComponent(String namespace, String component, String locale);
054}