Class DefaultOrgUnitService
- java.lang.Object
-
- de.hybris.platform.commerceservices.organization.services.impl.DefaultOrgUnitService
-
- All Implemented Interfaces:
OrgUnitService
public class DefaultOrgUnitService extends java.lang.Object implements OrgUnitService
Default implementation of theOrgUnitServiceinterface.
-
-
Constructor Summary
Constructors Constructor Description DefaultOrgUnitService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateUnit(OrgUnitModel orgUnit)Activate the organizational unit with the given orgUnit.voidaddMembers(OrgUnitMemberParameter parameter)Add one or more members to a organizational unit.protected <T extends PrincipalModel>
voidaddRemoveMembers(OrgUnitMemberParameter<T> parameter, java.util.function.BiConsumer<java.util.Set<PrincipalGroupModel>,OrgUnitModel> consumer)voidcreateUnit(OrgUnitParameter parameter)Create a new organizational unit.voiddeactivateUnit(OrgUnitModel orgUnit)Deactivate the organizational unit and all of its child units with the given orgUnit.protected ConfigurationServicegetConfigurationService()protected FlexibleSearchServicegetFlexibleSearchService()<T extends PrincipalModel>
SearchPageData<T>getMembers(OrgUnitMemberParameter<T> parameter)Get a paged search result for members of the given organizational unit.protected ModelServicegetModelService()protected OrgUnitActivationStrategygetOrgUnitActivationStrategy()protected OrgUnitAuthorizationStrategygetOrgUnitAuthorizationStrategy()protected OrgUnitDaogetOrgUnitDao()protected OrgUnitHierarchyServicegetOrgUnitHierarchyService()java.util.Optional<OrgUnitModel>getParent(OrgUnitModel orgUnit)Gets the parent unit of a unit.java.util.Set<PrincipalGroupModel>getRolesForEmployee(EmployeeModel employee)Get a list of user roles that the given employee belongs tojava.util.Optional<OrgUnitModel>getUnitForUid(java.lang.String uid)Get the organizational unit with the given uid.protected UserServicegetUserService()voidremoveMembers(OrgUnitMemberParameter parameter)Remove one or more members from a organizational unit.voidsetConfigurationService(ConfigurationService configurationService)voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)voidsetModelService(ModelService modelService)voidsetOrgUnitActivationStrategy(OrgUnitActivationStrategy orgUnitActivationStrategy)voidsetOrgUnitAuthorizationStrategy(OrgUnitAuthorizationStrategy orgUnitAuthorizationStrategy)voidsetOrgUnitDao(OrgUnitDao orgUnitDao)voidsetOrgUnitHierarchyService(OrgUnitHierarchyService orgUnitHierarchyService)protected booleansetParentUnit(OrgUnitModel orgUnit, OrgUnitModel newParentUnit)voidsetUserService(UserService userService)voidupdateUnit(OrgUnitParameter parameter)Update an existing organizational unit.
-
-
-
Method Detail
-
createUnit
public void createUnit(OrgUnitParameter parameter)
Description copied from interface:OrgUnitServiceCreate a new organizational unit.- Specified by:
createUnitin interfaceOrgUnitService- Parameters:
parameter- ExtensibleOrgUnitParameterbean containing the initial attributes of the organizational unit to be created. Mandatory values:
-
updateUnit
public void updateUnit(OrgUnitParameter parameter)
Description copied from interface:OrgUnitServiceUpdate an existing organizational unit.- Specified by:
updateUnitin interfaceOrgUnitService- Parameters:
parameter- ExtensibleOrgUnitParameterbean containing the initial attributes of the organizational unit to be updated. Mandatory values:
-
getUnitForUid
public java.util.Optional<OrgUnitModel> getUnitForUid(java.lang.String uid)
Description copied from interface:OrgUnitServiceGet the organizational unit with the given uid.- Specified by:
getUnitForUidin interfaceOrgUnitService- Parameters:
uid- the uid of the organizational unit- Returns:
- An
Optionalwhich- contains the
OrgUnitModelfor the given uid if it exists and - is empty otherwise.
- contains the
-
activateUnit
public void activateUnit(OrgUnitModel orgUnit)
Description copied from interface:OrgUnitServiceActivate the organizational unit with the given orgUnit.- Specified by:
activateUnitin interfaceOrgUnitService- Parameters:
orgUnit- the organizational unit
-
deactivateUnit
public void deactivateUnit(OrgUnitModel orgUnit)
Description copied from interface:OrgUnitServiceDeactivate the organizational unit and all of its child units with the given orgUnit.- Specified by:
deactivateUnitin interfaceOrgUnitService- Parameters:
orgUnit- the organizational unit
-
addMembers
public void addMembers(OrgUnitMemberParameter parameter)
Description copied from interface:OrgUnitServiceAdd one or more members to a organizational unit.- Specified by:
addMembersin interfaceOrgUnitService- Parameters:
parameter- ExtensibleOrgUnitMemberParameterbean holding the method parameters. Mandatory values:
-
removeMembers
public void removeMembers(OrgUnitMemberParameter parameter)
Description copied from interface:OrgUnitServiceRemove one or more members from a organizational unit.- Specified by:
removeMembersin interfaceOrgUnitService- Parameters:
parameter- ExtensibleOrgUnitMemberParameterbean holding the method parameters. Mandatory values:
-
getMembers
public <T extends PrincipalModel> SearchPageData<T> getMembers(OrgUnitMemberParameter<T> parameter)
Description copied from interface:OrgUnitServiceGet a paged search result for members of the given organizational unit.- Specified by:
getMembersin interfaceOrgUnitService- Parameters:
parameter- ExtensibleOrgUnitMemberParameterbean holding the method parameters. Mandatory values:- Returns:
SearchPageDatacontaining the paged search result for members of the given organizational unit
-
getParent
public java.util.Optional<OrgUnitModel> getParent(OrgUnitModel orgUnit)
Description copied from interface:OrgUnitServiceGets the parent unit of a unit.- Specified by:
getParentin interfaceOrgUnitService- Parameters:
orgUnit- the organizational unit- Returns:
- An
Optionalwhich- contains the parent
OrgUnitModelfor the given unit's uid if it exists and - is empty if
unitwas the root unit.
- contains the parent
-
addRemoveMembers
protected <T extends PrincipalModel> void addRemoveMembers(OrgUnitMemberParameter<T> parameter, java.util.function.BiConsumer<java.util.Set<PrincipalGroupModel>,OrgUnitModel> consumer)
-
setParentUnit
protected boolean setParentUnit(OrgUnitModel orgUnit, OrgUnitModel newParentUnit)
-
getRolesForEmployee
public java.util.Set<PrincipalGroupModel> getRolesForEmployee(EmployeeModel employee)
Description copied from interface:OrgUnitServiceGet a list of user roles that the given employee belongs to- Specified by:
getRolesForEmployeein interfaceOrgUnitService- Parameters:
employee- the employee model to search its belonging user roles- Returns:
- a list of user group which represents user role
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getFlexibleSearchService
protected FlexibleSearchService getFlexibleSearchService()
-
setFlexibleSearchService
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
-
getOrgUnitActivationStrategy
protected OrgUnitActivationStrategy getOrgUnitActivationStrategy()
-
setOrgUnitActivationStrategy
public void setOrgUnitActivationStrategy(OrgUnitActivationStrategy orgUnitActivationStrategy)
-
getOrgUnitDao
protected OrgUnitDao getOrgUnitDao()
-
setOrgUnitDao
public void setOrgUnitDao(OrgUnitDao orgUnitDao)
-
getOrgUnitAuthorizationStrategy
protected OrgUnitAuthorizationStrategy getOrgUnitAuthorizationStrategy()
-
setOrgUnitAuthorizationStrategy
public void setOrgUnitAuthorizationStrategy(OrgUnitAuthorizationStrategy orgUnitAuthorizationStrategy)
-
getOrgUnitHierarchyService
protected OrgUnitHierarchyService getOrgUnitHierarchyService()
-
setOrgUnitHierarchyService
public void setOrgUnitHierarchyService(OrgUnitHierarchyService orgUnitHierarchyService)
-
getConfigurationService
protected ConfigurationService getConfigurationService()
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
-