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.ksb.service;
017
018import javax.xml.namespace.QName;
019
020/**
021 * This class is used to register and validate services with basic authentication.
022 *
023 * @author Kuali Rice Team (rice.collab@kuali.org)
024 */
025public interface BasicAuthenticationService {
026
027    /**
028     * Registers the service credentials of the service
029     *
030     * @param credentials the credentials for the service
031     */
032    public void registerServiceCredentials(BasicAuthenticationCredentials credentials);
033
034    /**
035     * Registers the connection credentials of the service
036     *
037     * @param credentials the credentials for the service
038     */
039    public void registerConnectionCredentials(BasicAuthenticationConnectionCredentials credentials);
040
041    /**
042     * Gets the connection credentials for the given serviceNameSpaceURI and serviceName
043     *
044     * @param serviceNameSpaceURI the serviceNameSpaceURI of the service
045     * @param serviceName the serviceName of the service
046     * @return the BasicAuthenticationConnectionCredentials for the given serviceNameSpaceURI and serviceName
047     */
048    public BasicAuthenticationConnectionCredentials getConnectionCredentials(String serviceNameSpaceURI,
049            String serviceName);
050
051    /**
052     * Validates service authentication for the given serviceNameSpaceURI, serviceName, username and password
053     *
054     * @param serviceNameSpaceURI the serviceNameSpaceURI of the service
055     * @param serviceName the serviceName of the service
056     * @param username the username for the service
057     * @param password the password for the service
058     * @return true if the service can be authenticated
059     */
060    public boolean checkServiceAuthentication(String serviceNameSpaceURI, QName serviceName, String username,
061            String password);
062
063}