org.kuali.rice.coreservice.impl.component
Class ComponentServiceImpl

java.lang.Object
  extended by org.kuali.rice.coreservice.impl.component.ComponentServiceImpl
All Implemented Interfaces:
ComponentService

@Transactional
public class ComponentServiceImpl
extends Object
implements ComponentService

Reference implementation of the ComponentService.

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

Constructor Summary
ComponentServiceImpl()
           
 
Method Summary
protected  String calculateChecksum(List<Component> components)
          Calculates the checksum for the list of components.
 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
 BusinessObjectService getBusinessObjectService()
           
 Component getComponentByCode(String namespaceCode, String componentCode)
          This will return a Component with the given namespaceCode and componentCode
 ComponentSetDao getComponentSetDao()
           
 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.
 void setBusinessObjectService(BusinessObjectService businessObjectService)
           
 void setComponentSetDao(ComponentSetDao componentSetDao)
           
protected  List<Component> translateCollections(Collection<org.kuali.rice.coreservice.impl.component.ComponentBo> componentBos, Collection<org.kuali.rice.coreservice.impl.component.DerivedComponentBo> derivedComponentBos)
           
protected  void updateDerivedComponents(String componentSetId, List<Component> components)
           
protected  List<Component> validateAndNormalizeComponents(String componentSetId, List<Component> components)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentServiceImpl

public ComponentServiceImpl()
Method Detail

getComponentByCode

public Component getComponentByCode(String namespaceCode,
                                    String componentCode)
Description copied from interface: ComponentService
This will return a Component with the given namespaceCode and componentCode

Specified by:
getComponentByCode in interface ComponentService
Parameters:
namespaceCode - the namespaceCode of the component
componentCode - the componentCode of the component
Returns:
the component with the given namespaceCode and componentCode

getAllComponentsByNamespaceCode

public List<Component> getAllComponentsByNamespaceCode(String namespaceCode)
Description copied from interface: ComponentService
This will return a list of all Component with the given namespaceCode

Specified by:
getAllComponentsByNamespaceCode in interface ComponentService
Parameters:
namespaceCode - the namespaceCode of the component
Returns:
a list of components with the given namespaceCode

getActiveComponentsByNamespaceCode

public List<Component> getActiveComponentsByNamespaceCode(String namespaceCode)
Description copied from interface: ComponentService
This will return a list of active Component with the given namespaceCode

Specified by:
getActiveComponentsByNamespaceCode in interface ComponentService
Parameters:
namespaceCode - the namespaceCode of the component
Returns:
a list of active components with the given namespaceCode

getDerivedComponentSet

public List<Component> getDerivedComponentSet(String componentSetId)
Description copied from interface: ComponentService
This will return a list of derived Component with the given componentSetId

Specified by:
getDerivedComponentSet in interface ComponentService
Parameters:
componentSetId - the componentSetId of the component
Returns:
a list of components with the given componentSetId

publishDerivedComponents

public void publishDerivedComponents(String componentSetId,
                                     List<Component> components)
Description copied from interface: ComponentService
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.

Specified by:
publishDerivedComponents in interface ComponentService
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

validateAndNormalizeComponents

protected List<Component> validateAndNormalizeComponents(String componentSetId,
                                                         List<Component> components)

calculateChecksum

protected String calculateChecksum(List<Component> components)
Calculates the checksum for the list of components. The list of components should be sorted in a consistent way prior to generation of the checksum to ensure that the checksum value comes out the same regardless of the ordering of components contained therein. The checksum allows us to easily determine if the component set has been updated or not.


updateDerivedComponents

protected void updateDerivedComponents(String componentSetId,
                                       List<Component> components)

translateCollections

protected List<Component> translateCollections(Collection<org.kuali.rice.coreservice.impl.component.ComponentBo> componentBos,
                                               Collection<org.kuali.rice.coreservice.impl.component.DerivedComponentBo> derivedComponentBos)

getBusinessObjectService

public BusinessObjectService getBusinessObjectService()

setBusinessObjectService

public void setBusinessObjectService(BusinessObjectService businessObjectService)

getComponentSetDao

public ComponentSetDao getComponentSetDao()

setComponentSetDao

public void setComponentSetDao(ComponentSetDao componentSetDao)


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