org.kuali.rice.kim.api.responsibility
Interface ResponsibilityService

All Known Implementing Classes:
ResponsibilityServiceImpl

public interface ResponsibilityService

This service provides operations for determining what responsibility actions a principal has and for querying about responsibility data. It also provides several write operations.

A responsibility represents an action that a principal is requested to take. This is used for defining workflow actions (such as approve, acknowledge, fyi) that the principal has the responsibility to take. The workflow engine integrates with this service to provide responsibility-driven routing.

A responsibility is very similar to a permission in a couple of ways. First of all, responsibilities are always granted to a role, never assigned directly to a principal or group. Furthermore, in a similar fashion to permissions, a role has the concept of a responsibility template. The responsibility template specifies what additional responsibility details need to be defined when the responsibility is created.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 Responsibility createResponsibility(Responsibility responsibility)
          This will create a Responsibility exactly like the responsibility passed in.
 Responsibility findRespByNamespaceCodeAndName(String namespaceCode, String name)
          Finds a Responsibility for namespaceCode and name.
 ResponsibilityQueryResults findResponsibilities(QueryByCriteria queryByCriteria)
          This method find Responsibilities based on a query criteria.
 TemplateQueryResults findResponsibilityTemplates(QueryByCriteria queryByCriteria)
          This method find Responsibility Templates based on a query criteria.
 Template findRespTemplateByNamespaceCodeAndName(String namespaceCode, String name)
          Finds a Template for namespaceCode and name.
 Responsibility getResponsibility(String id)
          Gets a Responsibility from an id.
 List<ResponsibilityAction> getResponsibilityActions(String namespaceCode, String respName, Map<String,String> qualification, Map<String,String> respDetails)
          Gets a List of ResponsibilityAction based on passed in responsibility information.
 List<ResponsibilityAction> getResponsibilityActionsByTemplateName(String namespaceCode, String respTemplateName, Map<String,String> qualification, Map<String,String> respDetails)
          Gets a List of ResponsibilityAction based on passed in responsibility template information.
 Template getResponsibilityTemplate(String id)
          Gets a Template from an id.
 List<String> getRoleIdsForResponsibility(String id)
          Gets a List of roleIds that the responsibility is associated with.
 boolean hasResponsibility(String principalId, String namespaceCode, String respName, Map<String,String> qualification, Map<String,String> respDetails)
          Checks in a given principal id has a responsibility using the passed in responsibility information.
 boolean hasResponsibilityByTemplateName(String principalId, String namespaceCode, String respTemplateName, Map<String,String> qualification, Map<String,String> respDetails)
          Checks in a given principal id has a responsibility using the passed in responsibility template information.
 Responsibility updateResponsibility(Responsibility responsibility)
          This will up ev a Responsibility.
 

Method Detail

createResponsibility

@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/ResponsibilityType","http://rice.kuali.org/kim/v2_0/TemplateType{Responsibility}"},
            allEntries=true)
Responsibility createResponsibility(Responsibility responsibility)
                                    throws RiceIllegalArgumentException,
                                           RiceIllegalStateException
This will create a Responsibility exactly like the responsibility passed in.

Parameters:
responsibility - the responsibility to create
Returns:
the id of the newly created object. will never be null.
Throws:
IllegalArgumentException - if the responsibility is null
IllegalStateException - if the responsibility is already existing in the system
RiceIllegalArgumentException
RiceIllegalStateException

updateResponsibility

@CacheEvict(value={"http://rice.kuali.org/kim/v2_0/ResponsibilityType","http://rice.kuali.org/kim/v2_0/TemplateType{Responsibility}"},
            allEntries=true)
Responsibility updateResponsibility(Responsibility responsibility)
                                    throws RiceIllegalArgumentException,
                                           RiceIllegalStateException
This will up ev a Responsibility.

Parameters:
responsibility - the responsibility to update
Throws:
IllegalArgumentException - if the responsibility is null
IllegalStateException - if the responsibility does not exist in the system
RiceIllegalArgumentException
RiceIllegalStateException

getResponsibility

@Cacheable(value="http://rice.kuali.org/kim/v2_0/ResponsibilityType",
           key="\'id=\' + #p0")
Responsibility getResponsibility(String id)
                                 throws RiceIllegalArgumentException
Gets a Responsibility from an id.

This method will return null if the responsibility does not exist.

Parameters:
id - the unique id to retrieve the responsibility by. cannot be null or blank.
Returns:
a Responsibility or null
Throws:
IllegalArgumentException - if the id is null or blank
RiceIllegalArgumentException

findRespByNamespaceCodeAndName

@Cacheable(value="http://rice.kuali.org/kim/v2_0/ResponsibilityType",
           key="\'namespaceCode=\' + #p0 + \'|\' + \'name=\' + #p1")
Responsibility findRespByNamespaceCodeAndName(String namespaceCode,
                                                        String name)
                                              throws RiceIllegalArgumentException
Finds a Responsibility for namespaceCode and name.

Parameters:
namespaceCode - the namespace code. cannot be null or blank.
name - the responsibility name. cannot be null or blank.
Returns:
a Responsibility or null
Throws:
IllegalArgumentException - if the id or namespaceCode is null or blank
RiceIllegalArgumentException

getResponsibilityTemplate

@Cacheable(value="http://rice.kuali.org/kim/v2_0/TemplateType{Responsibility}",
           key="\'id=\' + #p0")
Template getResponsibilityTemplate(String id)
                                   throws RiceIllegalArgumentException
Gets a Template from an id.

This method will return null if the template does not exist.

Parameters:
id - the unique id to retrieve the template by. cannot be null or blank.
Returns:
a Template or null
Throws:
IllegalArgumentException - if the id is null or blank
RiceIllegalArgumentException

findRespTemplateByNamespaceCodeAndName

@Cacheable(value="http://rice.kuali.org/kim/v2_0/TemplateType{Responsibility}",
           key="\'namespaceCode=\' + #p0 + \'|\' + \'name=\' + #p1")
Template findRespTemplateByNamespaceCodeAndName(String namespaceCode,
                                                          String name)
                                                throws RiceIllegalArgumentException
Finds a Template for namespaceCode and name.

Parameters:
namespaceCode - the namespace code. cannot be null or blank.
name - the template name. cannot be null or blank.
Returns:
a Template or null
Throws:
IllegalArgumentException - if the id or namespaceCode is null or blank
RiceIllegalArgumentException

hasResponsibility

boolean hasResponsibility(String principalId,
                          String namespaceCode,
                          String respName,
                          Map<String,String> qualification,
                          Map<String,String> respDetails)
                          throws RiceIllegalArgumentException
Checks in a given principal id has a responsibility using the passed in responsibility information.

Parameters:
principalId - the principal id to check. cannot be null or blank.
namespaceCode - the namespace code. cannot be null or blank.
respName - the responsibility name. cannot be null or blank.
qualification - the qualification for the responsibility. cannot be null.
respDetails - the responsibility details. cannot be null.
Returns:
true is principal has responsibility
Throws:
IllegalArgumentException - if the principalId, namespaceCode, respName is null or blank
IllegalArgumentException - if the qualification or responsibilityDetails is null
RiceIllegalArgumentException

hasResponsibilityByTemplateName

boolean hasResponsibilityByTemplateName(String principalId,
                                        String namespaceCode,
                                        String respTemplateName,
                                        Map<String,String> qualification,
                                        Map<String,String> respDetails)
                                        throws RiceIllegalArgumentException
Checks in a given principal id has a responsibility using the passed in responsibility template information.

Parameters:
principalId - the principal id to check. cannot be null or blank.
namespaceCode - the namespace code. cannot be null or blank.
respTemplateName - the responsibility template name. cannot be null or blank.
qualification - the qualification for the responsibility. cannot be null.
respDetails - the responsibility details. cannot be null.
Returns:
true is principal has responsibility
Throws:
IllegalArgumentException - if the principalId, namespaceCode, respName is null or blank
IllegalArgumentException - if the qualification or responsibilityDetails is null
RiceIllegalArgumentException

getResponsibilityActions

List<ResponsibilityAction> getResponsibilityActions(String namespaceCode,
                                                    String respName,
                                                    Map<String,String> qualification,
                                                    Map<String,String> respDetails)
                                                    throws RiceIllegalArgumentException
Gets a List of ResponsibilityAction based on passed in responsibility information.

Parameters:
namespaceCode - the namespace code. cannot be null or blank.
respName - the responsibility name. cannot be null or blank.
qualification - the qualification for the responsibility. cannot be null.
respDetails - the responsibility details. cannot be null.
Returns:
an immutable list of ResponsibilityAction. Will not return null.
Throws:
IllegalArgumentException - if the namespaceCode, respName is null or blank
IllegalArgumentException - if the qualification or respDetails is null
RiceIllegalArgumentException

getResponsibilityActionsByTemplateName

List<ResponsibilityAction> getResponsibilityActionsByTemplateName(String namespaceCode,
                                                                  String respTemplateName,
                                                                  Map<String,String> qualification,
                                                                  Map<String,String> respDetails)
                                                                  throws RiceIllegalArgumentException
Gets a List of ResponsibilityAction based on passed in responsibility template information.

Parameters:
namespaceCode - the namespace code. cannot be null or blank.
respTemplateName - the responsibility name. cannot be null or blank.
qualification - the qualification for the responsibility. cannot be null.
respDetails - the responsibility details. cannot be null.
Returns:
an immutable list of ResponsibilityAction. Will not return null.
Throws:
IllegalArgumentException - if the namespaceCode, respName is null or blank
IllegalArgumentException - if the qualification or respDetails is null
RiceIllegalArgumentException

getRoleIdsForResponsibility

List<String> getRoleIdsForResponsibility(String id)
                                         throws RiceIllegalArgumentException
Gets a List of roleIds that the responsibility is associated with.

Parameters:
id - the unique id to retrieve the roleIds for. cannot be null or blank.
Returns:
an immutable list of roleIds. Will not return null.
Throws:
IllegalArgumentException - if the id is null or blank or if the qualification is null
RiceIllegalArgumentException

findResponsibilities

ResponsibilityQueryResults findResponsibilities(QueryByCriteria queryByCriteria)
                                                throws RiceIllegalArgumentException
This method find Responsibilities based on a query criteria. The criteria cannot be null.

Parameters:
queryByCriteria - the criteria. Cannot be null.
Returns:
query results. will never return null.
Throws:
IllegalArgumentException - if the queryByCriteria is null
RiceIllegalArgumentException

findResponsibilityTemplates

TemplateQueryResults findResponsibilityTemplates(QueryByCriteria queryByCriteria)
                                                 throws RiceIllegalArgumentException
This method find Responsibility Templates based on a query criteria. The criteria cannot be null.

Parameters:
queryByCriteria - the criteria. Cannot be null.
Returns:
query results. will never return null.
Throws:
IllegalArgumentException - if the queryByCriteria is null
RiceIllegalArgumentException


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.