Coverage Report - org.kuali.rice.kim.api.responsibility.ResponsibilityService
 
Classes in this File Line Coverage Branch Coverage Complexity
ResponsibilityService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2008 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.kim.api.responsibility;
 17  
 
 18  
 import org.kuali.rice.core.api.CoreConstants;
 19  
 import org.kuali.rice.core.api.criteria.QueryByCriteria;
 20  
 import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
 21  
 import org.kuali.rice.core.api.exception.RiceIllegalStateException;
 22  
 import org.kuali.rice.core.util.jaxb.MapStringStringAdapter;
 23  
 import org.kuali.rice.kim.api.common.template.Template;
 24  
 import org.kuali.rice.kim.api.common.template.TemplateQueryResults;
 25  
 
 26  
 import javax.jws.WebMethod;
 27  
 import javax.jws.WebParam;
 28  
 import javax.jws.WebResult;
 29  
 import javax.jws.WebService;
 30  
 import javax.jws.soap.SOAPBinding;
 31  
 import javax.xml.bind.annotation.XmlElement;
 32  
 import javax.xml.bind.annotation.XmlElementWrapper;
 33  
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 34  
 import java.util.List;
 35  
 import java.util.Map;
 36  
 
 37  
 /**
 38  
  * This service provides operations for determining what responsibility actions
 39  
  * a principal has and for querying about responsibility data.  It also provides several
 40  
  * write operations.
 41  
  *
 42  
  * <p>
 43  
  * A responsibility represents an action that a principal is requested to
 44  
  * take.  This is used for defining workflow actions (such as approve,
 45  
  * acknowledge, fyi) that the principal has the responsibility to take.  The
 46  
  * workflow engine integrates with this service to provide
 47  
  * responsibility-driven routing.
 48  
  * <p/>
 49  
  * <p>
 50  
  * A responsibility is very similar to a permission in a couple of ways.
 51  
  * First of all, responsibilities are always granted to a role, never assigned
 52  
  * directly to a principal or group.  Furthermore, in a similar fashion to
 53  
  * permissions, a role has the concept of a responsibility template.  The
 54  
  * responsibility template specifies what additional responsibility details
 55  
  * need to be defined when the responsibility is created.
 56  
  * <p/>
 57  
  *
 58  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 59  
  */
 60  
 @WebService(name = "ResponsibilityServiceSoap", targetNamespace = CoreConstants.Namespaces.CORE_NAMESPACE_2_0)
 61  
 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
 62  
 public interface ResponsibilityService {
 63  
 
 64  
     /**
 65  
      * This will create a {@link Responsibility} exactly like the responsibility passed in.
 66  
      *
 67  
      * @param responsibility the responsibility to create
 68  
      * @return the id of the newly created object.  will never be null.
 69  
      * @throws IllegalArgumentException if the responsibility is null
 70  
      * @throws IllegalStateException if the responsibility is already existing in the system
 71  
      */
 72  
     @WebMethod(operationName="createResponsibility")
 73  
     @WebResult(name = "responsibility")
 74  
     Responsibility createResponsibility(@WebParam(name = "responsibility") Responsibility responsibility)
 75  
             throws RiceIllegalArgumentException, RiceIllegalStateException;
 76  
 
 77  
     /**
 78  
      * This will update a {@link Responsibility}.
 79  
      *
 80  
      * @param responsibility the responsibility to update
 81  
      * @throws IllegalArgumentException if the responsibility is null
 82  
      * @throws IllegalStateException if the responsibility does not exist in the system
 83  
      */
 84  
     @WebMethod(operationName="updateResponsibility")
 85  
     @WebResult(name = "responsibility")
 86  
     Responsibility updateResponsibility(@WebParam(name = "responsibility") Responsibility responsibility)
 87  
             throws RiceIllegalArgumentException, RiceIllegalStateException;
 88  
 
 89  
     /**
 90  
      * Gets a {@link Responsibility} from an id.
 91  
      *
 92  
      * <p>
 93  
      *   This method will return null if the responsibility does not exist.
 94  
      * </p>
 95  
      *
 96  
      * @param id the unique id to retrieve the responsibility by. cannot be null.
 97  
      * @return a {@link Responsibility} or null
 98  
      * @throws IllegalArgumentException if the id is blank
 99  
      */
 100  
     @WebMethod(operationName = "getResponsibility")
 101  
     @WebResult(name = "responsibility")
 102  
     Responsibility getResponsibility(@WebParam(name = "id") String id);
 103  
 
 104  
     @WebMethod(operationName = "findRespByNamespaceCodeAndName")
 105  
     @WebResult(name = "responsibility")
 106  
     Responsibility findRespByNamespaceCodeAndName(@WebParam(name = "namespaceCode") String namespaceCode,
 107  
                                                   @WebParam(name = "name") String name);
 108  
     /**
 109  
      * Gets a {@link Template} from an id.
 110  
      *
 111  
      * <p>
 112  
      *   This method will return null if the template does not exist.
 113  
      * </p>
 114  
      *
 115  
      * @param id the unique id to retrieve the template by. cannot be null.
 116  
      * @return a {@link Template} or null
 117  
      * @throws IllegalArgumentException if the id is blank
 118  
      */
 119  
     @WebMethod(operationName = "getResponsibilityTemplate")
 120  
     @WebResult(name = "template")
 121  
     Template getResponsibilityTemplate(@WebParam(name = "id") String id);
 122  
 
 123  
     @WebMethod(operationName = "findRespTemplateByNamespaceCodeAndName")
 124  
     @WebResult(name = "template")
 125  
     Template findRespTemplateByNamespaceCodeAndName(@WebParam(name = "namespaceCode") String namespaceCode,
 126  
                                                     @WebParam(name = "name") String name);
 127  
 
 128  
     @WebMethod(operationName = "hasResponsibility")
 129  
     @WebResult(name = "result")
 130  
     boolean hasResponsibility(@WebParam(name = "principalId") String principalId,
 131  
                               @WebParam(name = "namespaceCode") String namespaceCode,
 132  
                               @WebParam(name = "respName") String respName,
 133  
                               @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 134  
                               @WebParam(name = "qualification") Map<String, String> qualification,
 135  
                               @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 136  
                               @WebParam(name = "responsibilityDetails") Map<String, String> responsibilityDetails);
 137  
 
 138  
     @WebMethod(operationName = "hasResponsibilityByTemplateName")
 139  
     @WebResult(name = "result")
 140  
     boolean hasResponsibilityByTemplateName(@WebParam(name = "principalId") String principalId,
 141  
                                             @WebParam(name = "namespaceCode") String namespaceCode,
 142  
                                             @WebParam(name = "respTemplateName") String respTemplateName,
 143  
                                             @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 144  
                                             @WebParam(name = "qualification") Map<String, String> qualification,
 145  
                                             @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 146  
                                             @WebParam(name = "responsibilityDetails") Map<String, String> responsibilityDetails);
 147  
 
 148  
     @WebMethod(operationName = "getResponsibilityActions")
 149  
     @XmlElementWrapper(name = "responsibilityActions", required = true)
 150  
     @XmlElement(name = "responsibilityAction", required = false)
 151  
     @WebResult(name = "responsibilityActions")
 152  
     List<ResponsibilityAction> getResponsibilityActions(@WebParam(name = "namespaceCode") String namespaceCode,
 153  
                                                         @WebParam(name = "responsibilityName") String responsibilityName,
 154  
                                                         @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 155  
                                                         @WebParam(name = "qualification") Map<String, String> qualification,
 156  
                                                         @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 157  
                                                         @WebParam(name = "responsibilityDetails") Map<String, String> responsibilityDetails);
 158  
 
 159  
     @WebMethod(operationName = "getResponsibilityActionsByTemplateName")
 160  
     @XmlElementWrapper(name = "responsibilityActions", required = true)
 161  
     @XmlElement(name = "responsibilityAction", required = false)
 162  
     @WebResult(name = "responsibilityActions")
 163  
     List<ResponsibilityAction> getResponsibilityActionsByTemplateName(@WebParam(name = "namespaceCode") String namespaceCode,
 164  
                                                                       @WebParam(name = "responsibilityTemplateName") String respTemplateName,
 165  
                                                                       @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 166  
                                                                       @WebParam(name = "qualification") Map<String, String> qualification,
 167  
                                                                       @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 168  
                                                                       @WebParam(name = "responsibilityDetails") Map<String, String> responsibilityDetails);
 169  
 
 170  
     @WebMethod(operationName = "getRoleIdsForResponsibility")
 171  
     @XmlElementWrapper(name = "roleIds", required = true)
 172  
     @XmlElement(name = "roleId", required = false)
 173  
     @WebResult(name = "roleIds")
 174  
     List<String> getRoleIdsForResponsibility(@WebParam(name = "id") String id,
 175  
                                              @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 176  
                                              @WebParam(name = "qualification") Map<String, String> qualification);
 177  
 
 178  
     /**
 179  
      * This method find Responsibilities based on a query criteria.  The criteria cannot be null.
 180  
      *
 181  
      * @param queryByCriteria the criteria.  Cannot be null.
 182  
      * @return query results.  will never return null.
 183  
      * @throws IllegalArgumentException if the queryByCriteria is null
 184  
      */
 185  
     @WebMethod(operationName = "findResponsibilities")
 186  
     @WebResult(name = "results")
 187  
     ResponsibilityQueryResults findResponsibilities(@WebParam(name = "query") QueryByCriteria queryByCriteria);
 188  
 
 189  
 
 190  
     /**
 191  
      * This method find Responsibility Templates based on a query criteria.  The criteria cannot be null.
 192  
      *
 193  
      * @param queryByCriteria the criteria.  Cannot be null.
 194  
      * @return query results.  will never return null.
 195  
      * @throws IllegalArgumentException if the queryByCriteria is null
 196  
      */
 197  
     @WebMethod(operationName = "findResponsibilityTemplates")
 198  
     @WebResult(name = "results")
 199  
     TemplateQueryResults findResponsibilityTemplates(@WebParam(name = "query") QueryByCriteria queryByCriteria);
 200  
 }