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.kim.framework.common.delegate;
017
018
019import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
020import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
021import org.kuali.rice.kim.api.KimConstants;
022import org.kuali.rice.kim.framework.type.KimTypeService;
023
024import javax.jws.WebMethod;
025import javax.jws.WebParam;
026import javax.jws.WebResult;
027import javax.jws.WebService;
028import javax.jws.soap.SOAPBinding;
029import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
030import java.util.Map;
031
032/**
033 * A {@link KimTypeService} with specific methods for Delegations.
034 */
035@WebService(name = "delegationTypeService", targetNamespace = KimConstants.Namespaces.KIM_NAMESPACE_2_0)
036@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
037public interface DelegationTypeService extends KimTypeService {
038
039    /**
040     * Gets whether a role assignment with the given qualifier is applicable for the given qualification.
041     * 
042     * For example, the qualifier for a role could be as follows:
043     *   chartOfAccountsCode = BL
044     *   organizationCode = ARSC
045     *   descendsHierarchy = true
046     *   
047     * The qualification could be:
048     *   chartOfAccountsCode = BL
049     *   organizationCode = PSY    (reports to BL-ARSC)
050     *   
051     * This method would return true for this set of arguments.  This would require a query of 
052     * the client app's organization hierarchy, so an implementation of this sort must be done by
053     * a service which lives within the client app and will be called remotely by KIM.
054     * 
055     * The contents of the passed in attribute sets should not be modified as they may be used in future calls by
056     * the role service.
057     *
058     * @param qualification the qualification.  cannot be null.
059     * @param delegationQualifier the delegation qualifier. cannot be null.
060     * @return true if the qualifications match
061     * @throws IllegalArgumentException if the qualification or delegationQualifier is null
062     */
063    @WebMethod(operationName="doesDelegationQualifierMatchQualification")
064    @WebResult(name = "match")
065    boolean doesDelegationQualifierMatchQualification(@WebParam(name = "qualification")
066                                                      @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
067                                                      Map<String, String> qualification,
068                                                      @WebParam(name = "delegationQualifier")
069                                                      @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
070                                                      Map<String, String> delegationQualifier ) throws RiceIllegalArgumentException;
071
072}