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.api.mo.common.Attributes;
 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 java.util.List;
 32  
 import java.util.Map;
 33  
 
 34  
 /**
 35  
  * This service provides operations for determining what responsibility actions
 36  
  * a principal has and for querying about responsibility data.  It also provides several
 37  
  * write operations.
 38  
  *
 39  
  * <p>
 40  
  * A responsibility represents an action that a principal is requested to
 41  
  * take.  This is used for defining workflow actions (such as approve,
 42  
  * acknowledge, fyi) that the principal has the responsibility to take.  The
 43  
  * workflow engine integrates with this service to provide
 44  
  * responsibility-driven routing.
 45  
  * <p/>
 46  
  * <p>
 47  
  * A responsibility is very similar to a permission in a couple of ways.
 48  
  * First of all, responsibilities are always granted to a role, never assigned
 49  
  * directly to a principal or group.  Furthermore, in a similar fashion to
 50  
  * permissions, a role has the concept of a responsibility template.  The
 51  
  * responsibility template specifies what additional responsibility details
 52  
  * need to be defined when the responsibility is created.
 53  
  * <p/>
 54  
  *
 55  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 56  
  */
 57  
 @WebService(name = "ResponsibilityServiceSoap", targetNamespace = CoreConstants.Namespaces.CORE_NAMESPACE_2_0)
 58  
 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
 59  
 public interface ResponsibilityService {
 60  
 
 61  
     /**
 62  
      * This will create a {@link Responsibility} exactly like the responsibility passed in.
 63  
      *
 64  
      * @param responsibility the responsibility to create
 65  
      * @throws IllegalArgumentException if the responsibility is null
 66  
      * @throws IllegalStateException if the responsibility is already existing in the system
 67  
      */
 68  
     @WebMethod(operationName="createResponsibility")
 69  
     void createResponsibility(@WebParam(name = "responsibility") Responsibility responsibility)
 70  
             throws RiceIllegalArgumentException, RiceIllegalStateException;
 71  
 
 72  
     /**
 73  
      * This will update a {@link Responsibility}.
 74  
      *
 75  
      * @param responsibility the responsibility to update
 76  
      * @throws IllegalArgumentException if the responsibility is null
 77  
      * @throws IllegalStateException if the responsibility does not exist in the system
 78  
      */
 79  
     @WebMethod(operationName="updateResponsibility")
 80  
     void updateResponsibility(@WebParam(name = "responsibility") Responsibility responsibility)
 81  
             throws RiceIllegalArgumentException, RiceIllegalStateException;
 82  
 
 83  
 
 84  
     @WebMethod(operationName = "getResponsibility")
 85  
     @WebResult(name = "responsibility")
 86  
     Responsibility getResponsibility(@WebParam(name = "id") String id);
 87  
 
 88  
     @WebMethod(operationName = "findRespsByNamespaceCodeAndName")
 89  
     @WebResult(name = "responsibilities")
 90  
     List<Responsibility> findRespsByNamespaceCodeAndName(@WebParam(name = "namespaceCode") String namespaceCode,
 91  
                                                          @WebParam(name = "name") String name);
 92  
 
 93  
     @WebMethod(operationName = "getResponsibilityTemplate")
 94  
     @WebResult(name = "template")
 95  
     Template getResponsibilityTemplate(@WebParam(name = "id") String id);
 96  
 
 97  
     @WebMethod(operationName = "findRespTemplatesByNamespaceCodeAndName")
 98  
     @WebResult(name = "templates")
 99  
     List<Template> findRespTemplatesByNamespaceCodeAndName(@WebParam(name = "namespaceCode") String namespaceCode,
 100  
                                                            @WebParam(name = "name") String name);
 101  
 
 102  
     @WebMethod(operationName = "hasResponsibility")
 103  
     @WebResult(name = "result")
 104  
     boolean hasResponsibility(@WebParam(name = "principalId") String principalId,
 105  
                               @WebParam(name = "namespaceCode") String namespaceCode,
 106  
                               @WebParam(name = "respName") String respName,
 107  
                               @WebParam(name = "qualification") Attributes qualification,
 108  
                               @WebParam(name = "responsibilityDetails") Attributes responsibilityDetails);
 109  
 
 110  
     @WebMethod(operationName = "hasResponsibilityByTemplateName")
 111  
     @WebResult(name = "result")
 112  
     boolean hasResponsibilityByTemplateName(@WebParam(name = "principalId") String principalId,
 113  
                                             @WebParam(name = "namespaceCode") String namespaceCode,
 114  
                                             @WebParam(name = "respTemplateName") String respTemplateName,
 115  
                                             @WebParam(name = "qualification") Attributes qualification,
 116  
                                             @WebParam(name = "responsibilityDetails") Attributes responsibilityDetails);
 117  
 
 118  
     @WebMethod(operationName = "getResponsibilityActions")
 119  
     @WebResult(name = "responsibilityActions")
 120  
     List<ResponsibilityAction> getResponsibilityActions(@WebParam(name = "namespaceCode") String namespaceCode,
 121  
                                                         @WebParam(name = "responsibilityName") String responsibilityName,
 122  
                                                         @WebParam(name = "qualification") Attributes qualification,
 123  
                                                         @WebParam(name = "responsibilityDetails") Attributes responsibilityDetails);
 124  
 
 125  
     @WebMethod(operationName = "getResponsibilityActionsByTemplateName")
 126  
     @WebResult(name = "responsibilityActions")
 127  
     List<ResponsibilityAction> getResponsibilityActionsByTemplateName(@WebParam(name = "namespaceCode") String namespaceCode,
 128  
                                                                       @WebParam(name = "responsibilityTemplateName") String respTemplateName,
 129  
                                                                       @WebParam(name = "qualification") Attributes qualification,
 130  
                                                                       @WebParam(name = "responsibilityDetails") Attributes responsibilityDetails);
 131  
 
 132  
     @WebMethod(operationName = "getRoleIdsForResponsibility")
 133  
     @WebResult(name = "roleIds")
 134  
     List<String> getRoleIdsForResponsibility(@WebParam(name = "id") String id,
 135  
                                              @WebParam(name = "qualification") Attributes qualification);
 136  
 
 137  
     /**
 138  
      * This method find Responsibilities based on a query criteria.  The criteria cannot be null.
 139  
      *
 140  
      * @param queryByCriteria the criteria.  Cannot be null.
 141  
      * @return query results.  will never return null.
 142  
      * @throws IllegalArgumentException if the queryByCriteria is null
 143  
      */
 144  
     @WebMethod(operationName = "findResponsibilities")
 145  
     @WebResult(name = "results")
 146  
     ResponsibilityQueryResults findResponsibilities(@WebParam(name = "query") QueryByCriteria queryByCriteria);
 147  
 
 148  
 
 149  
     /**
 150  
      * This method find Responsibility Templates based on a query criteria.  The criteria cannot be null.
 151  
      *
 152  
      * @param queryByCriteria the criteria.  Cannot be null.
 153  
      * @return query results.  will never return null.
 154  
      * @throws IllegalArgumentException if the queryByCriteria is null
 155  
      */
 156  
     @WebMethod(operationName = "findResponsibilityTemplates")
 157  
     @WebResult(name = "results")
 158  
     TemplateQueryResults findResponsibilityTemplates(@WebParam(name = "query") QueryByCriteria queryByCriteria);
 159  
 }