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.responsibility;
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.api.responsibility.Responsibility;
023import org.kuali.rice.kim.framework.type.KimTypeService;
024
025import javax.jws.WebMethod;
026import javax.jws.WebParam;
027import javax.jws.WebResult;
028import javax.jws.WebService;
029import javax.jws.soap.SOAPBinding;
030import javax.xml.bind.annotation.XmlElement;
031import javax.xml.bind.annotation.XmlElementWrapper;
032import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
033import java.util.List;
034import java.util.Map;
035
036/**
037 * A {@link KimTypeService} with specific methods for Responsibilities.
038 */
039@WebService(name = "responsibilityTypeService", targetNamespace = KimConstants.Namespaces.KIM_NAMESPACE_2_0)
040@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
041public interface ResponsibilityTypeService extends KimTypeService {
042
043    /** Gets whether a responsibility assignment with the given details is applicable for the given request details.
044     *
045     * For example, the details for a responsibilities (say approve) could be as follows:
046     *   component = Account
047     *   field = incomeStreamAccountNumber
048     *
049     * The Account component is known to belong to the KFS-COA namespace.  If this service is requested...
050     * component = Account, field = All
051     *
052     * @param requestedDetails the requested details.  cannot be null.
053     * @param responsibilities the list of responsibilities to check for matches. cannot be null.
054     * @return an immutable list of matched responsibilities.  will not return null.
055     * @throws IllegalArgumentException if the requestedDetails or responsibilities is null.
056     */
057    @WebMethod(operationName="getMatchingResponsibilities")
058    @XmlElementWrapper(name = "responsibilities", required = true)
059    @XmlElement(name = "responsibility", required = false)
060    @WebResult(name = "responsibilities")
061    List<Responsibility> getMatchingResponsibilities(@WebParam(name = "requestedDetails")
062                                            @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
063                                            Map<String, String> requestedDetails,
064                                            @WebParam(name = "responsibilities")
065                                            List<Responsibility> responsibilities) throws RiceIllegalArgumentException;
066}