org.kuali.rice.coreservice.api.component
Interface ComponentService

All Known Implementing Classes:
ComponentServiceImpl

public interface ComponentService

Defines the contract for a service which can be used to interact with the Rice core component store.

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

Method Summary
 List<Component> getActiveComponentsByNamespaceCode(String namespaceCode)
          This will return a list of active Component with the given namespaceCode
 List<Component> getAllComponentsByNamespaceCode(String namespaceCode)
          This will return a list of all Component with the given namespaceCode
 Component getComponentByCode(String namespaceCode, String componentCode)
          This will return a Component with the given namespaceCode and componentCode
 List<Component> getDerivedComponentSet(String componentSetId)
          This will return a list of derived Component with the given componentSetId
 void publishDerivedComponents(String componentSetId, List<Component> components)
          Publishes the given set of derived components to make them available to the component system.
 

Method Detail

getComponentByCode

Component getComponentByCode(String namespaceCode,
                             String componentCode)
                             throws RiceIllegalArgumentException
This will return a Component with the given namespaceCode and componentCode

Parameters:
namespaceCode - the namespaceCode of the component
componentCode - the componentCode of the component
Returns:
the component with the given namespaceCode and componentCode
Throws:
RiceIllegalArgumentException - if the namespaceCode or componentCode is null or blank

getAllComponentsByNamespaceCode

List<Component> getAllComponentsByNamespaceCode(String namespaceCode)
                                                throws RiceIllegalArgumentException
This will return a list of all Component with the given namespaceCode

Parameters:
namespaceCode - the namespaceCode of the component
Returns:
a list of components with the given namespaceCode
Throws:
RiceIllegalArgumentException - if the namespaceCode is null or blank

getActiveComponentsByNamespaceCode

List<Component> getActiveComponentsByNamespaceCode(String namespaceCode)
                                                   throws RiceIllegalArgumentException
This will return a list of active Component with the given namespaceCode

Parameters:
namespaceCode - the namespaceCode of the component
Returns:
a list of active components with the given namespaceCode
Throws:
RiceIllegalArgumentException - if the namespaceCode is null or blank

getDerivedComponentSet

List<Component> getDerivedComponentSet(String componentSetId)
                                       throws RiceIllegalArgumentException
This will return a list of derived Component with the given componentSetId

Parameters:
componentSetId - the componentSetId of the component
Returns:
a list of components with the given componentSetId
Throws:
RiceIllegalArgumentException - if the componentSetId is null or blank

publishDerivedComponents

void publishDerivedComponents(String componentSetId,
                              List<Component> components)
                              throws RiceIllegalArgumentException
Publishes the given set of derived components to make them available to the component system. It should only ever be necessary to invoke this service whenever published components for an application change. However, it is always safe to invoke this method even if the client cannot make this determination as the implementation of this service should be responsible for handling the given information and ignoring it if no publication needs to occur. To this end, this method should be idempotent.

When invoked, the set of components known to the component system for the given component set id will be replaced with the given list. Any previously published components for the component set id which are not contained within the given list will be deleted.

The componentSetId should be an identifier generated by the client application which uniquely identifies the component set being published (either newly published or updated). A simple value to use would be the applicationId of the client application but this would mean an application could only ever publish a single custom component set. So the applicationId could also be combined with some additional information on the source of the components being published if a particular application needs to publish custom components from multiple sources.

The componentSetId on each of the components supplied in the list must either be null or equal to the component set id that is passed to this method, otherwise a RiceIllegalArgumentException will be thrown.

Parameters:
componentSetId - an id that uniquely identifies this set of components being checked. The service will use this to track the components being published
components - the components to publish, may be empty or null, in which case all published components for the given component set id will be deleted from the component system if any exist
Throws:
RiceIllegalArgumentException - if componentSetId is a null or blank value
RiceIllegalArgumentException - if any of the components in the given list have a non-null componentSetId which does not match the componentSetId parameter supplied to this method


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